// Code generated by protoc-gen-microweb. DO NOT EDIT. // source: proto.proto package proto import ( "bytes" "encoding/json" "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/render" "github.com/golang/protobuf/jsonpb" ptypesempty "github.com/golang/protobuf/ptypes/empty" ) type webBundleServiceHandler struct { r chi.Router h BundleServiceHandler } func (h *webBundleServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.r.ServeHTTP(w, r) } func (h *webBundleServiceHandler) SaveBundle(w http.ResponseWriter, r *http.Request) { req := &SaveBundleRequest{} resp := &SaveBundleResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.SaveBundle( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webBundleServiceHandler) GetBundle(w http.ResponseWriter, r *http.Request) { req := &GetBundleRequest{} resp := &GetBundleResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.GetBundle( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webBundleServiceHandler) ListBundles(w http.ResponseWriter, r *http.Request) { req := &ListBundlesRequest{} resp := &ListBundlesResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.ListBundles( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webBundleServiceHandler) AddSettingToBundle(w http.ResponseWriter, r *http.Request) { req := &AddSettingToBundleRequest{} resp := &AddSettingToBundleResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.AddSettingToBundle( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webBundleServiceHandler) RemoveSettingFromBundle(w http.ResponseWriter, r *http.Request) { req := &RemoveSettingFromBundleRequest{} resp := &ptypesempty.Empty{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.RemoveSettingFromBundle( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusNoContent) render.NoContent(w, r) } func RegisterBundleServiceWeb(r chi.Router, i BundleServiceHandler, middlewares ...func(http.Handler) http.Handler) { handler := &webBundleServiceHandler{ r: r, h: i, } r.MethodFunc("POST", "/api/v0/settings/bundle-save", handler.SaveBundle) r.MethodFunc("POST", "/api/v0/settings/bundle-get", handler.GetBundle) r.MethodFunc("POST", "/api/v0/settings/bundles-list", handler.ListBundles) r.MethodFunc("POST", "/api/v0/settings/bundles-add-setting", handler.AddSettingToBundle) r.MethodFunc("POST", "/api/v0/settings/bundles-remove-setting", handler.RemoveSettingFromBundle) } type webValueServiceHandler struct { r chi.Router h ValueServiceHandler } func (h *webValueServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.r.ServeHTTP(w, r) } func (h *webValueServiceHandler) SaveValue(w http.ResponseWriter, r *http.Request) { req := &SaveValueRequest{} resp := &SaveValueResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.SaveValue( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webValueServiceHandler) GetValue(w http.ResponseWriter, r *http.Request) { req := &GetValueRequest{} resp := &GetValueResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.GetValue( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webValueServiceHandler) ListValues(w http.ResponseWriter, r *http.Request) { req := &ListValuesRequest{} resp := &ListValuesResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.ListValues( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webValueServiceHandler) GetValueByUniqueIdentifiers(w http.ResponseWriter, r *http.Request) { req := &GetValueByUniqueIdentifiersRequest{} resp := &GetValueResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.GetValueByUniqueIdentifiers( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func RegisterValueServiceWeb(r chi.Router, i ValueServiceHandler, middlewares ...func(http.Handler) http.Handler) { handler := &webValueServiceHandler{ r: r, h: i, } r.MethodFunc("POST", "/api/v0/settings/values-save", handler.SaveValue) r.MethodFunc("POST", "/api/v0/settings/values-get", handler.GetValue) r.MethodFunc("POST", "/api/v0/settings/values-list", handler.ListValues) r.MethodFunc("POST", "/api/v0/settings/values-get-by-unique-identifiers", handler.GetValueByUniqueIdentifiers) } type webRoleServiceHandler struct { r chi.Router h RoleServiceHandler } func (h *webRoleServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.r.ServeHTTP(w, r) } func (h *webRoleServiceHandler) ListRoles(w http.ResponseWriter, r *http.Request) { req := &ListBundlesRequest{} resp := &ListBundlesResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.ListRoles( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webRoleServiceHandler) ListRoleAssignments(w http.ResponseWriter, r *http.Request) { req := &ListRoleAssignmentsRequest{} resp := &ListRoleAssignmentsResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.ListRoleAssignments( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webRoleServiceHandler) AssignRoleToUser(w http.ResponseWriter, r *http.Request) { req := &AssignRoleToUserRequest{} resp := &AssignRoleToUserResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.AssignRoleToUser( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webRoleServiceHandler) RemoveRoleFromUser(w http.ResponseWriter, r *http.Request) { req := &RemoveRoleFromUserRequest{} resp := &ptypesempty.Empty{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.RemoveRoleFromUser( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusNoContent) render.NoContent(w, r) } func RegisterRoleServiceWeb(r chi.Router, i RoleServiceHandler, middlewares ...func(http.Handler) http.Handler) { handler := &webRoleServiceHandler{ r: r, h: i, } r.MethodFunc("POST", "/api/v0/settings/roles-list", handler.ListRoles) r.MethodFunc("POST", "/api/v0/settings/assignments-list", handler.ListRoleAssignments) r.MethodFunc("POST", "/api/v0/settings/assignments-add", handler.AssignRoleToUser) r.MethodFunc("POST", "/api/v0/settings/assignments-remove", handler.RemoveRoleFromUser) } type webPermissionServiceHandler struct { r chi.Router h PermissionServiceHandler } func (h *webPermissionServiceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.r.ServeHTTP(w, r) } func (h *webPermissionServiceHandler) ListPermissionsByResource(w http.ResponseWriter, r *http.Request) { req := &ListPermissionsByResourceRequest{} resp := &ListPermissionsByResourceResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.ListPermissionsByResource( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func (h *webPermissionServiceHandler) GetPermissionByID(w http.ResponseWriter, r *http.Request) { req := &GetPermissionByIDRequest{} resp := &GetPermissionByIDResponse{} if err := json.NewDecoder(r.Body).Decode(&req); err != nil { http.Error(w, err.Error(), http.StatusPreconditionFailed) return } if err := h.h.GetPermissionByID( r.Context(), req, resp, ); err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return } render.Status(r, http.StatusCreated) render.JSON(w, r, resp) } func RegisterPermissionServiceWeb(r chi.Router, i PermissionServiceHandler, middlewares ...func(http.Handler) http.Handler) { handler := &webPermissionServiceHandler{ r: r, h: i, } r.MethodFunc("POST", "/api/v0/settings/permissions-list-by-resource", handler.ListPermissionsByResource) r.MethodFunc("POST", "/api/v0/settings/permissions-get-by-id", handler.GetPermissionByID) } // SaveBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of SaveBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var SaveBundleRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *SaveBundleRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := SaveBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*SaveBundleRequest)(nil) // SaveBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of SaveBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var SaveBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *SaveBundleRequest) UnmarshalJSON(b []byte) error { return SaveBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*SaveBundleRequest)(nil) // SaveBundleResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of SaveBundleResponse. This struct is safe to replace or modify but // should not be done so concurrently. var SaveBundleResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *SaveBundleResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := SaveBundleResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*SaveBundleResponse)(nil) // SaveBundleResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of SaveBundleResponse. This struct is safe to replace or modify but // should not be done so concurrently. var SaveBundleResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *SaveBundleResponse) UnmarshalJSON(b []byte) error { return SaveBundleResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*SaveBundleResponse)(nil) // GetBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetBundleRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetBundleRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetBundleRequest)(nil) // GetBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetBundleRequest) UnmarshalJSON(b []byte) error { return GetBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetBundleRequest)(nil) // GetBundleResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetBundleResponse. This struct is safe to replace or modify but // should not be done so concurrently. var GetBundleResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetBundleResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetBundleResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetBundleResponse)(nil) // GetBundleResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetBundleResponse. This struct is safe to replace or modify but // should not be done so concurrently. var GetBundleResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetBundleResponse) UnmarshalJSON(b []byte) error { return GetBundleResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetBundleResponse)(nil) // ListBundlesRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListBundlesRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListBundlesRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListBundlesRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListBundlesRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListBundlesRequest)(nil) // ListBundlesRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListBundlesRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListBundlesRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListBundlesRequest) UnmarshalJSON(b []byte) error { return ListBundlesRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListBundlesRequest)(nil) // ListBundlesResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListBundlesResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListBundlesResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListBundlesResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListBundlesResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListBundlesResponse)(nil) // ListBundlesResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListBundlesResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListBundlesResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListBundlesResponse) UnmarshalJSON(b []byte) error { return ListBundlesResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListBundlesResponse)(nil) // AddSettingToBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of AddSettingToBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var AddSettingToBundleRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *AddSettingToBundleRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := AddSettingToBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*AddSettingToBundleRequest)(nil) // AddSettingToBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of AddSettingToBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var AddSettingToBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *AddSettingToBundleRequest) UnmarshalJSON(b []byte) error { return AddSettingToBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*AddSettingToBundleRequest)(nil) // AddSettingToBundleResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of AddSettingToBundleResponse. This struct is safe to replace or modify but // should not be done so concurrently. var AddSettingToBundleResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *AddSettingToBundleResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := AddSettingToBundleResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*AddSettingToBundleResponse)(nil) // AddSettingToBundleResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of AddSettingToBundleResponse. This struct is safe to replace or modify but // should not be done so concurrently. var AddSettingToBundleResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *AddSettingToBundleResponse) UnmarshalJSON(b []byte) error { return AddSettingToBundleResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*AddSettingToBundleResponse)(nil) // RemoveSettingFromBundleRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of RemoveSettingFromBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var RemoveSettingFromBundleRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *RemoveSettingFromBundleRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := RemoveSettingFromBundleRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*RemoveSettingFromBundleRequest)(nil) // RemoveSettingFromBundleRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of RemoveSettingFromBundleRequest. This struct is safe to replace or modify but // should not be done so concurrently. var RemoveSettingFromBundleRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *RemoveSettingFromBundleRequest) UnmarshalJSON(b []byte) error { return RemoveSettingFromBundleRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*RemoveSettingFromBundleRequest)(nil) // SaveValueRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of SaveValueRequest. This struct is safe to replace or modify but // should not be done so concurrently. var SaveValueRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *SaveValueRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := SaveValueRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*SaveValueRequest)(nil) // SaveValueRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of SaveValueRequest. This struct is safe to replace or modify but // should not be done so concurrently. var SaveValueRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *SaveValueRequest) UnmarshalJSON(b []byte) error { return SaveValueRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*SaveValueRequest)(nil) // SaveValueResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of SaveValueResponse. This struct is safe to replace or modify but // should not be done so concurrently. var SaveValueResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *SaveValueResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := SaveValueResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*SaveValueResponse)(nil) // SaveValueResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of SaveValueResponse. This struct is safe to replace or modify but // should not be done so concurrently. var SaveValueResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *SaveValueResponse) UnmarshalJSON(b []byte) error { return SaveValueResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*SaveValueResponse)(nil) // GetValueRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetValueRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetValueRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetValueRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetValueRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetValueRequest)(nil) // GetValueRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetValueRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetValueRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetValueRequest) UnmarshalJSON(b []byte) error { return GetValueRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetValueRequest)(nil) // GetValueResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetValueResponse. This struct is safe to replace or modify but // should not be done so concurrently. var GetValueResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetValueResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetValueResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetValueResponse)(nil) // GetValueResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetValueResponse. This struct is safe to replace or modify but // should not be done so concurrently. var GetValueResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetValueResponse) UnmarshalJSON(b []byte) error { return GetValueResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetValueResponse)(nil) // ListValuesRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListValuesRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListValuesRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListValuesRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListValuesRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListValuesRequest)(nil) // ListValuesRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListValuesRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListValuesRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListValuesRequest) UnmarshalJSON(b []byte) error { return ListValuesRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListValuesRequest)(nil) // ListValuesResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListValuesResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListValuesResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListValuesResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListValuesResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListValuesResponse)(nil) // ListValuesResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListValuesResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListValuesResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListValuesResponse) UnmarshalJSON(b []byte) error { return ListValuesResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListValuesResponse)(nil) // GetValueByUniqueIdentifiersRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetValueByUniqueIdentifiersRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetValueByUniqueIdentifiersRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetValueByUniqueIdentifiersRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetValueByUniqueIdentifiersRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetValueByUniqueIdentifiersRequest)(nil) // GetValueByUniqueIdentifiersRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetValueByUniqueIdentifiersRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetValueByUniqueIdentifiersRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetValueByUniqueIdentifiersRequest) UnmarshalJSON(b []byte) error { return GetValueByUniqueIdentifiersRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetValueByUniqueIdentifiersRequest)(nil) // ValueWithIdentifierJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ValueWithIdentifier. This struct is safe to replace or modify but // should not be done so concurrently. var ValueWithIdentifierJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ValueWithIdentifier) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ValueWithIdentifierJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ValueWithIdentifier)(nil) // ValueWithIdentifierJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ValueWithIdentifier. This struct is safe to replace or modify but // should not be done so concurrently. var ValueWithIdentifierJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ValueWithIdentifier) UnmarshalJSON(b []byte) error { return ValueWithIdentifierJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ValueWithIdentifier)(nil) // IdentifierJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Identifier. This struct is safe to replace or modify but // should not be done so concurrently. var IdentifierJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Identifier) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := IdentifierJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Identifier)(nil) // IdentifierJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Identifier. This struct is safe to replace or modify but // should not be done so concurrently. var IdentifierJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Identifier) UnmarshalJSON(b []byte) error { return IdentifierJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Identifier)(nil) // ListRoleAssignmentsRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListRoleAssignmentsRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListRoleAssignmentsRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListRoleAssignmentsRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListRoleAssignmentsRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListRoleAssignmentsRequest)(nil) // ListRoleAssignmentsRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListRoleAssignmentsRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListRoleAssignmentsRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListRoleAssignmentsRequest) UnmarshalJSON(b []byte) error { return ListRoleAssignmentsRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListRoleAssignmentsRequest)(nil) // ListRoleAssignmentsResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListRoleAssignmentsResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListRoleAssignmentsResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListRoleAssignmentsResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListRoleAssignmentsResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListRoleAssignmentsResponse)(nil) // ListRoleAssignmentsResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListRoleAssignmentsResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListRoleAssignmentsResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListRoleAssignmentsResponse) UnmarshalJSON(b []byte) error { return ListRoleAssignmentsResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListRoleAssignmentsResponse)(nil) // AssignRoleToUserRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of AssignRoleToUserRequest. This struct is safe to replace or modify but // should not be done so concurrently. var AssignRoleToUserRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *AssignRoleToUserRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := AssignRoleToUserRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*AssignRoleToUserRequest)(nil) // AssignRoleToUserRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of AssignRoleToUserRequest. This struct is safe to replace or modify but // should not be done so concurrently. var AssignRoleToUserRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *AssignRoleToUserRequest) UnmarshalJSON(b []byte) error { return AssignRoleToUserRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*AssignRoleToUserRequest)(nil) // AssignRoleToUserResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of AssignRoleToUserResponse. This struct is safe to replace or modify but // should not be done so concurrently. var AssignRoleToUserResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *AssignRoleToUserResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := AssignRoleToUserResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*AssignRoleToUserResponse)(nil) // AssignRoleToUserResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of AssignRoleToUserResponse. This struct is safe to replace or modify but // should not be done so concurrently. var AssignRoleToUserResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *AssignRoleToUserResponse) UnmarshalJSON(b []byte) error { return AssignRoleToUserResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*AssignRoleToUserResponse)(nil) // RemoveRoleFromUserRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of RemoveRoleFromUserRequest. This struct is safe to replace or modify but // should not be done so concurrently. var RemoveRoleFromUserRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *RemoveRoleFromUserRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := RemoveRoleFromUserRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*RemoveRoleFromUserRequest)(nil) // RemoveRoleFromUserRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of RemoveRoleFromUserRequest. This struct is safe to replace or modify but // should not be done so concurrently. var RemoveRoleFromUserRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *RemoveRoleFromUserRequest) UnmarshalJSON(b []byte) error { return RemoveRoleFromUserRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*RemoveRoleFromUserRequest)(nil) // UserRoleAssignmentJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of UserRoleAssignment. This struct is safe to replace or modify but // should not be done so concurrently. var UserRoleAssignmentJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *UserRoleAssignment) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := UserRoleAssignmentJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*UserRoleAssignment)(nil) // UserRoleAssignmentJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of UserRoleAssignment. This struct is safe to replace or modify but // should not be done so concurrently. var UserRoleAssignmentJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *UserRoleAssignment) UnmarshalJSON(b []byte) error { return UserRoleAssignmentJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*UserRoleAssignment)(nil) // ListPermissionsByResourceRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListPermissionsByResourceRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListPermissionsByResourceRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListPermissionsByResourceRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListPermissionsByResourceRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListPermissionsByResourceRequest)(nil) // ListPermissionsByResourceRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListPermissionsByResourceRequest. This struct is safe to replace or modify but // should not be done so concurrently. var ListPermissionsByResourceRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListPermissionsByResourceRequest) UnmarshalJSON(b []byte) error { return ListPermissionsByResourceRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListPermissionsByResourceRequest)(nil) // ListPermissionsByResourceResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListPermissionsByResourceResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListPermissionsByResourceResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListPermissionsByResourceResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListPermissionsByResourceResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListPermissionsByResourceResponse)(nil) // ListPermissionsByResourceResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListPermissionsByResourceResponse. This struct is safe to replace or modify but // should not be done so concurrently. var ListPermissionsByResourceResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListPermissionsByResourceResponse) UnmarshalJSON(b []byte) error { return ListPermissionsByResourceResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListPermissionsByResourceResponse)(nil) // GetPermissionByIDRequestJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetPermissionByIDRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetPermissionByIDRequestJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetPermissionByIDRequest) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetPermissionByIDRequestJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetPermissionByIDRequest)(nil) // GetPermissionByIDRequestJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetPermissionByIDRequest. This struct is safe to replace or modify but // should not be done so concurrently. var GetPermissionByIDRequestJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetPermissionByIDRequest) UnmarshalJSON(b []byte) error { return GetPermissionByIDRequestJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetPermissionByIDRequest)(nil) // GetPermissionByIDResponseJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of GetPermissionByIDResponse. This struct is safe to replace or modify but // should not be done so concurrently. var GetPermissionByIDResponseJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *GetPermissionByIDResponse) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := GetPermissionByIDResponseJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*GetPermissionByIDResponse)(nil) // GetPermissionByIDResponseJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of GetPermissionByIDResponse. This struct is safe to replace or modify but // should not be done so concurrently. var GetPermissionByIDResponseJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *GetPermissionByIDResponse) UnmarshalJSON(b []byte) error { return GetPermissionByIDResponseJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*GetPermissionByIDResponse)(nil) // ResourceJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Resource. This struct is safe to replace or modify but // should not be done so concurrently. var ResourceJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Resource) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ResourceJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Resource)(nil) // ResourceJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Resource. This struct is safe to replace or modify but // should not be done so concurrently. var ResourceJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Resource) UnmarshalJSON(b []byte) error { return ResourceJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Resource)(nil) // BundleJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Bundle. This struct is safe to replace or modify but // should not be done so concurrently. var BundleJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Bundle) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := BundleJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Bundle)(nil) // BundleJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Bundle. This struct is safe to replace or modify but // should not be done so concurrently. var BundleJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Bundle) UnmarshalJSON(b []byte) error { return BundleJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Bundle)(nil) // SettingJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Setting. This struct is safe to replace or modify but // should not be done so concurrently. var SettingJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Setting) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := SettingJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Setting)(nil) // SettingJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Setting. This struct is safe to replace or modify but // should not be done so concurrently. var SettingJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Setting) UnmarshalJSON(b []byte) error { return SettingJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Setting)(nil) // IntJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Int. This struct is safe to replace or modify but // should not be done so concurrently. var IntJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Int) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := IntJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Int)(nil) // IntJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Int. This struct is safe to replace or modify but // should not be done so concurrently. var IntJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Int) UnmarshalJSON(b []byte) error { return IntJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Int)(nil) // StringJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of String. This struct is safe to replace or modify but // should not be done so concurrently. var StringJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *String) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := StringJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*String)(nil) // StringJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of String. This struct is safe to replace or modify but // should not be done so concurrently. var StringJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *String) UnmarshalJSON(b []byte) error { return StringJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*String)(nil) // BoolJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Bool. This struct is safe to replace or modify but // should not be done so concurrently. var BoolJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Bool) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := BoolJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Bool)(nil) // BoolJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Bool. This struct is safe to replace or modify but // should not be done so concurrently. var BoolJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Bool) UnmarshalJSON(b []byte) error { return BoolJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Bool)(nil) // SingleChoiceListJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of SingleChoiceList. This struct is safe to replace or modify but // should not be done so concurrently. var SingleChoiceListJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *SingleChoiceList) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := SingleChoiceListJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*SingleChoiceList)(nil) // SingleChoiceListJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of SingleChoiceList. This struct is safe to replace or modify but // should not be done so concurrently. var SingleChoiceListJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *SingleChoiceList) UnmarshalJSON(b []byte) error { return SingleChoiceListJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*SingleChoiceList)(nil) // MultiChoiceListJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of MultiChoiceList. This struct is safe to replace or modify but // should not be done so concurrently. var MultiChoiceListJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *MultiChoiceList) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := MultiChoiceListJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*MultiChoiceList)(nil) // MultiChoiceListJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of MultiChoiceList. This struct is safe to replace or modify but // should not be done so concurrently. var MultiChoiceListJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *MultiChoiceList) UnmarshalJSON(b []byte) error { return MultiChoiceListJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*MultiChoiceList)(nil) // ListOptionJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListOption. This struct is safe to replace or modify but // should not be done so concurrently. var ListOptionJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListOption) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListOptionJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListOption)(nil) // ListOptionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListOption. This struct is safe to replace or modify but // should not be done so concurrently. var ListOptionJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListOption) UnmarshalJSON(b []byte) error { return ListOptionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListOption)(nil) // PermissionJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Permission. This struct is safe to replace or modify but // should not be done so concurrently. var PermissionJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Permission) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := PermissionJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Permission)(nil) // PermissionJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Permission. This struct is safe to replace or modify but // should not be done so concurrently. var PermissionJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Permission) UnmarshalJSON(b []byte) error { return PermissionJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Permission)(nil) // ValueJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of Value. This struct is safe to replace or modify but // should not be done so concurrently. var ValueJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *Value) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ValueJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*Value)(nil) // ValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of Value. This struct is safe to replace or modify but // should not be done so concurrently. var ValueJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *Value) UnmarshalJSON(b []byte) error { return ValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*Value)(nil) // ListValueJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListValue. This struct is safe to replace or modify but // should not be done so concurrently. var ListValueJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListValue) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListValueJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListValue)(nil) // ListValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListValue. This struct is safe to replace or modify but // should not be done so concurrently. var ListValueJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListValue) UnmarshalJSON(b []byte) error { return ListValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListValue)(nil) // ListOptionValueJSONMarshaler describes the default jsonpb.Marshaler used by all // instances of ListOptionValue. This struct is safe to replace or modify but // should not be done so concurrently. var ListOptionValueJSONMarshaler = new(jsonpb.Marshaler) // MarshalJSON satisfies the encoding/json Marshaler interface. This method // uses the more correct jsonpb package to correctly marshal the message. func (m *ListOptionValue) MarshalJSON() ([]byte, error) { if m == nil { return json.Marshal(nil) } buf := &bytes.Buffer{} if err := ListOptionValueJSONMarshaler.Marshal(buf, m); err != nil { return nil, err } return buf.Bytes(), nil } var _ json.Marshaler = (*ListOptionValue)(nil) // ListOptionValueJSONUnmarshaler describes the default jsonpb.Unmarshaler used by all // instances of ListOptionValue. This struct is safe to replace or modify but // should not be done so concurrently. var ListOptionValueJSONUnmarshaler = new(jsonpb.Unmarshaler) // UnmarshalJSON satisfies the encoding/json Unmarshaler interface. This method // uses the more correct jsonpb package to correctly unmarshal the message. func (m *ListOptionValue) UnmarshalJSON(b []byte) error { return ListOptionValueJSONUnmarshaler.Unmarshal(bytes.NewReader(b), m) } var _ json.Unmarshaler = (*ListOptionValue)(nil)