Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: implement user group api (#12070)
ecmadaoec6d3e6e3e55
diff --git a/backend/api/v1/acl_config.go b/backend/api/v1/acl_config.goindex 6611d9b71a..c0dad32e7a 100644--- a/backend/api/v1/acl_config.go+++ b/backend/api/v1/acl_config.go@@ -160,4 +160,11 @@ var methodPermissionMap = map[string]iam.Permission{v1pb.IdentityProviderService_DeleteIdentityProvider_FullMethodName: iam.PermissionIdentityProvidersDelete,v1pb.IdentityProviderService_UndeleteIdentityProvider_FullMethodName: iam.PermissionIdentityProvidersUndelete,v1pb.IdentityProviderService_TestIdentityProvider_FullMethodName: iam.PermissionIdentityProvidersUpdate,++ // TODO(pony):+ v1pb.UserGroupService_CreateUserGroup_FullMethodName: "",+ v1pb.UserGroupService_GetUserGroup_FullMethodName: "",+ v1pb.UserGroupService_DeleteUserGroup_FullMethodName: "",+ v1pb.UserGroupService_UpdateUserGroup_FullMethodName: "",+ v1pb.UserGroupService_ListUserGroups_FullMethodName: "",}diff --git a/backend/api/v1/acl_iam.go b/backend/api/v1/acl_iam.goindex 41d546c4e7..957cbd6d31 100644--- a/backend/api/v1/acl_iam.go+++ b/backend/api/v1/acl_iam.go@@ -82,6 +82,14 @@ func isSkippedMethod(fullMethod string) bool {v1pb.SubscriptionService_GetFeatureMatrix_FullMethodName,v1pb.SubscriptionService_UpdateSubscription_FullMethodName:return true+ case+ // TODO(p0ny): implement iam+ v1pb.UserGroupService_CreateUserGroup_FullMethodName,+ v1pb.UserGroupService_GetUserGroup_FullMethodName,+ v1pb.UserGroupService_DeleteUserGroup_FullMethodName,+ v1pb.UserGroupService_UpdateUserGroup_FullMethodName,+ v1pb.UserGroupService_ListUserGroups_FullMethodName:+ return true// skip checking for sheet service because we want to// discriminate bytebase artifact sheets and user sheets first.// TODO(p0ny): implementdiff --git a/backend/api/v1/user_group.go b/backend/api/v1/user_group.gonew file mode 100644index 0000000000..9db51e57d4--- /dev/null+++ b/backend/api/v1/user_group.go@@ -0,0 +1,195 @@+package v1++import (+ "context"+ "fmt"++ "google.golang.org/grpc/codes"+ "google.golang.org/grpc/status"+ "google.golang.org/protobuf/types/known/emptypb"++ "github.com/bytebase/bytebase/backend/common"+ "github.com/bytebase/bytebase/backend/store"+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"+ v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"+)++// UserGroupService implements the user group service.+type UserGroupService struct {+ v1pb.UnimplementedUserGroupServiceServer+ store *store.Store+}++// NewUserGroupService creates a new UserGroupService.+func NewUserGroupService(store *store.Store) *UserGroupService {+ return &UserGroupService{+ store: store,+ }+}++// GetUserGroup gets a group.+func (s *UserGroupService) GetUserGroup(ctx context.Context, request *v1pb.GetUserGroupRequest) (*v1pb.UserGroup, error) {+ email, err := common.GetUserGroupEmail(request.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }++ group, err := s.store.GetUserGroup(ctx, email)+ if err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }++ return convertToV1Group(group), nil+}++// ListUserGroups lists all groups.+func (s *UserGroupService) ListUserGroups(ctx context.Context, _ *v1pb.ListUserGroupsRequest) (*v1pb.ListUserGroupsResponse, error) {+ groups, err := s.store.ListUserGroups(ctx, &store.FindUserGroupMessage{})+ if err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }++ response := &v1pb.ListUserGroupsResponse{}+ for _, group := range groups {+ response.Groups = append(response.Groups, convertToV1Group(group))+ }+ return response, nil+}++// CreateUserGroup creates a group.+func (s *UserGroupService) CreateUserGroup(ctx context.Context, request *v1pb.CreateUserGroupRequest) (*v1pb.UserGroup, error) {+ groupMessage, err := convertToGroupMessage(request.Group)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }++ principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)+ if !ok {+ return nil, status.Errorf(codes.Internal, "principal ID not found")+ }++ group, err := s.store.CreateUserGroup(ctx, groupMessage, principalID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }++ return convertToV1Group(group), nil+}++// UpdateUserGroup updates a group.+func (s *UserGroupService) UpdateUserGroup(ctx context.Context, request *v1pb.UpdateUserGroupRequest) (*v1pb.UserGroup, error) {+ email, err := common.GetUserGroupEmail(request.Group.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }++ principalID, ok := ctx.Value(common.PrincipalIDContextKey).(int)+ if !ok {+ return nil, status.Errorf(codes.Internal, "principal ID not found")+ }++ patch := &store.UpdateUserGroupMessage{}++ for _, path := range request.UpdateMask.Paths {+ switch path {+ case "title":+ patch.Title = &request.Group.Title+ case "description":+ patch.Description = &request.Group.Description+ case "members":+ payload, err := convertToGroupPayload(request.Group)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ patch.Payload = payload+ default:+ return nil, status.Errorf(codes.InvalidArgument, `unsupport update_mask "%s"`, path)+ }+ }++ groupMessage, err := s.store.UpdateUserGroup(ctx, email, patch, principalID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }++ return convertToV1Group(groupMessage), nil+}++// DeleteUserGroup deletes a group.+func (s *UserGroupService) DeleteUserGroup(ctx context.Context, request *v1pb.DeleteUserGroupRequest) (*emptypb.Empty, error) {+ email, err := common.GetUserGroupEmail(request.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }++ if err := s.store.DeleteUserGroup(ctx, email); err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }++ return &emptypb.Empty{}, nil+}++func convertToGroupPayload(group *v1pb.UserGroup) (*storepb.UserGroupPayload, error) {+ payload := &storepb.UserGroupPayload{}+ for _, member := range group.Members {+ m := &storepb.UserGroupMember{+ Member: member.Member,+ }+ switch member.Role {+ case v1pb.UserGroupMember_MEMBER:+ m.Role = storepb.UserGroupMember_MEMBER+ case v1pb.UserGroupMember_OWNER:+ m.Role = storepb.UserGroupMember_OWNER+ default:+ return nil, status.Errorf(codes.InvalidArgument, "unsupport group member role %v", member.Role)+ }+ payload.Members = append(payload.Members, m)+ }+ return payload, nil+}++func convertToGroupMessage(group *v1pb.UserGroup) (*store.UserGroupMessage, error) {+ email, err := common.GetUserGroupEmail(group.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }++ groupMessage := &store.UserGroupMessage{+ Email: email,+ Title: group.Title,+ Description: group.Description,+ Payload: &storepb.UserGroupPayload{},+ }++ payload, err := convertToGroupPayload(group)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ groupMessage.Payload = payload+ return groupMessage, nil+}++func convertToV1Group(groupMessage *store.UserGroupMessage) *v1pb.UserGroup {+ group := &v1pb.UserGroup{+ Name: fmt.Sprintf("%s%s", common.UserGroupPrefix, groupMessage.Email),+ Title: groupMessage.Title,+ Description: groupMessage.Description,+ Creator: fmt.Sprintf("%s%d", common.UserNamePrefix, groupMessage.CreatorUID),+ }++ for _, member := range groupMessage.Payload.Members {+ m := &v1pb.UserGroupMember{+ Member: member.Member,+ Role: v1pb.UserGroupMember_ROLE_UNSPECIFIED,+ }+ switch member.Role {+ case storepb.UserGroupMember_MEMBER:+ m.Role = v1pb.UserGroupMember_MEMBER+ case storepb.UserGroupMember_OWNER:+ m.Role = v1pb.UserGroupMember_OWNER+ }+ group.Members = append(group.Members, m)+ }++ return group+}diff --git a/backend/common/resource_name.go b/backend/common/resource_name.goindex 6d78a2f3b6..793435438d 100644--- a/backend/common/resource_name.go+++ b/backend/common/resource_name.go@@ -48,6 +48,7 @@ const (ChangelistsPrefix = "changelists/"VCSConnectorPrefix = "vcsConnectors/"AuditLogPrefix = "auditLogs/"+ UserGroupPrefix = "groups/"SchemaSuffix = "/schema"MetadataSuffix = "/metadata"@@ -527,6 +528,15 @@ func GetWorkspaceProjectVCSConnectorID(name string) (string, string, string, errreturn tokens[0], tokens[1], tokens[2], nil}+// GetUserGroupEmail returns the group email.+func GetUserGroupEmail(name string) (string, error) {+ tokens, err := GetNameParentTokens(name, UserGroupPrefix)+ if err != nil {+ return "", err+ }+ return tokens[0], nil+}+// TrimSuffix trims the suffix from the name and returns the trimmed name.func TrimSuffix(name, suffix string) (string, error) {if !strings.HasSuffix(name, suffix) {diff --git a/backend/server/grpc_routes.go b/backend/server/grpc_routes.goindex ab60706b44..bd49edde2a 100644--- a/backend/server/grpc_routes.go+++ b/backend/server/grpc_routes.go@@ -92,6 +92,7 @@ func configureGrpcRouters(v1pb.RegisterLoggingServiceServer(grpcServer, apiv1.NewLoggingService(stores))v1pb.RegisterChangelistServiceServer(grpcServer, apiv1.NewChangelistService(stores, profile, iamManager))v1pb.RegisterVCSConnectorServiceServer(grpcServer, apiv1.NewVCSConnectorService(stores))+ v1pb.RegisterUserGroupServiceServer(grpcServer, apiv1.NewUserGroupService(stores))// REST gateway proxy.grpcEndpoint := fmt.Sprintf(":%d", profile.Port)@@ -175,5 +176,8 @@ func configureGrpcRouters(if err := v1pb.RegisterVCSConnectorServiceHandler(ctx, mux, grpcConn); err != nil {return nil, nil, nil, err}+ if err := v1pb.RegisterUserGroupServiceHandler(ctx, mux, grpcConn); err != nil {+ return nil, nil, nil, err+ }return planService, rolloutService, issueService, nil}diff --git a/backend/store/store.go b/backend/store/store.goindex be3c43309d..a8925d93a6 100644--- a/backend/store/store.go+++ b/backend/store/store.go@@ -50,6 +50,7 @@ type Store struct {schemaGroupCache *lru.Cache[string, *SchemaGroupMessage]vcsIDCache *lru.Cache[int, *VCSProviderMessage]rolesCache *lru.Cache[string, *RoleMessage]+ userGroupCache *lru.Cache[string, *UserGroupMessage]// Large objects.sheetCache *lru.Cache[int, string]@@ -166,6 +167,10 @@ func New(db *DB, profile *config.Profile) (*Store, error) {if err != nil {return nil, err}+ userGroupCache, err := lru.New[string, *UserGroupMessage](1024)+ if err != nil {+ return nil, err+ }return &Store{db: db,@@ -199,6 +204,7 @@ func New(db *DB, profile *config.Profile) (*Store, error) {rolesCache: rolesCache,sheetCache: sheetCache,dbSchemaCache: dbSchemaCache,+ userGroupCache: userGroupCache,}, nil}diff --git a/backend/store/user_group.go b/backend/store/user_group.gonew file mode 100644index 0000000000..5337f93c4c--- /dev/null+++ b/backend/store/user_group.go@@ -0,0 +1,266 @@+package store++import (+ "context"+ "fmt"+ "strings"+ "time"++ "google.golang.org/protobuf/encoding/protojson"++ "github.com/pkg/errors"++ "github.com/bytebase/bytebase/backend/common"+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"+)++// FindUserGroupMessage is the message for finding groups.+type FindUserGroupMessage struct {+ Email *string+}++// UpdateUserGroupMessage is the message to update a group.+type UpdateUserGroupMessage struct {+ Title *string+ Description *string+ Payload *storepb.UserGroupPayload+}++// UserGroupMessage is the message for a group.+type UserGroupMessage struct {+ Email string+ Title string+ Description string+ CreatorUID int+ Payload *storepb.UserGroupPayload+}++// GetUserGroup gets a group.+func (s *Store) GetUserGroup(ctx context.Context, email string) (*UserGroupMessage, error) {+ if v, ok := s.userGroupCache.Get(email); ok {+ return v, nil+ }++ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, err+ }+ defer tx.Rollback()++ groups, err := s.listUserGroupImpl(ctx, tx, &FindUserGroupMessage{+ Email: &email,+ })+ if err != nil {+ return nil, err+ }+ if err := tx.Commit(); err != nil {+ return nil, err+ }++ if len(groups) == 0 {+ return nil, nil+ } else if len(groups) > 1 {+ return nil, &common.Error{Code: common.Conflict, Err: errors.Errorf("found %d groups with email %+v, expect 1", len(groups), email)}+ }+ return groups[0], nil+}++// ListUserGroups list all groups.+func (s *Store) ListUserGroups(ctx context.Context, find *FindUserGroupMessage) ([]*UserGroupMessage, error) {+ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, err+ }+ defer tx.Rollback()++ groups, err := s.listUserGroupImpl(ctx, tx, find)+ if err != nil {+ return nil, err+ }+ if err := tx.Commit(); err != nil {+ return nil, err+ }++ for _, group := range groups {+ s.userGroupCache.Add(group.Email, group)+ }+ return groups, nil+}++func (*Store) listUserGroupImpl(ctx context.Context, tx *Tx, find *FindUserGroupMessage) ([]*UserGroupMessage, error) {+ where, args := []string{"TRUE"}, []any{}+ if v := find.Email; v != nil {+ where, args = append(where, fmt.Sprintf("email = $%d", len(args)+1)), append(args, *v)+ }++ var groups []*UserGroupMessage+ rows, err := tx.QueryContext(ctx, fmt.Sprintf(`+ SELECT+ email,+ creator_id,+ name,+ description,+ payload+ FROM user_group+ WHERE %s+ `, strings.Join(where, " AND ")), args...)+ if err != nil {+ return nil, err+ }+ defer rows.Close()++ for rows.Next() {+ var group UserGroupMessage+ var payload []byte+ if err := rows.Scan(+ &group.Email,+ &group.CreatorUID,+ &group.Title,+ &group.Description,+ &payload,+ ); err != nil {+ return nil, err+ }++ groupPayload := storepb.UserGroupPayload{}+ if err := protojson.Unmarshal(payload, &groupPayload); err != nil {+ return nil, err+ }+ group.Payload = &groupPayload+ groups = append(groups, &group)+ }+ if err := rows.Err(); err != nil {+ return nil, err+ }++ return groups, nil+}++// CreateUserGroup creates a group.+func (s *Store) CreateUserGroup(ctx context.Context, create *UserGroupMessage, creatorUID int) (*UserGroupMessage, error) {+ if create.Payload == nil {+ create.Payload = &storepb.UserGroupPayload{}+ }+ create.CreatorUID = creatorUID++ query := `+ INSERT INTO user_group (+ email,+ creator_id,+ updater_id,+ name,+ description,+ payload+ ) VALUES ($1, $2, $3, $4, $5, $6)+ `+ payloadBytes, err := protojson.Marshal(create.Payload)+ if err != nil {+ return nil, err+ }++ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, errors.Wrap(err, "failed to begin tx")+ }+ defer tx.Rollback()++ if _, err := tx.ExecContext(+ ctx,+ query,+ create.Email,+ create.CreatorUID,+ create.CreatorUID,+ create.Title,+ create.Description,+ payloadBytes,+ ); err != nil {+ return nil, err+ }++ if err := tx.Commit(); err != nil {+ return nil, errors.Wrap(err, "failed to commit")+ }++ s.userGroupCache.Add(create.Email, create)+ return create, nil+}++// UpdateUserGroup updates a group.+func (s *Store) UpdateUserGroup(ctx context.Context, email string, patch *UpdateUserGroupMessage, updaterID int) (*UserGroupMessage, error) {+ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, errors.Wrapf(err, "failed to begin transaction")+ }++ set, args := []string{"updater_id = $1", "updated_ts = $2"}, []any{updaterID, time.Now().Unix()}++ if v := patch.Title; v != nil {+ set, args = append(set, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *v)+ }+ if v := patch.Description; v != nil {+ set, args = append(set, fmt.Sprintf("description = $%d", len(args)+1)), append(args, *v)+ }+ if v := patch.Payload; v != nil {+ payload, err := protojson.Marshal(v)+ if err != nil {+ return nil, err+ }+ set, args = append(set, fmt.Sprintf("payload = $%d", len(args)+1)), append(args, payload)+ }+ args = append(args, email)++ var group UserGroupMessage+ var payload []byte+ if err := tx.QueryRowContext(ctx, fmt.Sprintf(`+ UPDATE user_group+ SET %s+ WHERE email = $%d+ RETURNING+ email,+ creator_id,+ name,+ description,+ payload+ `, strings.Join(set, ", "), len(set)+1), args...).Scan(+ &group.Email,+ &group.CreatorUID,+ &group.Title,+ &group.Description,+ &payload,+ ); err != nil {+ return nil, err+ }++ groupPayload := storepb.UserGroupPayload{}+ if err := protojson.Unmarshal(payload, &groupPayload); err != nil {+ return nil, err+ }+ group.Payload = &groupPayload++ if err := tx.Commit(); err != nil {+ return nil, errors.Wrap(err, "failed to commit transaction")+ }++ s.userGroupCache.Add(group.Email, &group)+ return &group, nil+}++// DeleteUserGroup deletes a group.+func (s *Store) DeleteUserGroup(ctx context.Context, email string) error {+ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return errors.Wrap(err, "failed to begin transaction")+ }+ defer tx.Rollback()++ if _, err := tx.ExecContext(ctx, `DELETE FROM user_group WHERE email = $1`, email); err != nil {+ return err+ }++ if err := tx.Commit(); err != nil {+ return errors.Wrap(err, "failed to commit transaction")+ }++ s.userGroupCache.Remove(email)+ return nil+}diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.tsindex 3a50d70585..3185d3cbac 100644--- a/frontend/src/types/proto/google/protobuf/descriptor.ts+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts@@ -8,11 +8,6 @@ export const protobufPackage = "google.protobuf";export enum Edition {/** EDITION_UNKNOWN - A placeholder for an unknown edition value. */EDITION_UNKNOWN = "EDITION_UNKNOWN",- /**- * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature- * was first introduced. This is effectively an "infinite past".- */- EDITION_LEGACY = "EDITION_LEGACY",/*** EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like* distinct editions. These can't be used to specify the edition of proto@@ -27,7 +22,6 @@ export enum Edition {* comparison.*/EDITION_2023 = "EDITION_2023",- EDITION_2024 = "EDITION_2024",/*** EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be* used or relyed on outside of tests.@@ -37,12 +31,6 @@ export enum Edition {EDITION_99997_TEST_ONLY = "EDITION_99997_TEST_ONLY",EDITION_99998_TEST_ONLY = "EDITION_99998_TEST_ONLY",EDITION_99999_TEST_ONLY = "EDITION_99999_TEST_ONLY",- /**- * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only- * ever be used by plugins that can expect to never require any changes to- * support a new edition.- */- EDITION_MAX = "EDITION_MAX",UNRECOGNIZED = "UNRECOGNIZED",}@@ -51,9 +39,6 @@ export function editionFromJSON(object: any): Edition {case 0:case "EDITION_UNKNOWN":return Edition.EDITION_UNKNOWN;- case 900:- case "EDITION_LEGACY":- return Edition.EDITION_LEGACY;case 998:case "EDITION_PROTO2":return Edition.EDITION_PROTO2;@@ -63,9 +48,6 @@ export function editionFromJSON(object: any): Edition {case 1000:case "EDITION_2023":return Edition.EDITION_2023;- case 1001:- case "EDITION_2024":- return Edition.EDITION_2024;case 1:case "EDITION_1_TEST_ONLY":return Edition.EDITION_1_TEST_ONLY;@@ -81,9 +63,6 @@ export function editionFromJSON(object: any): Edition {case 99999:case "EDITION_99999_TEST_ONLY":return Edition.EDITION_99999_TEST_ONLY;- case 2147483647:- case "EDITION_MAX":- return Edition.EDITION_MAX;case -1:case "UNRECOGNIZED":default:@@ -95,16 +74,12 @@ export function editionToJSON(object: Edition): string {switch (object) {case Edition.EDITION_UNKNOWN:return "EDITION_UNKNOWN";- case Edition.EDITION_LEGACY:- return "EDITION_LEGACY";case Edition.EDITION_PROTO2:return "EDITION_PROTO2";case Edition.EDITION_PROTO3:return "EDITION_PROTO3";case Edition.EDITION_2023:return "EDITION_2023";- case Edition.EDITION_2024:- return "EDITION_2024";case Edition.EDITION_1_TEST_ONLY:return "EDITION_1_TEST_ONLY";case Edition.EDITION_2_TEST_ONLY:@@ -115,8 +90,6 @@ export function editionToJSON(object: Edition): string {return "EDITION_99998_TEST_ONLY";case Edition.EDITION_99999_TEST_ONLY:return "EDITION_99999_TEST_ONLY";- case Edition.EDITION_MAX:- return "EDITION_MAX";case Edition.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -127,16 +100,12 @@ export function editionToNumber(object: Edition): number {switch (object) {case Edition.EDITION_UNKNOWN:return 0;- case Edition.EDITION_LEGACY:- return 900;case Edition.EDITION_PROTO2:return 998;case Edition.EDITION_PROTO3:return 999;case Edition.EDITION_2023:return 1000;- case Edition.EDITION_2024:- return 1001;case Edition.EDITION_1_TEST_ONLY:return 1;case Edition.EDITION_2_TEST_ONLY:@@ -147,8 +116,6 @@ export function editionToNumber(object: Edition): number {return 99998;case Edition.EDITION_99999_TEST_ONLY:return 99999;- case Edition.EDITION_MAX:- return 2147483647;case Edition.UNRECOGNIZED:default:return -1;@@ -390,12 +357,12 @@ export interface FieldDescriptorProto {* If true, this is a proto3 "optional". When a proto3 field is optional, it* tracks presence regardless of field type.*- * When proto3_optional is true, this field must belong to a oneof to signal- * to old proto3 clients that presence is tracked for this field. This oneof- * is known as a "synthetic" oneof, and this field must be its sole member- * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs- * exist in the descriptor only, and do not generate any API. Synthetic oneofs- * must be ordered after all "real" oneofs.+ * When proto3_optional is true, this field must be belong to a oneof to+ * signal to old proto3 clients that presence is tracked for this field. This+ * oneof is known as a "synthetic" oneof, and this field must be its sole+ * member (each proto3 optional field gets its own synthetic oneof). Synthetic+ * oneofs exist in the descriptor only, and do not generate any API. Synthetic+ * oneofs must be ordered after all "real" oneofs.** For message fields, proto3_optional doesn't create any semantic change,* since non-repeated message fields always track presence. However it still@@ -772,16 +739,12 @@ export interface FileOptions {*/javaGenerateEqualsAndHash: boolean;/**- * A proto2 file can set this to true to opt in to UTF-8 checking for Java,- * which will throw an exception if invalid UTF-8 is parsed from the wire or- * assigned to a string field.- *- * TODO: clarify exactly what kinds of field types this option- * applies to, and update these docs accordingly.- *- * Proto3 files already perform these checks. Setting the option explicitly to- * false has no effect: it cannot be used to opt proto3 files out of UTF-8- * checks.+ * If set true, then the Java2 code generator will generate code that+ * throws an exception whenever an attempt is made to assign a non-UTF-8+ * byte sequence to a string field.+ * Message reflection will do the same.+ * However, an extension field still accepts non-UTF-8 byte sequences.+ * This option has no effect on when used with the lite runtime.*/javaStringCheckUtf8: boolean;optimizeFor: FileOptions_OptimizeMode;@@ -808,6 +771,7 @@ export interface FileOptions {ccGenericServices: boolean;javaGenericServices: boolean;pyGenericServices: boolean;+ phpGenericServices: boolean;/*** Is this file deprecated?* Depending on the target platform, this can emit Deprecated annotations@@ -961,6 +925,10 @@ export interface MessageOptions {*/deprecated: boolean;/**+ * NOTE: Do not set the option in .proto files. Always use the maps syntax+ * instead. The option should only be implicitly set by the proto compiler+ * parser.+ ** Whether the message is an automatically generated map entry type for the* maps field.*@@ -978,10 +946,6 @@ export interface MessageOptions {* use a native map in the target language to hold the keys and values.* The reflection APIs in such implementations still need to work as* if the field is a repeated message field.- *- * NOTE: Do not set the option in .proto files. Always use the maps syntax- * instead. The option should only be implicitly set by the proto compiler- * parser.*/mapEntry: boolean;/**@@ -1059,11 +1023,19 @@ export interface FieldOptions {* call from multiple threads concurrently, while non-const methods continue* to require exclusive access.*- * Note that lazy message fields are still eagerly verified to check- * ill-formed wireformat or missing required fields. Calling IsInitialized()- * on the outer message would fail if the inner message has missing required- * fields. Failed verification would result in parsing failure (except when- * uninitialized messages are acceptable).+ * Note that implementations may choose not to check required fields within+ * a lazy sub-message. That is, calling IsInitialized() on the outer message+ * may return true even if the inner message has missing required fields.+ * This is necessary because otherwise the inner message would have to be+ * parsed in order to perform the check, defeating the purpose of lazy+ * parsing. An implementation which chooses not to check required fields+ * must be consistent about it. That is, for any particular sub-message, the+ * implementation must either *always* check its required fields, or *never*+ * check its required fields, regardless of whether or not the message has+ * been parsed.+ *+ * As of May 2022, lazy verifies the contents of the byte stream during+ * parsing. An invalid byte stream will cause the overall parsing to fail.*/lazy: boolean;/**@@ -1090,9 +1062,8 @@ export interface FieldOptions {targets: FieldOptions_OptionTargetType[];editionDefaults: FieldOptions_EditionDefault[];/** Any features defined in the specific edition. */- features: FeatureSet | undefined;- featureSupport:- | FieldOptions_FeatureSupport+ features:+ | FeatureSet| undefined;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];@@ -1395,32 +1366,6 @@ export interface FieldOptions_EditionDefault {value: string;}-/** Information about the support window of a feature. */-export interface FieldOptions_FeatureSupport {- /**- * The edition that this feature was first available in. In editions- * earlier than this one, the default assigned to EDITION_LEGACY will be- * used, and proto files will not be able to override it.- */- editionIntroduced: Edition;- /**- * The edition this feature becomes deprecated in. Using this after this- * edition may trigger warnings.- */- editionDeprecated: Edition;- /**- * The deprecation warning text if this feature is used after the edition it- * was marked deprecated in.- */- deprecationWarning: string;- /**- * The edition this feature is no longer available in. In editions after- * this one, the last default assigned will be used, and proto files will- * not be able to override it.- */- editionRemoved: Edition;-}-export interface OneofOptions {/** Any features defined in the specific edition. */features:@@ -1797,8 +1742,8 @@ export function featureSet_RepeatedFieldEncodingToNumber(object: FeatureSet_Repeexport enum FeatureSet_Utf8Validation {UTF8_VALIDATION_UNKNOWN = "UTF8_VALIDATION_UNKNOWN",- VERIFY = "VERIFY",NONE = "NONE",+ VERIFY = "VERIFY",UNRECOGNIZED = "UNRECOGNIZED",}@@ -1807,12 +1752,12 @@ export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Vcase 0:case "UTF8_VALIDATION_UNKNOWN":return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;+ case 1:+ case "NONE":+ return FeatureSet_Utf8Validation.NONE;case 2:case "VERIFY":return FeatureSet_Utf8Validation.VERIFY;- case 3:- case "NONE":- return FeatureSet_Utf8Validation.NONE;case -1:case "UNRECOGNIZED":default:@@ -1824,10 +1769,10 @@ export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validatioswitch (object) {case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:return "UTF8_VALIDATION_UNKNOWN";- case FeatureSet_Utf8Validation.VERIFY:- return "VERIFY";case FeatureSet_Utf8Validation.NONE:return "NONE";+ case FeatureSet_Utf8Validation.VERIFY:+ return "VERIFY";case FeatureSet_Utf8Validation.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -1838,10 +1783,10 @@ export function featureSet_Utf8ValidationToNumber(object: FeatureSet_Utf8Validatswitch (object) {case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:return 0;+ case FeatureSet_Utf8Validation.NONE:+ return 1;case FeatureSet_Utf8Validation.VERIFY:return 2;- case FeatureSet_Utf8Validation.NONE:- return 3;case FeatureSet_Utf8Validation.UNRECOGNIZED:default:return -1;@@ -1982,12 +1927,7 @@ export interface FeatureSetDefaults {*/export interface FeatureSetDefaults_FeatureSetEditionDefault {edition: Edition;- /** Defaults of features that can be overridden in this edition. */- overridableFeatures:- | FeatureSet- | undefined;- /** Defaults of features that can't be overridden in this edition. */- fixedFeatures: FeatureSet | undefined;+ features: FeatureSet | undefined;}/**@@ -2049,7 +1989,7 @@ export interface SourceCodeInfo_Location {* location.** Each element is a field number or an index. They form a path from- * the root FileDescriptorProto to the place where the definition appears.+ * the root FileDescriptorProto to the place where the definition occurs.* For example, this path:* [ 4, 3, 2, 7, 1 ]* refers to:@@ -4047,6 +3987,7 @@ function createBaseFileOptions(): FileOptions {ccGenericServices: false,javaGenericServices: false,pyGenericServices: false,+ phpGenericServices: false,deprecated: false,ccEnableArenas: false,objcClassPrefix: "",@@ -4093,6 +4034,9 @@ export const FileOptions = {if (message.pyGenericServices === true) {writer.uint32(144).bool(message.pyGenericServices);}+ if (message.phpGenericServices === true) {+ writer.uint32(336).bool(message.phpGenericServices);+ }if (message.deprecated === true) {writer.uint32(184).bool(message.deprecated);}@@ -4206,6 +4150,13 @@ export const FileOptions = {message.pyGenericServices = reader.bool();continue;+ case 42:+ if (tag !== 336) {+ break;+ }++ message.phpGenericServices = reader.bool();+ continue;case 23:if (tag !== 184) {break;@@ -4308,6 +4259,7 @@ export const FileOptions = {ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false,javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false,pyGenericServices: isSet(object.pyGenericServices) ? globalThis.Boolean(object.pyGenericServices) : false,+ phpGenericServices: isSet(object.phpGenericServices) ? globalThis.Boolean(object.phpGenericServices) : false,deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,ccEnableArenas: isSet(object.ccEnableArenas) ? globalThis.Boolean(object.ccEnableArenas) : false,objcClassPrefix: isSet(object.objcClassPrefix) ? globalThis.String(object.objcClassPrefix) : "",@@ -4356,6 +4308,9 @@ export const FileOptions = {if (message.pyGenericServices === true) {obj.pyGenericServices = message.pyGenericServices;}+ if (message.phpGenericServices === true) {+ obj.phpGenericServices = message.phpGenericServices;+ }if (message.deprecated === true) {obj.deprecated = message.deprecated;}@@ -4407,6 +4362,7 @@ export const FileOptions = {message.ccGenericServices = object.ccGenericServices ?? false;message.javaGenericServices = object.javaGenericServices ?? false;message.pyGenericServices = object.pyGenericServices ?? false;+ message.phpGenericServices = object.phpGenericServices ?? false;message.deprecated = object.deprecated ?? false;message.ccEnableArenas = object.ccEnableArenas ?? false;message.objcClassPrefix = object.objcClassPrefix ?? "";@@ -4605,7 +4561,6 @@ function createBaseFieldOptions(): FieldOptions {targets: [],editionDefaults: [],features: undefined,- featureSupport: undefined,uninterpretedOption: [],};}@@ -4650,9 +4605,6 @@ export const FieldOptions = {if (message.features !== undefined) {FeatureSet.encode(message.features, writer.uint32(170).fork()).ldelim();}- if (message.featureSupport !== undefined) {- FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -4760,13 +4712,6 @@ export const FieldOptions = {message.features = FeatureSet.decode(reader, reader.uint32());continue;- case 22:- if (tag !== 178) {- break;- }-- message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -4803,9 +4748,6 @@ export const FieldOptions = {? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e)): [],features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,- featureSupport: isSet(object.featureSupport)- ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport)- : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4850,9 +4792,6 @@ export const FieldOptions = {if (message.features !== undefined) {obj.features = FeatureSet.toJSON(message.features);}- if (message.featureSupport !== undefined) {- obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4878,9 +4817,6 @@ export const FieldOptions = {message.features = (object.features !== undefined && object.features !== null)? FeatureSet.fromPartial(object.features): undefined;- message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null)- ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -4960,119 +4896,6 @@ export const FieldOptions_EditionDefault = {},};-function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport {- return {- editionIntroduced: Edition.EDITION_UNKNOWN,- editionDeprecated: Edition.EDITION_UNKNOWN,- deprecationWarning: "",- editionRemoved: Edition.EDITION_UNKNOWN,- };-}--export const FieldOptions_FeatureSupport = {- encode(message: FieldOptions_FeatureSupport, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.editionIntroduced !== Edition.EDITION_UNKNOWN) {- writer.uint32(8).int32(editionToNumber(message.editionIntroduced));- }- if (message.editionDeprecated !== Edition.EDITION_UNKNOWN) {- writer.uint32(16).int32(editionToNumber(message.editionDeprecated));- }- if (message.deprecationWarning !== "") {- writer.uint32(26).string(message.deprecationWarning);- }- if (message.editionRemoved !== Edition.EDITION_UNKNOWN) {- writer.uint32(32).int32(editionToNumber(message.editionRemoved));- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions_FeatureSupport {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseFieldOptions_FeatureSupport();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.editionIntroduced = editionFromJSON(reader.int32());- continue;- case 2:- if (tag !== 16) {- break;- }-- message.editionDeprecated = editionFromJSON(reader.int32());- continue;- case 3:- if (tag !== 26) {- break;- }-- message.deprecationWarning = reader.string();- continue;- case 4:- if (tag !== 32) {- break;- }-- message.editionRemoved = editionFromJSON(reader.int32());- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): FieldOptions_FeatureSupport {- return {- editionIntroduced: isSet(object.editionIntroduced)- ? editionFromJSON(object.editionIntroduced)- : Edition.EDITION_UNKNOWN,- editionDeprecated: isSet(object.editionDeprecated)- ? editionFromJSON(object.editionDeprecated)- : Edition.EDITION_UNKNOWN,- deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "",- editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : Edition.EDITION_UNKNOWN,- };- },-- toJSON(message: FieldOptions_FeatureSupport): unknown {- const obj: any = {};- if (message.editionIntroduced !== Edition.EDITION_UNKNOWN) {- obj.editionIntroduced = editionToJSON(message.editionIntroduced);- }- if (message.editionDeprecated !== Edition.EDITION_UNKNOWN) {- obj.editionDeprecated = editionToJSON(message.editionDeprecated);- }- if (message.deprecationWarning !== "") {- obj.deprecationWarning = message.deprecationWarning;- }- if (message.editionRemoved !== Edition.EDITION_UNKNOWN) {- obj.editionRemoved = editionToJSON(message.editionRemoved);- }- return obj;- },-- create(base?: DeepPartial<FieldOptions_FeatureSupport>): FieldOptions_FeatureSupport {- return FieldOptions_FeatureSupport.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<FieldOptions_FeatureSupport>): FieldOptions_FeatureSupport {- const message = createBaseFieldOptions_FeatureSupport();- message.editionIntroduced = object.editionIntroduced ?? Edition.EDITION_UNKNOWN;- message.editionDeprecated = object.editionDeprecated ?? Edition.EDITION_UNKNOWN;- message.deprecationWarning = object.deprecationWarning ?? "";- message.editionRemoved = object.editionRemoved ?? Edition.EDITION_UNKNOWN;- return message;- },-};-function createBaseOneofOptions(): OneofOptions {return { features: undefined, uninterpretedOption: [] };}@@ -6081,7 +5904,7 @@ export const FeatureSetDefaults = {};function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault {- return { edition: Edition.EDITION_UNKNOWN, overridableFeatures: undefined, fixedFeatures: undefined };+ return { edition: Edition.EDITION_UNKNOWN, features: undefined };}export const FeatureSetDefaults_FeatureSetEditionDefault = {@@ -6089,11 +5912,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {if (message.edition !== Edition.EDITION_UNKNOWN) {writer.uint32(24).int32(editionToNumber(message.edition));}- if (message.overridableFeatures !== undefined) {- FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).ldelim();- }- if (message.fixedFeatures !== undefined) {- FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).ldelim();+ if (message.features !== undefined) {+ FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim();}return writer;},@@ -6112,19 +5932,12 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {message.edition = editionFromJSON(reader.int32());continue;- case 4:- if (tag !== 34) {- break;- }-- message.overridableFeatures = FeatureSet.decode(reader, reader.uint32());- continue;- case 5:- if (tag !== 42) {+ case 2:+ if (tag !== 18) {break;}- message.fixedFeatures = FeatureSet.decode(reader, reader.uint32());+ message.features = FeatureSet.decode(reader, reader.uint32());continue;}if ((tag & 7) === 4 || tag === 0) {@@ -6138,10 +5951,7 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault {return {edition: isSet(object.edition) ? editionFromJSON(object.edition) : Edition.EDITION_UNKNOWN,- overridableFeatures: isSet(object.overridableFeatures)- ? FeatureSet.fromJSON(object.overridableFeatures)- : undefined,- fixedFeatures: isSet(object.fixedFeatures) ? FeatureSet.fromJSON(object.fixedFeatures) : undefined,+ features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,};},@@ -6150,11 +5960,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {if (message.edition !== Edition.EDITION_UNKNOWN) {obj.edition = editionToJSON(message.edition);}- if (message.overridableFeatures !== undefined) {- obj.overridableFeatures = FeatureSet.toJSON(message.overridableFeatures);- }- if (message.fixedFeatures !== undefined) {- obj.fixedFeatures = FeatureSet.toJSON(message.fixedFeatures);+ if (message.features !== undefined) {+ obj.features = FeatureSet.toJSON(message.features);}return obj;},@@ -6167,11 +5974,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {): FeatureSetDefaults_FeatureSetEditionDefault {const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault();message.edition = object.edition ?? Edition.EDITION_UNKNOWN;- message.overridableFeatures = (object.overridableFeatures !== undefined && object.overridableFeatures !== null)- ? FeatureSet.fromPartial(object.overridableFeatures)- : undefined;- message.fixedFeatures = (object.fixedFeatures !== undefined && object.fixedFeatures !== null)- ? FeatureSet.fromPartial(object.fixedFeatures)+ message.features = (object.features !== undefined && object.features !== null)+ ? FeatureSet.fromPartial(object.features): undefined;return message;},diff --git a/frontend/src/types/proto/store/user_group.ts b/frontend/src/types/proto/store/user_group.tsnew file mode 100644index 0000000000..02bb24c320--- /dev/null+++ b/frontend/src/types/proto/store/user_group.ts@@ -0,0 +1,224 @@+/* eslint-disable */+import Long from "long";+import _m0 from "protobufjs/minimal";++export const protobufPackage = "bytebase.store";++export interface UserGroupMember {+ /**+ * Member is the principal who belong to this user group.+ *+ * Format: users/{userUID}.+ */+ member: string;+ role: UserGroupMember_Role;+}++export enum UserGroupMember_Role {+ ROLE_UNSPECIFIED = "ROLE_UNSPECIFIED",+ OWNER = "OWNER",+ MEMBER = "MEMBER",+ UNRECOGNIZED = "UNRECOGNIZED",+}++export function userGroupMember_RoleFromJSON(object: any): UserGroupMember_Role {+ switch (object) {+ case 0:+ case "ROLE_UNSPECIFIED":+ return UserGroupMember_Role.ROLE_UNSPECIFIED;+ case 1:+ case "OWNER":+ return UserGroupMember_Role.OWNER;+ case 2:+ case "MEMBER":+ return UserGroupMember_Role.MEMBER;+ case -1:+ case "UNRECOGNIZED":+ default:+ return UserGroupMember_Role.UNRECOGNIZED;+ }+}++export function userGroupMember_RoleToJSON(object: UserGroupMember_Role): string {+ switch (object) {+ case UserGroupMember_Role.ROLE_UNSPECIFIED:+ return "ROLE_UNSPECIFIED";+ case UserGroupMember_Role.OWNER:+ return "OWNER";+ case UserGroupMember_Role.MEMBER:+ return "MEMBER";+ case UserGroupMember_Role.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}++export function userGroupMember_RoleToNumber(object: UserGroupMember_Role): number {+ switch (object) {+ case UserGroupMember_Role.ROLE_UNSPECIFIED:+ return 0;+ case UserGroupMember_Role.OWNER:+ return 1;+ case UserGroupMember_Role.MEMBER:+ return 2;+ case UserGroupMember_Role.UNRECOGNIZED:+ default:+ return -1;+ }+}++export interface UserGroupPayload {+ members: UserGroupMember[];+}++function createBaseUserGroupMember(): UserGroupMember {+ return { member: "", role: UserGroupMember_Role.ROLE_UNSPECIFIED };+}++export const UserGroupMember = {+ encode(message: UserGroupMember, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.member !== "") {+ writer.uint32(10).string(message.member);+ }+ if (message.role !== UserGroupMember_Role.ROLE_UNSPECIFIED) {+ writer.uint32(16).int32(userGroupMember_RoleToNumber(message.role));+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UserGroupMember {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUserGroupMember();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.member = reader.string();+ continue;+ case 2:+ if (tag !== 16) {+ break;+ }++ message.role = userGroupMember_RoleFromJSON(reader.int32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): UserGroupMember {+ return {+ member: isSet(object.member) ? globalThis.String(object.member) : "",+ role: isSet(object.role) ? userGroupMember_RoleFromJSON(object.role) : UserGroupMember_Role.ROLE_UNSPECIFIED,+ };+ },++ toJSON(message: UserGroupMember): unknown {+ const obj: any = {};+ if (message.member !== "") {+ obj.member = message.member;+ }+ if (message.role !== UserGroupMember_Role.ROLE_UNSPECIFIED) {+ obj.role = userGroupMember_RoleToJSON(message.role);+ }+ return obj;+ },++ create(base?: DeepPartial<UserGroupMember>): UserGroupMember {+ return UserGroupMember.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<UserGroupMember>): UserGroupMember {+ const message = createBaseUserGroupMember();+ message.member = object.member ?? "";+ message.role = object.role ?? UserGroupMember_Role.ROLE_UNSPECIFIED;+ return message;+ },+};++function createBaseUserGroupPayload(): UserGroupPayload {+ return { members: [] };+}++export const UserGroupPayload = {+ encode(message: UserGroupPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.members) {+ UserGroupMember.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UserGroupPayload {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUserGroupPayload();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.members.push(UserGroupMember.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): UserGroupPayload {+ return {+ members: globalThis.Array.isArray(object?.members)+ ? object.members.map((e: any) => UserGroupMember.fromJSON(e))+ : [],+ };+ },++ toJSON(message: UserGroupPayload): unknown {+ const obj: any = {};+ if (message.members?.length) {+ obj.members = message.members.map((e) => UserGroupMember.toJSON(e));+ }+ return obj;+ },++ create(base?: DeepPartial<UserGroupPayload>): UserGroupPayload {+ return UserGroupPayload.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<UserGroupPayload>): UserGroupPayload {+ const message = createBaseUserGroupPayload();+ message.members = object.members?.map((e) => UserGroupMember.fromPartial(e)) || [];+ return message;+ },+};++type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;++export type DeepPartial<T> = T extends Builtin ? T+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }+ : Partial<T>;++if (_m0.util.Long !== Long) {+ _m0.util.Long = Long as any;+ _m0.configure();+}++function isSet(value: any): boolean {+ return value !== null && value !== undefined;+}diff --git a/frontend/src/types/proto/v1/user_group.ts b/frontend/src/types/proto/v1/user_group.tsnew file mode 100644index 0000000000..d2fc000614--- /dev/null+++ b/frontend/src/types/proto/v1/user_group.ts@@ -0,0 +1,921 @@+/* eslint-disable */+import Long from "long";+import _m0 from "protobufjs/minimal";+import { Empty } from "../google/protobuf/empty";+import { FieldMask } from "../google/protobuf/field_mask";++export const protobufPackage = "bytebase.v1";++export interface GetUserGroupRequest {+ /**+ * The name of the group to retrieve.+ * Format: groups/{email}+ */+ name: string;+}++export interface ListUserGroupsRequest {+ /**+ * The maximum number of groups to return. The service may return fewer than+ * this value.+ * If unspecified, at most 50 groups will be returned.+ * The maximum value is 1000; values above 1000 will be coerced to 1000.+ */+ pageSize: number;+ /**+ * A page token, received from a previous `ListUsers` call.+ * Provide this to retrieve the subsequent page.+ *+ * When paginating, all other parameters provided to `ListUsers` must match+ * the call that provided the page token.+ */+ pageToken: string;+}++export interface ListUserGroupsResponse {+ /** The groups from the specified request. */+ groups: UserGroup[];+ /**+ * A token, which can be sent as `page_token` to retrieve the next page.+ * If this field is omitted, there are no subsequent pages.+ */+ nextPageToken: string;+}++export interface CreateUserGroupRequest {+ /** The group to create. */+ group: UserGroup | undefined;+}++export interface UpdateUserGroupRequest {+ /**+ * The group to update.+ *+ * The group's `name` field is used to identify the group to update.+ * Format: groups/{email}+ */+ group:+ | UserGroup+ | undefined;+ /** The list of fields to update. */+ updateMask: string[] | undefined;+}++export interface DeleteUserGroupRequest {+ /**+ * The name of the group to delete.+ * Format: groups/{email}+ */+ name: string;+}++export interface UserGroupMember {+ /**+ * Member is the principal who belong to this user group.+ *+ * Format: users/[email protected]+ */+ member: string;+ role: UserGroupMember_Role;+}++export enum UserGroupMember_Role {+ ROLE_UNSPECIFIED = "ROLE_UNSPECIFIED",+ OWNER = "OWNER",+ MEMBER = "MEMBER",+ UNRECOGNIZED = "UNRECOGNIZED",+}++export function userGroupMember_RoleFromJSON(object: any): UserGroupMember_Role {+ switch (object) {+ case 0:+ case "ROLE_UNSPECIFIED":+ return UserGroupMember_Role.ROLE_UNSPECIFIED;+ case 1:+ case "OWNER":+ return UserGroupMember_Role.OWNER;+ case 2:+ case "MEMBER":+ return UserGroupMember_Role.MEMBER;+ case -1:+ case "UNRECOGNIZED":+ default:+ return UserGroupMember_Role.UNRECOGNIZED;+ }+}++export function userGroupMember_RoleToJSON(object: UserGroupMember_Role): string {+ switch (object) {+ case UserGroupMember_Role.ROLE_UNSPECIFIED:+ return "ROLE_UNSPECIFIED";+ case UserGroupMember_Role.OWNER:+ return "OWNER";+ case UserGroupMember_Role.MEMBER:+ return "MEMBER";+ case UserGroupMember_Role.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}++export function userGroupMember_RoleToNumber(object: UserGroupMember_Role): number {+ switch (object) {+ case UserGroupMember_Role.ROLE_UNSPECIFIED:+ return 0;+ case UserGroupMember_Role.OWNER:+ return 1;+ case UserGroupMember_Role.MEMBER:+ return 2;+ case UserGroupMember_Role.UNRECOGNIZED:+ default:+ return -1;+ }+}++export interface UserGroup {+ /**+ * The name of the group to retrieve.+ * Format: groups/{email}+ */+ name: string;+ title: string;+ description: string;+ /**+ * The name for the creator.+ * Format: users/[email protected]+ */+ creator: string;+ members: UserGroupMember[];+}++function createBaseGetUserGroupRequest(): GetUserGroupRequest {+ return { name: "" };+}++export const GetUserGroupRequest = {+ encode(message: GetUserGroupRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): GetUserGroupRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseGetUserGroupRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.name = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): GetUserGroupRequest {+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };+ },++ toJSON(message: GetUserGroupRequest): unknown {+ const obj: any = {};+ if (message.name !== "") {+ obj.name = message.name;+ }+ return obj;+ },++ create(base?: DeepPartial<GetUserGroupRequest>): GetUserGroupRequest {+ return GetUserGroupRequest.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<GetUserGroupRequest>): GetUserGroupRequest {+ const message = createBaseGetUserGroupRequest();+ message.name = object.name ?? "";+ return message;+ },+};++function createBaseListUserGroupsRequest(): ListUserGroupsRequest {+ return { pageSize: 0, pageToken: "" };+}++export const ListUserGroupsRequest = {+ encode(message: ListUserGroupsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.pageSize !== 0) {+ writer.uint32(8).int32(message.pageSize);+ }+ if (message.pageToken !== "") {+ writer.uint32(18).string(message.pageToken);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ListUserGroupsRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseListUserGroupsRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 8) {+ break;+ }++ message.pageSize = reader.int32();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.pageToken = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): ListUserGroupsRequest {+ return {+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",+ };+ },++ toJSON(message: ListUserGroupsRequest): unknown {+ const obj: any = {};+ if (message.pageSize !== 0) {+ obj.pageSize = Math.round(message.pageSize);+ }+ if (message.pageToken !== "") {+ obj.pageToken = message.pageToken;+ }+ return obj;+ },++ create(base?: DeepPartial<ListUserGroupsRequest>): ListUserGroupsRequest {+ return ListUserGroupsRequest.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<ListUserGroupsRequest>): ListUserGroupsRequest {+ const message = createBaseListUserGroupsRequest();+ message.pageSize = object.pageSize ?? 0;+ message.pageToken = object.pageToken ?? "";+ return message;+ },+};++function createBaseListUserGroupsResponse(): ListUserGroupsResponse {+ return { groups: [], nextPageToken: "" };+}++export const ListUserGroupsResponse = {+ encode(message: ListUserGroupsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.groups) {+ UserGroup.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ if (message.nextPageToken !== "") {+ writer.uint32(18).string(message.nextPageToken);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ListUserGroupsResponse {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseListUserGroupsResponse();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.groups.push(UserGroup.decode(reader, reader.uint32()));+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.nextPageToken = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): ListUserGroupsResponse {+ return {+ groups: globalThis.Array.isArray(object?.groups) ? object.groups.map((e: any) => UserGroup.fromJSON(e)) : [],+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",+ };+ },++ toJSON(message: ListUserGroupsResponse): unknown {+ const obj: any = {};+ if (message.groups?.length) {+ obj.groups = message.groups.map((e) => UserGroup.toJSON(e));+ }+ if (message.nextPageToken !== "") {+ obj.nextPageToken = message.nextPageToken;+ }+ return obj;+ },++ create(base?: DeepPartial<ListUserGroupsResponse>): ListUserGroupsResponse {+ return ListUserGroupsResponse.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<ListUserGroupsResponse>): ListUserGroupsResponse {+ const message = createBaseListUserGroupsResponse();+ message.groups = object.groups?.map((e) => UserGroup.fromPartial(e)) || [];+ message.nextPageToken = object.nextPageToken ?? "";+ return message;+ },+};++function createBaseCreateUserGroupRequest(): CreateUserGroupRequest {+ return { group: undefined };+}++export const CreateUserGroupRequest = {+ encode(message: CreateUserGroupRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.group !== undefined) {+ UserGroup.encode(message.group, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserGroupRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseCreateUserGroupRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.group = UserGroup.decode(reader, reader.uint32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): CreateUserGroupRequest {+ return { group: isSet(object.group) ? UserGroup.fromJSON(object.group) : undefined };+ },++ toJSON(message: CreateUserGroupRequest): unknown {+ const obj: any = {};+ if (message.group !== undefined) {+ obj.group = UserGroup.toJSON(message.group);+ }+ return obj;+ },++ create(base?: DeepPartial<CreateUserGroupRequest>): CreateUserGroupRequest {+ return CreateUserGroupRequest.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<CreateUserGroupRequest>): CreateUserGroupRequest {+ const message = createBaseCreateUserGroupRequest();+ message.group = (object.group !== undefined && object.group !== null)+ ? UserGroup.fromPartial(object.group)+ : undefined;+ return message;+ },+};++function createBaseUpdateUserGroupRequest(): UpdateUserGroupRequest {+ return { group: undefined, updateMask: undefined };+}++export const UpdateUserGroupRequest = {+ encode(message: UpdateUserGroupRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.group !== undefined) {+ UserGroup.encode(message.group, writer.uint32(10).fork()).ldelim();+ }+ if (message.updateMask !== undefined) {+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserGroupRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUpdateUserGroupRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.group = UserGroup.decode(reader, reader.uint32());+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): UpdateUserGroupRequest {+ return {+ group: isSet(object.group) ? UserGroup.fromJSON(object.group) : undefined,+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,+ };+ },++ toJSON(message: UpdateUserGroupRequest): unknown {+ const obj: any = {};+ if (message.group !== undefined) {+ obj.group = UserGroup.toJSON(message.group);+ }+ if (message.updateMask !== undefined) {+ obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));+ }+ return obj;+ },++ create(base?: DeepPartial<UpdateUserGroupRequest>): UpdateUserGroupRequest {+ return UpdateUserGroupRequest.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<UpdateUserGroupRequest>): UpdateUserGroupRequest {+ const message = createBaseUpdateUserGroupRequest();+ message.group = (object.group !== undefined && object.group !== null)+ ? UserGroup.fromPartial(object.group)+ : undefined;+ message.updateMask = object.updateMask ?? undefined;+ return message;+ },+};++function createBaseDeleteUserGroupRequest(): DeleteUserGroupRequest {+ return { name: "" };+}++export const DeleteUserGroupRequest = {+ encode(message: DeleteUserGroupRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserGroupRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseDeleteUserGroupRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.name = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): DeleteUserGroupRequest {+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };+ },++ toJSON(message: DeleteUserGroupRequest): unknown {+ const obj: any = {};+ if (message.name !== "") {+ obj.name = message.name;+ }+ return obj;+ },++ create(base?: DeepPartial<DeleteUserGroupRequest>): DeleteUserGroupRequest {+ return DeleteUserGroupRequest.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<DeleteUserGroupRequest>): DeleteUserGroupRequest {+ const message = createBaseDeleteUserGroupRequest();+ message.name = object.name ?? "";+ return message;+ },+};++function createBaseUserGroupMember(): UserGroupMember {+ return { member: "", role: UserGroupMember_Role.ROLE_UNSPECIFIED };+}++export const UserGroupMember = {+ encode(message: UserGroupMember, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.member !== "") {+ writer.uint32(10).string(message.member);+ }+ if (message.role !== UserGroupMember_Role.ROLE_UNSPECIFIED) {+ writer.uint32(16).int32(userGroupMember_RoleToNumber(message.role));+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UserGroupMember {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUserGroupMember();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.member = reader.string();+ continue;+ case 2:+ if (tag !== 16) {+ break;+ }++ message.role = userGroupMember_RoleFromJSON(reader.int32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): UserGroupMember {+ return {+ member: isSet(object.member) ? globalThis.String(object.member) : "",+ role: isSet(object.role) ? userGroupMember_RoleFromJSON(object.role) : UserGroupMember_Role.ROLE_UNSPECIFIED,+ };+ },++ toJSON(message: UserGroupMember): unknown {+ const obj: any = {};+ if (message.member !== "") {+ obj.member = message.member;+ }+ if (message.role !== UserGroupMember_Role.ROLE_UNSPECIFIED) {+ obj.role = userGroupMember_RoleToJSON(message.role);+ }+ return obj;+ },++ create(base?: DeepPartial<UserGroupMember>): UserGroupMember {+ return UserGroupMember.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<UserGroupMember>): UserGroupMember {+ const message = createBaseUserGroupMember();+ message.member = object.member ?? "";+ message.role = object.role ?? UserGroupMember_Role.ROLE_UNSPECIFIED;+ return message;+ },+};++function createBaseUserGroup(): UserGroup {+ return { name: "", title: "", description: "", creator: "", members: [] };+}++export const UserGroup = {+ encode(message: UserGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ if (message.title !== "") {+ writer.uint32(18).string(message.title);+ }+ if (message.description !== "") {+ writer.uint32(26).string(message.description);+ }+ if (message.creator !== "") {+ writer.uint32(34).string(message.creator);+ }+ for (const v of message.members) {+ UserGroupMember.encode(v!, writer.uint32(42).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UserGroup {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUserGroup();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.name = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.title = reader.string();+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.description = reader.string();+ continue;+ case 4:+ if (tag !== 34) {+ break;+ }++ message.creator = reader.string();+ continue;+ case 5:+ if (tag !== 42) {+ break;+ }++ message.members.push(UserGroupMember.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): UserGroup {+ return {+ name: isSet(object.name) ? globalThis.String(object.name) : "",+ title: isSet(object.title) ? globalThis.String(object.title) : "",+ description: isSet(object.description) ? globalThis.String(object.description) : "",+ creator: isSet(object.creator) ? globalThis.String(object.creator) : "",+ members: globalThis.Array.isArray(object?.members)+ ? object.members.map((e: any) => UserGroupMember.fromJSON(e))+ : [],+ };+ },++ toJSON(message: UserGroup): unknown {+ const obj: any = {};+ if (message.name !== "") {+ obj.name = message.name;+ }+ if (message.title !== "") {+ obj.title = message.title;+ }+ if (message.description !== "") {+ obj.description = message.description;+ }+ if (message.creator !== "") {+ obj.creator = message.creator;+ }+ if (message.members?.length) {+ obj.members = message.members.map((e) => UserGroupMember.toJSON(e));+ }+ return obj;+ },++ create(base?: DeepPartial<UserGroup>): UserGroup {+ return UserGroup.fromPartial(base ?? {});+ },+ fromPartial(object: DeepPartial<UserGroup>): UserGroup {+ const message = createBaseUserGroup();+ message.name = object.name ?? "";+ message.title = object.title ?? "";+ message.description = object.description ?? "";+ message.creator = object.creator ?? "";+ message.members = object.members?.map((e) => UserGroupMember.fromPartial(e)) || [];+ return message;+ },+};++export type UserGroupServiceDefinition = typeof UserGroupServiceDefinition;+export const UserGroupServiceDefinition = {+ name: "UserGroupService",+ fullName: "bytebase.v1.UserGroupService",+ methods: {+ getUserGroup: {+ name: "GetUserGroup",+ requestType: GetUserGroupRequest,+ requestStream: false,+ responseType: UserGroup,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],+ 578365826: [+ new Uint8Array([+ 21,+ 18,+ 19,+ 47,+ 118,+ 49,+ 47,+ 123,+ 110,+ 97,+ 109,+ 101,+ 61,+ 103,+ 114,+ 111,+ 117,+ 112,+ 115,+ 47,+ 42,+ 125,+ ]),+ ],+ },+ },+ },+ listUserGroups: {+ name: "ListUserGroups",+ requestType: ListUserGroupsRequest,+ requestStream: false,+ responseType: ListUserGroupsResponse,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [new Uint8Array([0])],+ 578365826: [new Uint8Array([12, 18, 10, 47, 118, 49, 47, 103, 114, 111, 117, 112, 115])],+ },+ },+ },+ createUserGroup: {+ name: "CreateUserGroup",+ requestType: CreateUserGroupRequest,+ requestStream: false,+ responseType: UserGroup,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [new Uint8Array([5, 103, 114, 111, 117, 112])],+ 578365826: [+ new Uint8Array([19, 58, 5, 103, 114, 111, 117, 112, 34, 10, 47, 118, 49, 47, 103, 114, 111, 117, 112, 115]),+ ],+ },+ },+ },+ updateUserGroup: {+ name: "UpdateUserGroup",+ requestType: UpdateUserGroupRequest,+ requestStream: false,+ responseType: UserGroup,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [new Uint8Array([17, 103, 114, 111, 117, 112, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],+ 578365826: [+ new Uint8Array([+ 34,+ 58,+ 5,+ 103,+ 114,+ 111,+ 117,+ 112,+ 50,+ 25,+ 47,+ 118,+ 49,+ 47,+ 123,+ 103,+ 114,+ 111,+ 117,+ 112,+ 46,+ 110,+ 97,+ 109,+ 101,+ 61,+ 103,+ 114,+ 111,+ 117,+ 112,+ 115,+ 47,+ 42,+ 125,+ ]),+ ],+ },+ },+ },+ deleteUserGroup: {+ name: "DeleteUserGroup",+ requestType: DeleteUserGroupRequest,+ requestStream: false,+ responseType: Empty,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],+ 578365826: [+ new Uint8Array([+ 21,+ 42,+ 19,+ 47,+ 118,+ 49,+ 47,+ 123,+ 110,+ 97,+ 109,+ 101,+ 61,+ 103,+ 114,+ 111,+ 117,+ 112,+ 115,+ 47,+ 42,+ 125,+ ]),+ ],+ },+ },+ },+ },+} as const;++type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;++export type DeepPartial<T> = T extends Builtin ? T+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }+ : Partial<T>;++if (_m0.util.Long !== Long) {+ _m0.util.Long = Long as any;+ _m0.configure();+}++function isSet(value: any): boolean {+ return value !== null && value !== undefined;+}diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex 0cec12e190..c0b103087b 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -869,6 +869,150 @@ paths:application/json:schema:$ref: '#/components/schemas/Status'+ /v1/groups:+ get:+ tags:+ - UserGroupService+ operationId: UserGroupService_ListUserGroups+ parameters:+ - name: pageSize+ in: query+ description: |-+ The maximum number of groups to return. The service may return fewer than+ this value.+ If unspecified, at most 50 groups will be returned.+ The maximum value is 1000; values above 1000 will be coerced to 1000.+ schema:+ type: integer+ format: int32+ - name: pageToken+ in: query+ description: |-+ A page token, received from a previous `ListUsers` call.+ Provide this to retrieve the subsequent page.++ When paginating, all other parameters provided to `ListUsers` must match+ the call that provided the page token.+ schema:+ type: string+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/ListUserGroupsResponse'+ default:+ description: Default error response+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Status'+ post:+ tags:+ - UserGroupService+ operationId: UserGroupService_CreateUserGroup+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/UserGroup'+ required: true+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/UserGroup'+ default:+ description: Default error response+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Status'+ /v1/groups/{group}:+ get:+ tags:+ - UserGroupService+ operationId: UserGroupService_GetUserGroup+ parameters:+ - name: group+ in: path+ description: The group id.+ required: true+ schema:+ type: string+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/UserGroup'+ default:+ description: Default error response+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Status'+ delete:+ tags:+ - UserGroupService+ operationId: UserGroupService_DeleteUserGroup+ parameters:+ - name: group+ in: path+ description: The group id.+ required: true+ schema:+ type: string+ responses:+ "200":+ description: OK+ content: {}+ default:+ description: Default error response+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Status'+ patch:+ tags:+ - UserGroupService+ operationId: UserGroupService_UpdateUserGroup+ parameters:+ - name: group+ in: path+ description: The group id.+ required: true+ schema:+ type: string+ - name: updateMask+ in: query+ description: The list of fields to update.+ schema:+ type: string+ format: field-mask+ requestBody:+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/UserGroup'+ required: true+ responses:+ "200":+ description: OK+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/UserGroup'+ default:+ description: Default error response+ content:+ application/json:+ schema:+ $ref: '#/components/schemas/Status'/v1/idps:get:tags:@@ -10873,6 +11017,19 @@ components:description: |-A token, which can be sent as `page_token` to retrieve the next page.If this field is omitted, there are no subsequent pages.+ ListUserGroupsResponse:+ type: object+ properties:+ groups:+ type: array+ items:+ $ref: '#/components/schemas/UserGroup'+ description: The groups from the specified request.+ nextPageToken:+ type: string+ description: |-+ A token, which can be sent as `page_token` to retrieve the next page.+ If this field is omitted, there are no subsequent pages.ListUsersResponse:type: objectproperties:@@ -13720,6 +13877,45 @@ components:description: |-The roles of the user.This filed is to supersede the `user_role` field.+ UserGroup:+ type: object+ properties:+ name:+ readOnly: true+ type: string+ description: |-+ The name of the group to retrieve.+ Format: groups/{email}+ title:+ type: string+ description:+ type: string+ creator:+ readOnly: true+ type: string+ description: |-+ The name for the creator.+ Format: users/[email protected]+ members:+ type: array+ items:+ $ref: '#/components/schemas/UserGroupMember'+ UserGroupMember:+ type: object+ properties:+ member:+ type: string+ description: |-+ Member is the principal who belong to this user group.++ Format: users/{userUID}.+ role:+ enum:+ - ROLE_UNSPECIFIED+ - OWNER+ - MEMBER+ type: string+ format: enumVCSConnector:type: objectproperties:@@ -14111,6 +14307,7 @@ tags:- name: SettingService- name: SheetService- name: SubscriptionService+ - name: UserGroupService- name: VCSConnectorService- name: VCSProviderService- name: WorksheetServicediff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex 6867dd3a3a..29c3de25a8 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -254,6 +254,12 @@- [store/user.proto](#store_user-proto)- [MFAConfig](#bytebase-store-MFAConfig)+- [store/user_group.proto](#store_user_group-proto)+ - [UserGroupMember](#bytebase-store-UserGroupMember)+ - [UserGroupPayload](#bytebase-store-UserGroupPayload)++ - [UserGroupMember.Role](#bytebase-store-UserGroupMember-Role)+- [store/vcs.proto](#store_vcs-proto)- [VCSConnector](#bytebase-store-VCSConnector)@@ -3872,6 +3878,68 @@ MFAConfig is the MFA configuration for a user.+<a name="store_user_group-proto"></a>+<p align="right"><a href="#top">Top</a></p>++## store/user_group.proto++++<a name="bytebase-store-UserGroupMember"></a>++### UserGroupMember++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| member | [string](#string) | | Member is the principal who belong to this user group.++Format: users/{userUID}. |+| role | [UserGroupMember.Role](#bytebase-store-UserGroupMember-Role) | | |+++++++<a name="bytebase-store-UserGroupPayload"></a>++### UserGroupPayload++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| members | [UserGroupMember](#bytebase-store-UserGroupMember) | repeated | |+++++++++<a name="bytebase-store-UserGroupMember-Role"></a>++### UserGroupMember.Role+++| Name | Number | Description |+| ---- | ------ | ----------- |+| ROLE_UNSPECIFIED | 0 | |+| OWNER | 1 | |+| MEMBER | 2 | |++++++++++<a name="store_vcs-proto"></a><p align="right"><a href="#top">Top</a></p>diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.htmlindex 1746fba8ec..0178f20a60 100644--- a/proto/gen/grpc-doc/store/index.html+++ b/proto/gen/grpc-doc/store/index.html@@ -1200,6 +1200,29 @@</li>+ <li>+ <a href="#store%2fuser_group.proto">store/user_group.proto</a>+ <ul>++ <li>+ <a href="#bytebase.store.UserGroupMember"><span class="badge">M</span>UserGroupMember</a>+ </li>++ <li>+ <a href="#bytebase.store.UserGroupPayload"><span class="badge">M</span>UserGroupPayload</a>+ </li>+++ <li>+ <a href="#bytebase.store.UserGroupMember.Role"><span class="badge">E</span>UserGroupMember.Role</a>+ </li>++++ </ul>+ </li>++<li><a href="#store%2fvcs.proto">store/vcs.proto</a><ul>@@ -9522,6 +9545,106 @@ GitOps workflow. The webhook endpoint points to the backend. </p></td>+ <div class="file-heading">+ <h2 id="store/user_group.proto">store/user_group.proto</h2><a href="#title">Top</a>+ </div>+ <p></p>+++ <h3 id="bytebase.store.UserGroupMember">UserGroupMember</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>member</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>Member is the principal who belong to this user group.++Format: users/{userUID}. </p></td>+ </tr>++ <tr>+ <td>role</td>+ <td><a href="#bytebase.store.UserGroupMember.Role">UserGroupMember.Role</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.store.UserGroupPayload">UserGroupPayload</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>members</td>+ <td><a href="#bytebase.store.UserGroupMember">UserGroupMember</a></td>+ <td>repeated</td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++++++ <h3 id="bytebase.store.UserGroupMember.Role">UserGroupMember.Role</h3>+ <p></p>+ <table class="enum-table">+ <thead>+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>ROLE_UNSPECIFIED</td>+ <td>0</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>OWNER</td>+ <td>1</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>MEMBER</td>+ <td>2</td>+ <td><p></p></td>+ </tr>++ </tbody>+ </table>+++++++<div class="file-heading"><h2 id="store/vcs.proto">store/vcs.proto</h2><a href="#title">Top</a></div>diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex b168c648e5..47c5054b33 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -624,6 +624,20 @@- [SQLService](#bytebase-v1-SQLService)+- [v1/user_group.proto](#v1_user_group-proto)+ - [CreateUserGroupRequest](#bytebase-v1-CreateUserGroupRequest)+ - [DeleteUserGroupRequest](#bytebase-v1-DeleteUserGroupRequest)+ - [GetUserGroupRequest](#bytebase-v1-GetUserGroupRequest)+ - [ListUserGroupsRequest](#bytebase-v1-ListUserGroupsRequest)+ - [ListUserGroupsResponse](#bytebase-v1-ListUserGroupsResponse)+ - [UpdateUserGroupRequest](#bytebase-v1-UpdateUserGroupRequest)+ - [UserGroup](#bytebase-v1-UserGroup)+ - [UserGroupMember](#bytebase-v1-UserGroupMember)++ - [UserGroupMember.Role](#bytebase-v1-UserGroupMember-Role)++ - [UserGroupService](#bytebase-v1-UserGroupService)+- [v1/vcs_connector_service.proto](#v1_vcs_connector_service-proto)- [CreateVCSConnectorRequest](#bytebase-v1-CreateVCSConnectorRequest)- [DeleteVCSConnectorRequest](#bytebase-v1-DeleteVCSConnectorRequest)@@ -10087,6 +10101,183 @@ Type of the SheetPayload.+<a name="v1_user_group-proto"></a>+<p align="right"><a href="#top">Top</a></p>++## v1/user_group.proto++++<a name="bytebase-v1-CreateUserGroupRequest"></a>++### CreateUserGroupRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| group | [UserGroup](#bytebase-v1-UserGroup) | | The group to create. |+++++++<a name="bytebase-v1-DeleteUserGroupRequest"></a>++### DeleteUserGroupRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| name | [string](#string) | | The name of the group to delete. Format: groups/{email} |+++++++<a name="bytebase-v1-GetUserGroupRequest"></a>++### GetUserGroupRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| name | [string](#string) | | The name of the group to retrieve. Format: groups/{email} |+++++++<a name="bytebase-v1-ListUserGroupsRequest"></a>++### ListUserGroupsRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| page_size | [int32](#int32) | | The maximum number of groups to return. The service may return fewer than this value. If unspecified, at most 50 groups will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |+| page_token | [string](#string) | | A page token, received from a previous `ListUsers` call. Provide this to retrieve the subsequent page.++When paginating, all other parameters provided to `ListUsers` must match the call that provided the page token. |+++++++<a name="bytebase-v1-ListUserGroupsResponse"></a>++### ListUserGroupsResponse++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| groups | [UserGroup](#bytebase-v1-UserGroup) | repeated | The groups from the specified request. |+| next_page_token | [string](#string) | | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |+++++++<a name="bytebase-v1-UpdateUserGroupRequest"></a>++### UpdateUserGroupRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| group | [UserGroup](#bytebase-v1-UserGroup) | | The group to update.++The group's `name` field is used to identify the group to update. Format: groups/{email} |+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |+++++++<a name="bytebase-v1-UserGroup"></a>++### UserGroup++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| name | [string](#string) | | The name of the group to retrieve. Format: groups/{email} |+| title | [string](#string) | | |+| description | [string](#string) | | |+| creator | [string](#string) | | The name for the creator. Format: users/[email protected] |+| members | [UserGroupMember](#bytebase-v1-UserGroupMember) | repeated | |+++++++<a name="bytebase-v1-UserGroupMember"></a>++### UserGroupMember++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| member | [string](#string) | | Member is the principal who belong to this user group.++Format: users/[email protected] |+| role | [UserGroupMember.Role](#bytebase-v1-UserGroupMember-Role) | | |+++++++++<a name="bytebase-v1-UserGroupMember-Role"></a>++### UserGroupMember.Role+++| Name | Number | Description |+| ---- | ------ | ----------- |+| ROLE_UNSPECIFIED | 0 | |+| OWNER | 1 | |+| MEMBER | 2 | |++++++++<a name="bytebase-v1-UserGroupService"></a>++### UserGroupService+++| Method Name | Request Type | Response Type | Description |+| ----------- | ------------ | ------------- | ------------|+| GetUserGroup | [GetUserGroupRequest](#bytebase-v1-GetUserGroupRequest) | [UserGroup](#bytebase-v1-UserGroup) | |+| ListUserGroups | [ListUserGroupsRequest](#bytebase-v1-ListUserGroupsRequest) | [ListUserGroupsResponse](#bytebase-v1-ListUserGroupsResponse) | |+| CreateUserGroup | [CreateUserGroupRequest](#bytebase-v1-CreateUserGroupRequest) | [UserGroup](#bytebase-v1-UserGroup) | |+| UpdateUserGroup | [UpdateUserGroupRequest](#bytebase-v1-UpdateUserGroupRequest) | [UserGroup](#bytebase-v1-UserGroup) | |+| DeleteUserGroup | [DeleteUserGroupRequest](#bytebase-v1-DeleteUserGroupRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |+++++<a name="v1_vcs_connector_service-proto"></a><p align="right"><a href="#top">Top</a></p>diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 98f8bfcefd..3bfbbee9d8 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -2564,6 +2564,57 @@</li>+ <li>+ <a href="#v1%2fuser_group.proto">v1/user_group.proto</a>+ <ul>++ <li>+ <a href="#bytebase.v1.CreateUserGroupRequest"><span class="badge">M</span>CreateUserGroupRequest</a>+ </li>++ <li>+ <a href="#bytebase.v1.DeleteUserGroupRequest"><span class="badge">M</span>DeleteUserGroupRequest</a>+ </li>++ <li>+ <a href="#bytebase.v1.GetUserGroupRequest"><span class="badge">M</span>GetUserGroupRequest</a>+ </li>++ <li>+ <a href="#bytebase.v1.ListUserGroupsRequest"><span class="badge">M</span>ListUserGroupsRequest</a>+ </li>++ <li>+ <a href="#bytebase.v1.ListUserGroupsResponse"><span class="badge">M</span>ListUserGroupsResponse</a>+ </li>++ <li>+ <a href="#bytebase.v1.UpdateUserGroupRequest"><span class="badge">M</span>UpdateUserGroupRequest</a>+ </li>++ <li>+ <a href="#bytebase.v1.UserGroup"><span class="badge">M</span>UserGroup</a>+ </li>++ <li>+ <a href="#bytebase.v1.UserGroupMember"><span class="badge">M</span>UserGroupMember</a>+ </li>+++ <li>+ <a href="#bytebase.v1.UserGroupMember.Role"><span class="badge">E</span>UserGroupMember.Role</a>+ </li>++++ <li>+ <a href="#bytebase.v1.UserGroupService"><span class="badge">S</span>UserGroupService</a>+ </li>++ </ul>+ </li>++<li><a href="#v1%2fvcs_connector_service.proto">v1/vcs_connector_service.proto</a><ul>@@ -27882,6 +27933,429 @@ to retrieve the next page of history. </p></td>+ <div class="file-heading">+ <h2 id="v1/user_group.proto">v1/user_group.proto</h2><a href="#title">Top</a>+ </div>+ <p></p>+++ <h3 id="bytebase.v1.CreateUserGroupRequest">CreateUserGroupRequest</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>group</td>+ <td><a href="#bytebase.v1.UserGroup">UserGroup</a></td>+ <td></td>+ <td><p>The group to create. </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.DeleteUserGroupRequest">DeleteUserGroupRequest</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The name of the group to delete.+Format: groups/{email} </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.GetUserGroupRequest">GetUserGroupRequest</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The name of the group to retrieve.+Format: groups/{email} </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.ListUserGroupsRequest">ListUserGroupsRequest</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>page_size</td>+ <td><a href="#int32">int32</a></td>+ <td></td>+ <td><p>The maximum number of groups to return. The service may return fewer than+this value.+If unspecified, at most 50 groups will be returned.+The maximum value is 1000; values above 1000 will be coerced to 1000. </p></td>+ </tr>++ <tr>+ <td>page_token</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>A page token, received from a previous `ListUsers` call.+Provide this to retrieve the subsequent page.++When paginating, all other parameters provided to `ListUsers` must match+the call that provided the page token. </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.ListUserGroupsResponse">ListUserGroupsResponse</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>groups</td>+ <td><a href="#bytebase.v1.UserGroup">UserGroup</a></td>+ <td>repeated</td>+ <td><p>The groups from the specified request. </p></td>+ </tr>++ <tr>+ <td>next_page_token</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>A token, which can be sent as `page_token` to retrieve the next page.+If this field is omitted, there are no subsequent pages. </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.UpdateUserGroupRequest">UpdateUserGroupRequest</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>group</td>+ <td><a href="#bytebase.v1.UserGroup">UserGroup</a></td>+ <td></td>+ <td><p>The group to update.++The group's `name` field is used to identify the group to update.+Format: groups/{email} </p></td>+ </tr>++ <tr>+ <td>update_mask</td>+ <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>+ <td></td>+ <td><p>The list of fields to update. </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.UserGroup">UserGroup</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>name</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The name of the group to retrieve.+Format: groups/{email} </p></td>+ </tr>++ <tr>+ <td>title</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>description</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ <tr>+ <td>creator</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>The name for the creator.+Format: users/[email protected] </p></td>+ </tr>++ <tr>+ <td>members</td>+ <td><a href="#bytebase.v1.UserGroupMember">UserGroupMember</a></td>+ <td>repeated</td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.UserGroupMember">UserGroupMember</h3>+ <p></p>+++ <table class="field-table">+ <thead>+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>member</td>+ <td><a href="#string">string</a></td>+ <td></td>+ <td><p>Member is the principal who belong to this user group.++Format: users/[email protected] </p></td>+ </tr>++ <tr>+ <td>role</td>+ <td><a href="#bytebase.v1.UserGroupMember.Role">UserGroupMember.Role</a></td>+ <td></td>+ <td><p> </p></td>+ </tr>++ </tbody>+ </table>++++++++ <h3 id="bytebase.v1.UserGroupMember.Role">UserGroupMember.Role</h3>+ <p></p>+ <table class="enum-table">+ <thead>+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>ROLE_UNSPECIFIED</td>+ <td>0</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>OWNER</td>+ <td>1</td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>MEMBER</td>+ <td>2</td>+ <td><p></p></td>+ </tr>++ </tbody>+ </table>++++++ <h3 id="bytebase.v1.UserGroupService">UserGroupService</h3>+ <p></p>+ <table class="enum-table">+ <thead>+ <tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>+ </thead>+ <tbody>++ <tr>+ <td>GetUserGroup</td>+ <td><a href="#bytebase.v1.GetUserGroupRequest">GetUserGroupRequest</a></td>+ <td><a href="#bytebase.v1.UserGroup">UserGroup</a></td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>ListUserGroups</td>+ <td><a href="#bytebase.v1.ListUserGroupsRequest">ListUserGroupsRequest</a></td>+ <td><a href="#bytebase.v1.ListUserGroupsResponse">ListUserGroupsResponse</a></td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>CreateUserGroup</td>+ <td><a href="#bytebase.v1.CreateUserGroupRequest">CreateUserGroupRequest</a></td>+ <td><a href="#bytebase.v1.UserGroup">UserGroup</a></td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>UpdateUserGroup</td>+ <td><a href="#bytebase.v1.UpdateUserGroupRequest">UpdateUserGroupRequest</a></td>+ <td><a href="#bytebase.v1.UserGroup">UserGroup</a></td>+ <td><p></p></td>+ </tr>++ <tr>+ <td>DeleteUserGroup</td>+ <td><a href="#bytebase.v1.DeleteUserGroupRequest">DeleteUserGroupRequest</a></td>+ <td><a href="#google.protobuf.Empty">.google.protobuf.Empty</a></td>+ <td><p></p></td>+ </tr>++ </tbody>+ </table>+++++ <h4>Methods with HTTP bindings</h4>+ <table>+ <thead>+ <tr>+ <td>Method Name</td>+ <td>Method</td>+ <td>Pattern</td>+ <td>Body</td>+ </tr>+ </thead>+ <tbody>++++ <tr>+ <td>GetUserGroup</td>+ <td>GET</td>+ <td>/v1/{name=groups/*}</td>+ <td></td>+ </tr>+++++ <tr>+ <td>ListUserGroups</td>+ <td>GET</td>+ <td>/v1/groups</td>+ <td></td>+ </tr>+++++ <tr>+ <td>CreateUserGroup</td>+ <td>POST</td>+ <td>/v1/groups</td>+ <td>group</td>+ </tr>+++++ <tr>+ <td>UpdateUserGroup</td>+ <td>PATCH</td>+ <td>/v1/{group.name=groups/*}</td>+ <td>group</td>+ </tr>+++++ <tr>+ <td>DeleteUserGroup</td>+ <td>DELETE</td>+ <td>/v1/{name=groups/*}</td>+ <td></td>+ </tr>+++ </tbody>+ </table>++++<div class="file-heading"><h2 id="v1/vcs_connector_service.proto">v1/vcs_connector_service.proto</h2><a href="#title">Top</a></div>diff --git a/proto/generated-go/store/user_group.pb.go b/proto/generated-go/store/user_group.pb.gonew file mode 100644index 0000000000..b1f7e533ea--- /dev/null+++ b/proto/generated-go/store/user_group.pb.go@@ -0,0 +1,280 @@+// Code generated by protoc-gen-go. DO NOT EDIT.+// versions:+// protoc-gen-go v1.34.1+// protoc (unknown)+// source: store/user_group.proto++package store++import (+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"+ reflect "reflect"+ sync "sync"+)++const (+ // Verify that this generated code is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)+ // Verify that runtime/protoimpl is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)+)++type UserGroupMember_Role int32++const (+ UserGroupMember_ROLE_UNSPECIFIED UserGroupMember_Role = 0+ UserGroupMember_OWNER UserGroupMember_Role = 1+ UserGroupMember_MEMBER UserGroupMember_Role = 2+)++// Enum value maps for UserGroupMember_Role.+var (+ UserGroupMember_Role_name = map[int32]string{+ 0: "ROLE_UNSPECIFIED",+ 1: "OWNER",+ 2: "MEMBER",+ }+ UserGroupMember_Role_value = map[string]int32{+ "ROLE_UNSPECIFIED": 0,+ "OWNER": 1,+ "MEMBER": 2,+ }+)++func (x UserGroupMember_Role) Enum() *UserGroupMember_Role {+ p := new(UserGroupMember_Role)+ *p = x+ return p+}++func (x UserGroupMember_Role) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (UserGroupMember_Role) Descriptor() protoreflect.EnumDescriptor {+ return file_store_user_group_proto_enumTypes[0].Descriptor()+}++func (UserGroupMember_Role) Type() protoreflect.EnumType {+ return &file_store_user_group_proto_enumTypes[0]+}++func (x UserGroupMember_Role) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use UserGroupMember_Role.Descriptor instead.+func (UserGroupMember_Role) EnumDescriptor() ([]byte, []int) {+ return file_store_user_group_proto_rawDescGZIP(), []int{0, 0}+}++type UserGroupMember struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // Member is the principal who belong to this user group.+ //+ // Format: users/{userUID}.+ Member string `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"`+ Role UserGroupMember_Role `protobuf:"varint,2,opt,name=role,proto3,enum=bytebase.store.UserGroupMember_Role" json:"role,omitempty"`+}++func (x *UserGroupMember) Reset() {+ *x = UserGroupMember{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_user_group_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UserGroupMember) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UserGroupMember) ProtoMessage() {}++func (x *UserGroupMember) ProtoReflect() protoreflect.Message {+ mi := &file_store_user_group_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UserGroupMember.ProtoReflect.Descriptor instead.+func (*UserGroupMember) Descriptor() ([]byte, []int) {+ return file_store_user_group_proto_rawDescGZIP(), []int{0}+}++func (x *UserGroupMember) GetMember() string {+ if x != nil {+ return x.Member+ }+ return ""+}++func (x *UserGroupMember) GetRole() UserGroupMember_Role {+ if x != nil {+ return x.Role+ }+ return UserGroupMember_ROLE_UNSPECIFIED+}++type UserGroupPayload struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ Members []*UserGroupMember `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`+}++func (x *UserGroupPayload) Reset() {+ *x = UserGroupPayload{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_user_group_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UserGroupPayload) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UserGroupPayload) ProtoMessage() {}++func (x *UserGroupPayload) ProtoReflect() protoreflect.Message {+ mi := &file_store_user_group_proto_msgTypes[1]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UserGroupPayload.ProtoReflect.Descriptor instead.+func (*UserGroupPayload) Descriptor() ([]byte, []int) {+ return file_store_user_group_proto_rawDescGZIP(), []int{1}+}++func (x *UserGroupPayload) GetMembers() []*UserGroupMember {+ if x != nil {+ return x.Members+ }+ return nil+}++var File_store_user_group_proto protoreflect.FileDescriptor++var file_store_user_group_proto_rawDesc = []byte{+ 0x0a, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f,+ 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65,+ 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06,+ 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65,+ 0x6d, 0x62, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,+ 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,+ 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d,+ 0x62, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x33,+ 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55,+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05,+ 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x4d, 0x42, 0x45,+ 0x52, 0x10, 0x02, 0x22, 0x4d, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,+ 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65,+ 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,+ 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65,+ 0x72, 0x73, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d,+ 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,+}++var (+ file_store_user_group_proto_rawDescOnce sync.Once+ file_store_user_group_proto_rawDescData = file_store_user_group_proto_rawDesc+)++func file_store_user_group_proto_rawDescGZIP() []byte {+ file_store_user_group_proto_rawDescOnce.Do(func() {+ file_store_user_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_user_group_proto_rawDescData)+ })+ return file_store_user_group_proto_rawDescData+}++var file_store_user_group_proto_enumTypes = make([]protoimpl.EnumInfo, 1)+var file_store_user_group_proto_msgTypes = make([]protoimpl.MessageInfo, 2)+var file_store_user_group_proto_goTypes = []interface{}{+ (UserGroupMember_Role)(0), // 0: bytebase.store.UserGroupMember.Role+ (*UserGroupMember)(nil), // 1: bytebase.store.UserGroupMember+ (*UserGroupPayload)(nil), // 2: bytebase.store.UserGroupPayload+}+var file_store_user_group_proto_depIdxs = []int32{+ 0, // 0: bytebase.store.UserGroupMember.role:type_name -> bytebase.store.UserGroupMember.Role+ 1, // 1: bytebase.store.UserGroupPayload.members:type_name -> bytebase.store.UserGroupMember+ 2, // [2:2] is the sub-list for method output_type+ 2, // [2:2] is the sub-list for method input_type+ 2, // [2:2] is the sub-list for extension type_name+ 2, // [2:2] is the sub-list for extension extendee+ 0, // [0:2] is the sub-list for field type_name+}++func init() { file_store_user_group_proto_init() }+func file_store_user_group_proto_init() {+ if File_store_user_group_proto != nil {+ return+ }+ if !protoimpl.UnsafeEnabled {+ file_store_user_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UserGroupMember); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_user_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UserGroupPayload); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ }+ type x struct{}+ out := protoimpl.TypeBuilder{+ File: protoimpl.DescBuilder{+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),+ RawDescriptor: file_store_user_group_proto_rawDesc,+ NumEnums: 1,+ NumMessages: 2,+ NumExtensions: 0,+ NumServices: 0,+ },+ GoTypes: file_store_user_group_proto_goTypes,+ DependencyIndexes: file_store_user_group_proto_depIdxs,+ EnumInfos: file_store_user_group_proto_enumTypes,+ MessageInfos: file_store_user_group_proto_msgTypes,+ }.Build()+ File_store_user_group_proto = out.File+ file_store_user_group_proto_rawDesc = nil+ file_store_user_group_proto_goTypes = nil+ file_store_user_group_proto_depIdxs = nil+}diff --git a/proto/generated-go/v1/user_group.pb.go b/proto/generated-go/v1/user_group.pb.gonew file mode 100644index 0000000000..6d55ad21b7--- /dev/null+++ b/proto/generated-go/v1/user_group.pb.go@@ -0,0 +1,828 @@+// Code generated by protoc-gen-go. DO NOT EDIT.+// versions:+// protoc-gen-go v1.34.1+// protoc (unknown)+// source: v1/user_group.proto++package v1++import (+ _ "google.golang.org/genproto/googleapis/api/annotations"+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"+ emptypb "google.golang.org/protobuf/types/known/emptypb"+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"+ reflect "reflect"+ sync "sync"+)++const (+ // Verify that this generated code is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)+ // Verify that runtime/protoimpl is sufficiently up-to-date.+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)+)++type UserGroupMember_Role int32++const (+ UserGroupMember_ROLE_UNSPECIFIED UserGroupMember_Role = 0+ UserGroupMember_OWNER UserGroupMember_Role = 1+ UserGroupMember_MEMBER UserGroupMember_Role = 2+)++// Enum value maps for UserGroupMember_Role.+var (+ UserGroupMember_Role_name = map[int32]string{+ 0: "ROLE_UNSPECIFIED",+ 1: "OWNER",+ 2: "MEMBER",+ }+ UserGroupMember_Role_value = map[string]int32{+ "ROLE_UNSPECIFIED": 0,+ "OWNER": 1,+ "MEMBER": 2,+ }+)++func (x UserGroupMember_Role) Enum() *UserGroupMember_Role {+ p := new(UserGroupMember_Role)+ *p = x+ return p+}++func (x UserGroupMember_Role) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (UserGroupMember_Role) Descriptor() protoreflect.EnumDescriptor {+ return file_v1_user_group_proto_enumTypes[0].Descriptor()+}++func (UserGroupMember_Role) Type() protoreflect.EnumType {+ return &file_v1_user_group_proto_enumTypes[0]+}++func (x UserGroupMember_Role) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use UserGroupMember_Role.Descriptor instead.+func (UserGroupMember_Role) EnumDescriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{6, 0}+}++type GetUserGroupRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the group to retrieve.+ // Format: groups/{email}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+}++func (x *GetUserGroupRequest) Reset() {+ *x = GetUserGroupRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *GetUserGroupRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*GetUserGroupRequest) ProtoMessage() {}++func (x *GetUserGroupRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use GetUserGroupRequest.ProtoReflect.Descriptor instead.+func (*GetUserGroupRequest) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{0}+}++func (x *GetUserGroupRequest) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++type ListUserGroupsRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The maximum number of groups to return. The service may return fewer than+ // this value.+ // If unspecified, at most 50 groups will be returned.+ // The maximum value is 1000; values above 1000 will be coerced to 1000.+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`+ // A page token, received from a previous `ListUsers` call.+ // Provide this to retrieve the subsequent page.+ //+ // When paginating, all other parameters provided to `ListUsers` must match+ // the call that provided the page token.+ PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`+}++func (x *ListUserGroupsRequest) Reset() {+ *x = ListUserGroupsRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ListUserGroupsRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ListUserGroupsRequest) ProtoMessage() {}++func (x *ListUserGroupsRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[1]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ListUserGroupsRequest.ProtoReflect.Descriptor instead.+func (*ListUserGroupsRequest) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{1}+}++func (x *ListUserGroupsRequest) GetPageSize() int32 {+ if x != nil {+ return x.PageSize+ }+ return 0+}++func (x *ListUserGroupsRequest) GetPageToken() string {+ if x != nil {+ return x.PageToken+ }+ return ""+}++type ListUserGroupsResponse struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The groups from the specified request.+ Groups []*UserGroup `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`+ // A token, which can be sent as `page_token` to retrieve the next page.+ // If this field is omitted, there are no subsequent pages.+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`+}++func (x *ListUserGroupsResponse) Reset() {+ *x = ListUserGroupsResponse{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[2]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ListUserGroupsResponse) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ListUserGroupsResponse) ProtoMessage() {}++func (x *ListUserGroupsResponse) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[2]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ListUserGroupsResponse.ProtoReflect.Descriptor instead.+func (*ListUserGroupsResponse) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{2}+}++func (x *ListUserGroupsResponse) GetGroups() []*UserGroup {+ if x != nil {+ return x.Groups+ }+ return nil+}++func (x *ListUserGroupsResponse) GetNextPageToken() string {+ if x != nil {+ return x.NextPageToken+ }+ return ""+}++type CreateUserGroupRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The group to create.+ Group *UserGroup `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`+}++func (x *CreateUserGroupRequest) Reset() {+ *x = CreateUserGroupRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[3]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *CreateUserGroupRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*CreateUserGroupRequest) ProtoMessage() {}++func (x *CreateUserGroupRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[3]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use CreateUserGroupRequest.ProtoReflect.Descriptor instead.+func (*CreateUserGroupRequest) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{3}+}++func (x *CreateUserGroupRequest) GetGroup() *UserGroup {+ if x != nil {+ return x.Group+ }+ return nil+}++type UpdateUserGroupRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The group to update.+ //+ // The group's `name` field is used to identify the group to update.+ // Format: groups/{email}+ Group *UserGroup `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`+ // The list of fields to update.+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`+}++func (x *UpdateUserGroupRequest) Reset() {+ *x = UpdateUserGroupRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[4]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UpdateUserGroupRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UpdateUserGroupRequest) ProtoMessage() {}++func (x *UpdateUserGroupRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[4]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UpdateUserGroupRequest.ProtoReflect.Descriptor instead.+func (*UpdateUserGroupRequest) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{4}+}++func (x *UpdateUserGroupRequest) GetGroup() *UserGroup {+ if x != nil {+ return x.Group+ }+ return nil+}++func (x *UpdateUserGroupRequest) GetUpdateMask() *fieldmaskpb.FieldMask {+ if x != nil {+ return x.UpdateMask+ }+ return nil+}++type DeleteUserGroupRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the group to delete.+ // Format: groups/{email}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+}++func (x *DeleteUserGroupRequest) Reset() {+ *x = DeleteUserGroupRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[5]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *DeleteUserGroupRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*DeleteUserGroupRequest) ProtoMessage() {}++func (x *DeleteUserGroupRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[5]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use DeleteUserGroupRequest.ProtoReflect.Descriptor instead.+func (*DeleteUserGroupRequest) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{5}+}++func (x *DeleteUserGroupRequest) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++type UserGroupMember struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // Member is the principal who belong to this user group.+ //+ // Format: users/[email protected]+ Member string `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"`+ Role UserGroupMember_Role `protobuf:"varint,2,opt,name=role,proto3,enum=bytebase.v1.UserGroupMember_Role" json:"role,omitempty"`+}++func (x *UserGroupMember) Reset() {+ *x = UserGroupMember{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[6]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UserGroupMember) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UserGroupMember) ProtoMessage() {}++func (x *UserGroupMember) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[6]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UserGroupMember.ProtoReflect.Descriptor instead.+func (*UserGroupMember) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{6}+}++func (x *UserGroupMember) GetMember() string {+ if x != nil {+ return x.Member+ }+ return ""+}++func (x *UserGroupMember) GetRole() UserGroupMember_Role {+ if x != nil {+ return x.Role+ }+ return UserGroupMember_ROLE_UNSPECIFIED+}++type UserGroup struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the group to retrieve.+ // Format: groups/{email}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+ Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`+ Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`+ // The name for the creator.+ // Format: users/[email protected]+ Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"`+ Members []*UserGroupMember `protobuf:"bytes,5,rep,name=members,proto3" json:"members,omitempty"`+}++func (x *UserGroup) Reset() {+ *x = UserGroup{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_user_group_proto_msgTypes[7]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UserGroup) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UserGroup) ProtoMessage() {}++func (x *UserGroup) ProtoReflect() protoreflect.Message {+ mi := &file_v1_user_group_proto_msgTypes[7]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UserGroup.ProtoReflect.Descriptor instead.+func (*UserGroup) Descriptor() ([]byte, []int) {+ return file_v1_user_group_proto_rawDescGZIP(), []int{7}+}++func (x *UserGroup) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++func (x *UserGroup) GetTitle() string {+ if x != nil {+ return x.Title+ }+ return ""+}++func (x *UserGroup) GetDescription() string {+ if x != nil {+ return x.Description+ }+ return ""+}++func (x *UserGroup) GetCreator() string {+ if x != nil {+ return x.Creator+ }+ return ""+}++func (x *UserGroup) GetMembers() []*UserGroupMember {+ if x != nil {+ return x.Members+ }+ return nil+}++var File_v1_user_group_proto protoreflect.FileDescriptor++var file_v1_user_group_proto_rawDesc = []byte{+ 0x0a, 0x13, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e,+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61,+ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,+ 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69,+ 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,+ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61,+ 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67,+ 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,+ 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,+ 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x13, 0x47, 0x65, 0x74,+ 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,+ 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,+ 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x15, 0x4c, 0x69,+ 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75,+ 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,+ 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22,+ 0x70, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,+ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x67, 0x72, 0x6f,+ 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,+ 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,+ 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,+ 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,+ 0x6e, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47,+ 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x67,+ 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f,+ 0x75, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22,+ 0x89, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,+ 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x67, 0x72,+ 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,+ 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3b,+ 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20,+ 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52,+ 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x32, 0x0a, 0x16, 0x44,+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65,+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,+ 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,+ 0x95, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d,+ 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x04, 0x72,+ 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,+ 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f,+ 0x6c, 0x65, 0x22, 0x33, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f,+ 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,+ 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d,+ 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0xb5, 0x01, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72,+ 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,+ 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,+ 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,+ 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63,+ 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74,+ 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x07,+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65,+ 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,+ 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x32,+ 0xe8, 0x04, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72,+ 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47,+ 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x22,+ 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f,+ 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f,+ 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,+ 0x6f, 0x75, 0x70, 0x73, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47,+ 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0xda,+ 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72,+ 0x6f, 0x75, 0x70, 0x73, 0x12, 0x71, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73,+ 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,+ 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47,+ 0x72, 0x6f, 0x75, 0x70, 0x22, 0x21, 0xda, 0x41, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x82, 0xd3,+ 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x0a, 0x2f, 0x76, 0x31,+ 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,+ 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,+ 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,+ 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x3c, 0xda, 0x41, 0x11, 0x67, 0x72, 0x6f,+ 0x75, 0x70, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3,+ 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x19, 0x2f, 0x76, 0x31,+ 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x67, 0x72, 0x6f,+ 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,+ 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73,+ 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,+ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,+ 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82,+ 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x2a, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,+ 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65,+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70,+ 0x72, 0x6f, 0x74, 0x6f, 0x33,+}++var (+ file_v1_user_group_proto_rawDescOnce sync.Once+ file_v1_user_group_proto_rawDescData = file_v1_user_group_proto_rawDesc+)++func file_v1_user_group_proto_rawDescGZIP() []byte {+ file_v1_user_group_proto_rawDescOnce.Do(func() {+ file_v1_user_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_user_group_proto_rawDescData)+ })+ return file_v1_user_group_proto_rawDescData+}++var file_v1_user_group_proto_enumTypes = make([]protoimpl.EnumInfo, 1)+var file_v1_user_group_proto_msgTypes = make([]protoimpl.MessageInfo, 8)+var file_v1_user_group_proto_goTypes = []interface{}{+ (UserGroupMember_Role)(0), // 0: bytebase.v1.UserGroupMember.Role+ (*GetUserGroupRequest)(nil), // 1: bytebase.v1.GetUserGroupRequest+ (*ListUserGroupsRequest)(nil), // 2: bytebase.v1.ListUserGroupsRequest+ (*ListUserGroupsResponse)(nil), // 3: bytebase.v1.ListUserGroupsResponse+ (*CreateUserGroupRequest)(nil), // 4: bytebase.v1.CreateUserGroupRequest+ (*UpdateUserGroupRequest)(nil), // 5: bytebase.v1.UpdateUserGroupRequest+ (*DeleteUserGroupRequest)(nil), // 6: bytebase.v1.DeleteUserGroupRequest+ (*UserGroupMember)(nil), // 7: bytebase.v1.UserGroupMember+ (*UserGroup)(nil), // 8: bytebase.v1.UserGroup+ (*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask+ (*emptypb.Empty)(nil), // 10: google.protobuf.Empty+}+var file_v1_user_group_proto_depIdxs = []int32{+ 8, // 0: bytebase.v1.ListUserGroupsResponse.groups:type_name -> bytebase.v1.UserGroup+ 8, // 1: bytebase.v1.CreateUserGroupRequest.group:type_name -> bytebase.v1.UserGroup+ 8, // 2: bytebase.v1.UpdateUserGroupRequest.group:type_name -> bytebase.v1.UserGroup+ 9, // 3: bytebase.v1.UpdateUserGroupRequest.update_mask:type_name -> google.protobuf.FieldMask+ 0, // 4: bytebase.v1.UserGroupMember.role:type_name -> bytebase.v1.UserGroupMember.Role+ 7, // 5: bytebase.v1.UserGroup.members:type_name -> bytebase.v1.UserGroupMember+ 1, // 6: bytebase.v1.UserGroupService.GetUserGroup:input_type -> bytebase.v1.GetUserGroupRequest+ 2, // 7: bytebase.v1.UserGroupService.ListUserGroups:input_type -> bytebase.v1.ListUserGroupsRequest+ 4, // 8: bytebase.v1.UserGroupService.CreateUserGroup:input_type -> bytebase.v1.CreateUserGroupRequest+ 5, // 9: bytebase.v1.UserGroupService.UpdateUserGroup:input_type -> bytebase.v1.UpdateUserGroupRequest+ 6, // 10: bytebase.v1.UserGroupService.DeleteUserGroup:input_type -> bytebase.v1.DeleteUserGroupRequest+ 8, // 11: bytebase.v1.UserGroupService.GetUserGroup:output_type -> bytebase.v1.UserGroup+ 3, // 12: bytebase.v1.UserGroupService.ListUserGroups:output_type -> bytebase.v1.ListUserGroupsResponse+ 8, // 13: bytebase.v1.UserGroupService.CreateUserGroup:output_type -> bytebase.v1.UserGroup+ 8, // 14: bytebase.v1.UserGroupService.UpdateUserGroup:output_type -> bytebase.v1.UserGroup+ 10, // 15: bytebase.v1.UserGroupService.DeleteUserGroup:output_type -> google.protobuf.Empty+ 11, // [11:16] is the sub-list for method output_type+ 6, // [6:11] is the sub-list for method input_type+ 6, // [6:6] is the sub-list for extension type_name+ 6, // [6:6] is the sub-list for extension extendee+ 0, // [0:6] is the sub-list for field type_name+}++func init() { file_v1_user_group_proto_init() }+func file_v1_user_group_proto_init() {+ if File_v1_user_group_proto != nil {+ return+ }+ if !protoimpl.UnsafeEnabled {+ file_v1_user_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*GetUserGroupRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ListUserGroupsRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ListUserGroupsResponse); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*CreateUserGroupRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UpdateUserGroupRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*DeleteUserGroupRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UserGroupMember); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_user_group_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UserGroup); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ }+ type x struct{}+ out := protoimpl.TypeBuilder{+ File: protoimpl.DescBuilder{+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),+ RawDescriptor: file_v1_user_group_proto_rawDesc,+ NumEnums: 1,+ NumMessages: 8,+ NumExtensions: 0,+ NumServices: 1,+ },+ GoTypes: file_v1_user_group_proto_goTypes,+ DependencyIndexes: file_v1_user_group_proto_depIdxs,+ EnumInfos: file_v1_user_group_proto_enumTypes,+ MessageInfos: file_v1_user_group_proto_msgTypes,+ }.Build()+ File_v1_user_group_proto = out.File+ file_v1_user_group_proto_rawDesc = nil+ file_v1_user_group_proto_goTypes = nil+ file_v1_user_group_proto_depIdxs = nil+}diff --git a/proto/generated-go/v1/user_group.pb.gw.go b/proto/generated-go/v1/user_group.pb.gw.gonew file mode 100644index 0000000000..9617a37448--- /dev/null+++ b/proto/generated-go/v1/user_group.pb.gw.go@@ -0,0 +1,607 @@+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.+// source: v1/user_group.proto++/*+Package v1 is a reverse proxy.++It translates gRPC into RESTful JSON APIs.+*/+package v1++import (+ "context"+ "io"+ "net/http"++ "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"+ "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"+ "google.golang.org/grpc"+ "google.golang.org/grpc/codes"+ "google.golang.org/grpc/grpclog"+ "google.golang.org/grpc/metadata"+ "google.golang.org/grpc/status"+ "google.golang.org/protobuf/proto"+)++// Suppress "imported and not used" errors+var _ codes.Code+var _ io.Reader+var _ status.Status+var _ = runtime.String+var _ = utilities.NewDoubleArray+var _ = metadata.Join++func request_UserGroupService_GetUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, client UserGroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq GetUserGroupRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := client.GetUserGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_UserGroupService_GetUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, server UserGroupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq GetUserGroupRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := server.GetUserGroup(ctx, &protoReq)+ return msg, metadata, err++}++var (+ filter_UserGroupService_ListUserGroups_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}+)++func request_UserGroupService_ListUserGroups_0(ctx context.Context, marshaler runtime.Marshaler, client UserGroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ListUserGroupsRequest+ var metadata runtime.ServerMetadata++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserGroupService_ListUserGroups_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.ListUserGroups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_UserGroupService_ListUserGroups_0(ctx context.Context, marshaler runtime.Marshaler, server UserGroupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ListUserGroupsRequest+ var metadata runtime.ServerMetadata++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserGroupService_ListUserGroups_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.ListUserGroups(ctx, &protoReq)+ return msg, metadata, err++}++func request_UserGroupService_CreateUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, client UserGroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq CreateUserGroupRequest+ var metadata runtime.ServerMetadata++ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Group); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.CreateUserGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_UserGroupService_CreateUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, server UserGroupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq CreateUserGroupRequest+ var metadata runtime.ServerMetadata++ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Group); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.CreateUserGroup(ctx, &protoReq)+ return msg, metadata, err++}++var (+ filter_UserGroupService_UpdateUserGroup_0 = &utilities.DoubleArray{Encoding: map[string]int{"group": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}+)++func request_UserGroupService_UpdateUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, client UserGroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateUserGroupRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Group); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Group); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["group.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "group.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group.name", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserGroupService_UpdateUserGroup_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.UpdateUserGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_UserGroupService_UpdateUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, server UserGroupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateUserGroupRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Group); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Group); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["group.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "group.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "group.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "group.name", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserGroupService_UpdateUserGroup_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.UpdateUserGroup(ctx, &protoReq)+ return msg, metadata, err++}++func request_UserGroupService_DeleteUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, client UserGroupServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq DeleteUserGroupRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := client.DeleteUserGroup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_UserGroupService_DeleteUserGroup_0(ctx context.Context, marshaler runtime.Marshaler, server UserGroupServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq DeleteUserGroupRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := server.DeleteUserGroup(ctx, &protoReq)+ return msg, metadata, err++}++// RegisterUserGroupServiceHandlerServer registers the http handlers for service UserGroupService to "mux".+// UnaryRPC :call UserGroupServiceServer directly.+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.+// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserGroupServiceHandlerFromEndpoint instead.+func RegisterUserGroupServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserGroupServiceServer) error {++ mux.Handle("GET", pattern_UserGroupService_GetUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.UserGroupService/GetUserGroup", runtime.WithHTTPPathPattern("/v1/{name=groups/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_UserGroupService_GetUserGroup_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_GetUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("GET", pattern_UserGroupService_ListUserGroups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.UserGroupService/ListUserGroups", runtime.WithHTTPPathPattern("/v1/groups"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_UserGroupService_ListUserGroups_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_ListUserGroups_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("POST", pattern_UserGroupService_CreateUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.UserGroupService/CreateUserGroup", runtime.WithHTTPPathPattern("/v1/groups"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_UserGroupService_CreateUserGroup_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_CreateUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("PATCH", pattern_UserGroupService_UpdateUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.UserGroupService/UpdateUserGroup", runtime.WithHTTPPathPattern("/v1/{group.name=groups/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_UserGroupService_UpdateUserGroup_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_UpdateUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("DELETE", pattern_UserGroupService_DeleteUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.UserGroupService/DeleteUserGroup", runtime.WithHTTPPathPattern("/v1/{name=groups/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_UserGroupService_DeleteUserGroup_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_DeleteUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ return nil+}++// RegisterUserGroupServiceHandlerFromEndpoint is same as RegisterUserGroupServiceHandler but+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.+func RegisterUserGroupServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {+ conn, err := grpc.NewClient(endpoint, opts...)+ if err != nil {+ return err+ }+ defer func() {+ if err != nil {+ if cerr := conn.Close(); cerr != nil {+ grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)+ }+ return+ }+ go func() {+ <-ctx.Done()+ if cerr := conn.Close(); cerr != nil {+ grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)+ }+ }()+ }()++ return RegisterUserGroupServiceHandler(ctx, mux, conn)+}++// RegisterUserGroupServiceHandler registers the http handlers for service UserGroupService to "mux".+// The handlers forward requests to the grpc endpoint over "conn".+func RegisterUserGroupServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {+ return RegisterUserGroupServiceHandlerClient(ctx, mux, NewUserGroupServiceClient(conn))+}++// RegisterUserGroupServiceHandlerClient registers the http handlers for service UserGroupService+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserGroupServiceClient".+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserGroupServiceClient"+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in+// "UserGroupServiceClient" to call the correct interceptors.+func RegisterUserGroupServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserGroupServiceClient) error {++ mux.Handle("GET", pattern_UserGroupService_GetUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.UserGroupService/GetUserGroup", runtime.WithHTTPPathPattern("/v1/{name=groups/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_UserGroupService_GetUserGroup_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_GetUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("GET", pattern_UserGroupService_ListUserGroups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.UserGroupService/ListUserGroups", runtime.WithHTTPPathPattern("/v1/groups"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_UserGroupService_ListUserGroups_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_ListUserGroups_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("POST", pattern_UserGroupService_CreateUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.UserGroupService/CreateUserGroup", runtime.WithHTTPPathPattern("/v1/groups"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_UserGroupService_CreateUserGroup_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_CreateUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("PATCH", pattern_UserGroupService_UpdateUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.UserGroupService/UpdateUserGroup", runtime.WithHTTPPathPattern("/v1/{group.name=groups/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_UserGroupService_UpdateUserGroup_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_UpdateUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("DELETE", pattern_UserGroupService_DeleteUserGroup_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.UserGroupService/DeleteUserGroup", runtime.WithHTTPPathPattern("/v1/{name=groups/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_UserGroupService_DeleteUserGroup_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_UserGroupService_DeleteUserGroup_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ return nil+}++var (+ pattern_UserGroupService_GetUserGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "groups", "name"}, ""))++ pattern_UserGroupService_ListUserGroups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, ""))++ pattern_UserGroupService_CreateUserGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "groups"}, ""))++ pattern_UserGroupService_UpdateUserGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "groups", "group.name"}, ""))++ pattern_UserGroupService_DeleteUserGroup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "groups", "name"}, ""))+)++var (+ forward_UserGroupService_GetUserGroup_0 = runtime.ForwardResponseMessage++ forward_UserGroupService_ListUserGroups_0 = runtime.ForwardResponseMessage++ forward_UserGroupService_CreateUserGroup_0 = runtime.ForwardResponseMessage++ forward_UserGroupService_UpdateUserGroup_0 = runtime.ForwardResponseMessage++ forward_UserGroupService_DeleteUserGroup_0 = runtime.ForwardResponseMessage+)diff --git a/proto/generated-go/v1/user_group_grpc.pb.go b/proto/generated-go/v1/user_group_grpc.pb.gonew file mode 100644index 0000000000..65881b3d7b--- /dev/null+++ b/proto/generated-go/v1/user_group_grpc.pb.go@@ -0,0 +1,258 @@+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.+// versions:+// - protoc-gen-go-grpc v1.3.0+// - protoc (unknown)+// source: v1/user_group.proto++package v1++import (+ context "context"+ grpc "google.golang.org/grpc"+ codes "google.golang.org/grpc/codes"+ status "google.golang.org/grpc/status"+ emptypb "google.golang.org/protobuf/types/known/emptypb"+)++// This is a compile-time assertion to ensure that this generated file+// is compatible with the grpc package it is being compiled against.+// Requires gRPC-Go v1.32.0 or later.+const _ = grpc.SupportPackageIsVersion7++const (+ UserGroupService_GetUserGroup_FullMethodName = "/bytebase.v1.UserGroupService/GetUserGroup"+ UserGroupService_ListUserGroups_FullMethodName = "/bytebase.v1.UserGroupService/ListUserGroups"+ UserGroupService_CreateUserGroup_FullMethodName = "/bytebase.v1.UserGroupService/CreateUserGroup"+ UserGroupService_UpdateUserGroup_FullMethodName = "/bytebase.v1.UserGroupService/UpdateUserGroup"+ UserGroupService_DeleteUserGroup_FullMethodName = "/bytebase.v1.UserGroupService/DeleteUserGroup"+)++// UserGroupServiceClient is the client API for UserGroupService service.+//+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.+type UserGroupServiceClient interface {+ GetUserGroup(ctx context.Context, in *GetUserGroupRequest, opts ...grpc.CallOption) (*UserGroup, error)+ ListUserGroups(ctx context.Context, in *ListUserGroupsRequest, opts ...grpc.CallOption) (*ListUserGroupsResponse, error)+ CreateUserGroup(ctx context.Context, in *CreateUserGroupRequest, opts ...grpc.CallOption) (*UserGroup, error)+ UpdateUserGroup(ctx context.Context, in *UpdateUserGroupRequest, opts ...grpc.CallOption) (*UserGroup, error)+ DeleteUserGroup(ctx context.Context, in *DeleteUserGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)+}++type userGroupServiceClient struct {+ cc grpc.ClientConnInterface+}++func NewUserGroupServiceClient(cc grpc.ClientConnInterface) UserGroupServiceClient {+ return &userGroupServiceClient{cc}+}++func (c *userGroupServiceClient) GetUserGroup(ctx context.Context, in *GetUserGroupRequest, opts ...grpc.CallOption) (*UserGroup, error) {+ out := new(UserGroup)+ err := c.cc.Invoke(ctx, UserGroupService_GetUserGroup_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *userGroupServiceClient) ListUserGroups(ctx context.Context, in *ListUserGroupsRequest, opts ...grpc.CallOption) (*ListUserGroupsResponse, error) {+ out := new(ListUserGroupsResponse)+ err := c.cc.Invoke(ctx, UserGroupService_ListUserGroups_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *userGroupServiceClient) CreateUserGroup(ctx context.Context, in *CreateUserGroupRequest, opts ...grpc.CallOption) (*UserGroup, error) {+ out := new(UserGroup)+ err := c.cc.Invoke(ctx, UserGroupService_CreateUserGroup_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *userGroupServiceClient) UpdateUserGroup(ctx context.Context, in *UpdateUserGroupRequest, opts ...grpc.CallOption) (*UserGroup, error) {+ out := new(UserGroup)+ err := c.cc.Invoke(ctx, UserGroupService_UpdateUserGroup_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *userGroupServiceClient) DeleteUserGroup(ctx context.Context, in *DeleteUserGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {+ out := new(emptypb.Empty)+ err := c.cc.Invoke(ctx, UserGroupService_DeleteUserGroup_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++// UserGroupServiceServer is the server API for UserGroupService service.+// All implementations must embed UnimplementedUserGroupServiceServer+// for forward compatibility+type UserGroupServiceServer interface {+ GetUserGroup(context.Context, *GetUserGroupRequest) (*UserGroup, error)+ ListUserGroups(context.Context, *ListUserGroupsRequest) (*ListUserGroupsResponse, error)+ CreateUserGroup(context.Context, *CreateUserGroupRequest) (*UserGroup, error)+ UpdateUserGroup(context.Context, *UpdateUserGroupRequest) (*UserGroup, error)+ DeleteUserGroup(context.Context, *DeleteUserGroupRequest) (*emptypb.Empty, error)+ mustEmbedUnimplementedUserGroupServiceServer()+}++// UnimplementedUserGroupServiceServer must be embedded to have forward compatible implementations.+type UnimplementedUserGroupServiceServer struct {+}++func (UnimplementedUserGroupServiceServer) GetUserGroup(context.Context, *GetUserGroupRequest) (*UserGroup, error) {+ return nil, status.Errorf(codes.Unimplemented, "method GetUserGroup not implemented")+}+func (UnimplementedUserGroupServiceServer) ListUserGroups(context.Context, *ListUserGroupsRequest) (*ListUserGroupsResponse, error) {+ return nil, status.Errorf(codes.Unimplemented, "method ListUserGroups not implemented")+}+func (UnimplementedUserGroupServiceServer) CreateUserGroup(context.Context, *CreateUserGroupRequest) (*UserGroup, error) {+ return nil, status.Errorf(codes.Unimplemented, "method CreateUserGroup not implemented")+}+func (UnimplementedUserGroupServiceServer) UpdateUserGroup(context.Context, *UpdateUserGroupRequest) (*UserGroup, error) {+ return nil, status.Errorf(codes.Unimplemented, "method UpdateUserGroup not implemented")+}+func (UnimplementedUserGroupServiceServer) DeleteUserGroup(context.Context, *DeleteUserGroupRequest) (*emptypb.Empty, error) {+ return nil, status.Errorf(codes.Unimplemented, "method DeleteUserGroup not implemented")+}+func (UnimplementedUserGroupServiceServer) mustEmbedUnimplementedUserGroupServiceServer() {}++// UnsafeUserGroupServiceServer may be embedded to opt out of forward compatibility for this service.+// Use of this interface is not recommended, as added methods to UserGroupServiceServer will+// result in compilation errors.+type UnsafeUserGroupServiceServer interface {+ mustEmbedUnimplementedUserGroupServiceServer()+}++func RegisterUserGroupServiceServer(s grpc.ServiceRegistrar, srv UserGroupServiceServer) {+ s.RegisterService(&UserGroupService_ServiceDesc, srv)+}++func _UserGroupService_GetUserGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(GetUserGroupRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(UserGroupServiceServer).GetUserGroup(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: UserGroupService_GetUserGroup_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(UserGroupServiceServer).GetUserGroup(ctx, req.(*GetUserGroupRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _UserGroupService_ListUserGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(ListUserGroupsRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(UserGroupServiceServer).ListUserGroups(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: UserGroupService_ListUserGroups_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(UserGroupServiceServer).ListUserGroups(ctx, req.(*ListUserGroupsRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _UserGroupService_CreateUserGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(CreateUserGroupRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(UserGroupServiceServer).CreateUserGroup(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: UserGroupService_CreateUserGroup_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(UserGroupServiceServer).CreateUserGroup(ctx, req.(*CreateUserGroupRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _UserGroupService_UpdateUserGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(UpdateUserGroupRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(UserGroupServiceServer).UpdateUserGroup(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: UserGroupService_UpdateUserGroup_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(UserGroupServiceServer).UpdateUserGroup(ctx, req.(*UpdateUserGroupRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _UserGroupService_DeleteUserGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(DeleteUserGroupRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(UserGroupServiceServer).DeleteUserGroup(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: UserGroupService_DeleteUserGroup_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(UserGroupServiceServer).DeleteUserGroup(ctx, req.(*DeleteUserGroupRequest))+ }+ return interceptor(ctx, in, info, handler)+}++// UserGroupService_ServiceDesc is the grpc.ServiceDesc for UserGroupService service.+// It's only intended for direct use with grpc.RegisterService,+// and not to be introspected or modified (even as a copy)+var UserGroupService_ServiceDesc = grpc.ServiceDesc{+ ServiceName: "bytebase.v1.UserGroupService",+ HandlerType: (*UserGroupServiceServer)(nil),+ Methods: []grpc.MethodDesc{+ {+ MethodName: "GetUserGroup",+ Handler: _UserGroupService_GetUserGroup_Handler,+ },+ {+ MethodName: "ListUserGroups",+ Handler: _UserGroupService_ListUserGroups_Handler,+ },+ {+ MethodName: "CreateUserGroup",+ Handler: _UserGroupService_CreateUserGroup_Handler,+ },+ {+ MethodName: "UpdateUserGroup",+ Handler: _UserGroupService_UpdateUserGroup_Handler,+ },+ {+ MethodName: "DeleteUserGroup",+ Handler: _UserGroupService_DeleteUserGroup_Handler,+ },+ },+ Streams: []grpc.StreamDesc{},+ Metadata: "v1/user_group.proto",+}diff --git a/proto/store/user_group.proto b/proto/store/user_group.protonew file mode 100644index 0000000000..2d7eabf52e--- /dev/null+++ b/proto/store/user_group.proto@@ -0,0 +1,24 @@+syntax = "proto3";++package bytebase.store;++option go_package = "generated-go/store";++message UserGroupMember {+ // Member is the principal who belong to this user group.+ //+ // Format: users/{userUID}.+ string member = 1;++ enum Role {+ ROLE_UNSPECIFIED = 0;+ OWNER = 1;+ MEMBER = 2;+ }++ Role role = 2;+}++message UserGroupPayload {+ repeated UserGroupMember members = 1;+}diff --git a/proto/v1/user_group.proto b/proto/v1/user_group.protonew file mode 100644index 0000000000..7e1216d692--- /dev/null+++ b/proto/v1/user_group.proto@@ -0,0 +1,127 @@+syntax = "proto3";++package bytebase.v1;++import "google/api/annotations.proto";+import "google/api/client.proto";+import "google/api/field_behavior.proto";+import "google/protobuf/empty.proto";+import "google/protobuf/field_mask.proto";++option go_package = "generated-go/v1";++service UserGroupService {+ rpc GetUserGroup(GetUserGroupRequest) returns (UserGroup) {+ option (google.api.http) = {get: "/v1/{name=groups/*}"};+ option (google.api.method_signature) = "name";+ }++ rpc ListUserGroups(ListUserGroupsRequest) returns (ListUserGroupsResponse) {+ option (google.api.http) = {get: "/v1/groups"};+ option (google.api.method_signature) = "";+ }++ rpc CreateUserGroup(CreateUserGroupRequest) returns (UserGroup) {+ option (google.api.http) = {+ post: "/v1/groups"+ body: "group"+ };+ option (google.api.method_signature) = "group";+ }++ rpc UpdateUserGroup(UpdateUserGroupRequest) returns (UserGroup) {+ option (google.api.http) = {+ patch: "/v1/{group.name=groups/*}"+ body: "group"+ };+ option (google.api.method_signature) = "group,update_mask";+ }++ rpc DeleteUserGroup(DeleteUserGroupRequest) returns (google.protobuf.Empty) {+ option (google.api.http) = {delete: "/v1/{name=groups/*}"};+ option (google.api.method_signature) = "name";+ }+}++message GetUserGroupRequest {+ // The name of the group to retrieve.+ // Format: groups/{email}+ string name = 1 [(google.api.field_behavior) = REQUIRED];+}++message ListUserGroupsRequest {+ // The maximum number of groups to return. The service may return fewer than+ // this value.+ // If unspecified, at most 50 groups will be returned.+ // The maximum value is 1000; values above 1000 will be coerced to 1000.+ int32 page_size = 1;++ // A page token, received from a previous `ListUsers` call.+ // Provide this to retrieve the subsequent page.+ //+ // When paginating, all other parameters provided to `ListUsers` must match+ // the call that provided the page token.+ string page_token = 2;+}++message ListUserGroupsResponse {+ // The groups from the specified request.+ repeated UserGroup groups = 1;++ // A token, which can be sent as `page_token` to retrieve the next page.+ // If this field is omitted, there are no subsequent pages.+ string next_page_token = 2;+}++message CreateUserGroupRequest {+ // The group to create.+ UserGroup group = 1 [(google.api.field_behavior) = REQUIRED];+}++message UpdateUserGroupRequest {+ // The group to update.+ //+ // The group's `name` field is used to identify the group to update.+ // Format: groups/{email}+ UserGroup group = 1 [(google.api.field_behavior) = REQUIRED];++ // The list of fields to update.+ google.protobuf.FieldMask update_mask = 2;+}++message DeleteUserGroupRequest {+ // The name of the group to delete.+ // Format: groups/{email}+ string name = 1 [(google.api.field_behavior) = REQUIRED];+}++message UserGroupMember {+ // Member is the principal who belong to this user group.+ //+ // Format: users/[email protected]+ string member = 1;++ enum Role {+ ROLE_UNSPECIFIED = 0;+ OWNER = 1;+ MEMBER = 2;+ }++ Role role = 2;+}++message UserGroup {+ // The name of the group to retrieve.+ // Format: groups/{email}+ string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];++ string title = 2;++ string description = 3;++ // The name for the creator.+ // Format: users/[email protected]+ string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY];++ repeated UserGroupMember members = 5;+}