mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-26 05:58:27 -05:00
Add proto files for the settings service and include generated code
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: ocis/messages/settings/v1/settings.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
@@ -0,0 +1,587 @@
|
||||
// Code generated by protoc-gen-microweb. DO NOT EDIT.
|
||||
// source: v1.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
)
|
||||
|
||||
// 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)
|
||||
|
||||
// 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)
|
||||
|
||||
// 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)
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "ocis/messages/settings/v1/settings.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,669 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: ocis/services/settings/v1/settings.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
_ "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "go-micro.dev/v4/api"
|
||||
client "go-micro.dev/v4/client"
|
||||
server "go-micro.dev/v4/server"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for BundleService service
|
||||
|
||||
func NewBundleServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
{
|
||||
Name: "BundleService.SaveBundle",
|
||||
Path: []string{"/api/v1/settings/bundle-save"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "BundleService.GetBundle",
|
||||
Path: []string{"/api/v1/settings/bundle-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "BundleService.ListBundles",
|
||||
Path: []string{"/api/v1/settings/bundles-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "BundleService.AddSettingToBundle",
|
||||
Path: []string{"/api/v1/settings/bundles-add-setting"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "BundleService.RemoveSettingFromBundle",
|
||||
Path: []string{"/api/v1/settings/bundles-remove-setting"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for BundleService service
|
||||
|
||||
type BundleService interface {
|
||||
SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error)
|
||||
GetBundle(ctx context.Context, in *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error)
|
||||
ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error)
|
||||
AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error)
|
||||
RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type bundleService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewBundleService(name string, c client.Client) BundleService {
|
||||
return &bundleService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *bundleService) SaveBundle(ctx context.Context, in *SaveBundleRequest, opts ...client.CallOption) (*SaveBundleResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "BundleService.SaveBundle", in)
|
||||
out := new(SaveBundleResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bundleService) GetBundle(ctx context.Context, in *GetBundleRequest, opts ...client.CallOption) (*GetBundleResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "BundleService.GetBundle", in)
|
||||
out := new(GetBundleResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bundleService) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "BundleService.ListBundles", in)
|
||||
out := new(ListBundlesResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bundleService) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, opts ...client.CallOption) (*AddSettingToBundleResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "BundleService.AddSettingToBundle", in)
|
||||
out := new(AddSettingToBundleResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bundleService) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
|
||||
req := c.c.NewRequest(c.name, "BundleService.RemoveSettingFromBundle", in)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for BundleService service
|
||||
|
||||
type BundleServiceHandler interface {
|
||||
SaveBundle(context.Context, *SaveBundleRequest, *SaveBundleResponse) error
|
||||
GetBundle(context.Context, *GetBundleRequest, *GetBundleResponse) error
|
||||
ListBundles(context.Context, *ListBundlesRequest, *ListBundlesResponse) error
|
||||
AddSettingToBundle(context.Context, *AddSettingToBundleRequest, *AddSettingToBundleResponse) error
|
||||
RemoveSettingFromBundle(context.Context, *RemoveSettingFromBundleRequest, *emptypb.Empty) error
|
||||
}
|
||||
|
||||
func RegisterBundleServiceHandler(s server.Server, hdlr BundleServiceHandler, opts ...server.HandlerOption) error {
|
||||
type bundleService interface {
|
||||
SaveBundle(ctx context.Context, in *SaveBundleRequest, out *SaveBundleResponse) error
|
||||
GetBundle(ctx context.Context, in *GetBundleRequest, out *GetBundleResponse) error
|
||||
ListBundles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error
|
||||
AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, out *AddSettingToBundleResponse) error
|
||||
RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, out *emptypb.Empty) error
|
||||
}
|
||||
type BundleService struct {
|
||||
bundleService
|
||||
}
|
||||
h := &bundleServiceHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "BundleService.SaveBundle",
|
||||
Path: []string{"/api/v1/settings/bundle-save"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "BundleService.GetBundle",
|
||||
Path: []string{"/api/v1/settings/bundle-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "BundleService.ListBundles",
|
||||
Path: []string{"/api/v1/settings/bundles-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "BundleService.AddSettingToBundle",
|
||||
Path: []string{"/api/v1/settings/bundles-add-setting"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "BundleService.RemoveSettingFromBundle",
|
||||
Path: []string{"/api/v1/settings/bundles-remove-setting"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&BundleService{h}, opts...))
|
||||
}
|
||||
|
||||
type bundleServiceHandler struct {
|
||||
BundleServiceHandler
|
||||
}
|
||||
|
||||
func (h *bundleServiceHandler) SaveBundle(ctx context.Context, in *SaveBundleRequest, out *SaveBundleResponse) error {
|
||||
return h.BundleServiceHandler.SaveBundle(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *bundleServiceHandler) GetBundle(ctx context.Context, in *GetBundleRequest, out *GetBundleResponse) error {
|
||||
return h.BundleServiceHandler.GetBundle(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *bundleServiceHandler) ListBundles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error {
|
||||
return h.BundleServiceHandler.ListBundles(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *bundleServiceHandler) AddSettingToBundle(ctx context.Context, in *AddSettingToBundleRequest, out *AddSettingToBundleResponse) error {
|
||||
return h.BundleServiceHandler.AddSettingToBundle(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *bundleServiceHandler) RemoveSettingFromBundle(ctx context.Context, in *RemoveSettingFromBundleRequest, out *emptypb.Empty) error {
|
||||
return h.BundleServiceHandler.RemoveSettingFromBundle(ctx, in, out)
|
||||
}
|
||||
|
||||
// Api Endpoints for ValueService service
|
||||
|
||||
func NewValueServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
{
|
||||
Name: "ValueService.SaveValue",
|
||||
Path: []string{"/api/v1/settings/values-save"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "ValueService.GetValue",
|
||||
Path: []string{"/api/v1/settings/values-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "ValueService.ListValues",
|
||||
Path: []string{"/api/v1/settings/values-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "ValueService.GetValueByUniqueIdentifiers",
|
||||
Path: []string{"/api/v1/settings/values-get-by-unique-identifiers"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for ValueService service
|
||||
|
||||
type ValueService interface {
|
||||
SaveValue(ctx context.Context, in *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error)
|
||||
GetValue(ctx context.Context, in *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error)
|
||||
ListValues(ctx context.Context, in *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error)
|
||||
GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error)
|
||||
}
|
||||
|
||||
type valueService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewValueService(name string, c client.Client) ValueService {
|
||||
return &valueService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *valueService) SaveValue(ctx context.Context, in *SaveValueRequest, opts ...client.CallOption) (*SaveValueResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "ValueService.SaveValue", in)
|
||||
out := new(SaveValueResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *valueService) GetValue(ctx context.Context, in *GetValueRequest, opts ...client.CallOption) (*GetValueResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "ValueService.GetValue", in)
|
||||
out := new(GetValueResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *valueService) ListValues(ctx context.Context, in *ListValuesRequest, opts ...client.CallOption) (*ListValuesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "ValueService.ListValues", in)
|
||||
out := new(ListValuesResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *valueService) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, opts ...client.CallOption) (*GetValueResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "ValueService.GetValueByUniqueIdentifiers", in)
|
||||
out := new(GetValueResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for ValueService service
|
||||
|
||||
type ValueServiceHandler interface {
|
||||
SaveValue(context.Context, *SaveValueRequest, *SaveValueResponse) error
|
||||
GetValue(context.Context, *GetValueRequest, *GetValueResponse) error
|
||||
ListValues(context.Context, *ListValuesRequest, *ListValuesResponse) error
|
||||
GetValueByUniqueIdentifiers(context.Context, *GetValueByUniqueIdentifiersRequest, *GetValueResponse) error
|
||||
}
|
||||
|
||||
func RegisterValueServiceHandler(s server.Server, hdlr ValueServiceHandler, opts ...server.HandlerOption) error {
|
||||
type valueService interface {
|
||||
SaveValue(ctx context.Context, in *SaveValueRequest, out *SaveValueResponse) error
|
||||
GetValue(ctx context.Context, in *GetValueRequest, out *GetValueResponse) error
|
||||
ListValues(ctx context.Context, in *ListValuesRequest, out *ListValuesResponse) error
|
||||
GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, out *GetValueResponse) error
|
||||
}
|
||||
type ValueService struct {
|
||||
valueService
|
||||
}
|
||||
h := &valueServiceHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "ValueService.SaveValue",
|
||||
Path: []string{"/api/v1/settings/values-save"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "ValueService.GetValue",
|
||||
Path: []string{"/api/v1/settings/values-get"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "ValueService.ListValues",
|
||||
Path: []string{"/api/v1/settings/values-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "ValueService.GetValueByUniqueIdentifiers",
|
||||
Path: []string{"/api/v1/settings/values-get-by-unique-identifiers"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&ValueService{h}, opts...))
|
||||
}
|
||||
|
||||
type valueServiceHandler struct {
|
||||
ValueServiceHandler
|
||||
}
|
||||
|
||||
func (h *valueServiceHandler) SaveValue(ctx context.Context, in *SaveValueRequest, out *SaveValueResponse) error {
|
||||
return h.ValueServiceHandler.SaveValue(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *valueServiceHandler) GetValue(ctx context.Context, in *GetValueRequest, out *GetValueResponse) error {
|
||||
return h.ValueServiceHandler.GetValue(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *valueServiceHandler) ListValues(ctx context.Context, in *ListValuesRequest, out *ListValuesResponse) error {
|
||||
return h.ValueServiceHandler.ListValues(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *valueServiceHandler) GetValueByUniqueIdentifiers(ctx context.Context, in *GetValueByUniqueIdentifiersRequest, out *GetValueResponse) error {
|
||||
return h.ValueServiceHandler.GetValueByUniqueIdentifiers(ctx, in, out)
|
||||
}
|
||||
|
||||
// Api Endpoints for RoleService service
|
||||
|
||||
func NewRoleServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
{
|
||||
Name: "RoleService.ListRoles",
|
||||
Path: []string{"/api/v1/settings/roles-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "RoleService.ListRoleAssignments",
|
||||
Path: []string{"/api/v1/settings/assignments-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "RoleService.AssignRoleToUser",
|
||||
Path: []string{"/api/v1/settings/assignments-add"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "RoleService.RemoveRoleFromUser",
|
||||
Path: []string{"/api/v1/settings/assignments-remove"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for RoleService service
|
||||
|
||||
type RoleService interface {
|
||||
ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error)
|
||||
ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error)
|
||||
AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error)
|
||||
RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error)
|
||||
}
|
||||
|
||||
type roleService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewRoleService(name string, c client.Client) RoleService {
|
||||
return &roleService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *roleService) ListRoles(ctx context.Context, in *ListBundlesRequest, opts ...client.CallOption) (*ListBundlesResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "RoleService.ListRoles", in)
|
||||
out := new(ListBundlesResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *roleService) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, opts ...client.CallOption) (*ListRoleAssignmentsResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "RoleService.ListRoleAssignments", in)
|
||||
out := new(ListRoleAssignmentsResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *roleService) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, opts ...client.CallOption) (*AssignRoleToUserResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "RoleService.AssignRoleToUser", in)
|
||||
out := new(AssignRoleToUserResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *roleService) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
|
||||
req := c.c.NewRequest(c.name, "RoleService.RemoveRoleFromUser", in)
|
||||
out := new(emptypb.Empty)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for RoleService service
|
||||
|
||||
type RoleServiceHandler interface {
|
||||
ListRoles(context.Context, *ListBundlesRequest, *ListBundlesResponse) error
|
||||
ListRoleAssignments(context.Context, *ListRoleAssignmentsRequest, *ListRoleAssignmentsResponse) error
|
||||
AssignRoleToUser(context.Context, *AssignRoleToUserRequest, *AssignRoleToUserResponse) error
|
||||
RemoveRoleFromUser(context.Context, *RemoveRoleFromUserRequest, *emptypb.Empty) error
|
||||
}
|
||||
|
||||
func RegisterRoleServiceHandler(s server.Server, hdlr RoleServiceHandler, opts ...server.HandlerOption) error {
|
||||
type roleService interface {
|
||||
ListRoles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error
|
||||
ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, out *ListRoleAssignmentsResponse) error
|
||||
AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, out *AssignRoleToUserResponse) error
|
||||
RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, out *emptypb.Empty) error
|
||||
}
|
||||
type RoleService struct {
|
||||
roleService
|
||||
}
|
||||
h := &roleServiceHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "RoleService.ListRoles",
|
||||
Path: []string{"/api/v1/settings/roles-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "RoleService.ListRoleAssignments",
|
||||
Path: []string{"/api/v1/settings/assignments-list"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "RoleService.AssignRoleToUser",
|
||||
Path: []string{"/api/v1/settings/assignments-add"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "RoleService.RemoveRoleFromUser",
|
||||
Path: []string{"/api/v1/settings/assignments-remove"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&RoleService{h}, opts...))
|
||||
}
|
||||
|
||||
type roleServiceHandler struct {
|
||||
RoleServiceHandler
|
||||
}
|
||||
|
||||
func (h *roleServiceHandler) ListRoles(ctx context.Context, in *ListBundlesRequest, out *ListBundlesResponse) error {
|
||||
return h.RoleServiceHandler.ListRoles(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *roleServiceHandler) ListRoleAssignments(ctx context.Context, in *ListRoleAssignmentsRequest, out *ListRoleAssignmentsResponse) error {
|
||||
return h.RoleServiceHandler.ListRoleAssignments(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *roleServiceHandler) AssignRoleToUser(ctx context.Context, in *AssignRoleToUserRequest, out *AssignRoleToUserResponse) error {
|
||||
return h.RoleServiceHandler.AssignRoleToUser(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *roleServiceHandler) RemoveRoleFromUser(ctx context.Context, in *RemoveRoleFromUserRequest, out *emptypb.Empty) error {
|
||||
return h.RoleServiceHandler.RemoveRoleFromUser(ctx, in, out)
|
||||
}
|
||||
|
||||
// Api Endpoints for PermissionService service
|
||||
|
||||
func NewPermissionServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{
|
||||
{
|
||||
Name: "PermissionService.ListPermissionsByResource",
|
||||
Path: []string{"/api/v1/settings/permissions-list-by-resource"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
{
|
||||
Name: "PermissionService.GetPermissionByID",
|
||||
Path: []string{"/api/v1/settings/permissions-get-by-id"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// Client API for PermissionService service
|
||||
|
||||
type PermissionService interface {
|
||||
ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error)
|
||||
GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error)
|
||||
}
|
||||
|
||||
type permissionService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewPermissionService(name string, c client.Client) PermissionService {
|
||||
return &permissionService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *permissionService) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, opts ...client.CallOption) (*ListPermissionsByResourceResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "PermissionService.ListPermissionsByResource", in)
|
||||
out := new(ListPermissionsByResourceResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *permissionService) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, opts ...client.CallOption) (*GetPermissionByIDResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "PermissionService.GetPermissionByID", in)
|
||||
out := new(GetPermissionByIDResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for PermissionService service
|
||||
|
||||
type PermissionServiceHandler interface {
|
||||
ListPermissionsByResource(context.Context, *ListPermissionsByResourceRequest, *ListPermissionsByResourceResponse) error
|
||||
GetPermissionByID(context.Context, *GetPermissionByIDRequest, *GetPermissionByIDResponse) error
|
||||
}
|
||||
|
||||
func RegisterPermissionServiceHandler(s server.Server, hdlr PermissionServiceHandler, opts ...server.HandlerOption) error {
|
||||
type permissionService interface {
|
||||
ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, out *ListPermissionsByResourceResponse) error
|
||||
GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, out *GetPermissionByIDResponse) error
|
||||
}
|
||||
type PermissionService struct {
|
||||
permissionService
|
||||
}
|
||||
h := &permissionServiceHandler{hdlr}
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "PermissionService.ListPermissionsByResource",
|
||||
Path: []string{"/api/v1/settings/permissions-list-by-resource"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
opts = append(opts, api.WithEndpoint(&api.Endpoint{
|
||||
Name: "PermissionService.GetPermissionByID",
|
||||
Path: []string{"/api/v1/settings/permissions-get-by-id"},
|
||||
Method: []string{"POST"},
|
||||
Body: "*",
|
||||
Handler: "rpc",
|
||||
}))
|
||||
return s.Handle(s.NewHandler(&PermissionService{h}, opts...))
|
||||
}
|
||||
|
||||
type permissionServiceHandler struct {
|
||||
PermissionServiceHandler
|
||||
}
|
||||
|
||||
func (h *permissionServiceHandler) ListPermissionsByResource(ctx context.Context, in *ListPermissionsByResourceRequest, out *ListPermissionsByResourceResponse) error {
|
||||
return h.PermissionServiceHandler.ListPermissionsByResource(ctx, in, out)
|
||||
}
|
||||
|
||||
func (h *permissionServiceHandler) GetPermissionByID(ctx context.Context, in *GetPermissionByIDRequest, out *GetPermissionByIDResponse) error {
|
||||
return h.PermissionServiceHandler.GetPermissionByID(ctx, in, out)
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user