Files
QSfera/Server/protogen/proto/qsfera/messages/settings/v0/settings.proto
T
Курнат Андрей 2315f25754 Initial QSfera import
2026-06-07 10:20:04 +03:00

222 lines
5.9 KiB
Protocol Buffer

syntax = "proto3";
package qsfera.messages.settings.v0;
option go_package = "github.com/qsfera/server/protogen/gen/qsfera/messages/settings/v0";
// ---
// 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;
}
message UserRoleAssignmentFilter {
enum Type {
TYPE_UNKNOWN = 0;
TYPE_ACCOUNT = 1;
TYPE_ROLE = 2;
}
Type type = 1;
oneof term {
string account_uuid = 2;
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; // @gotags: yaml:"id"
string name = 2; // @gotags: yaml:"name"
Type type = 3; // @gotags: yaml:"type"
string extension = 4; // @gotags: yaml:"extension"
string display_name = 5; // @gotags: yaml:"display_name"
repeated Setting settings = 6; // @gotags: yaml:"settings"
Resource resource = 7; // @gotags: yaml:"resource"
}
message Setting {
string id = 1; // @gotags: yaml:"id"
string name = 2; // @gotags: yaml:"name"
string display_name = 3; // @gotags: yaml:"display_name"
string description = 4; // @gotags: yaml:"description"
oneof value {
Int int_value = 5; // @gotags: yaml:"int_value"
String string_value = 6; // @gotags: yaml:"string_value"
Bool bool_value = 7; // @gotags: yaml:"bool_value"
SingleChoiceList single_choice_value = 8; // @gotags: yaml:"single_choice_value"
MultiChoiceList multi_choice_value = 9; // @gotags: yaml:"multi_choice_value"
Permission permission_value = 10; // @gotags: yaml:"permission_value"
MultiChoiceCollection multi_choice_collection_value = 12; // @gotags: yaml:"multi_choice_collection_value"
}
Resource resource = 11; // @gotags: yaml:"resource"
}
message Int {
int64 default = 1; // @gotags: yaml:"default"
int64 min = 2; // @gotags: yaml:"min"
int64 max = 3; // @gotags: yaml:"max"
int64 step = 4; // @gotags: yaml:"step"
string placeholder = 5; // @gotags: yaml:"placeholder"
}
message String {
string default = 1; // @gotags: yaml:"default"
bool required = 2; // @gotags: yaml:"required"
int32 min_length = 3; // @gotags: yaml:"min_length"
int32 max_length = 4; // @gotags: yaml:"max_length"
string placeholder = 5; // @gotags: yaml:"placeholder"
}
message Bool {
bool default = 1; // @gotags: yaml:"default"
string label = 2; // @gotags: yaml:"label"
}
message SingleChoiceList {
repeated ListOption options = 1; // @gotags: yaml:"options"
}
message MultiChoiceList {
repeated ListOption options = 1; // @gotags: yaml:"options"
}
message ListOption {
ListOptionValue value = 1; // @gotags: yaml:"value"
bool default = 2; // @gotags: yaml:"default"
string display_value = 3; // @gotags: yaml:"display_value"
}
message MultiChoiceCollection {
repeated MultiChoiceCollectionOption options = 1; // @gotags: yaml:"options"
}
message MultiChoiceCollectionOption {
MultiChoiceCollectionOptionValue value = 1; // @gotags: yaml:"value"
string key = 2; // @gotags: yaml:"key"
string attribute = 3; // @gotags: yaml:"attribute"
string display_value = 4; // @gotags: yaml:"display_value"
}
message MultiChoiceCollectionOptionValue {
oneof option {
Int int_value = 1; // @gotags: yaml:"int_value"
String string_value = 2; // @gotags: yaml:"string_value"
Bool bool_value = 3; // @gotags: yaml:"bool_value"
}
}
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; // @gotags: yaml:"operation"
enum Constraint {
CONSTRAINT_UNKNOWN = 0;
CONSTRAINT_OWN = 1;
CONSTRAINT_SHARED = 2;
CONSTRAINT_ALL = 3;
}
Constraint constraint = 2; // @gotags: yaml:"constraint"
}
// ---
// payloads for values
// ---
message Value {
// id is the id of the Value. It is generated on saving it.
string id = 1; // @gotags: yaml:"id"
string bundle_id = 2; // @gotags: yaml:"bundle_id"
// setting_id is the id of the setting from within its bundle.
string setting_id = 3; // @gotags: yaml:"setting_id"
string account_uuid = 4; // @gotags: yaml:"account_uuid"
Resource resource = 5; // @gotags: yaml:"resource"
oneof value {
bool bool_value = 6; // @gotags: yaml:"bool_value"
int64 int_value = 7; // @gotags: yaml:"int_value"
string string_value = 8; // @gotags: yaml:"string_value"
ListValue list_value = 9; // @gotags: yaml:"list_value"
CollectionValue collection_value = 10; // @gotags: yaml:"collection_value"
}
}
message ListValue {
repeated ListOptionValue values = 1; // @gotags: yaml:"values"
}
message ListOptionValue {
oneof option {
string string_value = 1; // @gotags: yaml:"string_value"
int64 int_value = 2; // @gotags: yaml:"int_value"
bool bool_value = 3; // @gotags: yaml:"bool_value"
}
}
message CollectionValue {
repeated CollectionOption values = 1; // @gotags: yaml:"values"
}
message CollectionOption {
// required
string key = 1; // @gotags: yaml:"key"
oneof option {
int64 int_value = 2; // @gotags: yaml:"int_value"
string string_value = 3; // @gotags: yaml:"string_value"
bool bool_value = 4; // @gotags: yaml:"bool_value"
}
}