qinglong/back/protos/api.ts
2025-01-12 17:02:21 +08:00

1452 lines
43 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v1.181.2
// protoc v3.17.3
// source: back/protos/api.proto
/* eslint-disable */
import {
type CallOptions,
ChannelCredentials,
Client,
type ClientOptions,
type ClientUnaryCall,
type handleUnaryCall,
makeGenericClientConstructor,
Metadata,
type ServiceError,
type UntypedServiceImplementation,
} from "@grpc/grpc-js";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "com.ql.api";
export interface EnvItem {
id?: number | undefined;
name?: string | undefined;
value?: string | undefined;
remarks?: string | undefined;
status?: number | undefined;
position?: number | undefined;
}
export interface GetEnvsRequest {
searchValue: string;
}
export interface CreateEnvRequest {
envs: EnvItem[];
}
export interface UpdateEnvRequest {
env: EnvItem | undefined;
}
export interface DeleteEnvsRequest {
ids: number[];
}
export interface MoveEnvRequest {
id: number;
fromIndex: number;
toIndex: number;
}
export interface DisableEnvsRequest {
ids: number[];
}
export interface EnableEnvsRequest {
ids: number[];
}
export interface UpdateEnvNamesRequest {
ids: number[];
name: string;
}
export interface GetEnvByIdRequest {
id: number;
}
export interface EnvsResponse {
code: number;
data: EnvItem[];
message?: string | undefined;
}
export interface EnvResponse {
code: number;
data: EnvItem | undefined;
message?: string | undefined;
}
export interface Response {
code: number;
message?: string | undefined;
}
export interface SystemNotifyRequest {
title: string;
content: string;
}
function createBaseEnvItem(): EnvItem {
return {
id: undefined,
name: undefined,
value: undefined,
remarks: undefined,
status: undefined,
position: undefined,
};
}
export const EnvItem = {
encode(message: EnvItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.id !== undefined) {
writer.uint32(8).int32(message.id);
}
if (message.name !== undefined) {
writer.uint32(18).string(message.name);
}
if (message.value !== undefined) {
writer.uint32(26).string(message.value);
}
if (message.remarks !== undefined) {
writer.uint32(34).string(message.remarks);
}
if (message.status !== undefined) {
writer.uint32(40).int32(message.status);
}
if (message.position !== undefined) {
writer.uint32(48).int32(message.position);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): EnvItem {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEnvItem();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
message.name = reader.string();
continue;
case 3:
if (tag !== 26) {
break;
}
message.value = reader.string();
continue;
case 4:
if (tag !== 34) {
break;
}
message.remarks = reader.string();
continue;
case 5:
if (tag !== 40) {
break;
}
message.status = reader.int32();
continue;
case 6:
if (tag !== 48) {
break;
}
message.position = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): EnvItem {
return {
id: isSet(object.id) ? globalThis.Number(object.id) : undefined,
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
value: isSet(object.value) ? globalThis.String(object.value) : undefined,
remarks: isSet(object.remarks) ? globalThis.String(object.remarks) : undefined,
status: isSet(object.status) ? globalThis.Number(object.status) : undefined,
position: isSet(object.position) ? globalThis.Number(object.position) : undefined,
};
},
toJSON(message: EnvItem): unknown {
const obj: any = {};
if (message.id !== undefined) {
obj.id = Math.round(message.id);
}
if (message.name !== undefined) {
obj.name = message.name;
}
if (message.value !== undefined) {
obj.value = message.value;
}
if (message.remarks !== undefined) {
obj.remarks = message.remarks;
}
if (message.status !== undefined) {
obj.status = Math.round(message.status);
}
if (message.position !== undefined) {
obj.position = Math.round(message.position);
}
return obj;
},
create<I extends Exact<DeepPartial<EnvItem>, I>>(base?: I): EnvItem {
return EnvItem.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EnvItem>, I>>(object: I): EnvItem {
const message = createBaseEnvItem();
message.id = object.id ?? undefined;
message.name = object.name ?? undefined;
message.value = object.value ?? undefined;
message.remarks = object.remarks ?? undefined;
message.status = object.status ?? undefined;
message.position = object.position ?? undefined;
return message;
},
};
function createBaseGetEnvsRequest(): GetEnvsRequest {
return { searchValue: "" };
}
export const GetEnvsRequest = {
encode(message: GetEnvsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.searchValue !== "") {
writer.uint32(10).string(message.searchValue);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): GetEnvsRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetEnvsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.searchValue = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): GetEnvsRequest {
return { searchValue: isSet(object.searchValue) ? globalThis.String(object.searchValue) : "" };
},
toJSON(message: GetEnvsRequest): unknown {
const obj: any = {};
if (message.searchValue !== "") {
obj.searchValue = message.searchValue;
}
return obj;
},
create<I extends Exact<DeepPartial<GetEnvsRequest>, I>>(base?: I): GetEnvsRequest {
return GetEnvsRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GetEnvsRequest>, I>>(object: I): GetEnvsRequest {
const message = createBaseGetEnvsRequest();
message.searchValue = object.searchValue ?? "";
return message;
},
};
function createBaseCreateEnvRequest(): CreateEnvRequest {
return { envs: [] };
}
export const CreateEnvRequest = {
encode(message: CreateEnvRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
for (const v of message.envs) {
EnvItem.encode(v!, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): CreateEnvRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseCreateEnvRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.envs.push(EnvItem.decode(reader, reader.uint32()));
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): CreateEnvRequest {
return { envs: globalThis.Array.isArray(object?.envs) ? object.envs.map((e: any) => EnvItem.fromJSON(e)) : [] };
},
toJSON(message: CreateEnvRequest): unknown {
const obj: any = {};
if (message.envs?.length) {
obj.envs = message.envs.map((e) => EnvItem.toJSON(e));
}
return obj;
},
create<I extends Exact<DeepPartial<CreateEnvRequest>, I>>(base?: I): CreateEnvRequest {
return CreateEnvRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<CreateEnvRequest>, I>>(object: I): CreateEnvRequest {
const message = createBaseCreateEnvRequest();
message.envs = object.envs?.map((e) => EnvItem.fromPartial(e)) || [];
return message;
},
};
function createBaseUpdateEnvRequest(): UpdateEnvRequest {
return { env: undefined };
}
export const UpdateEnvRequest = {
encode(message: UpdateEnvRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.env !== undefined) {
EnvItem.encode(message.env, writer.uint32(10).fork()).ldelim();
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateEnvRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUpdateEnvRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.env = EnvItem.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): UpdateEnvRequest {
return { env: isSet(object.env) ? EnvItem.fromJSON(object.env) : undefined };
},
toJSON(message: UpdateEnvRequest): unknown {
const obj: any = {};
if (message.env !== undefined) {
obj.env = EnvItem.toJSON(message.env);
}
return obj;
},
create<I extends Exact<DeepPartial<UpdateEnvRequest>, I>>(base?: I): UpdateEnvRequest {
return UpdateEnvRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<UpdateEnvRequest>, I>>(object: I): UpdateEnvRequest {
const message = createBaseUpdateEnvRequest();
message.env = (object.env !== undefined && object.env !== null) ? EnvItem.fromPartial(object.env) : undefined;
return message;
},
};
function createBaseDeleteEnvsRequest(): DeleteEnvsRequest {
return { ids: [] };
}
export const DeleteEnvsRequest = {
encode(message: DeleteEnvsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).fork();
for (const v of message.ids) {
writer.int32(v);
}
writer.ldelim();
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DeleteEnvsRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDeleteEnvsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag === 8) {
message.ids.push(reader.int32());
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ids.push(reader.int32());
}
continue;
}
break;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): DeleteEnvsRequest {
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
},
toJSON(message: DeleteEnvsRequest): unknown {
const obj: any = {};
if (message.ids?.length) {
obj.ids = message.ids.map((e) => Math.round(e));
}
return obj;
},
create<I extends Exact<DeepPartial<DeleteEnvsRequest>, I>>(base?: I): DeleteEnvsRequest {
return DeleteEnvsRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<DeleteEnvsRequest>, I>>(object: I): DeleteEnvsRequest {
const message = createBaseDeleteEnvsRequest();
message.ids = object.ids?.map((e) => e) || [];
return message;
},
};
function createBaseMoveEnvRequest(): MoveEnvRequest {
return { id: 0, fromIndex: 0, toIndex: 0 };
}
export const MoveEnvRequest = {
encode(message: MoveEnvRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.fromIndex !== 0) {
writer.uint32(16).int32(message.fromIndex);
}
if (message.toIndex !== 0) {
writer.uint32(24).int32(message.toIndex);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): MoveEnvRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMoveEnvRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
message.fromIndex = reader.int32();
continue;
case 3:
if (tag !== 24) {
break;
}
message.toIndex = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): MoveEnvRequest {
return {
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
fromIndex: isSet(object.fromIndex) ? globalThis.Number(object.fromIndex) : 0,
toIndex: isSet(object.toIndex) ? globalThis.Number(object.toIndex) : 0,
};
},
toJSON(message: MoveEnvRequest): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
if (message.fromIndex !== 0) {
obj.fromIndex = Math.round(message.fromIndex);
}
if (message.toIndex !== 0) {
obj.toIndex = Math.round(message.toIndex);
}
return obj;
},
create<I extends Exact<DeepPartial<MoveEnvRequest>, I>>(base?: I): MoveEnvRequest {
return MoveEnvRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<MoveEnvRequest>, I>>(object: I): MoveEnvRequest {
const message = createBaseMoveEnvRequest();
message.id = object.id ?? 0;
message.fromIndex = object.fromIndex ?? 0;
message.toIndex = object.toIndex ?? 0;
return message;
},
};
function createBaseDisableEnvsRequest(): DisableEnvsRequest {
return { ids: [] };
}
export const DisableEnvsRequest = {
encode(message: DisableEnvsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).fork();
for (const v of message.ids) {
writer.int32(v);
}
writer.ldelim();
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): DisableEnvsRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseDisableEnvsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag === 8) {
message.ids.push(reader.int32());
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ids.push(reader.int32());
}
continue;
}
break;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): DisableEnvsRequest {
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
},
toJSON(message: DisableEnvsRequest): unknown {
const obj: any = {};
if (message.ids?.length) {
obj.ids = message.ids.map((e) => Math.round(e));
}
return obj;
},
create<I extends Exact<DeepPartial<DisableEnvsRequest>, I>>(base?: I): DisableEnvsRequest {
return DisableEnvsRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<DisableEnvsRequest>, I>>(object: I): DisableEnvsRequest {
const message = createBaseDisableEnvsRequest();
message.ids = object.ids?.map((e) => e) || [];
return message;
},
};
function createBaseEnableEnvsRequest(): EnableEnvsRequest {
return { ids: [] };
}
export const EnableEnvsRequest = {
encode(message: EnableEnvsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).fork();
for (const v of message.ids) {
writer.int32(v);
}
writer.ldelim();
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): EnableEnvsRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEnableEnvsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag === 8) {
message.ids.push(reader.int32());
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ids.push(reader.int32());
}
continue;
}
break;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): EnableEnvsRequest {
return { ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [] };
},
toJSON(message: EnableEnvsRequest): unknown {
const obj: any = {};
if (message.ids?.length) {
obj.ids = message.ids.map((e) => Math.round(e));
}
return obj;
},
create<I extends Exact<DeepPartial<EnableEnvsRequest>, I>>(base?: I): EnableEnvsRequest {
return EnableEnvsRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EnableEnvsRequest>, I>>(object: I): EnableEnvsRequest {
const message = createBaseEnableEnvsRequest();
message.ids = object.ids?.map((e) => e) || [];
return message;
},
};
function createBaseUpdateEnvNamesRequest(): UpdateEnvNamesRequest {
return { ids: [], name: "" };
}
export const UpdateEnvNamesRequest = {
encode(message: UpdateEnvNamesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
writer.uint32(10).fork();
for (const v of message.ids) {
writer.int32(v);
}
writer.ldelim();
if (message.name !== "") {
writer.uint32(18).string(message.name);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateEnvNamesRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseUpdateEnvNamesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag === 8) {
message.ids.push(reader.int32());
continue;
}
if (tag === 10) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.ids.push(reader.int32());
}
continue;
}
break;
case 2:
if (tag !== 18) {
break;
}
message.name = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): UpdateEnvNamesRequest {
return {
ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.Number(e)) : [],
name: isSet(object.name) ? globalThis.String(object.name) : "",
};
},
toJSON(message: UpdateEnvNamesRequest): unknown {
const obj: any = {};
if (message.ids?.length) {
obj.ids = message.ids.map((e) => Math.round(e));
}
if (message.name !== "") {
obj.name = message.name;
}
return obj;
},
create<I extends Exact<DeepPartial<UpdateEnvNamesRequest>, I>>(base?: I): UpdateEnvNamesRequest {
return UpdateEnvNamesRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<UpdateEnvNamesRequest>, I>>(object: I): UpdateEnvNamesRequest {
const message = createBaseUpdateEnvNamesRequest();
message.ids = object.ids?.map((e) => e) || [];
message.name = object.name ?? "";
return message;
},
};
function createBaseGetEnvByIdRequest(): GetEnvByIdRequest {
return { id: 0 };
}
export const GetEnvByIdRequest = {
encode(message: GetEnvByIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): GetEnvByIdRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetEnvByIdRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.id = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): GetEnvByIdRequest {
return { id: isSet(object.id) ? globalThis.Number(object.id) : 0 };
},
toJSON(message: GetEnvByIdRequest): unknown {
const obj: any = {};
if (message.id !== 0) {
obj.id = Math.round(message.id);
}
return obj;
},
create<I extends Exact<DeepPartial<GetEnvByIdRequest>, I>>(base?: I): GetEnvByIdRequest {
return GetEnvByIdRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<GetEnvByIdRequest>, I>>(object: I): GetEnvByIdRequest {
const message = createBaseGetEnvByIdRequest();
message.id = object.id ?? 0;
return message;
},
};
function createBaseEnvsResponse(): EnvsResponse {
return { code: 0, data: [], message: undefined };
}
export const EnvsResponse = {
encode(message: EnvsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.code !== 0) {
writer.uint32(8).int32(message.code);
}
for (const v of message.data) {
EnvItem.encode(v!, writer.uint32(18).fork()).ldelim();
}
if (message.message !== undefined) {
writer.uint32(26).string(message.message);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): EnvsResponse {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEnvsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.code = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
message.data.push(EnvItem.decode(reader, reader.uint32()));
continue;
case 3:
if (tag !== 26) {
break;
}
message.message = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): EnvsResponse {
return {
code: isSet(object.code) ? globalThis.Number(object.code) : 0,
data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => EnvItem.fromJSON(e)) : [],
message: isSet(object.message) ? globalThis.String(object.message) : undefined,
};
},
toJSON(message: EnvsResponse): unknown {
const obj: any = {};
if (message.code !== 0) {
obj.code = Math.round(message.code);
}
if (message.data?.length) {
obj.data = message.data.map((e) => EnvItem.toJSON(e));
}
if (message.message !== undefined) {
obj.message = message.message;
}
return obj;
},
create<I extends Exact<DeepPartial<EnvsResponse>, I>>(base?: I): EnvsResponse {
return EnvsResponse.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EnvsResponse>, I>>(object: I): EnvsResponse {
const message = createBaseEnvsResponse();
message.code = object.code ?? 0;
message.data = object.data?.map((e) => EnvItem.fromPartial(e)) || [];
message.message = object.message ?? undefined;
return message;
},
};
function createBaseEnvResponse(): EnvResponse {
return { code: 0, data: undefined, message: undefined };
}
export const EnvResponse = {
encode(message: EnvResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.code !== 0) {
writer.uint32(8).int32(message.code);
}
if (message.data !== undefined) {
EnvItem.encode(message.data, writer.uint32(18).fork()).ldelim();
}
if (message.message !== undefined) {
writer.uint32(26).string(message.message);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): EnvResponse {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseEnvResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.code = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
message.data = EnvItem.decode(reader, reader.uint32());
continue;
case 3:
if (tag !== 26) {
break;
}
message.message = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): EnvResponse {
return {
code: isSet(object.code) ? globalThis.Number(object.code) : 0,
data: isSet(object.data) ? EnvItem.fromJSON(object.data) : undefined,
message: isSet(object.message) ? globalThis.String(object.message) : undefined,
};
},
toJSON(message: EnvResponse): unknown {
const obj: any = {};
if (message.code !== 0) {
obj.code = Math.round(message.code);
}
if (message.data !== undefined) {
obj.data = EnvItem.toJSON(message.data);
}
if (message.message !== undefined) {
obj.message = message.message;
}
return obj;
},
create<I extends Exact<DeepPartial<EnvResponse>, I>>(base?: I): EnvResponse {
return EnvResponse.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<EnvResponse>, I>>(object: I): EnvResponse {
const message = createBaseEnvResponse();
message.code = object.code ?? 0;
message.data = (object.data !== undefined && object.data !== null) ? EnvItem.fromPartial(object.data) : undefined;
message.message = object.message ?? undefined;
return message;
},
};
function createBaseResponse(): Response {
return { code: 0, message: undefined };
}
export const Response = {
encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.code !== 0) {
writer.uint32(8).int32(message.code);
}
if (message.message !== undefined) {
writer.uint32(18).string(message.message);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): Response {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.code = reader.int32();
continue;
case 2:
if (tag !== 18) {
break;
}
message.message = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): Response {
return {
code: isSet(object.code) ? globalThis.Number(object.code) : 0,
message: isSet(object.message) ? globalThis.String(object.message) : undefined,
};
},
toJSON(message: Response): unknown {
const obj: any = {};
if (message.code !== 0) {
obj.code = Math.round(message.code);
}
if (message.message !== undefined) {
obj.message = message.message;
}
return obj;
},
create<I extends Exact<DeepPartial<Response>, I>>(base?: I): Response {
return Response.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<Response>, I>>(object: I): Response {
const message = createBaseResponse();
message.code = object.code ?? 0;
message.message = object.message ?? undefined;
return message;
},
};
function createBaseSystemNotifyRequest(): SystemNotifyRequest {
return { title: "", content: "" };
}
export const SystemNotifyRequest = {
encode(message: SystemNotifyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.title !== "") {
writer.uint32(10).string(message.title);
}
if (message.content !== "") {
writer.uint32(18).string(message.content);
}
return writer;
},
decode(input: _m0.Reader | Uint8Array, length?: number): SystemNotifyRequest {
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSystemNotifyRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.title = reader.string();
continue;
case 2:
if (tag !== 18) {
break;
}
message.content = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object: any): SystemNotifyRequest {
return {
title: isSet(object.title) ? globalThis.String(object.title) : "",
content: isSet(object.content) ? globalThis.String(object.content) : "",
};
},
toJSON(message: SystemNotifyRequest): unknown {
const obj: any = {};
if (message.title !== "") {
obj.title = message.title;
}
if (message.content !== "") {
obj.content = message.content;
}
return obj;
},
create<I extends Exact<DeepPartial<SystemNotifyRequest>, I>>(base?: I): SystemNotifyRequest {
return SystemNotifyRequest.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<SystemNotifyRequest>, I>>(object: I): SystemNotifyRequest {
const message = createBaseSystemNotifyRequest();
message.title = object.title ?? "";
message.content = object.content ?? "";
return message;
},
};
export type ApiService = typeof ApiService;
export const ApiService = {
getEnvs: {
path: "/com.ql.api.Api/GetEnvs",
requestStream: false,
responseStream: false,
requestSerialize: (value: GetEnvsRequest) => Buffer.from(GetEnvsRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => GetEnvsRequest.decode(value),
responseSerialize: (value: EnvsResponse) => Buffer.from(EnvsResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => EnvsResponse.decode(value),
},
createEnv: {
path: "/com.ql.api.Api/CreateEnv",
requestStream: false,
responseStream: false,
requestSerialize: (value: CreateEnvRequest) => Buffer.from(CreateEnvRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => CreateEnvRequest.decode(value),
responseSerialize: (value: EnvsResponse) => Buffer.from(EnvsResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => EnvsResponse.decode(value),
},
updateEnv: {
path: "/com.ql.api.Api/UpdateEnv",
requestStream: false,
responseStream: false,
requestSerialize: (value: UpdateEnvRequest) => Buffer.from(UpdateEnvRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => UpdateEnvRequest.decode(value),
responseSerialize: (value: EnvResponse) => Buffer.from(EnvResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => EnvResponse.decode(value),
},
deleteEnvs: {
path: "/com.ql.api.Api/DeleteEnvs",
requestStream: false,
responseStream: false,
requestSerialize: (value: DeleteEnvsRequest) => Buffer.from(DeleteEnvsRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => DeleteEnvsRequest.decode(value),
responseSerialize: (value: Response) => Buffer.from(Response.encode(value).finish()),
responseDeserialize: (value: Buffer) => Response.decode(value),
},
moveEnv: {
path: "/com.ql.api.Api/MoveEnv",
requestStream: false,
responseStream: false,
requestSerialize: (value: MoveEnvRequest) => Buffer.from(MoveEnvRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => MoveEnvRequest.decode(value),
responseSerialize: (value: EnvResponse) => Buffer.from(EnvResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => EnvResponse.decode(value),
},
disableEnvs: {
path: "/com.ql.api.Api/DisableEnvs",
requestStream: false,
responseStream: false,
requestSerialize: (value: DisableEnvsRequest) => Buffer.from(DisableEnvsRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => DisableEnvsRequest.decode(value),
responseSerialize: (value: Response) => Buffer.from(Response.encode(value).finish()),
responseDeserialize: (value: Buffer) => Response.decode(value),
},
enableEnvs: {
path: "/com.ql.api.Api/EnableEnvs",
requestStream: false,
responseStream: false,
requestSerialize: (value: EnableEnvsRequest) => Buffer.from(EnableEnvsRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => EnableEnvsRequest.decode(value),
responseSerialize: (value: Response) => Buffer.from(Response.encode(value).finish()),
responseDeserialize: (value: Buffer) => Response.decode(value),
},
updateEnvNames: {
path: "/com.ql.api.Api/UpdateEnvNames",
requestStream: false,
responseStream: false,
requestSerialize: (value: UpdateEnvNamesRequest) => Buffer.from(UpdateEnvNamesRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => UpdateEnvNamesRequest.decode(value),
responseSerialize: (value: Response) => Buffer.from(Response.encode(value).finish()),
responseDeserialize: (value: Buffer) => Response.decode(value),
},
getEnvById: {
path: "/com.ql.api.Api/GetEnvById",
requestStream: false,
responseStream: false,
requestSerialize: (value: GetEnvByIdRequest) => Buffer.from(GetEnvByIdRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => GetEnvByIdRequest.decode(value),
responseSerialize: (value: EnvResponse) => Buffer.from(EnvResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => EnvResponse.decode(value),
},
systemNotify: {
path: "/com.ql.api.Api/SystemNotify",
requestStream: false,
responseStream: false,
requestSerialize: (value: SystemNotifyRequest) => Buffer.from(SystemNotifyRequest.encode(value).finish()),
requestDeserialize: (value: Buffer) => SystemNotifyRequest.decode(value),
responseSerialize: (value: Response) => Buffer.from(Response.encode(value).finish()),
responseDeserialize: (value: Buffer) => Response.decode(value),
},
} as const;
export interface ApiServer extends UntypedServiceImplementation {
getEnvs: handleUnaryCall<GetEnvsRequest, EnvsResponse>;
createEnv: handleUnaryCall<CreateEnvRequest, EnvsResponse>;
updateEnv: handleUnaryCall<UpdateEnvRequest, EnvResponse>;
deleteEnvs: handleUnaryCall<DeleteEnvsRequest, Response>;
moveEnv: handleUnaryCall<MoveEnvRequest, EnvResponse>;
disableEnvs: handleUnaryCall<DisableEnvsRequest, Response>;
enableEnvs: handleUnaryCall<EnableEnvsRequest, Response>;
updateEnvNames: handleUnaryCall<UpdateEnvNamesRequest, Response>;
getEnvById: handleUnaryCall<GetEnvByIdRequest, EnvResponse>;
systemNotify: handleUnaryCall<SystemNotifyRequest, Response>;
}
export interface ApiClient extends Client {
getEnvs(
request: GetEnvsRequest,
callback: (error: ServiceError | null, response: EnvsResponse) => void,
): ClientUnaryCall;
getEnvs(
request: GetEnvsRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: EnvsResponse) => void,
): ClientUnaryCall;
getEnvs(
request: GetEnvsRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: EnvsResponse) => void,
): ClientUnaryCall;
createEnv(
request: CreateEnvRequest,
callback: (error: ServiceError | null, response: EnvsResponse) => void,
): ClientUnaryCall;
createEnv(
request: CreateEnvRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: EnvsResponse) => void,
): ClientUnaryCall;
createEnv(
request: CreateEnvRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: EnvsResponse) => void,
): ClientUnaryCall;
updateEnv(
request: UpdateEnvRequest,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
updateEnv(
request: UpdateEnvRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
updateEnv(
request: UpdateEnvRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
deleteEnvs(
request: DeleteEnvsRequest,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
deleteEnvs(
request: DeleteEnvsRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
deleteEnvs(
request: DeleteEnvsRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
moveEnv(
request: MoveEnvRequest,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
moveEnv(
request: MoveEnvRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
moveEnv(
request: MoveEnvRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
disableEnvs(
request: DisableEnvsRequest,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
disableEnvs(
request: DisableEnvsRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
disableEnvs(
request: DisableEnvsRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
enableEnvs(
request: EnableEnvsRequest,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
enableEnvs(
request: EnableEnvsRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
enableEnvs(
request: EnableEnvsRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
updateEnvNames(
request: UpdateEnvNamesRequest,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
updateEnvNames(
request: UpdateEnvNamesRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
updateEnvNames(
request: UpdateEnvNamesRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
getEnvById(
request: GetEnvByIdRequest,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
getEnvById(
request: GetEnvByIdRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
getEnvById(
request: GetEnvByIdRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: EnvResponse) => void,
): ClientUnaryCall;
systemNotify(
request: SystemNotifyRequest,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
systemNotify(
request: SystemNotifyRequest,
metadata: Metadata,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
systemNotify(
request: SystemNotifyRequest,
metadata: Metadata,
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Response) => void,
): ClientUnaryCall;
}
export const ApiClient = makeGenericClientConstructor(ApiService, "com.ql.api.Api") as unknown as {
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): ApiClient;
service: typeof ApiService;
serviceName: string;
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin ? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}