@miradorlabs/web-grpc 2.77.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/proto/gateway/web/v1/ai_gateway.ts +458 -967
- package/proto/gateway/web/v1/ai_gateway_grpc_pb.js +0 -66
- package/proto/gateway/web/v1/ai_gateway_pb.js +687 -1634
- package/proto/gateway/web/v1/reference_gateway.ts +1633 -0
- package/proto/gateway/web/v1/reference_gateway_grpc_pb.js +215 -0
- package/proto/gateway/web/v1/reference_gateway_pb.js +2768 -0
|
@@ -0,0 +1,1633 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: proto/gateway/web/v1/reference_gateway.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
10
|
+
import { Timestamp } from "../../../../google/protobuf/timestamp";
|
|
11
|
+
import { ResponseStatus } from "../../common/v1/status";
|
|
12
|
+
|
|
13
|
+
export const protobufPackage = "gateway.web.v1";
|
|
14
|
+
|
|
15
|
+
/** AIReferenceNameOrigin mirrors telemetry.api.v1.AIReferenceNameOrigin. */
|
|
16
|
+
export enum AIReferenceNameOrigin {
|
|
17
|
+
AI_REFERENCE_NAME_ORIGIN_UNSPECIFIED = 0,
|
|
18
|
+
AI_REFERENCE_NAME_ORIGIN_AUTO = 1,
|
|
19
|
+
AI_REFERENCE_NAME_ORIGIN_MANUAL = 2,
|
|
20
|
+
AI_REFERENCE_NAME_ORIGIN_UNREGISTERED = 3,
|
|
21
|
+
UNRECOGNIZED = -1,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function aIReferenceNameOriginFromJSON(object: any): AIReferenceNameOrigin {
|
|
25
|
+
switch (object) {
|
|
26
|
+
case 0:
|
|
27
|
+
case "AI_REFERENCE_NAME_ORIGIN_UNSPECIFIED":
|
|
28
|
+
return AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_UNSPECIFIED;
|
|
29
|
+
case 1:
|
|
30
|
+
case "AI_REFERENCE_NAME_ORIGIN_AUTO":
|
|
31
|
+
return AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_AUTO;
|
|
32
|
+
case 2:
|
|
33
|
+
case "AI_REFERENCE_NAME_ORIGIN_MANUAL":
|
|
34
|
+
return AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_MANUAL;
|
|
35
|
+
case 3:
|
|
36
|
+
case "AI_REFERENCE_NAME_ORIGIN_UNREGISTERED":
|
|
37
|
+
return AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_UNREGISTERED;
|
|
38
|
+
case -1:
|
|
39
|
+
case "UNRECOGNIZED":
|
|
40
|
+
default:
|
|
41
|
+
return AIReferenceNameOrigin.UNRECOGNIZED;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function aIReferenceNameOriginToJSON(object: AIReferenceNameOrigin): string {
|
|
46
|
+
switch (object) {
|
|
47
|
+
case AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_UNSPECIFIED:
|
|
48
|
+
return "AI_REFERENCE_NAME_ORIGIN_UNSPECIFIED";
|
|
49
|
+
case AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_AUTO:
|
|
50
|
+
return "AI_REFERENCE_NAME_ORIGIN_AUTO";
|
|
51
|
+
case AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_MANUAL:
|
|
52
|
+
return "AI_REFERENCE_NAME_ORIGIN_MANUAL";
|
|
53
|
+
case AIReferenceNameOrigin.AI_REFERENCE_NAME_ORIGIN_UNREGISTERED:
|
|
54
|
+
return "AI_REFERENCE_NAME_ORIGIN_UNREGISTERED";
|
|
55
|
+
case AIReferenceNameOrigin.UNRECOGNIZED:
|
|
56
|
+
default:
|
|
57
|
+
return "UNRECOGNIZED";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export enum AIPrincipalKind {
|
|
62
|
+
AI_PRINCIPAL_KIND_UNSPECIFIED = 0,
|
|
63
|
+
AI_PRINCIPAL_KIND_USER = 1,
|
|
64
|
+
AI_PRINCIPAL_KIND_API_KEY = 2,
|
|
65
|
+
UNRECOGNIZED = -1,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function aIPrincipalKindFromJSON(object: any): AIPrincipalKind {
|
|
69
|
+
switch (object) {
|
|
70
|
+
case 0:
|
|
71
|
+
case "AI_PRINCIPAL_KIND_UNSPECIFIED":
|
|
72
|
+
return AIPrincipalKind.AI_PRINCIPAL_KIND_UNSPECIFIED;
|
|
73
|
+
case 1:
|
|
74
|
+
case "AI_PRINCIPAL_KIND_USER":
|
|
75
|
+
return AIPrincipalKind.AI_PRINCIPAL_KIND_USER;
|
|
76
|
+
case 2:
|
|
77
|
+
case "AI_PRINCIPAL_KIND_API_KEY":
|
|
78
|
+
return AIPrincipalKind.AI_PRINCIPAL_KIND_API_KEY;
|
|
79
|
+
case -1:
|
|
80
|
+
case "UNRECOGNIZED":
|
|
81
|
+
default:
|
|
82
|
+
return AIPrincipalKind.UNRECOGNIZED;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function aIPrincipalKindToJSON(object: AIPrincipalKind): string {
|
|
87
|
+
switch (object) {
|
|
88
|
+
case AIPrincipalKind.AI_PRINCIPAL_KIND_UNSPECIFIED:
|
|
89
|
+
return "AI_PRINCIPAL_KIND_UNSPECIFIED";
|
|
90
|
+
case AIPrincipalKind.AI_PRINCIPAL_KIND_USER:
|
|
91
|
+
return "AI_PRINCIPAL_KIND_USER";
|
|
92
|
+
case AIPrincipalKind.AI_PRINCIPAL_KIND_API_KEY:
|
|
93
|
+
return "AI_PRINCIPAL_KIND_API_KEY";
|
|
94
|
+
case AIPrincipalKind.UNRECOGNIZED:
|
|
95
|
+
default:
|
|
96
|
+
return "UNRECOGNIZED";
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ListPrincipalsRequest {
|
|
101
|
+
organizationId: string;
|
|
102
|
+
projectId: string;
|
|
103
|
+
/** Structured filter (both optional, ANDed): kind and source_system, exact match. */
|
|
104
|
+
kind?: AIPrincipalKind | undefined;
|
|
105
|
+
sourceSystem: string;
|
|
106
|
+
pageSize: number;
|
|
107
|
+
pageToken: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface ListPrincipalsResponse {
|
|
111
|
+
status: ResponseStatus | undefined;
|
|
112
|
+
principals: AIPrincipal[];
|
|
113
|
+
nextPageToken: string;
|
|
114
|
+
/** Exact total for the filter, computed on the first page only. */
|
|
115
|
+
totalCount?: number | undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface AIPrincipal {
|
|
119
|
+
kind: AIPrincipalKind;
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
sourceSystem: string;
|
|
123
|
+
alias: string;
|
|
124
|
+
/** The org member linked to this principal; empty when unset. */
|
|
125
|
+
accountUserId: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface UpdatePrincipalRequest {
|
|
129
|
+
organizationId: string;
|
|
130
|
+
projectId: string;
|
|
131
|
+
kind: AIPrincipalKind;
|
|
132
|
+
id: string;
|
|
133
|
+
sourceSystem: string;
|
|
134
|
+
/**
|
|
135
|
+
* Presence semantics: a field set (even to empty) is written, empty clears it; a field
|
|
136
|
+
* left absent is untouched. At least one of alias / account_user_id must be present.
|
|
137
|
+
*/
|
|
138
|
+
alias?:
|
|
139
|
+
| string
|
|
140
|
+
| undefined;
|
|
141
|
+
/** The org member to link. Must be a UUID when non-empty; empty clears it. */
|
|
142
|
+
accountUserId?: string | undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface UpdatePrincipalResponse {
|
|
146
|
+
status: ResponseStatus | undefined;
|
|
147
|
+
principal: AIPrincipal | undefined;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ListAIReferenceNamesRequest {
|
|
151
|
+
organizationId: string;
|
|
152
|
+
projectId: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface ListAIReferenceNamesResponse {
|
|
156
|
+
status: ResponseStatus | undefined;
|
|
157
|
+
names: AIReferenceName[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** AIReferenceName mirrors telemetry.api.v1.AIReferenceName: one raw name's display name. */
|
|
161
|
+
export interface AIReferenceName {
|
|
162
|
+
name: string;
|
|
163
|
+
displayName: string;
|
|
164
|
+
/** Every source that reported the name — provenance for display, never part of the lookup. */
|
|
165
|
+
sourceSystems: string[];
|
|
166
|
+
origin: AIReferenceNameOrigin;
|
|
167
|
+
/** Unset for an UNREGISTERED name. */
|
|
168
|
+
updatedAt: Date | undefined;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export interface UpdateAIReferenceNameRequest {
|
|
172
|
+
organizationId: string;
|
|
173
|
+
projectId: string;
|
|
174
|
+
/** Required, except that "" is a valid effort name. */
|
|
175
|
+
name: string;
|
|
176
|
+
/** Required, non-blank. */
|
|
177
|
+
displayName: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface UpdateAIReferenceNameResponse {
|
|
181
|
+
status: ResponseStatus | undefined;
|
|
182
|
+
name: AIReferenceName | undefined;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function createBaseListPrincipalsRequest(): ListPrincipalsRequest {
|
|
186
|
+
return { organizationId: "", projectId: "", kind: undefined, sourceSystem: "", pageSize: 0, pageToken: "" };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const ListPrincipalsRequest: MessageFns<ListPrincipalsRequest> = {
|
|
190
|
+
encode(message: ListPrincipalsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
191
|
+
if (message.organizationId !== "") {
|
|
192
|
+
writer.uint32(10).string(message.organizationId);
|
|
193
|
+
}
|
|
194
|
+
if (message.projectId !== "") {
|
|
195
|
+
writer.uint32(18).string(message.projectId);
|
|
196
|
+
}
|
|
197
|
+
if (message.kind !== undefined) {
|
|
198
|
+
writer.uint32(24).int32(message.kind);
|
|
199
|
+
}
|
|
200
|
+
if (message.sourceSystem !== "") {
|
|
201
|
+
writer.uint32(34).string(message.sourceSystem);
|
|
202
|
+
}
|
|
203
|
+
if (message.pageSize !== 0) {
|
|
204
|
+
writer.uint32(40).int32(message.pageSize);
|
|
205
|
+
}
|
|
206
|
+
if (message.pageToken !== "") {
|
|
207
|
+
writer.uint32(50).string(message.pageToken);
|
|
208
|
+
}
|
|
209
|
+
return writer;
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListPrincipalsRequest {
|
|
213
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
214
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
215
|
+
if (previousRecursionDepth >= 100) {
|
|
216
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
217
|
+
}
|
|
218
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
219
|
+
try {
|
|
220
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
221
|
+
const message = createBaseListPrincipalsRequest();
|
|
222
|
+
while (reader.pos < end) {
|
|
223
|
+
const tag = reader.uint32();
|
|
224
|
+
switch (tag >>> 3) {
|
|
225
|
+
case 1: {
|
|
226
|
+
if (tag !== 10) {
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
message.organizationId = reader.string();
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
case 2: {
|
|
234
|
+
if (tag !== 18) {
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
message.projectId = reader.string();
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
case 3: {
|
|
242
|
+
if (tag !== 24) {
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
message.kind = reader.int32() as any;
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
case 4: {
|
|
250
|
+
if (tag !== 34) {
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
message.sourceSystem = reader.string();
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
case 5: {
|
|
258
|
+
if (tag !== 40) {
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
message.pageSize = reader.int32();
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
case 6: {
|
|
266
|
+
if (tag !== 50) {
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
message.pageToken = reader.string();
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
reader.skip(tag & 7);
|
|
278
|
+
}
|
|
279
|
+
return message;
|
|
280
|
+
} finally {
|
|
281
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
fromJSON(object: any): ListPrincipalsRequest {
|
|
286
|
+
return {
|
|
287
|
+
organizationId: isSet(object.organizationId)
|
|
288
|
+
? globalThis.String(object.organizationId)
|
|
289
|
+
: isSet(object.organization_id)
|
|
290
|
+
? globalThis.String(object.organization_id)
|
|
291
|
+
: "",
|
|
292
|
+
projectId: isSet(object.projectId)
|
|
293
|
+
? globalThis.String(object.projectId)
|
|
294
|
+
: isSet(object.project_id)
|
|
295
|
+
? globalThis.String(object.project_id)
|
|
296
|
+
: "",
|
|
297
|
+
kind: isSet(object.kind) ? aIPrincipalKindFromJSON(object.kind) : undefined,
|
|
298
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
299
|
+
? globalThis.String(object.sourceSystem)
|
|
300
|
+
: isSet(object.source_system)
|
|
301
|
+
? globalThis.String(object.source_system)
|
|
302
|
+
: "",
|
|
303
|
+
pageSize: isSet(object.pageSize)
|
|
304
|
+
? globalThis.Number(object.pageSize)
|
|
305
|
+
: isSet(object.page_size)
|
|
306
|
+
? globalThis.Number(object.page_size)
|
|
307
|
+
: 0,
|
|
308
|
+
pageToken: isSet(object.pageToken)
|
|
309
|
+
? globalThis.String(object.pageToken)
|
|
310
|
+
: isSet(object.page_token)
|
|
311
|
+
? globalThis.String(object.page_token)
|
|
312
|
+
: "",
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
toJSON(message: ListPrincipalsRequest): unknown {
|
|
317
|
+
const obj: any = {};
|
|
318
|
+
if (message.organizationId !== "") {
|
|
319
|
+
obj.organizationId = message.organizationId;
|
|
320
|
+
}
|
|
321
|
+
if (message.projectId !== "") {
|
|
322
|
+
obj.projectId = message.projectId;
|
|
323
|
+
}
|
|
324
|
+
if (message.kind !== undefined) {
|
|
325
|
+
obj.kind = aIPrincipalKindToJSON(message.kind);
|
|
326
|
+
}
|
|
327
|
+
if (message.sourceSystem !== "") {
|
|
328
|
+
obj.sourceSystem = message.sourceSystem;
|
|
329
|
+
}
|
|
330
|
+
if (message.pageSize !== 0) {
|
|
331
|
+
obj.pageSize = Math.round(message.pageSize);
|
|
332
|
+
}
|
|
333
|
+
if (message.pageToken !== "") {
|
|
334
|
+
obj.pageToken = message.pageToken;
|
|
335
|
+
}
|
|
336
|
+
return obj;
|
|
337
|
+
},
|
|
338
|
+
|
|
339
|
+
create<I extends Exact<DeepPartial<ListPrincipalsRequest>, I>>(base?: I): ListPrincipalsRequest {
|
|
340
|
+
return ListPrincipalsRequest.fromPartial(base ?? ({} as any));
|
|
341
|
+
},
|
|
342
|
+
fromPartial<I extends Exact<DeepPartial<ListPrincipalsRequest>, I>>(object: I): ListPrincipalsRequest {
|
|
343
|
+
const message = createBaseListPrincipalsRequest();
|
|
344
|
+
message.organizationId = object.organizationId ?? "";
|
|
345
|
+
message.projectId = object.projectId ?? "";
|
|
346
|
+
message.kind = object.kind ?? undefined;
|
|
347
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
348
|
+
message.pageSize = object.pageSize ?? 0;
|
|
349
|
+
message.pageToken = object.pageToken ?? "";
|
|
350
|
+
return message;
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
function createBaseListPrincipalsResponse(): ListPrincipalsResponse {
|
|
355
|
+
return { status: undefined, principals: [], nextPageToken: "", totalCount: undefined };
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export const ListPrincipalsResponse: MessageFns<ListPrincipalsResponse> = {
|
|
359
|
+
encode(message: ListPrincipalsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
360
|
+
if (message.status !== undefined) {
|
|
361
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
362
|
+
}
|
|
363
|
+
for (const v of message.principals) {
|
|
364
|
+
AIPrincipal.encode(v!, writer.uint32(18).fork()).join();
|
|
365
|
+
}
|
|
366
|
+
if (message.nextPageToken !== "") {
|
|
367
|
+
writer.uint32(26).string(message.nextPageToken);
|
|
368
|
+
}
|
|
369
|
+
if (message.totalCount !== undefined) {
|
|
370
|
+
writer.uint32(32).int64(message.totalCount);
|
|
371
|
+
}
|
|
372
|
+
return writer;
|
|
373
|
+
},
|
|
374
|
+
|
|
375
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListPrincipalsResponse {
|
|
376
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
377
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
378
|
+
if (previousRecursionDepth >= 100) {
|
|
379
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
380
|
+
}
|
|
381
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
382
|
+
try {
|
|
383
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
384
|
+
const message = createBaseListPrincipalsResponse();
|
|
385
|
+
while (reader.pos < end) {
|
|
386
|
+
const tag = reader.uint32();
|
|
387
|
+
switch (tag >>> 3) {
|
|
388
|
+
case 1: {
|
|
389
|
+
if (tag !== 10) {
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
case 2: {
|
|
397
|
+
if (tag !== 18) {
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
message.principals.push(AIPrincipal.decode(reader, reader.uint32()));
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
case 3: {
|
|
405
|
+
if (tag !== 26) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
message.nextPageToken = reader.string();
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
case 4: {
|
|
413
|
+
if (tag !== 32) {
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
message.totalCount = longToNumber(reader.int64());
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
reader.skip(tag & 7);
|
|
425
|
+
}
|
|
426
|
+
return message;
|
|
427
|
+
} finally {
|
|
428
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
|
|
432
|
+
fromJSON(object: any): ListPrincipalsResponse {
|
|
433
|
+
return {
|
|
434
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
435
|
+
principals: globalThis.Array.isArray(object?.principals)
|
|
436
|
+
? object.principals.map((e: any) => AIPrincipal.fromJSON(e))
|
|
437
|
+
: [],
|
|
438
|
+
nextPageToken: isSet(object.nextPageToken)
|
|
439
|
+
? globalThis.String(object.nextPageToken)
|
|
440
|
+
: isSet(object.next_page_token)
|
|
441
|
+
? globalThis.String(object.next_page_token)
|
|
442
|
+
: "",
|
|
443
|
+
totalCount: isSet(object.totalCount)
|
|
444
|
+
? globalThis.Number(object.totalCount)
|
|
445
|
+
: isSet(object.total_count)
|
|
446
|
+
? globalThis.Number(object.total_count)
|
|
447
|
+
: undefined,
|
|
448
|
+
};
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
toJSON(message: ListPrincipalsResponse): unknown {
|
|
452
|
+
const obj: any = {};
|
|
453
|
+
if (message.status !== undefined) {
|
|
454
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
455
|
+
}
|
|
456
|
+
if (message.principals?.length) {
|
|
457
|
+
obj.principals = message.principals.map((e) => AIPrincipal.toJSON(e));
|
|
458
|
+
}
|
|
459
|
+
if (message.nextPageToken !== "") {
|
|
460
|
+
obj.nextPageToken = message.nextPageToken;
|
|
461
|
+
}
|
|
462
|
+
if (message.totalCount !== undefined) {
|
|
463
|
+
obj.totalCount = Math.round(message.totalCount);
|
|
464
|
+
}
|
|
465
|
+
return obj;
|
|
466
|
+
},
|
|
467
|
+
|
|
468
|
+
create<I extends Exact<DeepPartial<ListPrincipalsResponse>, I>>(base?: I): ListPrincipalsResponse {
|
|
469
|
+
return ListPrincipalsResponse.fromPartial(base ?? ({} as any));
|
|
470
|
+
},
|
|
471
|
+
fromPartial<I extends Exact<DeepPartial<ListPrincipalsResponse>, I>>(object: I): ListPrincipalsResponse {
|
|
472
|
+
const message = createBaseListPrincipalsResponse();
|
|
473
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
474
|
+
? ResponseStatus.fromPartial(object.status)
|
|
475
|
+
: undefined;
|
|
476
|
+
message.principals = object.principals?.map((e) => AIPrincipal.fromPartial(e)) || [];
|
|
477
|
+
message.nextPageToken = object.nextPageToken ?? "";
|
|
478
|
+
message.totalCount = object.totalCount ?? undefined;
|
|
479
|
+
return message;
|
|
480
|
+
},
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
function createBaseAIPrincipal(): AIPrincipal {
|
|
484
|
+
return { kind: 0, id: "", name: "", sourceSystem: "", alias: "", accountUserId: "" };
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
export const AIPrincipal: MessageFns<AIPrincipal> = {
|
|
488
|
+
encode(message: AIPrincipal, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
489
|
+
if (message.kind !== 0) {
|
|
490
|
+
writer.uint32(8).int32(message.kind);
|
|
491
|
+
}
|
|
492
|
+
if (message.id !== "") {
|
|
493
|
+
writer.uint32(18).string(message.id);
|
|
494
|
+
}
|
|
495
|
+
if (message.name !== "") {
|
|
496
|
+
writer.uint32(26).string(message.name);
|
|
497
|
+
}
|
|
498
|
+
if (message.sourceSystem !== "") {
|
|
499
|
+
writer.uint32(34).string(message.sourceSystem);
|
|
500
|
+
}
|
|
501
|
+
if (message.alias !== "") {
|
|
502
|
+
writer.uint32(42).string(message.alias);
|
|
503
|
+
}
|
|
504
|
+
if (message.accountUserId !== "") {
|
|
505
|
+
writer.uint32(50).string(message.accountUserId);
|
|
506
|
+
}
|
|
507
|
+
return writer;
|
|
508
|
+
},
|
|
509
|
+
|
|
510
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AIPrincipal {
|
|
511
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
512
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
513
|
+
if (previousRecursionDepth >= 100) {
|
|
514
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
515
|
+
}
|
|
516
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
517
|
+
try {
|
|
518
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
519
|
+
const message = createBaseAIPrincipal();
|
|
520
|
+
while (reader.pos < end) {
|
|
521
|
+
const tag = reader.uint32();
|
|
522
|
+
switch (tag >>> 3) {
|
|
523
|
+
case 1: {
|
|
524
|
+
if (tag !== 8) {
|
|
525
|
+
break;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
message.kind = reader.int32() as any;
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
case 2: {
|
|
532
|
+
if (tag !== 18) {
|
|
533
|
+
break;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
message.id = reader.string();
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
case 3: {
|
|
540
|
+
if (tag !== 26) {
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
message.name = reader.string();
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
case 4: {
|
|
548
|
+
if (tag !== 34) {
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
message.sourceSystem = reader.string();
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
case 5: {
|
|
556
|
+
if (tag !== 42) {
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
message.alias = reader.string();
|
|
561
|
+
continue;
|
|
562
|
+
}
|
|
563
|
+
case 6: {
|
|
564
|
+
if (tag !== 50) {
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
message.accountUserId = reader.string();
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
573
|
+
break;
|
|
574
|
+
}
|
|
575
|
+
reader.skip(tag & 7);
|
|
576
|
+
}
|
|
577
|
+
return message;
|
|
578
|
+
} finally {
|
|
579
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
|
|
583
|
+
fromJSON(object: any): AIPrincipal {
|
|
584
|
+
return {
|
|
585
|
+
kind: isSet(object.kind) ? aIPrincipalKindFromJSON(object.kind) : 0,
|
|
586
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
587
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
588
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
589
|
+
? globalThis.String(object.sourceSystem)
|
|
590
|
+
: isSet(object.source_system)
|
|
591
|
+
? globalThis.String(object.source_system)
|
|
592
|
+
: "",
|
|
593
|
+
alias: isSet(object.alias) ? globalThis.String(object.alias) : "",
|
|
594
|
+
accountUserId: isSet(object.accountUserId)
|
|
595
|
+
? globalThis.String(object.accountUserId)
|
|
596
|
+
: isSet(object.account_user_id)
|
|
597
|
+
? globalThis.String(object.account_user_id)
|
|
598
|
+
: "",
|
|
599
|
+
};
|
|
600
|
+
},
|
|
601
|
+
|
|
602
|
+
toJSON(message: AIPrincipal): unknown {
|
|
603
|
+
const obj: any = {};
|
|
604
|
+
if (message.kind !== 0) {
|
|
605
|
+
obj.kind = aIPrincipalKindToJSON(message.kind);
|
|
606
|
+
}
|
|
607
|
+
if (message.id !== "") {
|
|
608
|
+
obj.id = message.id;
|
|
609
|
+
}
|
|
610
|
+
if (message.name !== "") {
|
|
611
|
+
obj.name = message.name;
|
|
612
|
+
}
|
|
613
|
+
if (message.sourceSystem !== "") {
|
|
614
|
+
obj.sourceSystem = message.sourceSystem;
|
|
615
|
+
}
|
|
616
|
+
if (message.alias !== "") {
|
|
617
|
+
obj.alias = message.alias;
|
|
618
|
+
}
|
|
619
|
+
if (message.accountUserId !== "") {
|
|
620
|
+
obj.accountUserId = message.accountUserId;
|
|
621
|
+
}
|
|
622
|
+
return obj;
|
|
623
|
+
},
|
|
624
|
+
|
|
625
|
+
create<I extends Exact<DeepPartial<AIPrincipal>, I>>(base?: I): AIPrincipal {
|
|
626
|
+
return AIPrincipal.fromPartial(base ?? ({} as any));
|
|
627
|
+
},
|
|
628
|
+
fromPartial<I extends Exact<DeepPartial<AIPrincipal>, I>>(object: I): AIPrincipal {
|
|
629
|
+
const message = createBaseAIPrincipal();
|
|
630
|
+
message.kind = object.kind ?? 0;
|
|
631
|
+
message.id = object.id ?? "";
|
|
632
|
+
message.name = object.name ?? "";
|
|
633
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
634
|
+
message.alias = object.alias ?? "";
|
|
635
|
+
message.accountUserId = object.accountUserId ?? "";
|
|
636
|
+
return message;
|
|
637
|
+
},
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
function createBaseUpdatePrincipalRequest(): UpdatePrincipalRequest {
|
|
641
|
+
return {
|
|
642
|
+
organizationId: "",
|
|
643
|
+
projectId: "",
|
|
644
|
+
kind: 0,
|
|
645
|
+
id: "",
|
|
646
|
+
sourceSystem: "",
|
|
647
|
+
alias: undefined,
|
|
648
|
+
accountUserId: undefined,
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export const UpdatePrincipalRequest: MessageFns<UpdatePrincipalRequest> = {
|
|
653
|
+
encode(message: UpdatePrincipalRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
654
|
+
if (message.organizationId !== "") {
|
|
655
|
+
writer.uint32(10).string(message.organizationId);
|
|
656
|
+
}
|
|
657
|
+
if (message.projectId !== "") {
|
|
658
|
+
writer.uint32(18).string(message.projectId);
|
|
659
|
+
}
|
|
660
|
+
if (message.kind !== 0) {
|
|
661
|
+
writer.uint32(24).int32(message.kind);
|
|
662
|
+
}
|
|
663
|
+
if (message.id !== "") {
|
|
664
|
+
writer.uint32(34).string(message.id);
|
|
665
|
+
}
|
|
666
|
+
if (message.sourceSystem !== "") {
|
|
667
|
+
writer.uint32(42).string(message.sourceSystem);
|
|
668
|
+
}
|
|
669
|
+
if (message.alias !== undefined) {
|
|
670
|
+
writer.uint32(50).string(message.alias);
|
|
671
|
+
}
|
|
672
|
+
if (message.accountUserId !== undefined) {
|
|
673
|
+
writer.uint32(58).string(message.accountUserId);
|
|
674
|
+
}
|
|
675
|
+
return writer;
|
|
676
|
+
},
|
|
677
|
+
|
|
678
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdatePrincipalRequest {
|
|
679
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
680
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
681
|
+
if (previousRecursionDepth >= 100) {
|
|
682
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
683
|
+
}
|
|
684
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
685
|
+
try {
|
|
686
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
687
|
+
const message = createBaseUpdatePrincipalRequest();
|
|
688
|
+
while (reader.pos < end) {
|
|
689
|
+
const tag = reader.uint32();
|
|
690
|
+
switch (tag >>> 3) {
|
|
691
|
+
case 1: {
|
|
692
|
+
if (tag !== 10) {
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
message.organizationId = reader.string();
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
case 2: {
|
|
700
|
+
if (tag !== 18) {
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
message.projectId = reader.string();
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
case 3: {
|
|
708
|
+
if (tag !== 24) {
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
message.kind = reader.int32() as any;
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
case 4: {
|
|
716
|
+
if (tag !== 34) {
|
|
717
|
+
break;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
message.id = reader.string();
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
case 5: {
|
|
724
|
+
if (tag !== 42) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
message.sourceSystem = reader.string();
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
case 6: {
|
|
732
|
+
if (tag !== 50) {
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
message.alias = reader.string();
|
|
737
|
+
continue;
|
|
738
|
+
}
|
|
739
|
+
case 7: {
|
|
740
|
+
if (tag !== 58) {
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
message.accountUserId = reader.string();
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
reader.skip(tag & 7);
|
|
752
|
+
}
|
|
753
|
+
return message;
|
|
754
|
+
} finally {
|
|
755
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
756
|
+
}
|
|
757
|
+
},
|
|
758
|
+
|
|
759
|
+
fromJSON(object: any): UpdatePrincipalRequest {
|
|
760
|
+
return {
|
|
761
|
+
organizationId: isSet(object.organizationId)
|
|
762
|
+
? globalThis.String(object.organizationId)
|
|
763
|
+
: isSet(object.organization_id)
|
|
764
|
+
? globalThis.String(object.organization_id)
|
|
765
|
+
: "",
|
|
766
|
+
projectId: isSet(object.projectId)
|
|
767
|
+
? globalThis.String(object.projectId)
|
|
768
|
+
: isSet(object.project_id)
|
|
769
|
+
? globalThis.String(object.project_id)
|
|
770
|
+
: "",
|
|
771
|
+
kind: isSet(object.kind) ? aIPrincipalKindFromJSON(object.kind) : 0,
|
|
772
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
773
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
774
|
+
? globalThis.String(object.sourceSystem)
|
|
775
|
+
: isSet(object.source_system)
|
|
776
|
+
? globalThis.String(object.source_system)
|
|
777
|
+
: "",
|
|
778
|
+
alias: isSet(object.alias) ? globalThis.String(object.alias) : undefined,
|
|
779
|
+
accountUserId: isSet(object.accountUserId)
|
|
780
|
+
? globalThis.String(object.accountUserId)
|
|
781
|
+
: isSet(object.account_user_id)
|
|
782
|
+
? globalThis.String(object.account_user_id)
|
|
783
|
+
: undefined,
|
|
784
|
+
};
|
|
785
|
+
},
|
|
786
|
+
|
|
787
|
+
toJSON(message: UpdatePrincipalRequest): unknown {
|
|
788
|
+
const obj: any = {};
|
|
789
|
+
if (message.organizationId !== "") {
|
|
790
|
+
obj.organizationId = message.organizationId;
|
|
791
|
+
}
|
|
792
|
+
if (message.projectId !== "") {
|
|
793
|
+
obj.projectId = message.projectId;
|
|
794
|
+
}
|
|
795
|
+
if (message.kind !== 0) {
|
|
796
|
+
obj.kind = aIPrincipalKindToJSON(message.kind);
|
|
797
|
+
}
|
|
798
|
+
if (message.id !== "") {
|
|
799
|
+
obj.id = message.id;
|
|
800
|
+
}
|
|
801
|
+
if (message.sourceSystem !== "") {
|
|
802
|
+
obj.sourceSystem = message.sourceSystem;
|
|
803
|
+
}
|
|
804
|
+
if (message.alias !== undefined) {
|
|
805
|
+
obj.alias = message.alias;
|
|
806
|
+
}
|
|
807
|
+
if (message.accountUserId !== undefined) {
|
|
808
|
+
obj.accountUserId = message.accountUserId;
|
|
809
|
+
}
|
|
810
|
+
return obj;
|
|
811
|
+
},
|
|
812
|
+
|
|
813
|
+
create<I extends Exact<DeepPartial<UpdatePrincipalRequest>, I>>(base?: I): UpdatePrincipalRequest {
|
|
814
|
+
return UpdatePrincipalRequest.fromPartial(base ?? ({} as any));
|
|
815
|
+
},
|
|
816
|
+
fromPartial<I extends Exact<DeepPartial<UpdatePrincipalRequest>, I>>(object: I): UpdatePrincipalRequest {
|
|
817
|
+
const message = createBaseUpdatePrincipalRequest();
|
|
818
|
+
message.organizationId = object.organizationId ?? "";
|
|
819
|
+
message.projectId = object.projectId ?? "";
|
|
820
|
+
message.kind = object.kind ?? 0;
|
|
821
|
+
message.id = object.id ?? "";
|
|
822
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
823
|
+
message.alias = object.alias ?? undefined;
|
|
824
|
+
message.accountUserId = object.accountUserId ?? undefined;
|
|
825
|
+
return message;
|
|
826
|
+
},
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
function createBaseUpdatePrincipalResponse(): UpdatePrincipalResponse {
|
|
830
|
+
return { status: undefined, principal: undefined };
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
export const UpdatePrincipalResponse: MessageFns<UpdatePrincipalResponse> = {
|
|
834
|
+
encode(message: UpdatePrincipalResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
835
|
+
if (message.status !== undefined) {
|
|
836
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
837
|
+
}
|
|
838
|
+
if (message.principal !== undefined) {
|
|
839
|
+
AIPrincipal.encode(message.principal, writer.uint32(18).fork()).join();
|
|
840
|
+
}
|
|
841
|
+
return writer;
|
|
842
|
+
},
|
|
843
|
+
|
|
844
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdatePrincipalResponse {
|
|
845
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
846
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
847
|
+
if (previousRecursionDepth >= 100) {
|
|
848
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
849
|
+
}
|
|
850
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
851
|
+
try {
|
|
852
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
853
|
+
const message = createBaseUpdatePrincipalResponse();
|
|
854
|
+
while (reader.pos < end) {
|
|
855
|
+
const tag = reader.uint32();
|
|
856
|
+
switch (tag >>> 3) {
|
|
857
|
+
case 1: {
|
|
858
|
+
if (tag !== 10) {
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
863
|
+
continue;
|
|
864
|
+
}
|
|
865
|
+
case 2: {
|
|
866
|
+
if (tag !== 18) {
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
message.principal = AIPrincipal.decode(reader, reader.uint32());
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
reader.skip(tag & 7);
|
|
878
|
+
}
|
|
879
|
+
return message;
|
|
880
|
+
} finally {
|
|
881
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
|
|
885
|
+
fromJSON(object: any): UpdatePrincipalResponse {
|
|
886
|
+
return {
|
|
887
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
888
|
+
principal: isSet(object.principal) ? AIPrincipal.fromJSON(object.principal) : undefined,
|
|
889
|
+
};
|
|
890
|
+
},
|
|
891
|
+
|
|
892
|
+
toJSON(message: UpdatePrincipalResponse): unknown {
|
|
893
|
+
const obj: any = {};
|
|
894
|
+
if (message.status !== undefined) {
|
|
895
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
896
|
+
}
|
|
897
|
+
if (message.principal !== undefined) {
|
|
898
|
+
obj.principal = AIPrincipal.toJSON(message.principal);
|
|
899
|
+
}
|
|
900
|
+
return obj;
|
|
901
|
+
},
|
|
902
|
+
|
|
903
|
+
create<I extends Exact<DeepPartial<UpdatePrincipalResponse>, I>>(base?: I): UpdatePrincipalResponse {
|
|
904
|
+
return UpdatePrincipalResponse.fromPartial(base ?? ({} as any));
|
|
905
|
+
},
|
|
906
|
+
fromPartial<I extends Exact<DeepPartial<UpdatePrincipalResponse>, I>>(object: I): UpdatePrincipalResponse {
|
|
907
|
+
const message = createBaseUpdatePrincipalResponse();
|
|
908
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
909
|
+
? ResponseStatus.fromPartial(object.status)
|
|
910
|
+
: undefined;
|
|
911
|
+
message.principal = (object.principal !== undefined && object.principal !== null)
|
|
912
|
+
? AIPrincipal.fromPartial(object.principal)
|
|
913
|
+
: undefined;
|
|
914
|
+
return message;
|
|
915
|
+
},
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
function createBaseListAIReferenceNamesRequest(): ListAIReferenceNamesRequest {
|
|
919
|
+
return { organizationId: "", projectId: "" };
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export const ListAIReferenceNamesRequest: MessageFns<ListAIReferenceNamesRequest> = {
|
|
923
|
+
encode(message: ListAIReferenceNamesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
924
|
+
if (message.organizationId !== "") {
|
|
925
|
+
writer.uint32(10).string(message.organizationId);
|
|
926
|
+
}
|
|
927
|
+
if (message.projectId !== "") {
|
|
928
|
+
writer.uint32(18).string(message.projectId);
|
|
929
|
+
}
|
|
930
|
+
return writer;
|
|
931
|
+
},
|
|
932
|
+
|
|
933
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListAIReferenceNamesRequest {
|
|
934
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
935
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
936
|
+
if (previousRecursionDepth >= 100) {
|
|
937
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
938
|
+
}
|
|
939
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
940
|
+
try {
|
|
941
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
942
|
+
const message = createBaseListAIReferenceNamesRequest();
|
|
943
|
+
while (reader.pos < end) {
|
|
944
|
+
const tag = reader.uint32();
|
|
945
|
+
switch (tag >>> 3) {
|
|
946
|
+
case 1: {
|
|
947
|
+
if (tag !== 10) {
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
message.organizationId = reader.string();
|
|
952
|
+
continue;
|
|
953
|
+
}
|
|
954
|
+
case 2: {
|
|
955
|
+
if (tag !== 18) {
|
|
956
|
+
break;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
message.projectId = reader.string();
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
964
|
+
break;
|
|
965
|
+
}
|
|
966
|
+
reader.skip(tag & 7);
|
|
967
|
+
}
|
|
968
|
+
return message;
|
|
969
|
+
} finally {
|
|
970
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
|
|
974
|
+
fromJSON(object: any): ListAIReferenceNamesRequest {
|
|
975
|
+
return {
|
|
976
|
+
organizationId: isSet(object.organizationId)
|
|
977
|
+
? globalThis.String(object.organizationId)
|
|
978
|
+
: isSet(object.organization_id)
|
|
979
|
+
? globalThis.String(object.organization_id)
|
|
980
|
+
: "",
|
|
981
|
+
projectId: isSet(object.projectId)
|
|
982
|
+
? globalThis.String(object.projectId)
|
|
983
|
+
: isSet(object.project_id)
|
|
984
|
+
? globalThis.String(object.project_id)
|
|
985
|
+
: "",
|
|
986
|
+
};
|
|
987
|
+
},
|
|
988
|
+
|
|
989
|
+
toJSON(message: ListAIReferenceNamesRequest): unknown {
|
|
990
|
+
const obj: any = {};
|
|
991
|
+
if (message.organizationId !== "") {
|
|
992
|
+
obj.organizationId = message.organizationId;
|
|
993
|
+
}
|
|
994
|
+
if (message.projectId !== "") {
|
|
995
|
+
obj.projectId = message.projectId;
|
|
996
|
+
}
|
|
997
|
+
return obj;
|
|
998
|
+
},
|
|
999
|
+
|
|
1000
|
+
create<I extends Exact<DeepPartial<ListAIReferenceNamesRequest>, I>>(base?: I): ListAIReferenceNamesRequest {
|
|
1001
|
+
return ListAIReferenceNamesRequest.fromPartial(base ?? ({} as any));
|
|
1002
|
+
},
|
|
1003
|
+
fromPartial<I extends Exact<DeepPartial<ListAIReferenceNamesRequest>, I>>(object: I): ListAIReferenceNamesRequest {
|
|
1004
|
+
const message = createBaseListAIReferenceNamesRequest();
|
|
1005
|
+
message.organizationId = object.organizationId ?? "";
|
|
1006
|
+
message.projectId = object.projectId ?? "";
|
|
1007
|
+
return message;
|
|
1008
|
+
},
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
function createBaseListAIReferenceNamesResponse(): ListAIReferenceNamesResponse {
|
|
1012
|
+
return { status: undefined, names: [] };
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
export const ListAIReferenceNamesResponse: MessageFns<ListAIReferenceNamesResponse> = {
|
|
1016
|
+
encode(message: ListAIReferenceNamesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1017
|
+
if (message.status !== undefined) {
|
|
1018
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
1019
|
+
}
|
|
1020
|
+
for (const v of message.names) {
|
|
1021
|
+
AIReferenceName.encode(v!, writer.uint32(18).fork()).join();
|
|
1022
|
+
}
|
|
1023
|
+
return writer;
|
|
1024
|
+
},
|
|
1025
|
+
|
|
1026
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ListAIReferenceNamesResponse {
|
|
1027
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1028
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
1029
|
+
if (previousRecursionDepth >= 100) {
|
|
1030
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
1031
|
+
}
|
|
1032
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
1033
|
+
try {
|
|
1034
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1035
|
+
const message = createBaseListAIReferenceNamesResponse();
|
|
1036
|
+
while (reader.pos < end) {
|
|
1037
|
+
const tag = reader.uint32();
|
|
1038
|
+
switch (tag >>> 3) {
|
|
1039
|
+
case 1: {
|
|
1040
|
+
if (tag !== 10) {
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
1045
|
+
continue;
|
|
1046
|
+
}
|
|
1047
|
+
case 2: {
|
|
1048
|
+
if (tag !== 18) {
|
|
1049
|
+
break;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
message.names.push(AIReferenceName.decode(reader, reader.uint32()));
|
|
1053
|
+
continue;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1057
|
+
break;
|
|
1058
|
+
}
|
|
1059
|
+
reader.skip(tag & 7);
|
|
1060
|
+
}
|
|
1061
|
+
return message;
|
|
1062
|
+
} finally {
|
|
1063
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
|
|
1067
|
+
fromJSON(object: any): ListAIReferenceNamesResponse {
|
|
1068
|
+
return {
|
|
1069
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
1070
|
+
names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => AIReferenceName.fromJSON(e)) : [],
|
|
1071
|
+
};
|
|
1072
|
+
},
|
|
1073
|
+
|
|
1074
|
+
toJSON(message: ListAIReferenceNamesResponse): unknown {
|
|
1075
|
+
const obj: any = {};
|
|
1076
|
+
if (message.status !== undefined) {
|
|
1077
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
1078
|
+
}
|
|
1079
|
+
if (message.names?.length) {
|
|
1080
|
+
obj.names = message.names.map((e) => AIReferenceName.toJSON(e));
|
|
1081
|
+
}
|
|
1082
|
+
return obj;
|
|
1083
|
+
},
|
|
1084
|
+
|
|
1085
|
+
create<I extends Exact<DeepPartial<ListAIReferenceNamesResponse>, I>>(base?: I): ListAIReferenceNamesResponse {
|
|
1086
|
+
return ListAIReferenceNamesResponse.fromPartial(base ?? ({} as any));
|
|
1087
|
+
},
|
|
1088
|
+
fromPartial<I extends Exact<DeepPartial<ListAIReferenceNamesResponse>, I>>(object: I): ListAIReferenceNamesResponse {
|
|
1089
|
+
const message = createBaseListAIReferenceNamesResponse();
|
|
1090
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
1091
|
+
? ResponseStatus.fromPartial(object.status)
|
|
1092
|
+
: undefined;
|
|
1093
|
+
message.names = object.names?.map((e) => AIReferenceName.fromPartial(e)) || [];
|
|
1094
|
+
return message;
|
|
1095
|
+
},
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
function createBaseAIReferenceName(): AIReferenceName {
|
|
1099
|
+
return { name: "", displayName: "", sourceSystems: [], origin: 0, updatedAt: undefined };
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
export const AIReferenceName: MessageFns<AIReferenceName> = {
|
|
1103
|
+
encode(message: AIReferenceName, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1104
|
+
if (message.name !== "") {
|
|
1105
|
+
writer.uint32(10).string(message.name);
|
|
1106
|
+
}
|
|
1107
|
+
if (message.displayName !== "") {
|
|
1108
|
+
writer.uint32(18).string(message.displayName);
|
|
1109
|
+
}
|
|
1110
|
+
for (const v of message.sourceSystems) {
|
|
1111
|
+
writer.uint32(26).string(v!);
|
|
1112
|
+
}
|
|
1113
|
+
if (message.origin !== 0) {
|
|
1114
|
+
writer.uint32(32).int32(message.origin);
|
|
1115
|
+
}
|
|
1116
|
+
if (message.updatedAt !== undefined) {
|
|
1117
|
+
Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(42).fork()).join();
|
|
1118
|
+
}
|
|
1119
|
+
return writer;
|
|
1120
|
+
},
|
|
1121
|
+
|
|
1122
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AIReferenceName {
|
|
1123
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1124
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
1125
|
+
if (previousRecursionDepth >= 100) {
|
|
1126
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
1127
|
+
}
|
|
1128
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
1129
|
+
try {
|
|
1130
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1131
|
+
const message = createBaseAIReferenceName();
|
|
1132
|
+
while (reader.pos < end) {
|
|
1133
|
+
const tag = reader.uint32();
|
|
1134
|
+
switch (tag >>> 3) {
|
|
1135
|
+
case 1: {
|
|
1136
|
+
if (tag !== 10) {
|
|
1137
|
+
break;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
message.name = reader.string();
|
|
1141
|
+
continue;
|
|
1142
|
+
}
|
|
1143
|
+
case 2: {
|
|
1144
|
+
if (tag !== 18) {
|
|
1145
|
+
break;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
message.displayName = reader.string();
|
|
1149
|
+
continue;
|
|
1150
|
+
}
|
|
1151
|
+
case 3: {
|
|
1152
|
+
if (tag !== 26) {
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
message.sourceSystems.push(reader.string());
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
case 4: {
|
|
1160
|
+
if (tag !== 32) {
|
|
1161
|
+
break;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
message.origin = reader.int32() as any;
|
|
1165
|
+
continue;
|
|
1166
|
+
}
|
|
1167
|
+
case 5: {
|
|
1168
|
+
if (tag !== 42) {
|
|
1169
|
+
break;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1173
|
+
continue;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
reader.skip(tag & 7);
|
|
1180
|
+
}
|
|
1181
|
+
return message;
|
|
1182
|
+
} finally {
|
|
1183
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
|
|
1187
|
+
fromJSON(object: any): AIReferenceName {
|
|
1188
|
+
return {
|
|
1189
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
1190
|
+
displayName: isSet(object.displayName)
|
|
1191
|
+
? globalThis.String(object.displayName)
|
|
1192
|
+
: isSet(object.display_name)
|
|
1193
|
+
? globalThis.String(object.display_name)
|
|
1194
|
+
: "",
|
|
1195
|
+
sourceSystems: globalThis.Array.isArray(object?.sourceSystems)
|
|
1196
|
+
? object.sourceSystems.map((e: any) => globalThis.String(e))
|
|
1197
|
+
: globalThis.Array.isArray(object?.source_systems)
|
|
1198
|
+
? object.source_systems.map((e: any) => globalThis.String(e))
|
|
1199
|
+
: [],
|
|
1200
|
+
origin: isSet(object.origin) ? aIReferenceNameOriginFromJSON(object.origin) : 0,
|
|
1201
|
+
updatedAt: isSet(object.updatedAt)
|
|
1202
|
+
? fromJsonTimestamp(object.updatedAt)
|
|
1203
|
+
: isSet(object.updated_at)
|
|
1204
|
+
? fromJsonTimestamp(object.updated_at)
|
|
1205
|
+
: undefined,
|
|
1206
|
+
};
|
|
1207
|
+
},
|
|
1208
|
+
|
|
1209
|
+
toJSON(message: AIReferenceName): unknown {
|
|
1210
|
+
const obj: any = {};
|
|
1211
|
+
if (message.name !== "") {
|
|
1212
|
+
obj.name = message.name;
|
|
1213
|
+
}
|
|
1214
|
+
if (message.displayName !== "") {
|
|
1215
|
+
obj.displayName = message.displayName;
|
|
1216
|
+
}
|
|
1217
|
+
if (message.sourceSystems?.length) {
|
|
1218
|
+
obj.sourceSystems = message.sourceSystems;
|
|
1219
|
+
}
|
|
1220
|
+
if (message.origin !== 0) {
|
|
1221
|
+
obj.origin = aIReferenceNameOriginToJSON(message.origin);
|
|
1222
|
+
}
|
|
1223
|
+
if (message.updatedAt !== undefined) {
|
|
1224
|
+
obj.updatedAt = message.updatedAt.toISOString();
|
|
1225
|
+
}
|
|
1226
|
+
return obj;
|
|
1227
|
+
},
|
|
1228
|
+
|
|
1229
|
+
create<I extends Exact<DeepPartial<AIReferenceName>, I>>(base?: I): AIReferenceName {
|
|
1230
|
+
return AIReferenceName.fromPartial(base ?? ({} as any));
|
|
1231
|
+
},
|
|
1232
|
+
fromPartial<I extends Exact<DeepPartial<AIReferenceName>, I>>(object: I): AIReferenceName {
|
|
1233
|
+
const message = createBaseAIReferenceName();
|
|
1234
|
+
message.name = object.name ?? "";
|
|
1235
|
+
message.displayName = object.displayName ?? "";
|
|
1236
|
+
message.sourceSystems = object.sourceSystems?.map((e) => e) || [];
|
|
1237
|
+
message.origin = object.origin ?? 0;
|
|
1238
|
+
message.updatedAt = object.updatedAt ?? undefined;
|
|
1239
|
+
return message;
|
|
1240
|
+
},
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
function createBaseUpdateAIReferenceNameRequest(): UpdateAIReferenceNameRequest {
|
|
1244
|
+
return { organizationId: "", projectId: "", name: "", displayName: "" };
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
export const UpdateAIReferenceNameRequest: MessageFns<UpdateAIReferenceNameRequest> = {
|
|
1248
|
+
encode(message: UpdateAIReferenceNameRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1249
|
+
if (message.organizationId !== "") {
|
|
1250
|
+
writer.uint32(10).string(message.organizationId);
|
|
1251
|
+
}
|
|
1252
|
+
if (message.projectId !== "") {
|
|
1253
|
+
writer.uint32(18).string(message.projectId);
|
|
1254
|
+
}
|
|
1255
|
+
if (message.name !== "") {
|
|
1256
|
+
writer.uint32(26).string(message.name);
|
|
1257
|
+
}
|
|
1258
|
+
if (message.displayName !== "") {
|
|
1259
|
+
writer.uint32(34).string(message.displayName);
|
|
1260
|
+
}
|
|
1261
|
+
return writer;
|
|
1262
|
+
},
|
|
1263
|
+
|
|
1264
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateAIReferenceNameRequest {
|
|
1265
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1266
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
1267
|
+
if (previousRecursionDepth >= 100) {
|
|
1268
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
1269
|
+
}
|
|
1270
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
1271
|
+
try {
|
|
1272
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1273
|
+
const message = createBaseUpdateAIReferenceNameRequest();
|
|
1274
|
+
while (reader.pos < end) {
|
|
1275
|
+
const tag = reader.uint32();
|
|
1276
|
+
switch (tag >>> 3) {
|
|
1277
|
+
case 1: {
|
|
1278
|
+
if (tag !== 10) {
|
|
1279
|
+
break;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
message.organizationId = reader.string();
|
|
1283
|
+
continue;
|
|
1284
|
+
}
|
|
1285
|
+
case 2: {
|
|
1286
|
+
if (tag !== 18) {
|
|
1287
|
+
break;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
message.projectId = reader.string();
|
|
1291
|
+
continue;
|
|
1292
|
+
}
|
|
1293
|
+
case 3: {
|
|
1294
|
+
if (tag !== 26) {
|
|
1295
|
+
break;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
message.name = reader.string();
|
|
1299
|
+
continue;
|
|
1300
|
+
}
|
|
1301
|
+
case 4: {
|
|
1302
|
+
if (tag !== 34) {
|
|
1303
|
+
break;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
message.displayName = reader.string();
|
|
1307
|
+
continue;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1311
|
+
break;
|
|
1312
|
+
}
|
|
1313
|
+
reader.skip(tag & 7);
|
|
1314
|
+
}
|
|
1315
|
+
return message;
|
|
1316
|
+
} finally {
|
|
1317
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
1318
|
+
}
|
|
1319
|
+
},
|
|
1320
|
+
|
|
1321
|
+
fromJSON(object: any): UpdateAIReferenceNameRequest {
|
|
1322
|
+
return {
|
|
1323
|
+
organizationId: isSet(object.organizationId)
|
|
1324
|
+
? globalThis.String(object.organizationId)
|
|
1325
|
+
: isSet(object.organization_id)
|
|
1326
|
+
? globalThis.String(object.organization_id)
|
|
1327
|
+
: "",
|
|
1328
|
+
projectId: isSet(object.projectId)
|
|
1329
|
+
? globalThis.String(object.projectId)
|
|
1330
|
+
: isSet(object.project_id)
|
|
1331
|
+
? globalThis.String(object.project_id)
|
|
1332
|
+
: "",
|
|
1333
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
1334
|
+
displayName: isSet(object.displayName)
|
|
1335
|
+
? globalThis.String(object.displayName)
|
|
1336
|
+
: isSet(object.display_name)
|
|
1337
|
+
? globalThis.String(object.display_name)
|
|
1338
|
+
: "",
|
|
1339
|
+
};
|
|
1340
|
+
},
|
|
1341
|
+
|
|
1342
|
+
toJSON(message: UpdateAIReferenceNameRequest): unknown {
|
|
1343
|
+
const obj: any = {};
|
|
1344
|
+
if (message.organizationId !== "") {
|
|
1345
|
+
obj.organizationId = message.organizationId;
|
|
1346
|
+
}
|
|
1347
|
+
if (message.projectId !== "") {
|
|
1348
|
+
obj.projectId = message.projectId;
|
|
1349
|
+
}
|
|
1350
|
+
if (message.name !== "") {
|
|
1351
|
+
obj.name = message.name;
|
|
1352
|
+
}
|
|
1353
|
+
if (message.displayName !== "") {
|
|
1354
|
+
obj.displayName = message.displayName;
|
|
1355
|
+
}
|
|
1356
|
+
return obj;
|
|
1357
|
+
},
|
|
1358
|
+
|
|
1359
|
+
create<I extends Exact<DeepPartial<UpdateAIReferenceNameRequest>, I>>(base?: I): UpdateAIReferenceNameRequest {
|
|
1360
|
+
return UpdateAIReferenceNameRequest.fromPartial(base ?? ({} as any));
|
|
1361
|
+
},
|
|
1362
|
+
fromPartial<I extends Exact<DeepPartial<UpdateAIReferenceNameRequest>, I>>(object: I): UpdateAIReferenceNameRequest {
|
|
1363
|
+
const message = createBaseUpdateAIReferenceNameRequest();
|
|
1364
|
+
message.organizationId = object.organizationId ?? "";
|
|
1365
|
+
message.projectId = object.projectId ?? "";
|
|
1366
|
+
message.name = object.name ?? "";
|
|
1367
|
+
message.displayName = object.displayName ?? "";
|
|
1368
|
+
return message;
|
|
1369
|
+
},
|
|
1370
|
+
};
|
|
1371
|
+
|
|
1372
|
+
function createBaseUpdateAIReferenceNameResponse(): UpdateAIReferenceNameResponse {
|
|
1373
|
+
return { status: undefined, name: undefined };
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
export const UpdateAIReferenceNameResponse: MessageFns<UpdateAIReferenceNameResponse> = {
|
|
1377
|
+
encode(message: UpdateAIReferenceNameResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
1378
|
+
if (message.status !== undefined) {
|
|
1379
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
1380
|
+
}
|
|
1381
|
+
if (message.name !== undefined) {
|
|
1382
|
+
AIReferenceName.encode(message.name, writer.uint32(18).fork()).join();
|
|
1383
|
+
}
|
|
1384
|
+
return writer;
|
|
1385
|
+
},
|
|
1386
|
+
|
|
1387
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateAIReferenceNameResponse {
|
|
1388
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1389
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
1390
|
+
if (previousRecursionDepth >= 100) {
|
|
1391
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
1392
|
+
}
|
|
1393
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
1394
|
+
try {
|
|
1395
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1396
|
+
const message = createBaseUpdateAIReferenceNameResponse();
|
|
1397
|
+
while (reader.pos < end) {
|
|
1398
|
+
const tag = reader.uint32();
|
|
1399
|
+
switch (tag >>> 3) {
|
|
1400
|
+
case 1: {
|
|
1401
|
+
if (tag !== 10) {
|
|
1402
|
+
break;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
1406
|
+
continue;
|
|
1407
|
+
}
|
|
1408
|
+
case 2: {
|
|
1409
|
+
if (tag !== 18) {
|
|
1410
|
+
break;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
message.name = AIReferenceName.decode(reader, reader.uint32());
|
|
1414
|
+
continue;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1418
|
+
break;
|
|
1419
|
+
}
|
|
1420
|
+
reader.skip(tag & 7);
|
|
1421
|
+
}
|
|
1422
|
+
return message;
|
|
1423
|
+
} finally {
|
|
1424
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1427
|
+
|
|
1428
|
+
fromJSON(object: any): UpdateAIReferenceNameResponse {
|
|
1429
|
+
return {
|
|
1430
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
1431
|
+
name: isSet(object.name) ? AIReferenceName.fromJSON(object.name) : undefined,
|
|
1432
|
+
};
|
|
1433
|
+
},
|
|
1434
|
+
|
|
1435
|
+
toJSON(message: UpdateAIReferenceNameResponse): unknown {
|
|
1436
|
+
const obj: any = {};
|
|
1437
|
+
if (message.status !== undefined) {
|
|
1438
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
1439
|
+
}
|
|
1440
|
+
if (message.name !== undefined) {
|
|
1441
|
+
obj.name = AIReferenceName.toJSON(message.name);
|
|
1442
|
+
}
|
|
1443
|
+
return obj;
|
|
1444
|
+
},
|
|
1445
|
+
|
|
1446
|
+
create<I extends Exact<DeepPartial<UpdateAIReferenceNameResponse>, I>>(base?: I): UpdateAIReferenceNameResponse {
|
|
1447
|
+
return UpdateAIReferenceNameResponse.fromPartial(base ?? ({} as any));
|
|
1448
|
+
},
|
|
1449
|
+
fromPartial<I extends Exact<DeepPartial<UpdateAIReferenceNameResponse>, I>>(
|
|
1450
|
+
object: I,
|
|
1451
|
+
): UpdateAIReferenceNameResponse {
|
|
1452
|
+
const message = createBaseUpdateAIReferenceNameResponse();
|
|
1453
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
1454
|
+
? ResponseStatus.fromPartial(object.status)
|
|
1455
|
+
: undefined;
|
|
1456
|
+
message.name = (object.name !== undefined && object.name !== null)
|
|
1457
|
+
? AIReferenceName.fromPartial(object.name)
|
|
1458
|
+
: undefined;
|
|
1459
|
+
return message;
|
|
1460
|
+
},
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
/**
|
|
1464
|
+
* ReferenceGatewayService is the frontend-facing surface for the AI reference data: the org's lookup
|
|
1465
|
+
* tables (principals, and the provider / model / effort / billing-party display names). It proxies
|
|
1466
|
+
* telemetry.api.v1.AIReferenceService. Writes are org-admin only.
|
|
1467
|
+
*/
|
|
1468
|
+
export interface ReferenceGatewayService {
|
|
1469
|
+
ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse>;
|
|
1470
|
+
UpdatePrincipal(request: UpdatePrincipalRequest, metadata?: Metadata): Promise<UpdatePrincipalResponse>;
|
|
1471
|
+
/** Every stored name of the table has an entry, recorded or not. */
|
|
1472
|
+
ListAIProviders(request: ListAIReferenceNamesRequest, metadata?: Metadata): Promise<ListAIReferenceNamesResponse>;
|
|
1473
|
+
UpdateAIProvider(request: UpdateAIReferenceNameRequest, metadata?: Metadata): Promise<UpdateAIReferenceNameResponse>;
|
|
1474
|
+
ListAIModels(request: ListAIReferenceNamesRequest, metadata?: Metadata): Promise<ListAIReferenceNamesResponse>;
|
|
1475
|
+
UpdateAIModel(request: UpdateAIReferenceNameRequest, metadata?: Metadata): Promise<UpdateAIReferenceNameResponse>;
|
|
1476
|
+
ListAIEfforts(request: ListAIReferenceNamesRequest, metadata?: Metadata): Promise<ListAIReferenceNamesResponse>;
|
|
1477
|
+
UpdateAIEffort(request: UpdateAIReferenceNameRequest, metadata?: Metadata): Promise<UpdateAIReferenceNameResponse>;
|
|
1478
|
+
ListAIBillingParties(
|
|
1479
|
+
request: ListAIReferenceNamesRequest,
|
|
1480
|
+
metadata?: Metadata,
|
|
1481
|
+
): Promise<ListAIReferenceNamesResponse>;
|
|
1482
|
+
UpdateAIBillingParty(
|
|
1483
|
+
request: UpdateAIReferenceNameRequest,
|
|
1484
|
+
metadata?: Metadata,
|
|
1485
|
+
): Promise<UpdateAIReferenceNameResponse>;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
export const ReferenceGatewayServiceServiceName = "gateway.web.v1.ReferenceGatewayService";
|
|
1489
|
+
export class ReferenceGatewayServiceClientImpl implements ReferenceGatewayService {
|
|
1490
|
+
private readonly rpc: Rpc;
|
|
1491
|
+
private readonly service: string;
|
|
1492
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
1493
|
+
this.service = opts?.service || ReferenceGatewayServiceServiceName;
|
|
1494
|
+
this.rpc = rpc;
|
|
1495
|
+
this.ListPrincipals = this.ListPrincipals.bind(this);
|
|
1496
|
+
this.UpdatePrincipal = this.UpdatePrincipal.bind(this);
|
|
1497
|
+
this.ListAIProviders = this.ListAIProviders.bind(this);
|
|
1498
|
+
this.UpdateAIProvider = this.UpdateAIProvider.bind(this);
|
|
1499
|
+
this.ListAIModels = this.ListAIModels.bind(this);
|
|
1500
|
+
this.UpdateAIModel = this.UpdateAIModel.bind(this);
|
|
1501
|
+
this.ListAIEfforts = this.ListAIEfforts.bind(this);
|
|
1502
|
+
this.UpdateAIEffort = this.UpdateAIEffort.bind(this);
|
|
1503
|
+
this.ListAIBillingParties = this.ListAIBillingParties.bind(this);
|
|
1504
|
+
this.UpdateAIBillingParty = this.UpdateAIBillingParty.bind(this);
|
|
1505
|
+
}
|
|
1506
|
+
ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse> {
|
|
1507
|
+
const data = ListPrincipalsRequest.encode(request).finish();
|
|
1508
|
+
const promise = this.rpc.request(this.service, "ListPrincipals", data, metadata);
|
|
1509
|
+
return promise.then((data) => ListPrincipalsResponse.decode(new BinaryReader(data)));
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
UpdatePrincipal(request: UpdatePrincipalRequest, metadata?: Metadata): Promise<UpdatePrincipalResponse> {
|
|
1513
|
+
const data = UpdatePrincipalRequest.encode(request).finish();
|
|
1514
|
+
const promise = this.rpc.request(this.service, "UpdatePrincipal", data, metadata);
|
|
1515
|
+
return promise.then((data) => UpdatePrincipalResponse.decode(new BinaryReader(data)));
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
ListAIProviders(request: ListAIReferenceNamesRequest, metadata?: Metadata): Promise<ListAIReferenceNamesResponse> {
|
|
1519
|
+
const data = ListAIReferenceNamesRequest.encode(request).finish();
|
|
1520
|
+
const promise = this.rpc.request(this.service, "ListAIProviders", data, metadata);
|
|
1521
|
+
return promise.then((data) => ListAIReferenceNamesResponse.decode(new BinaryReader(data)));
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
UpdateAIProvider(request: UpdateAIReferenceNameRequest, metadata?: Metadata): Promise<UpdateAIReferenceNameResponse> {
|
|
1525
|
+
const data = UpdateAIReferenceNameRequest.encode(request).finish();
|
|
1526
|
+
const promise = this.rpc.request(this.service, "UpdateAIProvider", data, metadata);
|
|
1527
|
+
return promise.then((data) => UpdateAIReferenceNameResponse.decode(new BinaryReader(data)));
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
ListAIModels(request: ListAIReferenceNamesRequest, metadata?: Metadata): Promise<ListAIReferenceNamesResponse> {
|
|
1531
|
+
const data = ListAIReferenceNamesRequest.encode(request).finish();
|
|
1532
|
+
const promise = this.rpc.request(this.service, "ListAIModels", data, metadata);
|
|
1533
|
+
return promise.then((data) => ListAIReferenceNamesResponse.decode(new BinaryReader(data)));
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
UpdateAIModel(request: UpdateAIReferenceNameRequest, metadata?: Metadata): Promise<UpdateAIReferenceNameResponse> {
|
|
1537
|
+
const data = UpdateAIReferenceNameRequest.encode(request).finish();
|
|
1538
|
+
const promise = this.rpc.request(this.service, "UpdateAIModel", data, metadata);
|
|
1539
|
+
return promise.then((data) => UpdateAIReferenceNameResponse.decode(new BinaryReader(data)));
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
ListAIEfforts(request: ListAIReferenceNamesRequest, metadata?: Metadata): Promise<ListAIReferenceNamesResponse> {
|
|
1543
|
+
const data = ListAIReferenceNamesRequest.encode(request).finish();
|
|
1544
|
+
const promise = this.rpc.request(this.service, "ListAIEfforts", data, metadata);
|
|
1545
|
+
return promise.then((data) => ListAIReferenceNamesResponse.decode(new BinaryReader(data)));
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
UpdateAIEffort(request: UpdateAIReferenceNameRequest, metadata?: Metadata): Promise<UpdateAIReferenceNameResponse> {
|
|
1549
|
+
const data = UpdateAIReferenceNameRequest.encode(request).finish();
|
|
1550
|
+
const promise = this.rpc.request(this.service, "UpdateAIEffort", data, metadata);
|
|
1551
|
+
return promise.then((data) => UpdateAIReferenceNameResponse.decode(new BinaryReader(data)));
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
ListAIBillingParties(
|
|
1555
|
+
request: ListAIReferenceNamesRequest,
|
|
1556
|
+
metadata?: Metadata,
|
|
1557
|
+
): Promise<ListAIReferenceNamesResponse> {
|
|
1558
|
+
const data = ListAIReferenceNamesRequest.encode(request).finish();
|
|
1559
|
+
const promise = this.rpc.request(this.service, "ListAIBillingParties", data, metadata);
|
|
1560
|
+
return promise.then((data) => ListAIReferenceNamesResponse.decode(new BinaryReader(data)));
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
UpdateAIBillingParty(
|
|
1564
|
+
request: UpdateAIReferenceNameRequest,
|
|
1565
|
+
metadata?: Metadata,
|
|
1566
|
+
): Promise<UpdateAIReferenceNameResponse> {
|
|
1567
|
+
const data = UpdateAIReferenceNameRequest.encode(request).finish();
|
|
1568
|
+
const promise = this.rpc.request(this.service, "UpdateAIBillingParty", data, metadata);
|
|
1569
|
+
return promise.then((data) => UpdateAIReferenceNameResponse.decode(new BinaryReader(data)));
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
interface Rpc {
|
|
1574
|
+
request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
1578
|
+
|
|
1579
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
1580
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
1581
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
1582
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
1583
|
+
: Partial<T>;
|
|
1584
|
+
|
|
1585
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
1586
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
1587
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
1588
|
+
|
|
1589
|
+
function toTimestamp(date: Date): Timestamp {
|
|
1590
|
+
const seconds = Math.trunc(date.getTime() / 1_000);
|
|
1591
|
+
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
1592
|
+
return { seconds, nanos };
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
function fromTimestamp(t: Timestamp): Date {
|
|
1596
|
+
let millis = (t.seconds || 0) * 1_000;
|
|
1597
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
1598
|
+
return new globalThis.Date(millis);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
function fromJsonTimestamp(o: any): Date {
|
|
1602
|
+
if (o instanceof globalThis.Date) {
|
|
1603
|
+
return o;
|
|
1604
|
+
} else if (typeof o === "string") {
|
|
1605
|
+
return new globalThis.Date(o);
|
|
1606
|
+
} else {
|
|
1607
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
function longToNumber(int64: { toString(): string }): number {
|
|
1612
|
+
const num = globalThis.Number(int64.toString());
|
|
1613
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1614
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1615
|
+
}
|
|
1616
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1617
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1618
|
+
}
|
|
1619
|
+
return num;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
function isSet(value: any): boolean {
|
|
1623
|
+
return value !== null && value !== undefined;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
export interface MessageFns<T> {
|
|
1627
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
1628
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
1629
|
+
fromJSON(object: any): T;
|
|
1630
|
+
toJSON(message: T): unknown;
|
|
1631
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
1632
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
1633
|
+
}
|