Add proto files for the settings service and include generated code

This commit is contained in:
Juan Pablo Villafáñez
2022-01-12 10:38:14 +01:00
parent 04b8ef0fcb
commit e794c623bd
12 changed files with 8707 additions and 0 deletions

View File

@@ -0,0 +1,253 @@
---
title: "GRPC API"
date: 2018-05-02T00:00:00+00:00
weight: 50
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
geekdocEditPath: edit/master/docs
geekdocFilePath: grpc.md
---
{{< toc >}}
## ocis/messages/settings/v1/settings.proto
### Bool
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| default | [bool](#bool) | | |
| label | [string](#string) | | |
### Bundle
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
| name | [string](#string) | | |
| type | [Bundle.Type](#bundletype) | | |
| extension | [string](#string) | | |
| display_name | [string](#string) | | |
| settings | [Setting](#setting) | repeated | |
| resource | [Resource](#resource) | | |
### Identifier
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| extension | [string](#string) | | |
| bundle | [string](#string) | | |
| setting | [string](#string) | | |
### Int
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| default | [int64](#int64) | | |
| min | [int64](#int64) | | |
| max | [int64](#int64) | | |
| step | [int64](#int64) | | |
| placeholder | [string](#string) | | |
### ListOption
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ListOptionValue](#listoptionvalue) | | |
| default | [bool](#bool) | | |
| display_value | [string](#string) | | |
### ListOptionValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| string_value | [string](#string) | | |
| int_value | [int64](#int64) | | |
### ListValue
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| values | [ListOptionValue](#listoptionvalue) | repeated | |
### MultiChoiceList
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| options | [ListOption](#listoption) | repeated | |
### Permission
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| operation | [Permission.Operation](#permissionoperation) | | |
| constraint | [Permission.Constraint](#permissionconstraint) | | |
### Resource
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [Resource.Type](#resourcetype) | | |
| id | [string](#string) | | |
### Setting
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
| name | [string](#string) | | |
| display_name | [string](#string) | | |
| description | [string](#string) | | |
| int_value | [Int](#int) | | |
| string_value | [String](#string) | | |
| bool_value | [Bool](#bool) | | |
| single_choice_value | [SingleChoiceList](#singlechoicelist) | | |
| multi_choice_value | [MultiChoiceList](#multichoicelist) | | |
| permission_value | [Permission](#permission) | | |
| resource | [Resource](#resource) | | |
### SingleChoiceList
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| options | [ListOption](#listoption) | repeated | |
### String
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| default | [string](#string) | | |
| required | [bool](#bool) | | |
| min_length | [int32](#int32) | | |
| max_length | [int32](#int32) | | |
| placeholder | [string](#string) | | |
### UserRoleAssignment
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | id is generated upon saving the assignment |
| account_uuid | [string](#string) | | |
| role_id | [string](#string) | | the role_id is a bundle_id internally |
### Value
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | id is the id of the Value. It is generated on saving it. |
| bundle_id | [string](#string) | | |
| setting_id | [string](#string) | | setting_id is the id of the setting from within its bundle. |
| account_uuid | [string](#string) | | |
| resource | [Resource](#resource) | | |
| bool_value | [bool](#bool) | | |
| int_value | [int64](#int64) | | |
| string_value | [string](#string) | | |
| list_value | [ListValue](#listvalue) | | |
### ValueWithIdentifier
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| identifier | [Identifier](#identifier) | | |
| value | [Value](#value) | | |
### Bundle.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNKNOWN | 0 | |
| TYPE_DEFAULT | 1 | |
| TYPE_ROLE | 2 | |
### Permission.Constraint
| Name | Number | Description |
| ---- | ------ | ----------- |
| CONSTRAINT_UNKNOWN | 0 | |
| CONSTRAINT_OWN | 1 | |
| CONSTRAINT_SHARED | 2 | |
| CONSTRAINT_ALL | 3 | |
### Permission.Operation
| Name | Number | Description |
| ---- | ------ | ----------- |
| OPERATION_UNKNOWN | 0 | |
| OPERATION_CREATE | 1 | |
| OPERATION_READ | 2 | |
| OPERATION_UPDATE | 3 | |
| OPERATION_DELETE | 4 | |
| OPERATION_WRITE | 5 | WRITE is a combination of CREATE and UPDATE |
| OPERATION_READWRITE | 6 | READWRITE is a combination of READ and WRITE |
### Resource.Type
| Name | Number | Description |
| ---- | ------ | ----------- |
| TYPE_UNKNOWN | 0 | |
| TYPE_SYSTEM | 1 | |
| TYPE_FILE | 2 | |
| TYPE_SHARE | 3 | |
| TYPE_SETTING | 4 | |
| TYPE_BUNDLE | 5 | |
| TYPE_USER | 6 | |
| TYPE_GROUP | 7 | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |

View File

@@ -0,0 +1,286 @@
---
title: "GRPC API"
date: 2018-05-02T00:00:00+00:00
weight: 50
geekdocRepo: https://github.com/owncloud/ocis-thumbnails
geekdocEditPath: edit/master/docs
geekdocFilePath: grpc.md
---
{{< toc >}}
## ocis/services/settings/v1/settings.proto
### AddSettingToBundleRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
| setting | [ocis.messages.settings.v1.Setting](../../../messages/settings/v1/grpc.md#setting) | | |
### AddSettingToBundleResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| setting | [ocis.messages.settings.v1.Setting](../../../messages/settings/v1/grpc.md#setting) | | |
### AssignRoleToUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
| role_id | [string](#string) | | the role_id is a bundle_id internally |
### AssignRoleToUserResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| assignment | [ocis.messages.settings.v1.UserRoleAssignment](../../../messages/settings/v1/grpc.md#userroleassignment) | | |
### GetBundleRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
### GetBundleResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle | [ocis.messages.settings.v1.Bundle](../../../messages/settings/v1/grpc.md#bundle) | | |
### GetPermissionByIDRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission_id | [string](#string) | | |
### GetPermissionByIDResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permission | [ocis.messages.settings.v1.Permission](../../../messages/settings/v1/grpc.md#permission) | | |
### GetValueByUniqueIdentifiersRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
| setting_id | [string](#string) | | |
### GetValueRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
### GetValueResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ocis.messages.settings.v1.ValueWithIdentifier](../../../messages/settings/v1/grpc.md#valuewithidentifier) | | |
### ListBundlesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_ids | [string](#string) | repeated | |
### ListBundlesResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundles | [ocis.messages.settings.v1.Bundle](../../../messages/settings/v1/grpc.md#bundle) | repeated | |
### ListPermissionsByResourceRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| resource | [ocis.messages.settings.v1.Resource](../../../messages/settings/v1/grpc.md#resource) | | |
### ListPermissionsByResourceResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| permissions | [ocis.messages.settings.v1.Permission](../../../messages/settings/v1/grpc.md#permission) | repeated | |
### ListRoleAssignmentsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| account_uuid | [string](#string) | | |
### ListRoleAssignmentsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| assignments | [ocis.messages.settings.v1.UserRoleAssignment](../../../messages/settings/v1/grpc.md#userroleassignment) | repeated | |
### ListValuesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
| account_uuid | [string](#string) | | |
### ListValuesResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| values | [ocis.messages.settings.v1.ValueWithIdentifier](../../../messages/settings/v1/grpc.md#valuewithidentifier) | repeated | |
### RemoveRoleFromUserRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | |
### RemoveSettingFromBundleRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle_id | [string](#string) | | |
| setting_id | [string](#string) | | |
### SaveBundleRequest
---
requests and responses for settings bundles
---
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle | [ocis.messages.settings.v1.Bundle](../../../messages/settings/v1/grpc.md#bundle) | | |
### SaveBundleResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| bundle | [ocis.messages.settings.v1.Bundle](../../../messages/settings/v1/grpc.md#bundle) | | |
### SaveValueRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ocis.messages.settings.v1.Value](../../../messages/settings/v1/grpc.md#value) | | |
### SaveValueResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| value | [ocis.messages.settings.v1.ValueWithIdentifier](../../../messages/settings/v1/grpc.md#valuewithidentifier) | | |
### BundleService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| SaveBundle | [SaveBundleRequest](#savebundlerequest) | [SaveBundleResponse](#savebundleresponse) | |
| GetBundle | [GetBundleRequest](#getbundlerequest) | [GetBundleResponse](#getbundleresponse) | |
| ListBundles | [ListBundlesRequest](#listbundlesrequest) | [ListBundlesResponse](#listbundlesresponse) | |
| AddSettingToBundle | [AddSettingToBundleRequest](#addsettingtobundlerequest) | [AddSettingToBundleResponse](#addsettingtobundleresponse) | |
| RemoveSettingFromBundle | [RemoveSettingFromBundleRequest](#removesettingfrombundlerequest) | [.google.protobuf.Empty](#googleprotobufempty) | |
### PermissionService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ListPermissionsByResource | [ListPermissionsByResourceRequest](#listpermissionsbyresourcerequest) | [ListPermissionsByResourceResponse](#listpermissionsbyresourceresponse) | |
| GetPermissionByID | [GetPermissionByIDRequest](#getpermissionbyidrequest) | [GetPermissionByIDResponse](#getpermissionbyidresponse) | |
### RoleService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ListRoles | [ListBundlesRequest](#listbundlesrequest) | [ListBundlesResponse](#listbundlesresponse) | |
| ListRoleAssignments | [ListRoleAssignmentsRequest](#listroleassignmentsrequest) | [ListRoleAssignmentsResponse](#listroleassignmentsresponse) | |
| AssignRoleToUser | [AssignRoleToUserRequest](#assignroletouserrequest) | [AssignRoleToUserResponse](#assignroletouserresponse) | |
| RemoveRoleFromUser | [RemoveRoleFromUserRequest](#removerolefromuserrequest) | [.google.protobuf.Empty](#googleprotobufempty) | |
### ValueService
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| SaveValue | [SaveValueRequest](#savevaluerequest) | [SaveValueResponse](#savevalueresponse) | |
| GetValue | [GetValueRequest](#getvaluerequest) | [GetValueResponse](#getvalueresponse) | |
| ListValues | [ListValuesRequest](#listvaluesrequest) | [ListValuesResponse](#listvaluesresponse) | |
| GetValueByUniqueIdentifiers | [GetValueByUniqueIdentifiersRequest](#getvaluebyuniqueidentifiersrequest) | [GetValueResponse](#getvalueresponse) | |
## Scalar Value Types
| .proto Type | Notes | C++ | Java |
| ----------- | ----- | --- | ---- |
| {{< div id="double" content="double" >}} | | double | double |
| {{< div id="float" content="float" >}} | | float | float |
| {{< div id="int32" content="int32" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead. | int32 | int |
| {{< div id="int64" content="int64" >}} | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead. | int64 | long |
| {{< div id="uint32" content="uint32" >}} | Uses variable-length encoding. | uint32 | int |
| {{< div id="uint64" content="uint64" >}} | Uses variable-length encoding. | uint64 | long |
| {{< div id="sint32" content="sint32" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int |
| {{< div id="sint64" content="sint64" >}} | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long |
| {{< div id="fixed32" content="fixed32" >}} | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int |
| {{< div id="fixed64" content="fixed64" >}} | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long |
| {{< div id="sfixed32" content="sfixed32" >}} | Always four bytes. | int32 | int |
| {{< div id="sfixed64" content="sfixed64" >}} | Always eight bytes. | int64 | long |
| {{< div id="bool" content="bool" >}} | | bool | boolean |
| {{< div id="string" content="string" >}} | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String |
| {{< div id="bytes" content="bytes" >}} | May contain any arbitrary sequence of bytes. | string | ByteString |

View File

File diff suppressed because it is too large Load Diff

View File

@@ -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

View File

@@ -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)

View File

@@ -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"
}
}
}
}
}
}

View File

File diff suppressed because it is too large Load Diff

View File

@@ -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)
}

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,172 @@
syntax = "proto3";
package ocis.messages.settings.v1;
option go_package = "github.com/owncloud/ocis/protogen/gen/ocis/messages/settings/v1";
// ---
// messages for settings values
// ---
message ValueWithIdentifier {
Identifier identifier = 1;
Value value = 2;
}
message Identifier {
string extension = 1;
string bundle = 2;
string setting = 3;
}
// ---
// messages for role assignment
// ---
message UserRoleAssignment {
// id is generated upon saving the assignment
string id = 1;
string account_uuid = 2;
// the role_id is a bundle_id internally
string role_id = 3;
}
// ---
// resource payloads
// ---
message Resource {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_SYSTEM = 1;
TYPE_FILE = 2;
TYPE_SHARE = 3;
TYPE_SETTING = 4;
TYPE_BUNDLE = 5;
TYPE_USER = 6;
TYPE_GROUP = 7;
}
Type type = 1;
string id = 2;
}
// ---
// payloads for bundles
// ---
message Bundle {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_DEFAULT = 1;
TYPE_ROLE = 2;
}
string id = 1;
string name = 2;
Type type = 3;
string extension = 4;
string display_name = 5;
repeated Setting settings = 6;
Resource resource = 7;
}
message Setting {
string id = 1;
string name = 2;
string display_name = 3;
string description = 4;
oneof value {
Int int_value = 5;
String string_value = 6;
Bool bool_value = 7;
SingleChoiceList single_choice_value = 8;
MultiChoiceList multi_choice_value = 9;
Permission permission_value = 10;
}
Resource resource = 11;
}
message Int {
int64 default = 1;
int64 min = 2;
int64 max = 3;
int64 step = 4;
string placeholder = 5;
}
message String {
string default = 1;
bool required = 2;
int32 min_length = 3;
int32 max_length = 4;
string placeholder = 5;
}
message Bool {
bool default = 1;
string label = 2;
}
message SingleChoiceList {
repeated ListOption options = 1;
}
message MultiChoiceList {
repeated ListOption options = 1;
}
message ListOption {
ListOptionValue value = 1;
bool default = 2;
string display_value = 3;
}
message Permission {
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_CREATE = 1;
OPERATION_READ = 2;
OPERATION_UPDATE = 3;
OPERATION_DELETE = 4;
OPERATION_WRITE = 5;// WRITE is a combination of CREATE and UPDATE
OPERATION_READWRITE = 6;// READWRITE is a combination of READ and WRITE
}
Operation operation = 1;
enum Constraint {
CONSTRAINT_UNKNOWN = 0;
CONSTRAINT_OWN = 1;
CONSTRAINT_SHARED = 2;
CONSTRAINT_ALL = 3;
}
Constraint constraint = 2;
}
// ---
// payloads for values
// ---
message Value {
// id is the id of the Value. It is generated on saving it.
string id = 1;
string bundle_id = 2;
// setting_id is the id of the setting from within its bundle.
string setting_id = 3;
string account_uuid = 4;
Resource resource = 5;
oneof value {
bool bool_value = 6;
int64 int_value = 7;
string string_value = 8;
ListValue list_value = 9;
}
}
message ListValue {
repeated ListOptionValue values = 1;
}
message ListOptionValue {
oneof option {
string string_value = 1;
int64 int_value = 2;
}
}

View File

@@ -0,0 +1,257 @@
syntax = "proto3";
package ocis.services.settings.v1;
option go_package = "github.com/owncloud/ocis/protogen/gen/ocis/services/settings/v1";
import "ocis/messages/settings/v1/settings.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "ownCloud Infinite Scale settings";
version: "1.0.0";
contact: {
name: "ownCloud GmbH";
url: "https://github.com/owncloud/ocis";
email: "support@owncloud.com";
};
license: {
name: "Apache-2.0";
url: "https://github.com/owncloud/ocis/blob/master/LICENSE";
};
};
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
external_docs: {
description: "Developer Manual";
url: "https://owncloud.dev/extensions/settings/";
};
};
service BundleService {
rpc SaveBundle(SaveBundleRequest) returns (SaveBundleResponse) {
option (google.api.http) = {
post: "/api/v1/settings/bundle-save",
body: "*"
};
}
rpc GetBundle(GetBundleRequest) returns (GetBundleResponse) {
option (google.api.http) = {
post: "/api/v1/settings/bundle-get",
body: "*"
};
}
rpc ListBundles(ListBundlesRequest) returns (ListBundlesResponse) {
option (google.api.http) = {
post: "/api/v1/settings/bundles-list",
body: "*"
};
}
rpc AddSettingToBundle(AddSettingToBundleRequest) returns (AddSettingToBundleResponse) {
option (google.api.http) = {
post: "/api/v1/settings/bundles-add-setting",
body: "*"
};
}
rpc RemoveSettingFromBundle(RemoveSettingFromBundleRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/api/v1/settings/bundles-remove-setting",
body: "*"
};
}
}
service ValueService {
rpc SaveValue(SaveValueRequest) returns (SaveValueResponse) {
option (google.api.http) = {
post: "/api/v1/settings/values-save",
body: "*"
};
}
rpc GetValue(GetValueRequest) returns (GetValueResponse) {
option (google.api.http) = {
post: "/api/v1/settings/values-get",
body: "*"
};
}
rpc ListValues(ListValuesRequest) returns (ListValuesResponse) {
option (google.api.http) = {
post: "/api/v1/settings/values-list",
body: "*"
};
}
rpc GetValueByUniqueIdentifiers(GetValueByUniqueIdentifiersRequest) returns (GetValueResponse) {
option (google.api.http) = {
post: "/api/v1/settings/values-get-by-unique-identifiers",
body: "*"
};
}
}
service RoleService {
rpc ListRoles(ListBundlesRequest) returns (ListBundlesResponse) {
option (google.api.http) = {
post: "/api/v1/settings/roles-list",
body: "*"
};
}
rpc ListRoleAssignments(ListRoleAssignmentsRequest) returns (ListRoleAssignmentsResponse) {
option (google.api.http) = {
post: "/api/v1/settings/assignments-list",
body: "*"
};
}
rpc AssignRoleToUser(AssignRoleToUserRequest) returns (AssignRoleToUserResponse) {
option (google.api.http) = {
post: "/api/v1/settings/assignments-add",
body: "*"
};
}
rpc RemoveRoleFromUser(RemoveRoleFromUserRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/api/v1/settings/assignments-remove",
body: "*"
};
}
}
service PermissionService {
rpc ListPermissionsByResource(ListPermissionsByResourceRequest) returns (ListPermissionsByResourceResponse) {
option (google.api.http) = {
post: "/api/v1/settings/permissions-list-by-resource",
body: "*"
};
}
rpc GetPermissionByID(GetPermissionByIDRequest) returns (GetPermissionByIDResponse) {
option (google.api.http) = {
post: "/api/v1/settings/permissions-get-by-id",
body: "*"
};
}
}
// ---
// requests and responses for settings bundles
// ---
message SaveBundleRequest {
ocis.messages.settings.v1.Bundle bundle = 1;
}
message SaveBundleResponse {
ocis.messages.settings.v1.Bundle bundle = 1;
}
message GetBundleRequest {
string bundle_id = 1;
}
message GetBundleResponse {
ocis.messages.settings.v1.Bundle bundle = 1;
}
message ListBundlesRequest {
repeated string bundle_ids = 1;
}
message ListBundlesResponse {
repeated ocis.messages.settings.v1.Bundle bundles = 1;
}
message AddSettingToBundleRequest {
string bundle_id = 1;
ocis.messages.settings.v1.Setting setting = 2;
}
message AddSettingToBundleResponse {
ocis.messages.settings.v1.Setting setting = 1;
}
message RemoveSettingFromBundleRequest {
string bundle_id = 1;
string setting_id = 2;
}
// ---
// requests and responses for settings values
// ---
message SaveValueRequest {
ocis.messages.settings.v1.Value value = 1;
}
message SaveValueResponse {
ocis.messages.settings.v1.ValueWithIdentifier value = 1;
}
message GetValueRequest {
string id = 1;
}
message GetValueResponse {
ocis.messages.settings.v1.ValueWithIdentifier value = 1;
}
message ListValuesRequest {
string bundle_id = 1;
string account_uuid = 2;
}
message ListValuesResponse {
repeated ocis.messages.settings.v1.ValueWithIdentifier values = 1;
}
message GetValueByUniqueIdentifiersRequest{
string account_uuid = 1;
string setting_id = 2;
}
// --
// requests and responses for role assignments
// ---
message ListRoleAssignmentsRequest {
string account_uuid = 1;
}
message ListRoleAssignmentsResponse {
repeated ocis.messages.settings.v1.UserRoleAssignment assignments = 1;
}
message AssignRoleToUserRequest {
string account_uuid = 1;
// the role_id is a bundle_id internally
string role_id = 2;
}
message AssignRoleToUserResponse {
ocis.messages.settings.v1.UserRoleAssignment assignment = 1;
}
message RemoveRoleFromUserRequest {
string id = 1;
}
// --
// requests and responses for permissions
// ---
message ListPermissionsByResourceRequest {
ocis.messages.settings.v1.Resource resource = 1;
}
message ListPermissionsByResourceResponse {
repeated ocis.messages.settings.v1.Permission permissions = 1;
}
message GetPermissionByIDRequest {
string permission_id = 1;
}
message GetPermissionByIDResponse {
ocis.messages.settings.v1.Permission permission = 1;
}