From 4f0a8cdc0ae7d94a12c3962a1a4d07c49af442f1 Mon Sep 17 00:00:00 2001 From: steven Date: Mon, 4 Sep 2023 23:41:41 +0800 Subject: [PATCH] chore: implement i18n setting --- api/v2/user_service.go | 28 + api/v2/user_setting_service.go | 8 +- .../types/proto/api/v2/user_service_pb.d.ts | 58 ++ .../src/types/proto/api/v2/user_service_pb.js | 22 + .../proto/api/v2/user_setting_service_pb.d.ts | 8 +- .../proto/api/v2/user_setting_service_pb.js | 4 +- frontend/locales/en.json | 5 +- frontend/locales/zh.json | 5 +- .../components/setting/PreferenceSection.tsx | 58 ++ frontend/web/src/i18n.ts | 4 + frontend/web/src/layouts/Root.tsx | 9 +- frontend/web/src/locales/en.json | 38 -- frontend/web/src/locales/zh.json | 38 -- frontend/web/src/pages/Setting.tsx | 2 + frontend/web/src/stores/v1/user.ts | 20 +- .../types/proto/api/v2/user_service_pb.d.ts | 58 ++ .../src/types/proto/api/v2/user_service_pb.js | 22 + .../proto/api/v2/user_setting_service_pb.d.ts | 8 +- .../proto/api/v2/user_setting_service_pb.js | 4 +- proto/api/v2/user_service.proto | 19 + proto/api/v2/user_setting_service.proto | 7 +- proto/gen/api/v2/README.md | 37 +- proto/gen/api/v2/user_service.pb.go | 538 +++++++++++------- proto/gen/api/v2/user_service.pb.gw.go | 137 +++++ proto/gen/api/v2/user_service_grpc.pb.go | 37 ++ proto/gen/api/v2/user_setting_service.pb.go | 159 +++--- .../gen/api/v2/user_setting_service.pb.gw.go | 4 +- 27 files changed, 957 insertions(+), 380 deletions(-) create mode 100644 frontend/web/src/components/setting/PreferenceSection.tsx delete mode 100644 frontend/web/src/locales/en.json delete mode 100644 frontend/web/src/locales/zh.json diff --git a/api/v2/user_service.go b/api/v2/user_service.go index b4ac439..5f6c032 100644 --- a/api/v2/user_service.go +++ b/api/v2/user_service.go @@ -86,6 +86,34 @@ func (s *UserService) CreateUser(ctx context.Context, request *apiv2pb.CreateUse return response, nil } +func (s *UserService) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUserRequest) (*apiv2pb.UpdateUserResponse, error) { + userID := ctx.Value(UserIDContextKey).(int32) + if userID != request.User.Id { + return nil, status.Errorf(codes.PermissionDenied, "Permission denied") + } + if request.UpdateMask == nil || len(request.UpdateMask) == 0 { + return nil, status.Errorf(codes.InvalidArgument, "UpdateMask is empty") + } + + userUpdate := &store.UpdateUser{ + ID: request.User.Id, + } + for _, path := range request.UpdateMask { + if path == "email" { + userUpdate.Email = &request.User.Email + } else if path == "nickname" { + userUpdate.Nickname = &request.User.Nickname + } + } + user, err := s.Store.UpdateUser(ctx, userUpdate) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to update user: %v", err) + } + return &apiv2pb.UpdateUserResponse{ + User: convertUserFromStore(user), + }, nil +} + func (s *UserService) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUserRequest) (*apiv2pb.DeleteUserResponse, error) { userID := ctx.Value(UserIDContextKey).(int32) if userID == request.Id { diff --git a/api/v2/user_setting_service.go b/api/v2/user_setting_service.go index 0054ee1..349aa71 100644 --- a/api/v2/user_setting_service.go +++ b/api/v2/user_setting_service.go @@ -35,12 +35,12 @@ func (s *UserSettingService) GetUserSetting(ctx context.Context, request *apiv2p } func (s *UserSettingService) UpdateUserSetting(ctx context.Context, request *apiv2pb.UpdateUserSettingRequest) (*apiv2pb.UpdateUserSettingResponse, error) { - if len(request.UpdateMask.Paths) == 0 { + if request.UpdateMask == nil || len(request.UpdateMask) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is empty") } userID := ctx.Value(UserIDContextKey).(int32) - for _, path := range request.UpdateMask.Paths { + for _, path := range request.UpdateMask { if path == "locale" { if _, err := s.Store.UpsertUserSetting(ctx, &storepb.UserSetting{ UserId: userID, @@ -73,7 +73,9 @@ func getUserSetting(ctx context.Context, s *store.Store, userID int32) (*apiv2pb return nil, errors.Wrap(err, "failed to find user setting") } - userSetting := &apiv2pb.UserSetting{} + userSetting := &apiv2pb.UserSetting{ + Id: userID, + } for _, setting := range userSettings { if setting.Key == storepb.UserSettingKey_USER_SETTING_LOCALE { userSetting.Locale = convertUserSettingLocaleFromStore(setting.GetLocale()) diff --git a/frontend/extension/src/types/proto/api/v2/user_service_pb.d.ts b/frontend/extension/src/types/proto/api/v2/user_service_pb.d.ts index 0665347..e607c14 100644 --- a/frontend/extension/src/types/proto/api/v2/user_service_pb.d.ts +++ b/frontend/extension/src/types/proto/api/v2/user_service_pb.d.ts @@ -225,6 +225,64 @@ export declare class CreateUserResponse extends Message { static equals(a: CreateUserResponse | PlainMessage | undefined, b: CreateUserResponse | PlainMessage | undefined): boolean; } +/** + * @generated from message slash.api.v2.UpdateUserRequest + */ +export declare class UpdateUserRequest extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * @generated from field: slash.api.v2.User user = 2; + */ + user?: User; + + /** + * @generated from field: repeated string update_mask = 3; + */ + updateMask: string[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.UpdateUserRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateUserRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateUserRequest; + + static fromJsonString(jsonString: string, options?: Partial): UpdateUserRequest; + + static equals(a: UpdateUserRequest | PlainMessage | undefined, b: UpdateUserRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.api.v2.UpdateUserResponse + */ +export declare class UpdateUserResponse extends Message { + /** + * @generated from field: slash.api.v2.User user = 1; + */ + user?: User; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.UpdateUserResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateUserResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateUserResponse; + + static fromJsonString(jsonString: string, options?: Partial): UpdateUserResponse; + + static equals(a: UpdateUserResponse | PlainMessage | undefined, b: UpdateUserResponse | PlainMessage | undefined): boolean; +} + /** * @generated from message slash.api.v2.DeleteUserRequest */ diff --git a/frontend/extension/src/types/proto/api/v2/user_service_pb.js b/frontend/extension/src/types/proto/api/v2/user_service_pb.js index 767e9bc..55a6495 100644 --- a/frontend/extension/src/types/proto/api/v2/user_service_pb.js +++ b/frontend/extension/src/types/proto/api/v2/user_service_pb.js @@ -93,6 +93,28 @@ export const CreateUserResponse = proto3.makeMessageType( ], ); +/** + * @generated from message slash.api.v2.UpdateUserRequest + */ +export const UpdateUserRequest = proto3.makeMessageType( + "slash.api.v2.UpdateUserRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "user", kind: "message", T: User }, + { no: 3, name: "update_mask", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ], +); + +/** + * @generated from message slash.api.v2.UpdateUserResponse + */ +export const UpdateUserResponse = proto3.makeMessageType( + "slash.api.v2.UpdateUserResponse", + () => [ + { no: 1, name: "user", kind: "message", T: User }, + ], +); + /** * @generated from message slash.api.v2.DeleteUserRequest */ diff --git a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts index 4f537af..d9273f9 100644 --- a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts +++ b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, FieldMask, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -128,11 +128,11 @@ export declare class UpdateUserSettingRequest extends Message); diff --git a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js index 28cb97a..6b27e1c 100644 --- a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js +++ b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import { FieldMask, proto3 } from "@bufbuild/protobuf"; +import { proto3 } from "@bufbuild/protobuf"; /** * @generated from message slash.api.v2.UserSetting @@ -56,7 +56,7 @@ export const UpdateUserSettingRequest = proto3.makeMessageType( () => [ { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "user_setting", kind: "message", T: UserSetting }, - { no: 3, name: "update_mask", kind: "message", T: FieldMask }, + { no: 3, name: "update_mask", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ], ); diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 8342f9b..c45d713 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -7,7 +7,8 @@ "create": "Create", "download": "Download", "edit": "Edit", - "delete": "Delete" + "delete": "Delete", + "language": "Language" }, "analytics": { "self": "Analytics", @@ -35,4 +36,4 @@ } } } -} +} \ No newline at end of file diff --git a/frontend/locales/zh.json b/frontend/locales/zh.json index 87f58d4..17e310f 100644 --- a/frontend/locales/zh.json +++ b/frontend/locales/zh.json @@ -7,7 +7,8 @@ "create": "创建", "download": "下载", "edit": "编辑", - "delete": "删除" + "delete": "删除", + "language": "语言" }, "analytics": { "self": "分析", @@ -35,4 +36,4 @@ } } } -} +} \ No newline at end of file diff --git a/frontend/web/src/components/setting/PreferenceSection.tsx b/frontend/web/src/components/setting/PreferenceSection.tsx new file mode 100644 index 0000000..7232ddb --- /dev/null +++ b/frontend/web/src/components/setting/PreferenceSection.tsx @@ -0,0 +1,58 @@ +import { Option, Select } from "@mui/joy"; +import { useTranslation } from "react-i18next"; +import { UserSetting, UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service_pb"; +import useUserStore from "../../stores/v1/user"; + +const PreferenceSection: React.FC = () => { + const { t } = useTranslation(); + const userStore = useUserStore(); + const userSetting = userStore.getCurrentUserSetting(); + const language = userSetting.locale || UserSetting_Locale.EN; + + const languageOptions = [ + { + value: "LOCALE_EN", + label: "English", + }, + { + value: "LOCALE_ZH", + label: "中文", + }, + ]; + + const handleSelectLanguage = async (locale: UserSetting_Locale) => { + if (!locale) { + return; + } + + await userStore.updateUserSetting( + { + ...userSetting, + locale: locale, + } as UserSetting, + ["locale"] + ); + }; + + return ( + <> +
+

Preference

+
+ {t("common.language")} + +
+
+ + ); +}; + +export default PreferenceSection; diff --git a/frontend/web/src/i18n.ts b/frontend/web/src/i18n.ts index 435dbc9..ce58517 100644 --- a/frontend/web/src/i18n.ts +++ b/frontend/web/src/i18n.ts @@ -1,12 +1,16 @@ import i18n from "i18next"; import { initReactI18next } from "react-i18next"; import en from "../../locales/en.json"; +import zh from "../../locales/zh.json"; i18n.use(initReactI18next).init({ resources: { en: { translation: en, }, + zh: { + translation: zh, + }, }, lng: "en", fallbackLng: "en", diff --git a/frontend/web/src/layouts/Root.tsx b/frontend/web/src/layouts/Root.tsx index 4df7068..2b47993 100644 --- a/frontend/web/src/layouts/Root.tsx +++ b/frontend/web/src/layouts/Root.tsx @@ -1,7 +1,7 @@ +import { isEqual } from "lodash-es"; import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { Outlet, useNavigate } from "react-router-dom"; -import { UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service_pb"; import Header from "../components/Header"; import useUserStore from "../stores/v1/user"; @@ -11,6 +11,7 @@ const Root: React.FC = () => { const userStore = useUserStore(); const currentUser = userStore.getCurrentUser(); const currentUserSetting = userStore.getCurrentUserSetting(); + const isInitialized = Boolean(currentUser) && Boolean(currentUserSetting); useEffect(() => { if (!currentUser) { @@ -29,16 +30,16 @@ const Root: React.FC = () => { return; } - if (currentUserSetting.locale === UserSetting_Locale.EN) { + if (isEqual(currentUserSetting.locale, "LOCALE_EN")) { i18n.changeLanguage("en"); - } else if (currentUserSetting.locale === UserSetting_Locale.ZH) { + } else if (isEqual(currentUserSetting.locale, "LOCALE_ZH")) { i18n.changeLanguage("zh"); } }, [currentUserSetting]); return ( <> - {currentUser && ( + {isInitialized && (
diff --git a/frontend/web/src/locales/en.json b/frontend/web/src/locales/en.json deleted file mode 100644 index 8342f9b..0000000 --- a/frontend/web/src/locales/en.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "common": { - "about": "About", - "loading": "Loading", - "cancel": "Cancel", - "save": "Save", - "create": "Create", - "download": "Download", - "edit": "Edit", - "delete": "Delete" - }, - "analytics": { - "self": "Analytics", - "top-sources": "Top sources", - "source": "Source", - "visitors": "Visitors", - "devices": "Devices", - "browser": "Browser", - "browsers": "Browsers", - "operating-system": "Operating System" - }, - "shortcut": { - "visibility": { - "private": { - "self": "Private", - "description": "Only you can access" - }, - "workspace": { - "self": "Workspace", - "description": "Workspace members can access" - }, - "public": { - "self": "Public", - "description": "Visible to everyone on the internet" - } - } - } -} diff --git a/frontend/web/src/locales/zh.json b/frontend/web/src/locales/zh.json deleted file mode 100644 index 87f58d4..0000000 --- a/frontend/web/src/locales/zh.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "common": { - "about": "关于", - "loading": "加载中", - "cancel": "取消", - "save": "保存", - "create": "创建", - "download": "下载", - "edit": "编辑", - "delete": "删除" - }, - "analytics": { - "self": "分析", - "top-sources": "热门来源", - "source": "来源", - "visitors": "访客数", - "devices": "设备", - "browser": "浏览器", - "browsers": "浏览器", - "operating-system": "操作系统" - }, - "shortcut": { - "visibility": { - "private": { - "self": "私有的", - "description": "仅您可以访问" - }, - "workspace": { - "self": "工作区", - "description": "工作区成员可以访问" - }, - "public": { - "self": "公开的", - "description": "对任何人可见" - } - } - } -} diff --git a/frontend/web/src/pages/Setting.tsx b/frontend/web/src/pages/Setting.tsx index 69e90fd..3392bc6 100644 --- a/frontend/web/src/pages/Setting.tsx +++ b/frontend/web/src/pages/Setting.tsx @@ -1,3 +1,4 @@ +import PreferenceSection from "@/components/setting/PreferenceSection"; import AccessTokenSection from "../components/setting/AccessTokenSection"; import AccountSection from "../components/setting/AccountSection"; import MemberSection from "../components/setting/MemberSection"; @@ -12,6 +13,7 @@ const Setting: React.FC = () => {
+ {isAdmin && ( <> diff --git a/frontend/web/src/stores/v1/user.ts b/frontend/web/src/stores/v1/user.ts index 41e6f6d..2aecd81 100644 --- a/frontend/web/src/stores/v1/user.ts +++ b/frontend/web/src/stores/v1/user.ts @@ -1,6 +1,6 @@ import axios from "axios"; import { create } from "zustand"; -import { GetUserSettingResponse, UserSetting } from "@/types/proto/api/v2/user_setting_service_pb"; +import { GetUserSettingResponse, UpdateUserSettingResponse, UserSetting } from "@/types/proto/api/v2/user_setting_service_pb"; import * as api from "../../helpers/api"; const convertResponseModelUser = (user: User): User => { @@ -28,6 +28,7 @@ interface UserState { // User setting related actions. fetchUserSetting: (userId: UserId) => Promise; + updateUserSetting: (userSetting: UserSetting, updateMask: string[]) => Promise; getCurrentUserSetting: () => UserSetting; } @@ -105,6 +106,23 @@ const useUserStore = create()((set, get) => ({ set(userSettingMap); return userSetting; }, + updateUserSetting: async (userSetting: UserSetting, updateMask: string[]) => { + const userId = userSetting.id; + const { + data: { userSetting: updatedUserSetting }, + } = await axios.post(`api/v2/users/${userId}/settings`, { + id: userId, + userSetting, + updateMask, + }); + if (!updatedUserSetting) { + throw new Error(`User setting not found for user ${userId}`); + } + const userSettingMap = get().userSettingMapById; + userSettingMap[userId] = updatedUserSetting; + set(userSettingMap); + return updatedUserSetting; + }, getCurrentUserSetting: () => { const userSettingMap = get().userSettingMapById; const currentUserId = get().currentUserId; diff --git a/frontend/web/src/types/proto/api/v2/user_service_pb.d.ts b/frontend/web/src/types/proto/api/v2/user_service_pb.d.ts index 0665347..e607c14 100644 --- a/frontend/web/src/types/proto/api/v2/user_service_pb.d.ts +++ b/frontend/web/src/types/proto/api/v2/user_service_pb.d.ts @@ -225,6 +225,64 @@ export declare class CreateUserResponse extends Message { static equals(a: CreateUserResponse | PlainMessage | undefined, b: CreateUserResponse | PlainMessage | undefined): boolean; } +/** + * @generated from message slash.api.v2.UpdateUserRequest + */ +export declare class UpdateUserRequest extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * @generated from field: slash.api.v2.User user = 2; + */ + user?: User; + + /** + * @generated from field: repeated string update_mask = 3; + */ + updateMask: string[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.UpdateUserRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateUserRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateUserRequest; + + static fromJsonString(jsonString: string, options?: Partial): UpdateUserRequest; + + static equals(a: UpdateUserRequest | PlainMessage | undefined, b: UpdateUserRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.api.v2.UpdateUserResponse + */ +export declare class UpdateUserResponse extends Message { + /** + * @generated from field: slash.api.v2.User user = 1; + */ + user?: User; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.UpdateUserResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateUserResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateUserResponse; + + static fromJsonString(jsonString: string, options?: Partial): UpdateUserResponse; + + static equals(a: UpdateUserResponse | PlainMessage | undefined, b: UpdateUserResponse | PlainMessage | undefined): boolean; +} + /** * @generated from message slash.api.v2.DeleteUserRequest */ diff --git a/frontend/web/src/types/proto/api/v2/user_service_pb.js b/frontend/web/src/types/proto/api/v2/user_service_pb.js index 767e9bc..55a6495 100644 --- a/frontend/web/src/types/proto/api/v2/user_service_pb.js +++ b/frontend/web/src/types/proto/api/v2/user_service_pb.js @@ -93,6 +93,28 @@ export const CreateUserResponse = proto3.makeMessageType( ], ); +/** + * @generated from message slash.api.v2.UpdateUserRequest + */ +export const UpdateUserRequest = proto3.makeMessageType( + "slash.api.v2.UpdateUserRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "user", kind: "message", T: User }, + { no: 3, name: "update_mask", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ], +); + +/** + * @generated from message slash.api.v2.UpdateUserResponse + */ +export const UpdateUserResponse = proto3.makeMessageType( + "slash.api.v2.UpdateUserResponse", + () => [ + { no: 1, name: "user", kind: "message", T: User }, + ], +); + /** * @generated from message slash.api.v2.DeleteUserRequest */ diff --git a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts index 4f537af..d9273f9 100644 --- a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts +++ b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import type { BinaryReadOptions, FieldList, FieldMask, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; /** @@ -128,11 +128,11 @@ export declare class UpdateUserSettingRequest extends Message); diff --git a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js index 28cb97a..6b27e1c 100644 --- a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js +++ b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js @@ -3,7 +3,7 @@ /* eslint-disable */ // @ts-nocheck -import { FieldMask, proto3 } from "@bufbuild/protobuf"; +import { proto3 } from "@bufbuild/protobuf"; /** * @generated from message slash.api.v2.UserSetting @@ -56,7 +56,7 @@ export const UpdateUserSettingRequest = proto3.makeMessageType( () => [ { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "user_setting", kind: "message", T: UserSetting }, - { no: 3, name: "update_mask", kind: "message", T: FieldMask }, + { no: 3, name: "update_mask", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, ], ); diff --git a/proto/api/v2/user_service.proto b/proto/api/v2/user_service.proto index eeb1da8..c989985 100644 --- a/proto/api/v2/user_service.proto +++ b/proto/api/v2/user_service.proto @@ -26,6 +26,13 @@ service UserService { body: "user" }; } + rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) { + option (google.api.http) = { + put: "/api/v2/users/{id}" + body: "user" + }; + option (google.api.method_signature) = "id"; + } // DeleteUser deletes a user by id. rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) { option (google.api.http) = {delete: "/api/v2/users/{id}"}; @@ -99,6 +106,18 @@ message CreateUserResponse { User user = 1; } +message UpdateUserRequest { + int32 id = 1; + + User user = 2; + + repeated string update_mask = 3; +} + +message UpdateUserResponse { + User user = 1; +} + message DeleteUserRequest { int32 id = 1; } diff --git a/proto/api/v2/user_setting_service.proto b/proto/api/v2/user_setting_service.proto index 38981d0..4acd97d 100644 --- a/proto/api/v2/user_setting_service.proto +++ b/proto/api/v2/user_setting_service.proto @@ -4,7 +4,6 @@ package slash.api.v2; import "google/api/annotations.proto"; import "google/api/client.proto"; -import "google/protobuf/field_mask.proto"; option go_package = "gen/api/v2"; @@ -17,7 +16,7 @@ service UserSettingService { // UpdateUserSetting updates the user setting. rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) { option (google.api.http) = { - put: "/api/v2/users/{id}/settings" + post: "/api/v2/users/{id}/settings" body: "*" }; option (google.api.method_signature) = "id"; @@ -53,8 +52,8 @@ message UpdateUserSettingRequest { // user_setting is the user setting to update. UserSetting user_setting = 2; - // update_mask is the field mask to update the user setting. - google.protobuf.FieldMask update_mask = 3; + // update_mask is the field mask to update. + repeated string update_mask = 3; } message UpdateUserSettingResponse { diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index 5ebd037..b609705 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -37,6 +37,8 @@ - [ListUserAccessTokensResponse](#slash-api-v2-ListUserAccessTokensResponse) - [ListUsersRequest](#slash-api-v2-ListUsersRequest) - [ListUsersResponse](#slash-api-v2-ListUsersResponse) + - [UpdateUserRequest](#slash-api-v2-UpdateUserRequest) + - [UpdateUserResponse](#slash-api-v2-UpdateUserResponse) - [User](#slash-api-v2-User) - [UserAccessToken](#slash-api-v2-UserAccessToken) @@ -488,6 +490,38 @@ + + +### UpdateUserRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [int32](#int32) | | | +| user | [User](#slash-api-v2-User) | | | +| update_mask | [string](#string) | repeated | | + + + + + + + + +### UpdateUserResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| user | [User](#slash-api-v2-User) | | | + + + + + + ### User @@ -557,6 +591,7 @@ | ListUsers | [ListUsersRequest](#slash-api-v2-ListUsersRequest) | [ListUsersResponse](#slash-api-v2-ListUsersResponse) | ListUsers returns a list of users. | | GetUser | [GetUserRequest](#slash-api-v2-GetUserRequest) | [GetUserResponse](#slash-api-v2-GetUserResponse) | GetUser returns a user by id. | | CreateUser | [CreateUserRequest](#slash-api-v2-CreateUserRequest) | [CreateUserResponse](#slash-api-v2-CreateUserResponse) | CreateUser creates a new user. | +| UpdateUser | [UpdateUserRequest](#slash-api-v2-UpdateUserRequest) | [UpdateUserResponse](#slash-api-v2-UpdateUserResponse) | | | DeleteUser | [DeleteUserRequest](#slash-api-v2-DeleteUserRequest) | [DeleteUserResponse](#slash-api-v2-DeleteUserResponse) | DeleteUser deletes a user by id. | | ListUserAccessTokens | [ListUserAccessTokensRequest](#slash-api-v2-ListUserAccessTokensRequest) | [ListUserAccessTokensResponse](#slash-api-v2-ListUserAccessTokensResponse) | ListUserAccessTokens returns a list of access tokens for a user. | | CreateUserAccessToken | [CreateUserAccessTokenRequest](#slash-api-v2-CreateUserAccessTokenRequest) | [CreateUserAccessTokenResponse](#slash-api-v2-CreateUserAccessTokenResponse) | CreateUserAccessToken creates a new access token for a user. | @@ -613,7 +648,7 @@ | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | id is the user id. | | user_setting | [UserSetting](#slash-api-v2-UserSetting) | | user_setting is the user setting to update. | -| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | update_mask is the field mask to update the user setting. | +| update_mask | [string](#string) | repeated | update_mask is the field mask to update. | diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index b75091b..d52c25f 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -447,6 +447,116 @@ func (x *CreateUserResponse) GetUser() *User { return nil } +type UpdateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + UpdateMask []string `protobuf:"bytes,3,rep,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_user_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_user_service_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 UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateUserRequest) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateUserRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *UpdateUserRequest) GetUpdateMask() []string { + if x != nil { + return x.UpdateMask + } + return nil +} + +type UpdateUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *UpdateUserResponse) Reset() { + *x = UpdateUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_user_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserResponse) ProtoMessage() {} + +func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_user_service_proto_msgTypes[8] + 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 UpdateUserResponse.ProtoReflect.Descriptor instead. +func (*UpdateUserResponse) Descriptor() ([]byte, []int) { + return file_api_v2_user_service_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateUserResponse) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + type DeleteUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -458,7 +568,7 @@ type DeleteUserRequest struct { func (x *DeleteUserRequest) Reset() { *x = DeleteUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[7] + mi := &file_api_v2_user_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -471,7 +581,7 @@ func (x *DeleteUserRequest) String() string { func (*DeleteUserRequest) ProtoMessage() {} func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[7] + mi := &file_api_v2_user_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -484,7 +594,7 @@ func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. func (*DeleteUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} } func (x *DeleteUserRequest) GetId() int32 { @@ -503,7 +613,7 @@ type DeleteUserResponse struct { func (x *DeleteUserResponse) Reset() { *x = DeleteUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[8] + mi := &file_api_v2_user_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -516,7 +626,7 @@ func (x *DeleteUserResponse) String() string { func (*DeleteUserResponse) ProtoMessage() {} func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[8] + mi := &file_api_v2_user_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -529,7 +639,7 @@ func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. func (*DeleteUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{8} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{10} } type ListUserAccessTokensRequest struct { @@ -544,7 +654,7 @@ type ListUserAccessTokensRequest struct { func (x *ListUserAccessTokensRequest) Reset() { *x = ListUserAccessTokensRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[9] + mi := &file_api_v2_user_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -557,7 +667,7 @@ func (x *ListUserAccessTokensRequest) String() string { func (*ListUserAccessTokensRequest) ProtoMessage() {} func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[9] + mi := &file_api_v2_user_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -570,7 +680,7 @@ func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListUserAccessTokensRequest.ProtoReflect.Descriptor instead. func (*ListUserAccessTokensRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} } func (x *ListUserAccessTokensRequest) GetId() int32 { @@ -591,7 +701,7 @@ type ListUserAccessTokensResponse struct { func (x *ListUserAccessTokensResponse) Reset() { *x = ListUserAccessTokensResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[10] + mi := &file_api_v2_user_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -604,7 +714,7 @@ func (x *ListUserAccessTokensResponse) String() string { func (*ListUserAccessTokensResponse) ProtoMessage() {} func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[10] + mi := &file_api_v2_user_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -617,7 +727,7 @@ func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListUserAccessTokensResponse.ProtoReflect.Descriptor instead. func (*ListUserAccessTokensResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{10} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{12} } func (x *ListUserAccessTokensResponse) GetAccessTokens() []*UserAccessToken { @@ -640,7 +750,7 @@ type CreateUserAccessTokenRequest struct { func (x *CreateUserAccessTokenRequest) Reset() { *x = CreateUserAccessTokenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[11] + mi := &file_api_v2_user_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -653,7 +763,7 @@ func (x *CreateUserAccessTokenRequest) String() string { func (*CreateUserAccessTokenRequest) ProtoMessage() {} func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[11] + mi := &file_api_v2_user_service_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -666,7 +776,7 @@ func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserAccessTokenRequest.ProtoReflect.Descriptor instead. func (*CreateUserAccessTokenRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{13} } func (x *CreateUserAccessTokenRequest) GetId() int32 { @@ -694,7 +804,7 @@ type CreateUserAccessTokenResponse struct { func (x *CreateUserAccessTokenResponse) Reset() { *x = CreateUserAccessTokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[12] + mi := &file_api_v2_user_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -707,7 +817,7 @@ func (x *CreateUserAccessTokenResponse) String() string { func (*CreateUserAccessTokenResponse) ProtoMessage() {} func (x *CreateUserAccessTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[12] + mi := &file_api_v2_user_service_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -720,7 +830,7 @@ func (x *CreateUserAccessTokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserAccessTokenResponse.ProtoReflect.Descriptor instead. func (*CreateUserAccessTokenResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{12} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{14} } func (x *CreateUserAccessTokenResponse) GetAccessToken() *UserAccessToken { @@ -744,7 +854,7 @@ type DeleteUserAccessTokenRequest struct { func (x *DeleteUserAccessTokenRequest) Reset() { *x = DeleteUserAccessTokenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[13] + mi := &file_api_v2_user_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -757,7 +867,7 @@ func (x *DeleteUserAccessTokenRequest) String() string { func (*DeleteUserAccessTokenRequest) ProtoMessage() {} func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[13] + mi := &file_api_v2_user_service_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -770,7 +880,7 @@ func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserAccessTokenRequest.ProtoReflect.Descriptor instead. func (*DeleteUserAccessTokenRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{13} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{15} } func (x *DeleteUserAccessTokenRequest) GetId() int32 { @@ -796,7 +906,7 @@ type DeleteUserAccessTokenResponse struct { func (x *DeleteUserAccessTokenResponse) Reset() { *x = DeleteUserAccessTokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[14] + mi := &file_api_v2_user_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -809,7 +919,7 @@ func (x *DeleteUserAccessTokenResponse) String() string { func (*DeleteUserAccessTokenResponse) ProtoMessage() {} func (x *DeleteUserAccessTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[14] + mi := &file_api_v2_user_service_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -822,7 +932,7 @@ func (x *DeleteUserAccessTokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserAccessTokenResponse.ProtoReflect.Descriptor instead. func (*DeleteUserAccessTokenResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{14} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{16} } type UserAccessToken struct { @@ -839,7 +949,7 @@ type UserAccessToken struct { func (x *UserAccessToken) Reset() { *x = UserAccessToken{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[15] + mi := &file_api_v2_user_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -852,7 +962,7 @@ func (x *UserAccessToken) String() string { func (*UserAccessToken) ProtoMessage() {} func (x *UserAccessToken) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[15] + mi := &file_api_v2_user_service_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -865,7 +975,7 @@ func (x *UserAccessToken) ProtoReflect() protoreflect.Message { // Deprecated: Use UserAccessToken.ProtoReflect.Descriptor instead. func (*UserAccessToken) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{15} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{17} } func (x *UserAccessToken) GetAccessToken() string { @@ -943,129 +1053,147 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x6c, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2d, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x0a, + 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x1c, + 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x22, 0x79, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x62, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x42, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x79, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x49, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0f, - 0x75, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x61, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x40, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x51, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x37, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, - 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, - 0x73, 0x41, 0x74, 0x2a, 0x31, 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, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, - 0x55, 0x53, 0x45, 0x52, 0x10, 0x02, 0x32, 0xcd, 0x07, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x67, 0x0a, 0x07, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, - 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x6c, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, - 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x29, 0x2e, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, + 0x12, 0x49, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x72, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x61, 0x0a, 0x1d, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x51, + 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x69, + 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, + 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x2a, + 0x31, 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, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x02, 0x32, 0xc5, 0x08, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, + 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x67, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x12, 0x6c, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, + 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x76, + 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x25, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x1a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, + 0x73, 0x12, 0x29, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xb2, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x35, 0x3a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xbb, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0xda, 0x41, 0x02, 0x69, + 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xbb, 0x01, 0x0a, + 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, - 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, 0xda, 0x41, 0x0f, - 0x69, 0x64, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x2a, 0x2f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xa7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, - 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, - 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, - 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, - 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, - 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x49, 0xda, 0x41, 0x0f, 0x69, 0x64, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x2a, 0x2f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xa7, 0x01, 0x0a, 0x10, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, + 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, + 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, + 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, + 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1081,7 +1209,7 @@ func file_api_v2_user_service_proto_rawDescGZIP() []byte { } var file_api_v2_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_v2_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_api_v2_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_api_v2_user_service_proto_goTypes = []interface{}{ (Role)(0), // 0: slash.api.v2.Role (*User)(nil), // 1: slash.api.v2.User @@ -1091,49 +1219,55 @@ var file_api_v2_user_service_proto_goTypes = []interface{}{ (*GetUserResponse)(nil), // 5: slash.api.v2.GetUserResponse (*CreateUserRequest)(nil), // 6: slash.api.v2.CreateUserRequest (*CreateUserResponse)(nil), // 7: slash.api.v2.CreateUserResponse - (*DeleteUserRequest)(nil), // 8: slash.api.v2.DeleteUserRequest - (*DeleteUserResponse)(nil), // 9: slash.api.v2.DeleteUserResponse - (*ListUserAccessTokensRequest)(nil), // 10: slash.api.v2.ListUserAccessTokensRequest - (*ListUserAccessTokensResponse)(nil), // 11: slash.api.v2.ListUserAccessTokensResponse - (*CreateUserAccessTokenRequest)(nil), // 12: slash.api.v2.CreateUserAccessTokenRequest - (*CreateUserAccessTokenResponse)(nil), // 13: slash.api.v2.CreateUserAccessTokenResponse - (*DeleteUserAccessTokenRequest)(nil), // 14: slash.api.v2.DeleteUserAccessTokenRequest - (*DeleteUserAccessTokenResponse)(nil), // 15: slash.api.v2.DeleteUserAccessTokenResponse - (*UserAccessToken)(nil), // 16: slash.api.v2.UserAccessToken - (RowStatus)(0), // 17: slash.api.v2.RowStatus - (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp + (*UpdateUserRequest)(nil), // 8: slash.api.v2.UpdateUserRequest + (*UpdateUserResponse)(nil), // 9: slash.api.v2.UpdateUserResponse + (*DeleteUserRequest)(nil), // 10: slash.api.v2.DeleteUserRequest + (*DeleteUserResponse)(nil), // 11: slash.api.v2.DeleteUserResponse + (*ListUserAccessTokensRequest)(nil), // 12: slash.api.v2.ListUserAccessTokensRequest + (*ListUserAccessTokensResponse)(nil), // 13: slash.api.v2.ListUserAccessTokensResponse + (*CreateUserAccessTokenRequest)(nil), // 14: slash.api.v2.CreateUserAccessTokenRequest + (*CreateUserAccessTokenResponse)(nil), // 15: slash.api.v2.CreateUserAccessTokenResponse + (*DeleteUserAccessTokenRequest)(nil), // 16: slash.api.v2.DeleteUserAccessTokenRequest + (*DeleteUserAccessTokenResponse)(nil), // 17: slash.api.v2.DeleteUserAccessTokenResponse + (*UserAccessToken)(nil), // 18: slash.api.v2.UserAccessToken + (RowStatus)(0), // 19: slash.api.v2.RowStatus + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp } var file_api_v2_user_service_proto_depIdxs = []int32{ - 17, // 0: slash.api.v2.User.row_status:type_name -> slash.api.v2.RowStatus + 19, // 0: slash.api.v2.User.row_status:type_name -> slash.api.v2.RowStatus 0, // 1: slash.api.v2.User.role:type_name -> slash.api.v2.Role 1, // 2: slash.api.v2.ListUsersResponse.users:type_name -> slash.api.v2.User 1, // 3: slash.api.v2.GetUserResponse.user:type_name -> slash.api.v2.User 1, // 4: slash.api.v2.CreateUserRequest.user:type_name -> slash.api.v2.User 1, // 5: slash.api.v2.CreateUserResponse.user:type_name -> slash.api.v2.User - 16, // 6: slash.api.v2.ListUserAccessTokensResponse.access_tokens:type_name -> slash.api.v2.UserAccessToken - 16, // 7: slash.api.v2.CreateUserAccessTokenRequest.user_access_token:type_name -> slash.api.v2.UserAccessToken - 16, // 8: slash.api.v2.CreateUserAccessTokenResponse.access_token:type_name -> slash.api.v2.UserAccessToken - 18, // 9: slash.api.v2.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp - 18, // 10: slash.api.v2.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp - 2, // 11: slash.api.v2.UserService.ListUsers:input_type -> slash.api.v2.ListUsersRequest - 4, // 12: slash.api.v2.UserService.GetUser:input_type -> slash.api.v2.GetUserRequest - 6, // 13: slash.api.v2.UserService.CreateUser:input_type -> slash.api.v2.CreateUserRequest - 8, // 14: slash.api.v2.UserService.DeleteUser:input_type -> slash.api.v2.DeleteUserRequest - 10, // 15: slash.api.v2.UserService.ListUserAccessTokens:input_type -> slash.api.v2.ListUserAccessTokensRequest - 12, // 16: slash.api.v2.UserService.CreateUserAccessToken:input_type -> slash.api.v2.CreateUserAccessTokenRequest - 14, // 17: slash.api.v2.UserService.DeleteUserAccessToken:input_type -> slash.api.v2.DeleteUserAccessTokenRequest - 3, // 18: slash.api.v2.UserService.ListUsers:output_type -> slash.api.v2.ListUsersResponse - 5, // 19: slash.api.v2.UserService.GetUser:output_type -> slash.api.v2.GetUserResponse - 7, // 20: slash.api.v2.UserService.CreateUser:output_type -> slash.api.v2.CreateUserResponse - 9, // 21: slash.api.v2.UserService.DeleteUser:output_type -> slash.api.v2.DeleteUserResponse - 11, // 22: slash.api.v2.UserService.ListUserAccessTokens:output_type -> slash.api.v2.ListUserAccessTokensResponse - 13, // 23: slash.api.v2.UserService.CreateUserAccessToken:output_type -> slash.api.v2.CreateUserAccessTokenResponse - 15, // 24: slash.api.v2.UserService.DeleteUserAccessToken:output_type -> slash.api.v2.DeleteUserAccessTokenResponse - 18, // [18:25] is the sub-list for method output_type - 11, // [11:18] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 1, // 6: slash.api.v2.UpdateUserRequest.user:type_name -> slash.api.v2.User + 1, // 7: slash.api.v2.UpdateUserResponse.user:type_name -> slash.api.v2.User + 18, // 8: slash.api.v2.ListUserAccessTokensResponse.access_tokens:type_name -> slash.api.v2.UserAccessToken + 18, // 9: slash.api.v2.CreateUserAccessTokenRequest.user_access_token:type_name -> slash.api.v2.UserAccessToken + 18, // 10: slash.api.v2.CreateUserAccessTokenResponse.access_token:type_name -> slash.api.v2.UserAccessToken + 20, // 11: slash.api.v2.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp + 20, // 12: slash.api.v2.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp + 2, // 13: slash.api.v2.UserService.ListUsers:input_type -> slash.api.v2.ListUsersRequest + 4, // 14: slash.api.v2.UserService.GetUser:input_type -> slash.api.v2.GetUserRequest + 6, // 15: slash.api.v2.UserService.CreateUser:input_type -> slash.api.v2.CreateUserRequest + 8, // 16: slash.api.v2.UserService.UpdateUser:input_type -> slash.api.v2.UpdateUserRequest + 10, // 17: slash.api.v2.UserService.DeleteUser:input_type -> slash.api.v2.DeleteUserRequest + 12, // 18: slash.api.v2.UserService.ListUserAccessTokens:input_type -> slash.api.v2.ListUserAccessTokensRequest + 14, // 19: slash.api.v2.UserService.CreateUserAccessToken:input_type -> slash.api.v2.CreateUserAccessTokenRequest + 16, // 20: slash.api.v2.UserService.DeleteUserAccessToken:input_type -> slash.api.v2.DeleteUserAccessTokenRequest + 3, // 21: slash.api.v2.UserService.ListUsers:output_type -> slash.api.v2.ListUsersResponse + 5, // 22: slash.api.v2.UserService.GetUser:output_type -> slash.api.v2.GetUserResponse + 7, // 23: slash.api.v2.UserService.CreateUser:output_type -> slash.api.v2.CreateUserResponse + 9, // 24: slash.api.v2.UserService.UpdateUser:output_type -> slash.api.v2.UpdateUserResponse + 11, // 25: slash.api.v2.UserService.DeleteUser:output_type -> slash.api.v2.DeleteUserResponse + 13, // 26: slash.api.v2.UserService.ListUserAccessTokens:output_type -> slash.api.v2.ListUserAccessTokensResponse + 15, // 27: slash.api.v2.UserService.CreateUserAccessToken:output_type -> slash.api.v2.CreateUserAccessTokenResponse + 17, // 28: slash.api.v2.UserService.DeleteUserAccessToken:output_type -> slash.api.v2.DeleteUserAccessTokenResponse + 21, // [21:29] is the sub-list for method output_type + 13, // [13:21] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_api_v2_user_service_proto_init() } @@ -1228,7 +1362,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserRequest); i { + switch v := v.(*UpdateUserRequest); i { case 0: return &v.state case 1: @@ -1240,7 +1374,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserResponse); i { + switch v := v.(*UpdateUserResponse); i { case 0: return &v.state case 1: @@ -1252,7 +1386,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserAccessTokensRequest); i { + switch v := v.(*DeleteUserRequest); i { case 0: return &v.state case 1: @@ -1264,7 +1398,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserAccessTokensResponse); i { + switch v := v.(*DeleteUserResponse); i { case 0: return &v.state case 1: @@ -1276,7 +1410,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserAccessTokenRequest); i { + switch v := v.(*ListUserAccessTokensRequest); i { case 0: return &v.state case 1: @@ -1288,7 +1422,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserAccessTokenResponse); i { + switch v := v.(*ListUserAccessTokensResponse); i { case 0: return &v.state case 1: @@ -1300,7 +1434,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserAccessTokenRequest); i { + switch v := v.(*CreateUserAccessTokenRequest); i { case 0: return &v.state case 1: @@ -1312,7 +1446,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserAccessTokenResponse); i { + switch v := v.(*CreateUserAccessTokenResponse); i { case 0: return &v.state case 1: @@ -1324,6 +1458,30 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserAccessTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_user_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserAccessTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_user_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserAccessToken); i { case 0: return &v.state @@ -1342,7 +1500,7 @@ func file_api_v2_user_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v2_user_service_proto_rawDesc, NumEnums: 1, - NumMessages: 16, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/api/v2/user_service.pb.gw.go b/proto/gen/api/v2/user_service.pb.gw.go index 6605704..391cd5c 100644 --- a/proto/gen/api/v2/user_service.pb.gw.go +++ b/proto/gen/api/v2/user_service.pb.gw.go @@ -135,6 +135,92 @@ func local_request_UserService_CreateUser_0(ctx context.Context, marshaler runti } +var ( + filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "id": 1}, Base: []int{1, 2, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 2, 3, 3}} +) + +func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserRequest + 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.User); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserRequest + 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.User); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int32(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_UpdateUser_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUser(ctx, &protoReq) + return msg, metadata, err + +} + func request_UserService_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteUserRequest var metadata runtime.ServerMetadata @@ -460,6 +546,31 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("PUT", pattern_UserService_UpdateUser_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, "/slash.api.v2.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/users/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_UpdateUser_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_UserService_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("DELETE", pattern_UserService_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -667,6 +778,28 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("PUT", pattern_UserService_UpdateUser_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, "/slash.api.v2.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/users/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_UpdateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("DELETE", pattern_UserService_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -765,6 +898,8 @@ var ( pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "")) + pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "id"}, "")) + pattern_UserService_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "id"}, "")) pattern_UserService_ListUserAccessTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "access_tokens"}, "")) @@ -781,6 +916,8 @@ var ( forward_UserService_CreateUser_0 = runtime.ForwardResponseMessage + forward_UserService_UpdateUser_0 = runtime.ForwardResponseMessage + forward_UserService_DeleteUser_0 = runtime.ForwardResponseMessage forward_UserService_ListUserAccessTokens_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/user_service_grpc.pb.go b/proto/gen/api/v2/user_service_grpc.pb.go index 026f437..3d843d5 100644 --- a/proto/gen/api/v2/user_service_grpc.pb.go +++ b/proto/gen/api/v2/user_service_grpc.pb.go @@ -22,6 +22,7 @@ const ( UserService_ListUsers_FullMethodName = "/slash.api.v2.UserService/ListUsers" UserService_GetUser_FullMethodName = "/slash.api.v2.UserService/GetUser" UserService_CreateUser_FullMethodName = "/slash.api.v2.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/slash.api.v2.UserService/UpdateUser" UserService_DeleteUser_FullMethodName = "/slash.api.v2.UserService/DeleteUser" UserService_ListUserAccessTokens_FullMethodName = "/slash.api.v2.UserService/ListUserAccessTokens" UserService_CreateUserAccessToken_FullMethodName = "/slash.api.v2.UserService/CreateUserAccessToken" @@ -38,6 +39,7 @@ type UserServiceClient interface { GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) // CreateUser creates a new user. CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) // DeleteUser deletes a user by id. DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) // ListUserAccessTokens returns a list of access tokens for a user. @@ -83,6 +85,15 @@ func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserReques return out, nil } +func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) { + out := new(UpdateUserResponse) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) { out := new(DeleteUserResponse) err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...) @@ -129,6 +140,7 @@ type UserServiceServer interface { GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) // CreateUser creates a new user. CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) + UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) // DeleteUser deletes a user by id. DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) // ListUserAccessTokens returns a list of access tokens for a user. @@ -153,6 +165,9 @@ func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") } @@ -232,6 +247,24 @@ func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteUserRequest) if err := dec(in); err != nil { @@ -323,6 +356,10 @@ var UserService_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateUser", Handler: _UserService_CreateUser_Handler, }, + { + MethodName: "UpdateUser", + Handler: _UserService_UpdateUser_Handler, + }, { MethodName: "DeleteUser", Handler: _UserService_DeleteUser_Handler, diff --git a/proto/gen/api/v2/user_setting_service.pb.go b/proto/gen/api/v2/user_setting_service.pb.go index e2396fc..77b4323 100644 --- a/proto/gen/api/v2/user_setting_service.pb.go +++ b/proto/gen/api/v2/user_setting_service.pb.go @@ -10,7 +10,6 @@ import ( _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" reflect "reflect" sync "sync" ) @@ -232,8 +231,8 @@ type UpdateUserSettingRequest struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // user_setting is the user setting to update. UserSetting *UserSetting `protobuf:"bytes,2,opt,name=user_setting,json=userSetting,proto3" json:"user_setting,omitempty"` - // update_mask is the field mask to update the user setting. - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` + // update_mask is the field mask to update. + UpdateMask []string `protobuf:"bytes,3,rep,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` } func (x *UpdateUserSettingRequest) Reset() { @@ -282,7 +281,7 @@ func (x *UpdateUserSettingRequest) GetUserSetting() *UserSetting { return nil } -func (x *UpdateUserSettingRequest) GetUpdateMask() *fieldmaskpb.FieldMask { +func (x *UpdateUserSettingRequest) GetUpdateMask() []string { if x != nil { return x.UpdateMask } @@ -345,74 +344,70 @@ var file_api_v2_user_setting_service_proto_rawDesc = []byte{ 0x32, 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, 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, 0x97, 0x01, 0x0a, 0x0b, 0x55, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x06, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x52, 0x06, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x65, 0x22, 0x3e, 0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x16, - 0x0a, 0x12, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, - 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, - 0x5a, 0x48, 0x10, 0x02, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, - 0x16, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xa5, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, - 0x03, 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, 0x59, 0x0a, - 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xb0, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, - 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, - 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x1a, 0x1b, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, - 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, 0x0a, 0x10, - 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, 0x2f, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x53, - 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, - 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, - 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x65, 0x22, 0x3e, 0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x12, + 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x45, + 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x5a, 0x48, + 0x10, 0x02, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x16, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1f, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, + 0x59, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xb0, 0x02, 0x0a, 0x12, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, + 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2b, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, + 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, + 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, + 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, + 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, + 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, + 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -436,23 +431,21 @@ var file_api_v2_user_setting_service_proto_goTypes = []interface{}{ (*GetUserSettingResponse)(nil), // 3: slash.api.v2.GetUserSettingResponse (*UpdateUserSettingRequest)(nil), // 4: slash.api.v2.UpdateUserSettingRequest (*UpdateUserSettingResponse)(nil), // 5: slash.api.v2.UpdateUserSettingResponse - (*fieldmaskpb.FieldMask)(nil), // 6: google.protobuf.FieldMask } var file_api_v2_user_setting_service_proto_depIdxs = []int32{ 0, // 0: slash.api.v2.UserSetting.locale:type_name -> slash.api.v2.UserSetting.Locale 1, // 1: slash.api.v2.GetUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting 1, // 2: slash.api.v2.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v2.UserSetting - 6, // 3: slash.api.v2.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask - 1, // 4: slash.api.v2.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting - 2, // 5: slash.api.v2.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest - 4, // 6: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest - 3, // 7: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse - 5, // 8: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 1, // 3: slash.api.v2.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting + 2, // 4: slash.api.v2.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest + 4, // 5: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest + 3, // 6: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse + 5, // 7: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_api_v2_user_setting_service_proto_init() } diff --git a/proto/gen/api/v2/user_setting_service.pb.gw.go b/proto/gen/api/v2/user_setting_service.pb.gw.go index 84ea3cd..092e7f8 100644 --- a/proto/gen/api/v2/user_setting_service.pb.gw.go +++ b/proto/gen/api/v2/user_setting_service.pb.gw.go @@ -182,7 +182,7 @@ func RegisterUserSettingServiceHandlerServer(ctx context.Context, mux *runtime.S }) - mux.Handle("PUT", pattern_UserSettingService_UpdateUserSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_UserSettingService_UpdateUserSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -270,7 +270,7 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S }) - mux.Handle("PUT", pattern_UserSettingService_UpdateUserSetting_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_UserSettingService_UpdateUserSetting_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)