// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name // @generated from protobuf file "viz-user-settings.proto" (package "vizapi", syntax proto3) // tslint:disable import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; import { WireType } from "@protobuf-ts/runtime"; import type { BinaryReadOptions } from "@protobuf-ts/runtime"; import type { IBinaryReader } from "@protobuf-ts/runtime"; import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; /** * @generated from protobuf message vizapi.UserSetting */ export interface UserSetting { /** * @generated from protobuf field: string UserID = 1 */ UserID: string; /** * @generated from protobuf field: string Key = 2 */ Key: string; /** * @generated from protobuf field: string Value = 3 */ Value: string; } /** * Key, Value pair to store * * @generated from protobuf message vizapi.PutUserSettingRequest */ export interface PutUserSettingRequest { /** * Key: each key must be unique * * @generated from protobuf field: string Key = 1 */ Key: string; /** * @generated from protobuf field: string Value = 2 */ Value: string; } /** * Key, Value pair response * * @generated from protobuf message vizapi.PutUserSettingResult */ export interface PutUserSettingResult { /** * @generated from protobuf field: string Key = 1 */ Key: string; /** * @generated from protobuf field: string Value = 2 */ Value: string; } /** * Key of the user's setting to get * * @generated from protobuf message vizapi.GetUserSettingRequest */ export interface GetUserSettingRequest { /** * @generated from protobuf field: string Key = 2 */ Key: string; } /** * Key, Value pair response * * @generated from protobuf message vizapi.GetUserSettingResult */ export interface GetUserSettingResult { /** * @generated from protobuf field: string Key = 1 */ Key: string; /** * @generated from protobuf field: string Value = 2 */ Value: string; } /** * Key of the user's setting to delete * * @generated from protobuf message vizapi.DeleteUserSettingRequest */ export interface DeleteUserSettingRequest { /** * @generated from protobuf field: string Key = 2 */ Key: string; } /** * @generated from protobuf message vizapi.DeleteUserSettingResult */ export interface DeleteUserSettingResult { } /** * @generated from protobuf message vizapi.ListUserSettingsRequest */ export interface ListUserSettingsRequest { } /** * List of the user's settings * * @generated from protobuf message vizapi.ListUserSettingsResult */ export interface ListUserSettingsResult { /** * @generated from protobuf field: repeated vizapi.GetUserSettingResult UserSettings = 1 */ UserSettings: GetUserSettingResult[]; } // @generated message type with reflection information, may provide speed optimized methods class UserSetting$Type extends MessageType { constructor() { super("vizapi.UserSetting", [ { no: 1, name: "UserID", kind: "scalar", localName: "UserID", jsonName: "UserID", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "Key", kind: "scalar", localName: "Key", jsonName: "Key", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "Value", kind: "scalar", localName: "Value", jsonName: "Value", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): UserSetting { const message = globalThis.Object.create((this.messagePrototype!)); message.UserID = ""; message.Key = ""; message.Value = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserSetting): UserSetting { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string UserID */ 1: message.UserID = reader.string(); break; case /* string Key */ 2: message.Key = reader.string(); break; case /* string Value */ 3: message.Value = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: UserSetting, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string UserID = 1; */ if (message.UserID !== "") writer.tag(1, WireType.LengthDelimited).string(message.UserID); /* string Key = 2; */ if (message.Key !== "") writer.tag(2, WireType.LengthDelimited).string(message.Key); /* string Value = 3; */ if (message.Value !== "") writer.tag(3, WireType.LengthDelimited).string(message.Value); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.UserSetting */ export const UserSetting = new UserSetting$Type(); // @generated message type with reflection information, may provide speed optimized methods class PutUserSettingRequest$Type extends MessageType { constructor() { super("vizapi.PutUserSettingRequest", [ { no: 1, name: "Key", kind: "scalar", localName: "Key", jsonName: "Key", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Key: each key must be unique", example: "\"preferredTheme\"" }, "n1validate.rules": { string: { minLen: "1" } } } }, { no: 2, name: "Value", kind: "scalar", localName: "Value", jsonName: "Value", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"dark \"" }, "n1validate.rules": { string: { minLen: "1" } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Key, Value pair to store", required: ["Key", "Value"] } } }); } create(value?: PartialMessage): PutUserSettingRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.Key = ""; message.Value = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PutUserSettingRequest): PutUserSettingRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Key */ 1: message.Key = reader.string(); break; case /* string Value */ 2: message.Value = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: PutUserSettingRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Key = 1; */ if (message.Key !== "") writer.tag(1, WireType.LengthDelimited).string(message.Key); /* string Value = 2; */ if (message.Value !== "") writer.tag(2, WireType.LengthDelimited).string(message.Value); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.PutUserSettingRequest */ export const PutUserSettingRequest = new PutUserSettingRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class PutUserSettingResult$Type extends MessageType { constructor() { super("vizapi.PutUserSettingResult", [ { no: 1, name: "Key", kind: "scalar", localName: "Key", jsonName: "Key", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"preferredTheme\"" }, "n1validate.rules": { string: { minLen: "1" } } } }, { no: 2, name: "Value", kind: "scalar", localName: "Value", jsonName: "Value", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"dark\"" }, "n1validate.rules": { string: { minLen: "1" } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Key, Value pair response" } } }); } create(value?: PartialMessage): PutUserSettingResult { const message = globalThis.Object.create((this.messagePrototype!)); message.Key = ""; message.Value = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PutUserSettingResult): PutUserSettingResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Key */ 1: message.Key = reader.string(); break; case /* string Value */ 2: message.Value = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: PutUserSettingResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Key = 1; */ if (message.Key !== "") writer.tag(1, WireType.LengthDelimited).string(message.Key); /* string Value = 2; */ if (message.Value !== "") writer.tag(2, WireType.LengthDelimited).string(message.Value); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.PutUserSettingResult */ export const PutUserSettingResult = new PutUserSettingResult$Type(); // @generated message type with reflection information, may provide speed optimized methods class GetUserSettingRequest$Type extends MessageType { constructor() { super("vizapi.GetUserSettingRequest", [ { no: 2, name: "Key", kind: "scalar", localName: "Key", jsonName: "Key", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"preferredTheme\"" }, "n1validate.rules": { string: { minLen: "1" } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Key of the user's setting to get", required: ["Key"] } } }); } create(value?: PartialMessage): GetUserSettingRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.Key = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserSettingRequest): GetUserSettingRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Key */ 2: message.Key = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: GetUserSettingRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Key = 2; */ if (message.Key !== "") writer.tag(2, WireType.LengthDelimited).string(message.Key); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.GetUserSettingRequest */ export const GetUserSettingRequest = new GetUserSettingRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class GetUserSettingResult$Type extends MessageType { constructor() { super("vizapi.GetUserSettingResult", [ { no: 1, name: "Key", kind: "scalar", localName: "Key", jsonName: "Key", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"preferredTheme\"" }, "n1validate.rules": { string: { minLen: "1" } } } }, { no: 2, name: "Value", kind: "scalar", localName: "Value", jsonName: "Value", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"dark\"" }, "n1validate.rules": { string: { minLen: "1" } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Key, Value pair response" } } }); } create(value?: PartialMessage): GetUserSettingResult { const message = globalThis.Object.create((this.messagePrototype!)); message.Key = ""; message.Value = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserSettingResult): GetUserSettingResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Key */ 1: message.Key = reader.string(); break; case /* string Value */ 2: message.Value = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: GetUserSettingResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Key = 1; */ if (message.Key !== "") writer.tag(1, WireType.LengthDelimited).string(message.Key); /* string Value = 2; */ if (message.Value !== "") writer.tag(2, WireType.LengthDelimited).string(message.Value); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.GetUserSettingResult */ export const GetUserSettingResult = new GetUserSettingResult$Type(); // @generated message type with reflection information, may provide speed optimized methods class DeleteUserSettingRequest$Type extends MessageType { constructor() { super("vizapi.DeleteUserSettingRequest", [ { no: 2, name: "Key", kind: "scalar", localName: "Key", jsonName: "Key", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"preferredTheme\"" }, "n1validate.rules": { string: { minLen: "1" } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Key of the user's setting to delete", required: ["Key"] } } }); } create(value?: PartialMessage): DeleteUserSettingRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.Key = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteUserSettingRequest): DeleteUserSettingRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Key */ 2: message.Key = reader.string(); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: DeleteUserSettingRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Key = 2; */ if (message.Key !== "") writer.tag(2, WireType.LengthDelimited).string(message.Key); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.DeleteUserSettingRequest */ export const DeleteUserSettingRequest = new DeleteUserSettingRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class DeleteUserSettingResult$Type extends MessageType { constructor() { super("vizapi.DeleteUserSettingResult", []); } create(value?: PartialMessage): DeleteUserSettingResult { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteUserSettingResult): DeleteUserSettingResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: DeleteUserSettingResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.DeleteUserSettingResult */ export const DeleteUserSettingResult = new DeleteUserSettingResult$Type(); // @generated message type with reflection information, may provide speed optimized methods class ListUserSettingsRequest$Type extends MessageType { constructor() { super("vizapi.ListUserSettingsRequest", []); } create(value?: PartialMessage): ListUserSettingsRequest { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUserSettingsRequest): ListUserSettingsRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: ListUserSettingsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.ListUserSettingsRequest */ export const ListUserSettingsRequest = new ListUserSettingsRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class ListUserSettingsResult$Type extends MessageType { constructor() { super("vizapi.ListUserSettingsResult", [ { no: 1, name: "UserSettings", kind: "message", localName: "UserSettings", jsonName: "UserSettings", repeat: 2 /*RepeatType.UNPACKED*/, T: () => GetUserSettingResult } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "List of the user's settings" } } }); } create(value?: PartialMessage): ListUserSettingsResult { const message = globalThis.Object.create((this.messagePrototype!)); message.UserSettings = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUserSettingsResult): ListUserSettingsResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* repeated vizapi.GetUserSettingResult UserSettings */ 1: message.UserSettings.push(GetUserSettingResult.internalBinaryRead(reader, reader.uint32(), options)); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: ListUserSettingsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* repeated vizapi.GetUserSettingResult UserSettings = 1; */ for (let i = 0; i < message.UserSettings.length; i++) GetUserSettingResult.internalBinaryWrite(message.UserSettings[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message vizapi.ListUserSettingsResult */ export const ListUserSettingsResult = new ListUserSettingsResult$Type(); /** * @generated ServiceType for protobuf service vizapi.UserSettingsService */ export const UserSettingsService = new ServiceType("vizapi.UserSettingsService", [ { name: "Get", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Settings"], summary: "Get a user setting", description: "Use to get a user setting with his key" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: GetUserSettingRequest, O: GetUserSettingResult }, { name: "Put", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Settings"], summary: "Update or create a user setting", description: "Use to create or update user's settings" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: PutUserSettingRequest, O: PutUserSettingResult }, { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Settings"], summary: "Delete a user setting", description: "Use to delete a user setting with his key" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: DeleteUserSettingRequest, O: DeleteUserSettingResult }, { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Settings"], summary: "List a user's settings", description: "Use to list a user's settings" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ListUserSettingsRequest, O: ListUserSettingsResult } ], { "api.k8sService": "settings-server" });