@miradorlabs/web-grpc 2.21.0 → 2.23.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.
@@ -7,6 +7,8 @@
7
7
  /* eslint-disable */
8
8
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
9
  import type { Metadata } from "@grpc/grpc-js";
10
+ import { Observable } from "rxjs";
11
+ import { map } from "rxjs/operators";
10
12
  import { Timestamp } from "../../../../google/protobuf/timestamp";
11
13
  import { ResponseStatus } from "../../common/v1/status";
12
14
 
@@ -139,6 +141,20 @@ export interface GaugeThresholdSli {
139
141
  threshold: number;
140
142
  }
141
143
 
144
+ /**
145
+ * SloCorridorSelector pins a status/timeline read to ONE corridor. `values` maps each
146
+ * group_by attribute key to the value that corridor must equal; keys must exactly match
147
+ * the SLO objective's group_by. Absent (or empty map) = all corridors.
148
+ */
149
+ export interface SloCorridorSelector {
150
+ values: { [key: string]: string };
151
+ }
152
+
153
+ export interface SloCorridorSelector_ValuesEntry {
154
+ key: string;
155
+ value: string;
156
+ }
157
+
142
158
  export interface CreateSloRequest {
143
159
  organizationId: string;
144
160
  projectId: string;
@@ -211,7 +227,11 @@ export interface GetSloStatusRequest {
211
227
  projectId: string;
212
228
  sloId: string;
213
229
  /** evaluation_time: the instant the rolling window ends at. Unset = server now(). */
214
- evaluationTime: Date | undefined;
230
+ evaluationTime:
231
+ | Date
232
+ | undefined;
233
+ /** corridor: unset = all corridors; set = scope to one corridor. */
234
+ corridor: SloCorridorSelector | undefined;
215
235
  }
216
236
 
217
237
  export interface GetSloStatusResponse {
@@ -233,11 +253,12 @@ export interface SloStatus {
233
253
  }
234
254
 
235
255
  /**
236
- * SloCorridorStatus is one group_by combination's compliance. group_values is
237
- * parallel to the objective's group_by (empty for a project-wide SLO).
256
+ * SloCorridorStatus is one corridor's compliance. `corridor` identifies it as an
257
+ * attribute-key → value map, parallel to the objective's group_by (empty map for a
258
+ * project-wide SLO).
238
259
  */
239
260
  export interface SloCorridorStatus {
240
- groupValues: string[];
261
+ corridor: SloCorridorSelector | undefined;
241
262
  eligibleCount: number;
242
263
  goodCount: number;
243
264
  /** compliance: good/eligible in [0,1]; 0 and state NO_DATA when eligible_count is 0. */
@@ -257,6 +278,8 @@ export interface GetSloTimelineRequest {
257
278
  | undefined;
258
279
  /** bucket_count: number of trailing 1-hour buckets (0 = default 168 = 7d; max 2000). */
259
280
  bucketCount: number;
281
+ /** corridor: unset = all corridors pooled per hour; set = that one corridor's bar. */
282
+ corridor: SloCorridorSelector | undefined;
260
283
  }
261
284
 
262
285
  export interface GetSloTimelineResponse {
@@ -267,7 +290,8 @@ export interface GetSloTimelineResponse {
267
290
  /**
268
291
  * SloTimeline is one SLO's per-hour health over a trailing window of completed UTC
269
292
  * hours. Buckets are SPARSE: an hour with no eligible sample is omitted (render it
270
- * no-data). Each bucket is the worst (lowest-compliance) corridor that hour.
293
+ * no-data). Unscoped, each bucket pools all corridors that hour; scoped to a corridor,
294
+ * each bucket is that one corridor's good-ratio.
271
295
  */
272
296
  export interface SloTimeline {
273
297
  sloId: string;
@@ -277,6 +301,8 @@ export interface SloTimeline {
277
301
  windowStart: Date | undefined;
278
302
  windowEnd: Date | undefined;
279
303
  buckets: SloTimelineBucket[];
304
+ /** corridor: the scope this timeline was computed for; unset = all corridors pooled. */
305
+ corridor: SloCorridorSelector | undefined;
280
306
  }
281
307
 
282
308
  export interface SloTimelineBucket {
@@ -287,6 +313,192 @@ export interface SloTimelineBucket {
287
313
  state: SloCorridorState;
288
314
  }
289
315
 
316
+ export interface PreviewSloRequest {
317
+ organizationId: string;
318
+ projectId: string;
319
+ /** objective: the unsaved definition to score, updated live as the user edits. */
320
+ objective: SloObjective | undefined;
321
+ evaluationTime:
322
+ | Date
323
+ | undefined;
324
+ /** bucket_count: trailing 1-hour timeline buckets (0 = default 168 = 7d; max 2000). */
325
+ bucketCount: number;
326
+ }
327
+
328
+ export interface PreviewSloResponse {
329
+ status: ResponseStatus | undefined;
330
+ sloStatus: SloStatus | undefined;
331
+ timeline: SloTimeline | undefined;
332
+ }
333
+
334
+ export interface StreamSloStatusRequest {
335
+ organizationId: string;
336
+ projectId: string;
337
+ sloId: string;
338
+ /** corridor: unset = all corridors; set = scope to one corridor. */
339
+ corridor: SloCorridorSelector | undefined;
340
+ }
341
+
342
+ /**
343
+ * SloDashboard is a named, persisted board grouping SLOs. Each entry renders as the
344
+ * standard SLO card — a whole SLO (all corridors) or one corridor. The open board's
345
+ * aggregate summary is derived client-side from the entries' live status.
346
+ */
347
+ export interface SloDashboard {
348
+ id: string;
349
+ organizationId: string;
350
+ projectId: string;
351
+ name: string;
352
+ description: string;
353
+ /** entries: ordered; array order is display order. */
354
+ entries: SloDashboardEntry[];
355
+ /** version: optimistic lock; UpdateSloDashboard must echo it. */
356
+ version: number;
357
+ createdAt: Date | undefined;
358
+ updatedAt: Date | undefined;
359
+ }
360
+
361
+ /**
362
+ * SloDashboardEntry places one SLO on a board. `id` is client-generated
363
+ * ([A-Za-z0-9_-]{1,64}), unique within the board — the correlation key for
364
+ * StreamSloDashboardData frames. `corridor` unset = the whole SLO; set = one corridor.
365
+ */
366
+ export interface SloDashboardEntry {
367
+ id: string;
368
+ sloId: string;
369
+ corridor: SloCorridorSelector | undefined;
370
+ }
371
+
372
+ export interface CreateSloDashboardRequest {
373
+ organizationId: string;
374
+ projectId: string;
375
+ name: string;
376
+ description: string;
377
+ entries: SloDashboardEntry[];
378
+ }
379
+
380
+ export interface CreateSloDashboardResponse {
381
+ status: ResponseStatus | undefined;
382
+ dashboard: SloDashboard | undefined;
383
+ }
384
+
385
+ export interface GetSloDashboardRequest {
386
+ organizationId: string;
387
+ projectId: string;
388
+ dashboardId: string;
389
+ }
390
+
391
+ export interface GetSloDashboardResponse {
392
+ status: ResponseStatus | undefined;
393
+ dashboard: SloDashboard | undefined;
394
+ }
395
+
396
+ export interface ListSloDashboardsRequest {
397
+ organizationId: string;
398
+ projectId: string;
399
+ }
400
+
401
+ export interface ListSloDashboardsResponse {
402
+ status: ResponseStatus | undefined;
403
+ dashboards: SloDashboardSummary[];
404
+ }
405
+
406
+ /**
407
+ * SloDashboardSummary lists a board without its entries, plus a rolled-up live health so
408
+ * the dashboards list can show which board needs attention without opening it.
409
+ */
410
+ export interface SloDashboardSummary {
411
+ id: string;
412
+ name: string;
413
+ description: string;
414
+ sloCount: number;
415
+ createdAt: Date | undefined;
416
+ updatedAt:
417
+ | Date
418
+ | undefined;
419
+ /**
420
+ * health: live rollup across the board's entries; unset if it could not be computed so
421
+ * the list still renders (an unset health is never read as healthy).
422
+ */
423
+ health: SloDashboardHealth | undefined;
424
+ }
425
+
426
+ /** SloDashboardHealth rolls a board's entries into one at-a-glance status. */
427
+ export interface SloDashboardHealth {
428
+ okCount: number;
429
+ breachedCount: number;
430
+ noDataCount: number;
431
+ /**
432
+ * lowest_budget_remaining: the worst error budget across entries that have data (may be
433
+ * negative). Meaningful only when ok_count + breached_count > 0.
434
+ */
435
+ lowestBudgetRemaining: number;
436
+ /** worst_state: the most severe entry state on the board (BREACHED > NO_DATA > OK). */
437
+ worstState: SloCorridorState;
438
+ /**
439
+ * worst_entry_id: the entry driving worst_state / the lowest budget. Empty when the
440
+ * board has no entries.
441
+ */
442
+ worstEntryId: string;
443
+ /**
444
+ * at_risk_count: OK entries with less than 20% error budget remaining (budget < 0.2),
445
+ * i.e. close to breaching. Carved out of ok_count, so ok/at_risk/breached/no_data are
446
+ * disjoint and sum to the board's evaluable entries.
447
+ */
448
+ atRiskCount: number;
449
+ }
450
+
451
+ export interface UpdateSloDashboardRequest {
452
+ organizationId: string;
453
+ projectId: string;
454
+ dashboardId: string;
455
+ name: string;
456
+ description: string;
457
+ entries: SloDashboardEntry[];
458
+ /**
459
+ * version: the version last read; a mismatch fails with CONFLICT and the caller
460
+ * re-fetches, merges, retries.
461
+ */
462
+ version: number;
463
+ }
464
+
465
+ export interface UpdateSloDashboardResponse {
466
+ status: ResponseStatus | undefined;
467
+ dashboard: SloDashboard | undefined;
468
+ }
469
+
470
+ export interface DeleteSloDashboardRequest {
471
+ organizationId: string;
472
+ projectId: string;
473
+ dashboardId: string;
474
+ }
475
+
476
+ export interface DeleteSloDashboardResponse {
477
+ status: ResponseStatus | undefined;
478
+ }
479
+
480
+ export interface StreamSloDashboardDataRequest {
481
+ organizationId: string;
482
+ projectId: string;
483
+ dashboardId: string;
484
+ /** entry_ids: empty = all entries; otherwise only the listed ones. Unknown ids ignored. */
485
+ entryIds: string[];
486
+ }
487
+
488
+ /**
489
+ * SloDashboardDataEnvelope tags each frame with the entry it belongs to. A status is a
490
+ * COMPLETE replacement of that entry's compliance; an error is non-terminal.
491
+ */
492
+ export interface SloDashboardDataEnvelope {
493
+ entryId: string;
494
+ status?: SloStatus | undefined;
495
+ error?: SloPanelError | undefined;
496
+ }
497
+
498
+ export interface SloPanelError {
499
+ message: string;
500
+ }
501
+
290
502
  function createBaseSlo(): Slo {
291
503
  return {
292
504
  id: "",
@@ -721,6 +933,169 @@ export const GaugeThresholdSli: MessageFns<GaugeThresholdSli> = {
721
933
  },
722
934
  };
723
935
 
936
+ function createBaseSloCorridorSelector(): SloCorridorSelector {
937
+ return { values: {} };
938
+ }
939
+
940
+ export const SloCorridorSelector: MessageFns<SloCorridorSelector> = {
941
+ encode(message: SloCorridorSelector, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
942
+ globalThis.Object.entries(message.values).forEach(([key, value]: [string, string]) => {
943
+ SloCorridorSelector_ValuesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
944
+ });
945
+ return writer;
946
+ },
947
+
948
+ decode(input: BinaryReader | Uint8Array, length?: number): SloCorridorSelector {
949
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
950
+ const end = length === undefined ? reader.len : reader.pos + length;
951
+ const message = createBaseSloCorridorSelector();
952
+ while (reader.pos < end) {
953
+ const tag = reader.uint32();
954
+ switch (tag >>> 3) {
955
+ case 1: {
956
+ if (tag !== 10) {
957
+ break;
958
+ }
959
+
960
+ const entry1 = SloCorridorSelector_ValuesEntry.decode(reader, reader.uint32());
961
+ if (entry1.value !== undefined) {
962
+ message.values[entry1.key] = entry1.value;
963
+ }
964
+ continue;
965
+ }
966
+ }
967
+ if ((tag & 7) === 4 || tag === 0) {
968
+ break;
969
+ }
970
+ reader.skip(tag & 7);
971
+ }
972
+ return message;
973
+ },
974
+
975
+ fromJSON(object: any): SloCorridorSelector {
976
+ return {
977
+ values: isObject(object.values)
978
+ ? (globalThis.Object.entries(object.values) as [string, any][]).reduce(
979
+ (acc: { [key: string]: string }, [key, value]: [string, any]) => {
980
+ acc[key] = globalThis.String(value);
981
+ return acc;
982
+ },
983
+ {},
984
+ )
985
+ : {},
986
+ };
987
+ },
988
+
989
+ toJSON(message: SloCorridorSelector): unknown {
990
+ const obj: any = {};
991
+ if (message.values) {
992
+ const entries = globalThis.Object.entries(message.values) as [string, string][];
993
+ if (entries.length > 0) {
994
+ obj.values = {};
995
+ entries.forEach(([k, v]) => {
996
+ obj.values[k] = v;
997
+ });
998
+ }
999
+ }
1000
+ return obj;
1001
+ },
1002
+
1003
+ create<I extends Exact<DeepPartial<SloCorridorSelector>, I>>(base?: I): SloCorridorSelector {
1004
+ return SloCorridorSelector.fromPartial(base ?? ({} as any));
1005
+ },
1006
+ fromPartial<I extends Exact<DeepPartial<SloCorridorSelector>, I>>(object: I): SloCorridorSelector {
1007
+ const message = createBaseSloCorridorSelector();
1008
+ message.values = (globalThis.Object.entries(object.values ?? {}) as [string, string][]).reduce(
1009
+ (acc: { [key: string]: string }, [key, value]: [string, string]) => {
1010
+ if (value !== undefined) {
1011
+ acc[key] = globalThis.String(value);
1012
+ }
1013
+ return acc;
1014
+ },
1015
+ {},
1016
+ );
1017
+ return message;
1018
+ },
1019
+ };
1020
+
1021
+ function createBaseSloCorridorSelector_ValuesEntry(): SloCorridorSelector_ValuesEntry {
1022
+ return { key: "", value: "" };
1023
+ }
1024
+
1025
+ export const SloCorridorSelector_ValuesEntry: MessageFns<SloCorridorSelector_ValuesEntry> = {
1026
+ encode(message: SloCorridorSelector_ValuesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1027
+ if (message.key !== "") {
1028
+ writer.uint32(10).string(message.key);
1029
+ }
1030
+ if (message.value !== "") {
1031
+ writer.uint32(18).string(message.value);
1032
+ }
1033
+ return writer;
1034
+ },
1035
+
1036
+ decode(input: BinaryReader | Uint8Array, length?: number): SloCorridorSelector_ValuesEntry {
1037
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1038
+ const end = length === undefined ? reader.len : reader.pos + length;
1039
+ const message = createBaseSloCorridorSelector_ValuesEntry();
1040
+ while (reader.pos < end) {
1041
+ const tag = reader.uint32();
1042
+ switch (tag >>> 3) {
1043
+ case 1: {
1044
+ if (tag !== 10) {
1045
+ break;
1046
+ }
1047
+
1048
+ message.key = reader.string();
1049
+ continue;
1050
+ }
1051
+ case 2: {
1052
+ if (tag !== 18) {
1053
+ break;
1054
+ }
1055
+
1056
+ message.value = reader.string();
1057
+ continue;
1058
+ }
1059
+ }
1060
+ if ((tag & 7) === 4 || tag === 0) {
1061
+ break;
1062
+ }
1063
+ reader.skip(tag & 7);
1064
+ }
1065
+ return message;
1066
+ },
1067
+
1068
+ fromJSON(object: any): SloCorridorSelector_ValuesEntry {
1069
+ return {
1070
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
1071
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
1072
+ };
1073
+ },
1074
+
1075
+ toJSON(message: SloCorridorSelector_ValuesEntry): unknown {
1076
+ const obj: any = {};
1077
+ if (message.key !== "") {
1078
+ obj.key = message.key;
1079
+ }
1080
+ if (message.value !== "") {
1081
+ obj.value = message.value;
1082
+ }
1083
+ return obj;
1084
+ },
1085
+
1086
+ create<I extends Exact<DeepPartial<SloCorridorSelector_ValuesEntry>, I>>(base?: I): SloCorridorSelector_ValuesEntry {
1087
+ return SloCorridorSelector_ValuesEntry.fromPartial(base ?? ({} as any));
1088
+ },
1089
+ fromPartial<I extends Exact<DeepPartial<SloCorridorSelector_ValuesEntry>, I>>(
1090
+ object: I,
1091
+ ): SloCorridorSelector_ValuesEntry {
1092
+ const message = createBaseSloCorridorSelector_ValuesEntry();
1093
+ message.key = object.key ?? "";
1094
+ message.value = object.value ?? "";
1095
+ return message;
1096
+ },
1097
+ };
1098
+
724
1099
  function createBaseCreateSloRequest(): CreateSloRequest {
725
1100
  return { organizationId: "", projectId: "", name: "", description: "", enabled: false, objective: undefined };
726
1101
  }
@@ -1768,7 +2143,7 @@ export const DeleteSloResponse: MessageFns<DeleteSloResponse> = {
1768
2143
  };
1769
2144
 
1770
2145
  function createBaseGetSloStatusRequest(): GetSloStatusRequest {
1771
- return { organizationId: "", projectId: "", sloId: "", evaluationTime: undefined };
2146
+ return { organizationId: "", projectId: "", sloId: "", evaluationTime: undefined, corridor: undefined };
1772
2147
  }
1773
2148
 
1774
2149
  export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
@@ -1785,6 +2160,9 @@ export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
1785
2160
  if (message.evaluationTime !== undefined) {
1786
2161
  Timestamp.encode(toTimestamp(message.evaluationTime), writer.uint32(34).fork()).join();
1787
2162
  }
2163
+ if (message.corridor !== undefined) {
2164
+ SloCorridorSelector.encode(message.corridor, writer.uint32(42).fork()).join();
2165
+ }
1788
2166
  return writer;
1789
2167
  },
1790
2168
 
@@ -1827,6 +2205,14 @@ export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
1827
2205
  message.evaluationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1828
2206
  continue;
1829
2207
  }
2208
+ case 5: {
2209
+ if (tag !== 42) {
2210
+ break;
2211
+ }
2212
+
2213
+ message.corridor = SloCorridorSelector.decode(reader, reader.uint32());
2214
+ continue;
2215
+ }
1830
2216
  }
1831
2217
  if ((tag & 7) === 4 || tag === 0) {
1832
2218
  break;
@@ -1858,6 +2244,7 @@ export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
1858
2244
  : isSet(object.evaluation_time)
1859
2245
  ? fromJsonTimestamp(object.evaluation_time)
1860
2246
  : undefined,
2247
+ corridor: isSet(object.corridor) ? SloCorridorSelector.fromJSON(object.corridor) : undefined,
1861
2248
  };
1862
2249
  },
1863
2250
 
@@ -1875,6 +2262,9 @@ export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
1875
2262
  if (message.evaluationTime !== undefined) {
1876
2263
  obj.evaluationTime = message.evaluationTime.toISOString();
1877
2264
  }
2265
+ if (message.corridor !== undefined) {
2266
+ obj.corridor = SloCorridorSelector.toJSON(message.corridor);
2267
+ }
1878
2268
  return obj;
1879
2269
  },
1880
2270
 
@@ -1887,6 +2277,9 @@ export const GetSloStatusRequest: MessageFns<GetSloStatusRequest> = {
1887
2277
  message.projectId = object.projectId ?? "";
1888
2278
  message.sloId = object.sloId ?? "";
1889
2279
  message.evaluationTime = object.evaluationTime ?? undefined;
2280
+ message.corridor = (object.corridor !== undefined && object.corridor !== null)
2281
+ ? SloCorridorSelector.fromPartial(object.corridor)
2282
+ : undefined;
1890
2283
  return message;
1891
2284
  },
1892
2285
  };
@@ -2134,13 +2527,13 @@ export const SloStatus: MessageFns<SloStatus> = {
2134
2527
  };
2135
2528
 
2136
2529
  function createBaseSloCorridorStatus(): SloCorridorStatus {
2137
- return { groupValues: [], eligibleCount: 0, goodCount: 0, compliance: 0, budgetRemaining: 0, state: 0 };
2530
+ return { corridor: undefined, eligibleCount: 0, goodCount: 0, compliance: 0, budgetRemaining: 0, state: 0 };
2138
2531
  }
2139
2532
 
2140
2533
  export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
2141
2534
  encode(message: SloCorridorStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2142
- for (const v of message.groupValues) {
2143
- writer.uint32(10).string(v!);
2535
+ if (message.corridor !== undefined) {
2536
+ SloCorridorSelector.encode(message.corridor, writer.uint32(10).fork()).join();
2144
2537
  }
2145
2538
  if (message.eligibleCount !== 0) {
2146
2539
  writer.uint32(16).uint64(message.eligibleCount);
@@ -2172,7 +2565,7 @@ export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
2172
2565
  break;
2173
2566
  }
2174
2567
 
2175
- message.groupValues.push(reader.string());
2568
+ message.corridor = SloCorridorSelector.decode(reader, reader.uint32());
2176
2569
  continue;
2177
2570
  }
2178
2571
  case 2: {
@@ -2226,11 +2619,7 @@ export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
2226
2619
 
2227
2620
  fromJSON(object: any): SloCorridorStatus {
2228
2621
  return {
2229
- groupValues: globalThis.Array.isArray(object?.groupValues)
2230
- ? object.groupValues.map((e: any) => globalThis.String(e))
2231
- : globalThis.Array.isArray(object?.group_values)
2232
- ? object.group_values.map((e: any) => globalThis.String(e))
2233
- : [],
2622
+ corridor: isSet(object.corridor) ? SloCorridorSelector.fromJSON(object.corridor) : undefined,
2234
2623
  eligibleCount: isSet(object.eligibleCount)
2235
2624
  ? globalThis.Number(object.eligibleCount)
2236
2625
  : isSet(object.eligible_count)
@@ -2253,8 +2642,8 @@ export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
2253
2642
 
2254
2643
  toJSON(message: SloCorridorStatus): unknown {
2255
2644
  const obj: any = {};
2256
- if (message.groupValues?.length) {
2257
- obj.groupValues = message.groupValues;
2645
+ if (message.corridor !== undefined) {
2646
+ obj.corridor = SloCorridorSelector.toJSON(message.corridor);
2258
2647
  }
2259
2648
  if (message.eligibleCount !== 0) {
2260
2649
  obj.eligibleCount = Math.round(message.eligibleCount);
@@ -2279,7 +2668,9 @@ export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
2279
2668
  },
2280
2669
  fromPartial<I extends Exact<DeepPartial<SloCorridorStatus>, I>>(object: I): SloCorridorStatus {
2281
2670
  const message = createBaseSloCorridorStatus();
2282
- message.groupValues = object.groupValues?.map((e) => e) || [];
2671
+ message.corridor = (object.corridor !== undefined && object.corridor !== null)
2672
+ ? SloCorridorSelector.fromPartial(object.corridor)
2673
+ : undefined;
2283
2674
  message.eligibleCount = object.eligibleCount ?? 0;
2284
2675
  message.goodCount = object.goodCount ?? 0;
2285
2676
  message.compliance = object.compliance ?? 0;
@@ -2290,7 +2681,7 @@ export const SloCorridorStatus: MessageFns<SloCorridorStatus> = {
2290
2681
  };
2291
2682
 
2292
2683
  function createBaseGetSloTimelineRequest(): GetSloTimelineRequest {
2293
- return { organizationId: "", projectId: "", sloId: "", endTime: undefined, bucketCount: 0 };
2684
+ return { organizationId: "", projectId: "", sloId: "", endTime: undefined, bucketCount: 0, corridor: undefined };
2294
2685
  }
2295
2686
 
2296
2687
  export const GetSloTimelineRequest: MessageFns<GetSloTimelineRequest> = {
@@ -2310,6 +2701,9 @@ export const GetSloTimelineRequest: MessageFns<GetSloTimelineRequest> = {
2310
2701
  if (message.bucketCount !== 0) {
2311
2702
  writer.uint32(40).uint32(message.bucketCount);
2312
2703
  }
2704
+ if (message.corridor !== undefined) {
2705
+ SloCorridorSelector.encode(message.corridor, writer.uint32(50).fork()).join();
2706
+ }
2313
2707
  return writer;
2314
2708
  },
2315
2709
 
@@ -2360,6 +2754,14 @@ export const GetSloTimelineRequest: MessageFns<GetSloTimelineRequest> = {
2360
2754
  message.bucketCount = reader.uint32();
2361
2755
  continue;
2362
2756
  }
2757
+ case 6: {
2758
+ if (tag !== 50) {
2759
+ break;
2760
+ }
2761
+
2762
+ message.corridor = SloCorridorSelector.decode(reader, reader.uint32());
2763
+ continue;
2764
+ }
2363
2765
  }
2364
2766
  if ((tag & 7) === 4 || tag === 0) {
2365
2767
  break;
@@ -2396,6 +2798,7 @@ export const GetSloTimelineRequest: MessageFns<GetSloTimelineRequest> = {
2396
2798
  : isSet(object.bucket_count)
2397
2799
  ? globalThis.Number(object.bucket_count)
2398
2800
  : 0,
2801
+ corridor: isSet(object.corridor) ? SloCorridorSelector.fromJSON(object.corridor) : undefined,
2399
2802
  };
2400
2803
  },
2401
2804
 
@@ -2416,6 +2819,9 @@ export const GetSloTimelineRequest: MessageFns<GetSloTimelineRequest> = {
2416
2819
  if (message.bucketCount !== 0) {
2417
2820
  obj.bucketCount = Math.round(message.bucketCount);
2418
2821
  }
2822
+ if (message.corridor !== undefined) {
2823
+ obj.corridor = SloCorridorSelector.toJSON(message.corridor);
2824
+ }
2419
2825
  return obj;
2420
2826
  },
2421
2827
 
@@ -2429,6 +2835,9 @@ export const GetSloTimelineRequest: MessageFns<GetSloTimelineRequest> = {
2429
2835
  message.sloId = object.sloId ?? "";
2430
2836
  message.endTime = object.endTime ?? undefined;
2431
2837
  message.bucketCount = object.bucketCount ?? 0;
2838
+ message.corridor = (object.corridor !== undefined && object.corridor !== null)
2839
+ ? SloCorridorSelector.fromPartial(object.corridor)
2840
+ : undefined;
2432
2841
  return message;
2433
2842
  },
2434
2843
  };
@@ -2522,6 +2931,7 @@ function createBaseSloTimeline(): SloTimeline {
2522
2931
  windowStart: undefined,
2523
2932
  windowEnd: undefined,
2524
2933
  buckets: [],
2934
+ corridor: undefined,
2525
2935
  };
2526
2936
  }
2527
2937
 
@@ -2548,6 +2958,9 @@ export const SloTimeline: MessageFns<SloTimeline> = {
2548
2958
  for (const v of message.buckets) {
2549
2959
  SloTimelineBucket.encode(v!, writer.uint32(58).fork()).join();
2550
2960
  }
2961
+ if (message.corridor !== undefined) {
2962
+ SloCorridorSelector.encode(message.corridor, writer.uint32(66).fork()).join();
2963
+ }
2551
2964
  return writer;
2552
2965
  },
2553
2966
 
@@ -2614,6 +3027,14 @@ export const SloTimeline: MessageFns<SloTimeline> = {
2614
3027
  message.buckets.push(SloTimelineBucket.decode(reader, reader.uint32()));
2615
3028
  continue;
2616
3029
  }
3030
+ case 8: {
3031
+ if (tag !== 66) {
3032
+ break;
3033
+ }
3034
+
3035
+ message.corridor = SloCorridorSelector.decode(reader, reader.uint32());
3036
+ continue;
3037
+ }
2617
3038
  }
2618
3039
  if ((tag & 7) === 4 || tag === 0) {
2619
3040
  break;
@@ -2650,6 +3071,7 @@ export const SloTimeline: MessageFns<SloTimeline> = {
2650
3071
  buckets: globalThis.Array.isArray(object?.buckets)
2651
3072
  ? object.buckets.map((e: any) => SloTimelineBucket.fromJSON(e))
2652
3073
  : [],
3074
+ corridor: isSet(object.corridor) ? SloCorridorSelector.fromJSON(object.corridor) : undefined,
2653
3075
  };
2654
3076
  },
2655
3077
 
@@ -2676,6 +3098,9 @@ export const SloTimeline: MessageFns<SloTimeline> = {
2676
3098
  if (message.buckets?.length) {
2677
3099
  obj.buckets = message.buckets.map((e) => SloTimelineBucket.toJSON(e));
2678
3100
  }
3101
+ if (message.corridor !== undefined) {
3102
+ obj.corridor = SloCorridorSelector.toJSON(message.corridor);
3103
+ }
2679
3104
  return obj;
2680
3105
  },
2681
3106
 
@@ -2691,6 +3116,9 @@ export const SloTimeline: MessageFns<SloTimeline> = {
2691
3116
  message.windowStart = object.windowStart ?? undefined;
2692
3117
  message.windowEnd = object.windowEnd ?? undefined;
2693
3118
  message.buckets = object.buckets?.map((e) => SloTimelineBucket.fromPartial(e)) || [];
3119
+ message.corridor = (object.corridor !== undefined && object.corridor !== null)
3120
+ ? SloCorridorSelector.fromPartial(object.corridor)
3121
+ : undefined;
2694
3122
  return message;
2695
3123
  },
2696
3124
  };
@@ -2831,36 +3259,2374 @@ export const SloTimelineBucket: MessageFns<SloTimelineBucket> = {
2831
3259
  },
2832
3260
  };
2833
3261
 
2834
- /** SloGatewayService provides web client access to SLO definitions. */
2835
- export interface SloGatewayService {
2836
- CreateSlo(request: CreateSloRequest, metadata?: Metadata): Promise<CreateSloResponse>;
2837
- GetSlo(request: GetSloRequest, metadata?: Metadata): Promise<GetSloResponse>;
2838
- ListSlos(request: ListSlosRequest, metadata?: Metadata): Promise<ListSlosResponse>;
2839
- UpdateSlo(request: UpdateSloRequest, metadata?: Metadata): Promise<UpdateSloResponse>;
2840
- DeleteSlo(request: DeleteSloRequest, metadata?: Metadata): Promise<DeleteSloResponse>;
2841
- GetSloStatus(request: GetSloStatusRequest, metadata?: Metadata): Promise<GetSloStatusResponse>;
2842
- GetSloTimeline(request: GetSloTimelineRequest, metadata?: Metadata): Promise<GetSloTimelineResponse>;
3262
+ function createBasePreviewSloRequest(): PreviewSloRequest {
3263
+ return { organizationId: "", projectId: "", objective: undefined, evaluationTime: undefined, bucketCount: 0 };
2843
3264
  }
2844
3265
 
2845
- export const SloGatewayServiceServiceName = "gateway.web.v1.SloGatewayService";
2846
- export class SloGatewayServiceClientImpl implements SloGatewayService {
2847
- private readonly rpc: Rpc;
2848
- private readonly service: string;
2849
- constructor(rpc: Rpc, opts?: { service?: string }) {
2850
- this.service = opts?.service || SloGatewayServiceServiceName;
2851
- this.rpc = rpc;
2852
- this.CreateSlo = this.CreateSlo.bind(this);
2853
- this.GetSlo = this.GetSlo.bind(this);
2854
- this.ListSlos = this.ListSlos.bind(this);
2855
- this.UpdateSlo = this.UpdateSlo.bind(this);
2856
- this.DeleteSlo = this.DeleteSlo.bind(this);
2857
- this.GetSloStatus = this.GetSloStatus.bind(this);
2858
- this.GetSloTimeline = this.GetSloTimeline.bind(this);
2859
- }
2860
- CreateSlo(request: CreateSloRequest, metadata?: Metadata): Promise<CreateSloResponse> {
2861
- const data = CreateSloRequest.encode(request).finish();
2862
- const promise = this.rpc.request(this.service, "CreateSlo", data, metadata);
2863
- return promise.then((data) => CreateSloResponse.decode(new BinaryReader(data)));
3266
+ export const PreviewSloRequest: MessageFns<PreviewSloRequest> = {
3267
+ encode(message: PreviewSloRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3268
+ if (message.organizationId !== "") {
3269
+ writer.uint32(10).string(message.organizationId);
3270
+ }
3271
+ if (message.projectId !== "") {
3272
+ writer.uint32(18).string(message.projectId);
3273
+ }
3274
+ if (message.objective !== undefined) {
3275
+ SloObjective.encode(message.objective, writer.uint32(26).fork()).join();
3276
+ }
3277
+ if (message.evaluationTime !== undefined) {
3278
+ Timestamp.encode(toTimestamp(message.evaluationTime), writer.uint32(34).fork()).join();
3279
+ }
3280
+ if (message.bucketCount !== 0) {
3281
+ writer.uint32(40).uint32(message.bucketCount);
3282
+ }
3283
+ return writer;
3284
+ },
3285
+
3286
+ decode(input: BinaryReader | Uint8Array, length?: number): PreviewSloRequest {
3287
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3288
+ const end = length === undefined ? reader.len : reader.pos + length;
3289
+ const message = createBasePreviewSloRequest();
3290
+ while (reader.pos < end) {
3291
+ const tag = reader.uint32();
3292
+ switch (tag >>> 3) {
3293
+ case 1: {
3294
+ if (tag !== 10) {
3295
+ break;
3296
+ }
3297
+
3298
+ message.organizationId = reader.string();
3299
+ continue;
3300
+ }
3301
+ case 2: {
3302
+ if (tag !== 18) {
3303
+ break;
3304
+ }
3305
+
3306
+ message.projectId = reader.string();
3307
+ continue;
3308
+ }
3309
+ case 3: {
3310
+ if (tag !== 26) {
3311
+ break;
3312
+ }
3313
+
3314
+ message.objective = SloObjective.decode(reader, reader.uint32());
3315
+ continue;
3316
+ }
3317
+ case 4: {
3318
+ if (tag !== 34) {
3319
+ break;
3320
+ }
3321
+
3322
+ message.evaluationTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3323
+ continue;
3324
+ }
3325
+ case 5: {
3326
+ if (tag !== 40) {
3327
+ break;
3328
+ }
3329
+
3330
+ message.bucketCount = reader.uint32();
3331
+ continue;
3332
+ }
3333
+ }
3334
+ if ((tag & 7) === 4 || tag === 0) {
3335
+ break;
3336
+ }
3337
+ reader.skip(tag & 7);
3338
+ }
3339
+ return message;
3340
+ },
3341
+
3342
+ fromJSON(object: any): PreviewSloRequest {
3343
+ return {
3344
+ organizationId: isSet(object.organizationId)
3345
+ ? globalThis.String(object.organizationId)
3346
+ : isSet(object.organization_id)
3347
+ ? globalThis.String(object.organization_id)
3348
+ : "",
3349
+ projectId: isSet(object.projectId)
3350
+ ? globalThis.String(object.projectId)
3351
+ : isSet(object.project_id)
3352
+ ? globalThis.String(object.project_id)
3353
+ : "",
3354
+ objective: isSet(object.objective) ? SloObjective.fromJSON(object.objective) : undefined,
3355
+ evaluationTime: isSet(object.evaluationTime)
3356
+ ? fromJsonTimestamp(object.evaluationTime)
3357
+ : isSet(object.evaluation_time)
3358
+ ? fromJsonTimestamp(object.evaluation_time)
3359
+ : undefined,
3360
+ bucketCount: isSet(object.bucketCount)
3361
+ ? globalThis.Number(object.bucketCount)
3362
+ : isSet(object.bucket_count)
3363
+ ? globalThis.Number(object.bucket_count)
3364
+ : 0,
3365
+ };
3366
+ },
3367
+
3368
+ toJSON(message: PreviewSloRequest): unknown {
3369
+ const obj: any = {};
3370
+ if (message.organizationId !== "") {
3371
+ obj.organizationId = message.organizationId;
3372
+ }
3373
+ if (message.projectId !== "") {
3374
+ obj.projectId = message.projectId;
3375
+ }
3376
+ if (message.objective !== undefined) {
3377
+ obj.objective = SloObjective.toJSON(message.objective);
3378
+ }
3379
+ if (message.evaluationTime !== undefined) {
3380
+ obj.evaluationTime = message.evaluationTime.toISOString();
3381
+ }
3382
+ if (message.bucketCount !== 0) {
3383
+ obj.bucketCount = Math.round(message.bucketCount);
3384
+ }
3385
+ return obj;
3386
+ },
3387
+
3388
+ create<I extends Exact<DeepPartial<PreviewSloRequest>, I>>(base?: I): PreviewSloRequest {
3389
+ return PreviewSloRequest.fromPartial(base ?? ({} as any));
3390
+ },
3391
+ fromPartial<I extends Exact<DeepPartial<PreviewSloRequest>, I>>(object: I): PreviewSloRequest {
3392
+ const message = createBasePreviewSloRequest();
3393
+ message.organizationId = object.organizationId ?? "";
3394
+ message.projectId = object.projectId ?? "";
3395
+ message.objective = (object.objective !== undefined && object.objective !== null)
3396
+ ? SloObjective.fromPartial(object.objective)
3397
+ : undefined;
3398
+ message.evaluationTime = object.evaluationTime ?? undefined;
3399
+ message.bucketCount = object.bucketCount ?? 0;
3400
+ return message;
3401
+ },
3402
+ };
3403
+
3404
+ function createBasePreviewSloResponse(): PreviewSloResponse {
3405
+ return { status: undefined, sloStatus: undefined, timeline: undefined };
3406
+ }
3407
+
3408
+ export const PreviewSloResponse: MessageFns<PreviewSloResponse> = {
3409
+ encode(message: PreviewSloResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3410
+ if (message.status !== undefined) {
3411
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
3412
+ }
3413
+ if (message.sloStatus !== undefined) {
3414
+ SloStatus.encode(message.sloStatus, writer.uint32(18).fork()).join();
3415
+ }
3416
+ if (message.timeline !== undefined) {
3417
+ SloTimeline.encode(message.timeline, writer.uint32(26).fork()).join();
3418
+ }
3419
+ return writer;
3420
+ },
3421
+
3422
+ decode(input: BinaryReader | Uint8Array, length?: number): PreviewSloResponse {
3423
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3424
+ const end = length === undefined ? reader.len : reader.pos + length;
3425
+ const message = createBasePreviewSloResponse();
3426
+ while (reader.pos < end) {
3427
+ const tag = reader.uint32();
3428
+ switch (tag >>> 3) {
3429
+ case 1: {
3430
+ if (tag !== 10) {
3431
+ break;
3432
+ }
3433
+
3434
+ message.status = ResponseStatus.decode(reader, reader.uint32());
3435
+ continue;
3436
+ }
3437
+ case 2: {
3438
+ if (tag !== 18) {
3439
+ break;
3440
+ }
3441
+
3442
+ message.sloStatus = SloStatus.decode(reader, reader.uint32());
3443
+ continue;
3444
+ }
3445
+ case 3: {
3446
+ if (tag !== 26) {
3447
+ break;
3448
+ }
3449
+
3450
+ message.timeline = SloTimeline.decode(reader, reader.uint32());
3451
+ continue;
3452
+ }
3453
+ }
3454
+ if ((tag & 7) === 4 || tag === 0) {
3455
+ break;
3456
+ }
3457
+ reader.skip(tag & 7);
3458
+ }
3459
+ return message;
3460
+ },
3461
+
3462
+ fromJSON(object: any): PreviewSloResponse {
3463
+ return {
3464
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
3465
+ sloStatus: isSet(object.sloStatus)
3466
+ ? SloStatus.fromJSON(object.sloStatus)
3467
+ : isSet(object.slo_status)
3468
+ ? SloStatus.fromJSON(object.slo_status)
3469
+ : undefined,
3470
+ timeline: isSet(object.timeline) ? SloTimeline.fromJSON(object.timeline) : undefined,
3471
+ };
3472
+ },
3473
+
3474
+ toJSON(message: PreviewSloResponse): unknown {
3475
+ const obj: any = {};
3476
+ if (message.status !== undefined) {
3477
+ obj.status = ResponseStatus.toJSON(message.status);
3478
+ }
3479
+ if (message.sloStatus !== undefined) {
3480
+ obj.sloStatus = SloStatus.toJSON(message.sloStatus);
3481
+ }
3482
+ if (message.timeline !== undefined) {
3483
+ obj.timeline = SloTimeline.toJSON(message.timeline);
3484
+ }
3485
+ return obj;
3486
+ },
3487
+
3488
+ create<I extends Exact<DeepPartial<PreviewSloResponse>, I>>(base?: I): PreviewSloResponse {
3489
+ return PreviewSloResponse.fromPartial(base ?? ({} as any));
3490
+ },
3491
+ fromPartial<I extends Exact<DeepPartial<PreviewSloResponse>, I>>(object: I): PreviewSloResponse {
3492
+ const message = createBasePreviewSloResponse();
3493
+ message.status = (object.status !== undefined && object.status !== null)
3494
+ ? ResponseStatus.fromPartial(object.status)
3495
+ : undefined;
3496
+ message.sloStatus = (object.sloStatus !== undefined && object.sloStatus !== null)
3497
+ ? SloStatus.fromPartial(object.sloStatus)
3498
+ : undefined;
3499
+ message.timeline = (object.timeline !== undefined && object.timeline !== null)
3500
+ ? SloTimeline.fromPartial(object.timeline)
3501
+ : undefined;
3502
+ return message;
3503
+ },
3504
+ };
3505
+
3506
+ function createBaseStreamSloStatusRequest(): StreamSloStatusRequest {
3507
+ return { organizationId: "", projectId: "", sloId: "", corridor: undefined };
3508
+ }
3509
+
3510
+ export const StreamSloStatusRequest: MessageFns<StreamSloStatusRequest> = {
3511
+ encode(message: StreamSloStatusRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3512
+ if (message.organizationId !== "") {
3513
+ writer.uint32(10).string(message.organizationId);
3514
+ }
3515
+ if (message.projectId !== "") {
3516
+ writer.uint32(18).string(message.projectId);
3517
+ }
3518
+ if (message.sloId !== "") {
3519
+ writer.uint32(26).string(message.sloId);
3520
+ }
3521
+ if (message.corridor !== undefined) {
3522
+ SloCorridorSelector.encode(message.corridor, writer.uint32(34).fork()).join();
3523
+ }
3524
+ return writer;
3525
+ },
3526
+
3527
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamSloStatusRequest {
3528
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3529
+ const end = length === undefined ? reader.len : reader.pos + length;
3530
+ const message = createBaseStreamSloStatusRequest();
3531
+ while (reader.pos < end) {
3532
+ const tag = reader.uint32();
3533
+ switch (tag >>> 3) {
3534
+ case 1: {
3535
+ if (tag !== 10) {
3536
+ break;
3537
+ }
3538
+
3539
+ message.organizationId = reader.string();
3540
+ continue;
3541
+ }
3542
+ case 2: {
3543
+ if (tag !== 18) {
3544
+ break;
3545
+ }
3546
+
3547
+ message.projectId = reader.string();
3548
+ continue;
3549
+ }
3550
+ case 3: {
3551
+ if (tag !== 26) {
3552
+ break;
3553
+ }
3554
+
3555
+ message.sloId = reader.string();
3556
+ continue;
3557
+ }
3558
+ case 4: {
3559
+ if (tag !== 34) {
3560
+ break;
3561
+ }
3562
+
3563
+ message.corridor = SloCorridorSelector.decode(reader, reader.uint32());
3564
+ continue;
3565
+ }
3566
+ }
3567
+ if ((tag & 7) === 4 || tag === 0) {
3568
+ break;
3569
+ }
3570
+ reader.skip(tag & 7);
3571
+ }
3572
+ return message;
3573
+ },
3574
+
3575
+ fromJSON(object: any): StreamSloStatusRequest {
3576
+ return {
3577
+ organizationId: isSet(object.organizationId)
3578
+ ? globalThis.String(object.organizationId)
3579
+ : isSet(object.organization_id)
3580
+ ? globalThis.String(object.organization_id)
3581
+ : "",
3582
+ projectId: isSet(object.projectId)
3583
+ ? globalThis.String(object.projectId)
3584
+ : isSet(object.project_id)
3585
+ ? globalThis.String(object.project_id)
3586
+ : "",
3587
+ sloId: isSet(object.sloId)
3588
+ ? globalThis.String(object.sloId)
3589
+ : isSet(object.slo_id)
3590
+ ? globalThis.String(object.slo_id)
3591
+ : "",
3592
+ corridor: isSet(object.corridor) ? SloCorridorSelector.fromJSON(object.corridor) : undefined,
3593
+ };
3594
+ },
3595
+
3596
+ toJSON(message: StreamSloStatusRequest): unknown {
3597
+ const obj: any = {};
3598
+ if (message.organizationId !== "") {
3599
+ obj.organizationId = message.organizationId;
3600
+ }
3601
+ if (message.projectId !== "") {
3602
+ obj.projectId = message.projectId;
3603
+ }
3604
+ if (message.sloId !== "") {
3605
+ obj.sloId = message.sloId;
3606
+ }
3607
+ if (message.corridor !== undefined) {
3608
+ obj.corridor = SloCorridorSelector.toJSON(message.corridor);
3609
+ }
3610
+ return obj;
3611
+ },
3612
+
3613
+ create<I extends Exact<DeepPartial<StreamSloStatusRequest>, I>>(base?: I): StreamSloStatusRequest {
3614
+ return StreamSloStatusRequest.fromPartial(base ?? ({} as any));
3615
+ },
3616
+ fromPartial<I extends Exact<DeepPartial<StreamSloStatusRequest>, I>>(object: I): StreamSloStatusRequest {
3617
+ const message = createBaseStreamSloStatusRequest();
3618
+ message.organizationId = object.organizationId ?? "";
3619
+ message.projectId = object.projectId ?? "";
3620
+ message.sloId = object.sloId ?? "";
3621
+ message.corridor = (object.corridor !== undefined && object.corridor !== null)
3622
+ ? SloCorridorSelector.fromPartial(object.corridor)
3623
+ : undefined;
3624
+ return message;
3625
+ },
3626
+ };
3627
+
3628
+ function createBaseSloDashboard(): SloDashboard {
3629
+ return {
3630
+ id: "",
3631
+ organizationId: "",
3632
+ projectId: "",
3633
+ name: "",
3634
+ description: "",
3635
+ entries: [],
3636
+ version: 0,
3637
+ createdAt: undefined,
3638
+ updatedAt: undefined,
3639
+ };
3640
+ }
3641
+
3642
+ export const SloDashboard: MessageFns<SloDashboard> = {
3643
+ encode(message: SloDashboard, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3644
+ if (message.id !== "") {
3645
+ writer.uint32(10).string(message.id);
3646
+ }
3647
+ if (message.organizationId !== "") {
3648
+ writer.uint32(18).string(message.organizationId);
3649
+ }
3650
+ if (message.projectId !== "") {
3651
+ writer.uint32(26).string(message.projectId);
3652
+ }
3653
+ if (message.name !== "") {
3654
+ writer.uint32(34).string(message.name);
3655
+ }
3656
+ if (message.description !== "") {
3657
+ writer.uint32(42).string(message.description);
3658
+ }
3659
+ for (const v of message.entries) {
3660
+ SloDashboardEntry.encode(v!, writer.uint32(50).fork()).join();
3661
+ }
3662
+ if (message.version !== 0) {
3663
+ writer.uint32(56).int64(message.version);
3664
+ }
3665
+ if (message.createdAt !== undefined) {
3666
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
3667
+ }
3668
+ if (message.updatedAt !== undefined) {
3669
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(74).fork()).join();
3670
+ }
3671
+ return writer;
3672
+ },
3673
+
3674
+ decode(input: BinaryReader | Uint8Array, length?: number): SloDashboard {
3675
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3676
+ const end = length === undefined ? reader.len : reader.pos + length;
3677
+ const message = createBaseSloDashboard();
3678
+ while (reader.pos < end) {
3679
+ const tag = reader.uint32();
3680
+ switch (tag >>> 3) {
3681
+ case 1: {
3682
+ if (tag !== 10) {
3683
+ break;
3684
+ }
3685
+
3686
+ message.id = reader.string();
3687
+ continue;
3688
+ }
3689
+ case 2: {
3690
+ if (tag !== 18) {
3691
+ break;
3692
+ }
3693
+
3694
+ message.organizationId = reader.string();
3695
+ continue;
3696
+ }
3697
+ case 3: {
3698
+ if (tag !== 26) {
3699
+ break;
3700
+ }
3701
+
3702
+ message.projectId = reader.string();
3703
+ continue;
3704
+ }
3705
+ case 4: {
3706
+ if (tag !== 34) {
3707
+ break;
3708
+ }
3709
+
3710
+ message.name = reader.string();
3711
+ continue;
3712
+ }
3713
+ case 5: {
3714
+ if (tag !== 42) {
3715
+ break;
3716
+ }
3717
+
3718
+ message.description = reader.string();
3719
+ continue;
3720
+ }
3721
+ case 6: {
3722
+ if (tag !== 50) {
3723
+ break;
3724
+ }
3725
+
3726
+ message.entries.push(SloDashboardEntry.decode(reader, reader.uint32()));
3727
+ continue;
3728
+ }
3729
+ case 7: {
3730
+ if (tag !== 56) {
3731
+ break;
3732
+ }
3733
+
3734
+ message.version = longToNumber(reader.int64());
3735
+ continue;
3736
+ }
3737
+ case 8: {
3738
+ if (tag !== 66) {
3739
+ break;
3740
+ }
3741
+
3742
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3743
+ continue;
3744
+ }
3745
+ case 9: {
3746
+ if (tag !== 74) {
3747
+ break;
3748
+ }
3749
+
3750
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
3751
+ continue;
3752
+ }
3753
+ }
3754
+ if ((tag & 7) === 4 || tag === 0) {
3755
+ break;
3756
+ }
3757
+ reader.skip(tag & 7);
3758
+ }
3759
+ return message;
3760
+ },
3761
+
3762
+ fromJSON(object: any): SloDashboard {
3763
+ return {
3764
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
3765
+ organizationId: isSet(object.organizationId)
3766
+ ? globalThis.String(object.organizationId)
3767
+ : isSet(object.organization_id)
3768
+ ? globalThis.String(object.organization_id)
3769
+ : "",
3770
+ projectId: isSet(object.projectId)
3771
+ ? globalThis.String(object.projectId)
3772
+ : isSet(object.project_id)
3773
+ ? globalThis.String(object.project_id)
3774
+ : "",
3775
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
3776
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
3777
+ entries: globalThis.Array.isArray(object?.entries)
3778
+ ? object.entries.map((e: any) => SloDashboardEntry.fromJSON(e))
3779
+ : [],
3780
+ version: isSet(object.version) ? globalThis.Number(object.version) : 0,
3781
+ createdAt: isSet(object.createdAt)
3782
+ ? fromJsonTimestamp(object.createdAt)
3783
+ : isSet(object.created_at)
3784
+ ? fromJsonTimestamp(object.created_at)
3785
+ : undefined,
3786
+ updatedAt: isSet(object.updatedAt)
3787
+ ? fromJsonTimestamp(object.updatedAt)
3788
+ : isSet(object.updated_at)
3789
+ ? fromJsonTimestamp(object.updated_at)
3790
+ : undefined,
3791
+ };
3792
+ },
3793
+
3794
+ toJSON(message: SloDashboard): unknown {
3795
+ const obj: any = {};
3796
+ if (message.id !== "") {
3797
+ obj.id = message.id;
3798
+ }
3799
+ if (message.organizationId !== "") {
3800
+ obj.organizationId = message.organizationId;
3801
+ }
3802
+ if (message.projectId !== "") {
3803
+ obj.projectId = message.projectId;
3804
+ }
3805
+ if (message.name !== "") {
3806
+ obj.name = message.name;
3807
+ }
3808
+ if (message.description !== "") {
3809
+ obj.description = message.description;
3810
+ }
3811
+ if (message.entries?.length) {
3812
+ obj.entries = message.entries.map((e) => SloDashboardEntry.toJSON(e));
3813
+ }
3814
+ if (message.version !== 0) {
3815
+ obj.version = Math.round(message.version);
3816
+ }
3817
+ if (message.createdAt !== undefined) {
3818
+ obj.createdAt = message.createdAt.toISOString();
3819
+ }
3820
+ if (message.updatedAt !== undefined) {
3821
+ obj.updatedAt = message.updatedAt.toISOString();
3822
+ }
3823
+ return obj;
3824
+ },
3825
+
3826
+ create<I extends Exact<DeepPartial<SloDashboard>, I>>(base?: I): SloDashboard {
3827
+ return SloDashboard.fromPartial(base ?? ({} as any));
3828
+ },
3829
+ fromPartial<I extends Exact<DeepPartial<SloDashboard>, I>>(object: I): SloDashboard {
3830
+ const message = createBaseSloDashboard();
3831
+ message.id = object.id ?? "";
3832
+ message.organizationId = object.organizationId ?? "";
3833
+ message.projectId = object.projectId ?? "";
3834
+ message.name = object.name ?? "";
3835
+ message.description = object.description ?? "";
3836
+ message.entries = object.entries?.map((e) => SloDashboardEntry.fromPartial(e)) || [];
3837
+ message.version = object.version ?? 0;
3838
+ message.createdAt = object.createdAt ?? undefined;
3839
+ message.updatedAt = object.updatedAt ?? undefined;
3840
+ return message;
3841
+ },
3842
+ };
3843
+
3844
+ function createBaseSloDashboardEntry(): SloDashboardEntry {
3845
+ return { id: "", sloId: "", corridor: undefined };
3846
+ }
3847
+
3848
+ export const SloDashboardEntry: MessageFns<SloDashboardEntry> = {
3849
+ encode(message: SloDashboardEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3850
+ if (message.id !== "") {
3851
+ writer.uint32(10).string(message.id);
3852
+ }
3853
+ if (message.sloId !== "") {
3854
+ writer.uint32(18).string(message.sloId);
3855
+ }
3856
+ if (message.corridor !== undefined) {
3857
+ SloCorridorSelector.encode(message.corridor, writer.uint32(26).fork()).join();
3858
+ }
3859
+ return writer;
3860
+ },
3861
+
3862
+ decode(input: BinaryReader | Uint8Array, length?: number): SloDashboardEntry {
3863
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3864
+ const end = length === undefined ? reader.len : reader.pos + length;
3865
+ const message = createBaseSloDashboardEntry();
3866
+ while (reader.pos < end) {
3867
+ const tag = reader.uint32();
3868
+ switch (tag >>> 3) {
3869
+ case 1: {
3870
+ if (tag !== 10) {
3871
+ break;
3872
+ }
3873
+
3874
+ message.id = reader.string();
3875
+ continue;
3876
+ }
3877
+ case 2: {
3878
+ if (tag !== 18) {
3879
+ break;
3880
+ }
3881
+
3882
+ message.sloId = reader.string();
3883
+ continue;
3884
+ }
3885
+ case 3: {
3886
+ if (tag !== 26) {
3887
+ break;
3888
+ }
3889
+
3890
+ message.corridor = SloCorridorSelector.decode(reader, reader.uint32());
3891
+ continue;
3892
+ }
3893
+ }
3894
+ if ((tag & 7) === 4 || tag === 0) {
3895
+ break;
3896
+ }
3897
+ reader.skip(tag & 7);
3898
+ }
3899
+ return message;
3900
+ },
3901
+
3902
+ fromJSON(object: any): SloDashboardEntry {
3903
+ return {
3904
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
3905
+ sloId: isSet(object.sloId)
3906
+ ? globalThis.String(object.sloId)
3907
+ : isSet(object.slo_id)
3908
+ ? globalThis.String(object.slo_id)
3909
+ : "",
3910
+ corridor: isSet(object.corridor) ? SloCorridorSelector.fromJSON(object.corridor) : undefined,
3911
+ };
3912
+ },
3913
+
3914
+ toJSON(message: SloDashboardEntry): unknown {
3915
+ const obj: any = {};
3916
+ if (message.id !== "") {
3917
+ obj.id = message.id;
3918
+ }
3919
+ if (message.sloId !== "") {
3920
+ obj.sloId = message.sloId;
3921
+ }
3922
+ if (message.corridor !== undefined) {
3923
+ obj.corridor = SloCorridorSelector.toJSON(message.corridor);
3924
+ }
3925
+ return obj;
3926
+ },
3927
+
3928
+ create<I extends Exact<DeepPartial<SloDashboardEntry>, I>>(base?: I): SloDashboardEntry {
3929
+ return SloDashboardEntry.fromPartial(base ?? ({} as any));
3930
+ },
3931
+ fromPartial<I extends Exact<DeepPartial<SloDashboardEntry>, I>>(object: I): SloDashboardEntry {
3932
+ const message = createBaseSloDashboardEntry();
3933
+ message.id = object.id ?? "";
3934
+ message.sloId = object.sloId ?? "";
3935
+ message.corridor = (object.corridor !== undefined && object.corridor !== null)
3936
+ ? SloCorridorSelector.fromPartial(object.corridor)
3937
+ : undefined;
3938
+ return message;
3939
+ },
3940
+ };
3941
+
3942
+ function createBaseCreateSloDashboardRequest(): CreateSloDashboardRequest {
3943
+ return { organizationId: "", projectId: "", name: "", description: "", entries: [] };
3944
+ }
3945
+
3946
+ export const CreateSloDashboardRequest: MessageFns<CreateSloDashboardRequest> = {
3947
+ encode(message: CreateSloDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
3948
+ if (message.organizationId !== "") {
3949
+ writer.uint32(10).string(message.organizationId);
3950
+ }
3951
+ if (message.projectId !== "") {
3952
+ writer.uint32(18).string(message.projectId);
3953
+ }
3954
+ if (message.name !== "") {
3955
+ writer.uint32(26).string(message.name);
3956
+ }
3957
+ if (message.description !== "") {
3958
+ writer.uint32(34).string(message.description);
3959
+ }
3960
+ for (const v of message.entries) {
3961
+ SloDashboardEntry.encode(v!, writer.uint32(42).fork()).join();
3962
+ }
3963
+ return writer;
3964
+ },
3965
+
3966
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateSloDashboardRequest {
3967
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
3968
+ const end = length === undefined ? reader.len : reader.pos + length;
3969
+ const message = createBaseCreateSloDashboardRequest();
3970
+ while (reader.pos < end) {
3971
+ const tag = reader.uint32();
3972
+ switch (tag >>> 3) {
3973
+ case 1: {
3974
+ if (tag !== 10) {
3975
+ break;
3976
+ }
3977
+
3978
+ message.organizationId = reader.string();
3979
+ continue;
3980
+ }
3981
+ case 2: {
3982
+ if (tag !== 18) {
3983
+ break;
3984
+ }
3985
+
3986
+ message.projectId = reader.string();
3987
+ continue;
3988
+ }
3989
+ case 3: {
3990
+ if (tag !== 26) {
3991
+ break;
3992
+ }
3993
+
3994
+ message.name = reader.string();
3995
+ continue;
3996
+ }
3997
+ case 4: {
3998
+ if (tag !== 34) {
3999
+ break;
4000
+ }
4001
+
4002
+ message.description = reader.string();
4003
+ continue;
4004
+ }
4005
+ case 5: {
4006
+ if (tag !== 42) {
4007
+ break;
4008
+ }
4009
+
4010
+ message.entries.push(SloDashboardEntry.decode(reader, reader.uint32()));
4011
+ continue;
4012
+ }
4013
+ }
4014
+ if ((tag & 7) === 4 || tag === 0) {
4015
+ break;
4016
+ }
4017
+ reader.skip(tag & 7);
4018
+ }
4019
+ return message;
4020
+ },
4021
+
4022
+ fromJSON(object: any): CreateSloDashboardRequest {
4023
+ return {
4024
+ organizationId: isSet(object.organizationId)
4025
+ ? globalThis.String(object.organizationId)
4026
+ : isSet(object.organization_id)
4027
+ ? globalThis.String(object.organization_id)
4028
+ : "",
4029
+ projectId: isSet(object.projectId)
4030
+ ? globalThis.String(object.projectId)
4031
+ : isSet(object.project_id)
4032
+ ? globalThis.String(object.project_id)
4033
+ : "",
4034
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
4035
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
4036
+ entries: globalThis.Array.isArray(object?.entries)
4037
+ ? object.entries.map((e: any) => SloDashboardEntry.fromJSON(e))
4038
+ : [],
4039
+ };
4040
+ },
4041
+
4042
+ toJSON(message: CreateSloDashboardRequest): unknown {
4043
+ const obj: any = {};
4044
+ if (message.organizationId !== "") {
4045
+ obj.organizationId = message.organizationId;
4046
+ }
4047
+ if (message.projectId !== "") {
4048
+ obj.projectId = message.projectId;
4049
+ }
4050
+ if (message.name !== "") {
4051
+ obj.name = message.name;
4052
+ }
4053
+ if (message.description !== "") {
4054
+ obj.description = message.description;
4055
+ }
4056
+ if (message.entries?.length) {
4057
+ obj.entries = message.entries.map((e) => SloDashboardEntry.toJSON(e));
4058
+ }
4059
+ return obj;
4060
+ },
4061
+
4062
+ create<I extends Exact<DeepPartial<CreateSloDashboardRequest>, I>>(base?: I): CreateSloDashboardRequest {
4063
+ return CreateSloDashboardRequest.fromPartial(base ?? ({} as any));
4064
+ },
4065
+ fromPartial<I extends Exact<DeepPartial<CreateSloDashboardRequest>, I>>(object: I): CreateSloDashboardRequest {
4066
+ const message = createBaseCreateSloDashboardRequest();
4067
+ message.organizationId = object.organizationId ?? "";
4068
+ message.projectId = object.projectId ?? "";
4069
+ message.name = object.name ?? "";
4070
+ message.description = object.description ?? "";
4071
+ message.entries = object.entries?.map((e) => SloDashboardEntry.fromPartial(e)) || [];
4072
+ return message;
4073
+ },
4074
+ };
4075
+
4076
+ function createBaseCreateSloDashboardResponse(): CreateSloDashboardResponse {
4077
+ return { status: undefined, dashboard: undefined };
4078
+ }
4079
+
4080
+ export const CreateSloDashboardResponse: MessageFns<CreateSloDashboardResponse> = {
4081
+ encode(message: CreateSloDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4082
+ if (message.status !== undefined) {
4083
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
4084
+ }
4085
+ if (message.dashboard !== undefined) {
4086
+ SloDashboard.encode(message.dashboard, writer.uint32(18).fork()).join();
4087
+ }
4088
+ return writer;
4089
+ },
4090
+
4091
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateSloDashboardResponse {
4092
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4093
+ const end = length === undefined ? reader.len : reader.pos + length;
4094
+ const message = createBaseCreateSloDashboardResponse();
4095
+ while (reader.pos < end) {
4096
+ const tag = reader.uint32();
4097
+ switch (tag >>> 3) {
4098
+ case 1: {
4099
+ if (tag !== 10) {
4100
+ break;
4101
+ }
4102
+
4103
+ message.status = ResponseStatus.decode(reader, reader.uint32());
4104
+ continue;
4105
+ }
4106
+ case 2: {
4107
+ if (tag !== 18) {
4108
+ break;
4109
+ }
4110
+
4111
+ message.dashboard = SloDashboard.decode(reader, reader.uint32());
4112
+ continue;
4113
+ }
4114
+ }
4115
+ if ((tag & 7) === 4 || tag === 0) {
4116
+ break;
4117
+ }
4118
+ reader.skip(tag & 7);
4119
+ }
4120
+ return message;
4121
+ },
4122
+
4123
+ fromJSON(object: any): CreateSloDashboardResponse {
4124
+ return {
4125
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
4126
+ dashboard: isSet(object.dashboard) ? SloDashboard.fromJSON(object.dashboard) : undefined,
4127
+ };
4128
+ },
4129
+
4130
+ toJSON(message: CreateSloDashboardResponse): unknown {
4131
+ const obj: any = {};
4132
+ if (message.status !== undefined) {
4133
+ obj.status = ResponseStatus.toJSON(message.status);
4134
+ }
4135
+ if (message.dashboard !== undefined) {
4136
+ obj.dashboard = SloDashboard.toJSON(message.dashboard);
4137
+ }
4138
+ return obj;
4139
+ },
4140
+
4141
+ create<I extends Exact<DeepPartial<CreateSloDashboardResponse>, I>>(base?: I): CreateSloDashboardResponse {
4142
+ return CreateSloDashboardResponse.fromPartial(base ?? ({} as any));
4143
+ },
4144
+ fromPartial<I extends Exact<DeepPartial<CreateSloDashboardResponse>, I>>(object: I): CreateSloDashboardResponse {
4145
+ const message = createBaseCreateSloDashboardResponse();
4146
+ message.status = (object.status !== undefined && object.status !== null)
4147
+ ? ResponseStatus.fromPartial(object.status)
4148
+ : undefined;
4149
+ message.dashboard = (object.dashboard !== undefined && object.dashboard !== null)
4150
+ ? SloDashboard.fromPartial(object.dashboard)
4151
+ : undefined;
4152
+ return message;
4153
+ },
4154
+ };
4155
+
4156
+ function createBaseGetSloDashboardRequest(): GetSloDashboardRequest {
4157
+ return { organizationId: "", projectId: "", dashboardId: "" };
4158
+ }
4159
+
4160
+ export const GetSloDashboardRequest: MessageFns<GetSloDashboardRequest> = {
4161
+ encode(message: GetSloDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4162
+ if (message.organizationId !== "") {
4163
+ writer.uint32(10).string(message.organizationId);
4164
+ }
4165
+ if (message.projectId !== "") {
4166
+ writer.uint32(18).string(message.projectId);
4167
+ }
4168
+ if (message.dashboardId !== "") {
4169
+ writer.uint32(26).string(message.dashboardId);
4170
+ }
4171
+ return writer;
4172
+ },
4173
+
4174
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSloDashboardRequest {
4175
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4176
+ const end = length === undefined ? reader.len : reader.pos + length;
4177
+ const message = createBaseGetSloDashboardRequest();
4178
+ while (reader.pos < end) {
4179
+ const tag = reader.uint32();
4180
+ switch (tag >>> 3) {
4181
+ case 1: {
4182
+ if (tag !== 10) {
4183
+ break;
4184
+ }
4185
+
4186
+ message.organizationId = reader.string();
4187
+ continue;
4188
+ }
4189
+ case 2: {
4190
+ if (tag !== 18) {
4191
+ break;
4192
+ }
4193
+
4194
+ message.projectId = reader.string();
4195
+ continue;
4196
+ }
4197
+ case 3: {
4198
+ if (tag !== 26) {
4199
+ break;
4200
+ }
4201
+
4202
+ message.dashboardId = reader.string();
4203
+ continue;
4204
+ }
4205
+ }
4206
+ if ((tag & 7) === 4 || tag === 0) {
4207
+ break;
4208
+ }
4209
+ reader.skip(tag & 7);
4210
+ }
4211
+ return message;
4212
+ },
4213
+
4214
+ fromJSON(object: any): GetSloDashboardRequest {
4215
+ return {
4216
+ organizationId: isSet(object.organizationId)
4217
+ ? globalThis.String(object.organizationId)
4218
+ : isSet(object.organization_id)
4219
+ ? globalThis.String(object.organization_id)
4220
+ : "",
4221
+ projectId: isSet(object.projectId)
4222
+ ? globalThis.String(object.projectId)
4223
+ : isSet(object.project_id)
4224
+ ? globalThis.String(object.project_id)
4225
+ : "",
4226
+ dashboardId: isSet(object.dashboardId)
4227
+ ? globalThis.String(object.dashboardId)
4228
+ : isSet(object.dashboard_id)
4229
+ ? globalThis.String(object.dashboard_id)
4230
+ : "",
4231
+ };
4232
+ },
4233
+
4234
+ toJSON(message: GetSloDashboardRequest): unknown {
4235
+ const obj: any = {};
4236
+ if (message.organizationId !== "") {
4237
+ obj.organizationId = message.organizationId;
4238
+ }
4239
+ if (message.projectId !== "") {
4240
+ obj.projectId = message.projectId;
4241
+ }
4242
+ if (message.dashboardId !== "") {
4243
+ obj.dashboardId = message.dashboardId;
4244
+ }
4245
+ return obj;
4246
+ },
4247
+
4248
+ create<I extends Exact<DeepPartial<GetSloDashboardRequest>, I>>(base?: I): GetSloDashboardRequest {
4249
+ return GetSloDashboardRequest.fromPartial(base ?? ({} as any));
4250
+ },
4251
+ fromPartial<I extends Exact<DeepPartial<GetSloDashboardRequest>, I>>(object: I): GetSloDashboardRequest {
4252
+ const message = createBaseGetSloDashboardRequest();
4253
+ message.organizationId = object.organizationId ?? "";
4254
+ message.projectId = object.projectId ?? "";
4255
+ message.dashboardId = object.dashboardId ?? "";
4256
+ return message;
4257
+ },
4258
+ };
4259
+
4260
+ function createBaseGetSloDashboardResponse(): GetSloDashboardResponse {
4261
+ return { status: undefined, dashboard: undefined };
4262
+ }
4263
+
4264
+ export const GetSloDashboardResponse: MessageFns<GetSloDashboardResponse> = {
4265
+ encode(message: GetSloDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4266
+ if (message.status !== undefined) {
4267
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
4268
+ }
4269
+ if (message.dashboard !== undefined) {
4270
+ SloDashboard.encode(message.dashboard, writer.uint32(18).fork()).join();
4271
+ }
4272
+ return writer;
4273
+ },
4274
+
4275
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSloDashboardResponse {
4276
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4277
+ const end = length === undefined ? reader.len : reader.pos + length;
4278
+ const message = createBaseGetSloDashboardResponse();
4279
+ while (reader.pos < end) {
4280
+ const tag = reader.uint32();
4281
+ switch (tag >>> 3) {
4282
+ case 1: {
4283
+ if (tag !== 10) {
4284
+ break;
4285
+ }
4286
+
4287
+ message.status = ResponseStatus.decode(reader, reader.uint32());
4288
+ continue;
4289
+ }
4290
+ case 2: {
4291
+ if (tag !== 18) {
4292
+ break;
4293
+ }
4294
+
4295
+ message.dashboard = SloDashboard.decode(reader, reader.uint32());
4296
+ continue;
4297
+ }
4298
+ }
4299
+ if ((tag & 7) === 4 || tag === 0) {
4300
+ break;
4301
+ }
4302
+ reader.skip(tag & 7);
4303
+ }
4304
+ return message;
4305
+ },
4306
+
4307
+ fromJSON(object: any): GetSloDashboardResponse {
4308
+ return {
4309
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
4310
+ dashboard: isSet(object.dashboard) ? SloDashboard.fromJSON(object.dashboard) : undefined,
4311
+ };
4312
+ },
4313
+
4314
+ toJSON(message: GetSloDashboardResponse): unknown {
4315
+ const obj: any = {};
4316
+ if (message.status !== undefined) {
4317
+ obj.status = ResponseStatus.toJSON(message.status);
4318
+ }
4319
+ if (message.dashboard !== undefined) {
4320
+ obj.dashboard = SloDashboard.toJSON(message.dashboard);
4321
+ }
4322
+ return obj;
4323
+ },
4324
+
4325
+ create<I extends Exact<DeepPartial<GetSloDashboardResponse>, I>>(base?: I): GetSloDashboardResponse {
4326
+ return GetSloDashboardResponse.fromPartial(base ?? ({} as any));
4327
+ },
4328
+ fromPartial<I extends Exact<DeepPartial<GetSloDashboardResponse>, I>>(object: I): GetSloDashboardResponse {
4329
+ const message = createBaseGetSloDashboardResponse();
4330
+ message.status = (object.status !== undefined && object.status !== null)
4331
+ ? ResponseStatus.fromPartial(object.status)
4332
+ : undefined;
4333
+ message.dashboard = (object.dashboard !== undefined && object.dashboard !== null)
4334
+ ? SloDashboard.fromPartial(object.dashboard)
4335
+ : undefined;
4336
+ return message;
4337
+ },
4338
+ };
4339
+
4340
+ function createBaseListSloDashboardsRequest(): ListSloDashboardsRequest {
4341
+ return { organizationId: "", projectId: "" };
4342
+ }
4343
+
4344
+ export const ListSloDashboardsRequest: MessageFns<ListSloDashboardsRequest> = {
4345
+ encode(message: ListSloDashboardsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4346
+ if (message.organizationId !== "") {
4347
+ writer.uint32(10).string(message.organizationId);
4348
+ }
4349
+ if (message.projectId !== "") {
4350
+ writer.uint32(18).string(message.projectId);
4351
+ }
4352
+ return writer;
4353
+ },
4354
+
4355
+ decode(input: BinaryReader | Uint8Array, length?: number): ListSloDashboardsRequest {
4356
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4357
+ const end = length === undefined ? reader.len : reader.pos + length;
4358
+ const message = createBaseListSloDashboardsRequest();
4359
+ while (reader.pos < end) {
4360
+ const tag = reader.uint32();
4361
+ switch (tag >>> 3) {
4362
+ case 1: {
4363
+ if (tag !== 10) {
4364
+ break;
4365
+ }
4366
+
4367
+ message.organizationId = reader.string();
4368
+ continue;
4369
+ }
4370
+ case 2: {
4371
+ if (tag !== 18) {
4372
+ break;
4373
+ }
4374
+
4375
+ message.projectId = reader.string();
4376
+ continue;
4377
+ }
4378
+ }
4379
+ if ((tag & 7) === 4 || tag === 0) {
4380
+ break;
4381
+ }
4382
+ reader.skip(tag & 7);
4383
+ }
4384
+ return message;
4385
+ },
4386
+
4387
+ fromJSON(object: any): ListSloDashboardsRequest {
4388
+ return {
4389
+ organizationId: isSet(object.organizationId)
4390
+ ? globalThis.String(object.organizationId)
4391
+ : isSet(object.organization_id)
4392
+ ? globalThis.String(object.organization_id)
4393
+ : "",
4394
+ projectId: isSet(object.projectId)
4395
+ ? globalThis.String(object.projectId)
4396
+ : isSet(object.project_id)
4397
+ ? globalThis.String(object.project_id)
4398
+ : "",
4399
+ };
4400
+ },
4401
+
4402
+ toJSON(message: ListSloDashboardsRequest): unknown {
4403
+ const obj: any = {};
4404
+ if (message.organizationId !== "") {
4405
+ obj.organizationId = message.organizationId;
4406
+ }
4407
+ if (message.projectId !== "") {
4408
+ obj.projectId = message.projectId;
4409
+ }
4410
+ return obj;
4411
+ },
4412
+
4413
+ create<I extends Exact<DeepPartial<ListSloDashboardsRequest>, I>>(base?: I): ListSloDashboardsRequest {
4414
+ return ListSloDashboardsRequest.fromPartial(base ?? ({} as any));
4415
+ },
4416
+ fromPartial<I extends Exact<DeepPartial<ListSloDashboardsRequest>, I>>(object: I): ListSloDashboardsRequest {
4417
+ const message = createBaseListSloDashboardsRequest();
4418
+ message.organizationId = object.organizationId ?? "";
4419
+ message.projectId = object.projectId ?? "";
4420
+ return message;
4421
+ },
4422
+ };
4423
+
4424
+ function createBaseListSloDashboardsResponse(): ListSloDashboardsResponse {
4425
+ return { status: undefined, dashboards: [] };
4426
+ }
4427
+
4428
+ export const ListSloDashboardsResponse: MessageFns<ListSloDashboardsResponse> = {
4429
+ encode(message: ListSloDashboardsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4430
+ if (message.status !== undefined) {
4431
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
4432
+ }
4433
+ for (const v of message.dashboards) {
4434
+ SloDashboardSummary.encode(v!, writer.uint32(18).fork()).join();
4435
+ }
4436
+ return writer;
4437
+ },
4438
+
4439
+ decode(input: BinaryReader | Uint8Array, length?: number): ListSloDashboardsResponse {
4440
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4441
+ const end = length === undefined ? reader.len : reader.pos + length;
4442
+ const message = createBaseListSloDashboardsResponse();
4443
+ while (reader.pos < end) {
4444
+ const tag = reader.uint32();
4445
+ switch (tag >>> 3) {
4446
+ case 1: {
4447
+ if (tag !== 10) {
4448
+ break;
4449
+ }
4450
+
4451
+ message.status = ResponseStatus.decode(reader, reader.uint32());
4452
+ continue;
4453
+ }
4454
+ case 2: {
4455
+ if (tag !== 18) {
4456
+ break;
4457
+ }
4458
+
4459
+ message.dashboards.push(SloDashboardSummary.decode(reader, reader.uint32()));
4460
+ continue;
4461
+ }
4462
+ }
4463
+ if ((tag & 7) === 4 || tag === 0) {
4464
+ break;
4465
+ }
4466
+ reader.skip(tag & 7);
4467
+ }
4468
+ return message;
4469
+ },
4470
+
4471
+ fromJSON(object: any): ListSloDashboardsResponse {
4472
+ return {
4473
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
4474
+ dashboards: globalThis.Array.isArray(object?.dashboards)
4475
+ ? object.dashboards.map((e: any) => SloDashboardSummary.fromJSON(e))
4476
+ : [],
4477
+ };
4478
+ },
4479
+
4480
+ toJSON(message: ListSloDashboardsResponse): unknown {
4481
+ const obj: any = {};
4482
+ if (message.status !== undefined) {
4483
+ obj.status = ResponseStatus.toJSON(message.status);
4484
+ }
4485
+ if (message.dashboards?.length) {
4486
+ obj.dashboards = message.dashboards.map((e) => SloDashboardSummary.toJSON(e));
4487
+ }
4488
+ return obj;
4489
+ },
4490
+
4491
+ create<I extends Exact<DeepPartial<ListSloDashboardsResponse>, I>>(base?: I): ListSloDashboardsResponse {
4492
+ return ListSloDashboardsResponse.fromPartial(base ?? ({} as any));
4493
+ },
4494
+ fromPartial<I extends Exact<DeepPartial<ListSloDashboardsResponse>, I>>(object: I): ListSloDashboardsResponse {
4495
+ const message = createBaseListSloDashboardsResponse();
4496
+ message.status = (object.status !== undefined && object.status !== null)
4497
+ ? ResponseStatus.fromPartial(object.status)
4498
+ : undefined;
4499
+ message.dashboards = object.dashboards?.map((e) => SloDashboardSummary.fromPartial(e)) || [];
4500
+ return message;
4501
+ },
4502
+ };
4503
+
4504
+ function createBaseSloDashboardSummary(): SloDashboardSummary {
4505
+ return {
4506
+ id: "",
4507
+ name: "",
4508
+ description: "",
4509
+ sloCount: 0,
4510
+ createdAt: undefined,
4511
+ updatedAt: undefined,
4512
+ health: undefined,
4513
+ };
4514
+ }
4515
+
4516
+ export const SloDashboardSummary: MessageFns<SloDashboardSummary> = {
4517
+ encode(message: SloDashboardSummary, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4518
+ if (message.id !== "") {
4519
+ writer.uint32(10).string(message.id);
4520
+ }
4521
+ if (message.name !== "") {
4522
+ writer.uint32(18).string(message.name);
4523
+ }
4524
+ if (message.description !== "") {
4525
+ writer.uint32(26).string(message.description);
4526
+ }
4527
+ if (message.sloCount !== 0) {
4528
+ writer.uint32(32).uint32(message.sloCount);
4529
+ }
4530
+ if (message.createdAt !== undefined) {
4531
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
4532
+ }
4533
+ if (message.updatedAt !== undefined) {
4534
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(50).fork()).join();
4535
+ }
4536
+ if (message.health !== undefined) {
4537
+ SloDashboardHealth.encode(message.health, writer.uint32(58).fork()).join();
4538
+ }
4539
+ return writer;
4540
+ },
4541
+
4542
+ decode(input: BinaryReader | Uint8Array, length?: number): SloDashboardSummary {
4543
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4544
+ const end = length === undefined ? reader.len : reader.pos + length;
4545
+ const message = createBaseSloDashboardSummary();
4546
+ while (reader.pos < end) {
4547
+ const tag = reader.uint32();
4548
+ switch (tag >>> 3) {
4549
+ case 1: {
4550
+ if (tag !== 10) {
4551
+ break;
4552
+ }
4553
+
4554
+ message.id = reader.string();
4555
+ continue;
4556
+ }
4557
+ case 2: {
4558
+ if (tag !== 18) {
4559
+ break;
4560
+ }
4561
+
4562
+ message.name = reader.string();
4563
+ continue;
4564
+ }
4565
+ case 3: {
4566
+ if (tag !== 26) {
4567
+ break;
4568
+ }
4569
+
4570
+ message.description = reader.string();
4571
+ continue;
4572
+ }
4573
+ case 4: {
4574
+ if (tag !== 32) {
4575
+ break;
4576
+ }
4577
+
4578
+ message.sloCount = reader.uint32();
4579
+ continue;
4580
+ }
4581
+ case 5: {
4582
+ if (tag !== 42) {
4583
+ break;
4584
+ }
4585
+
4586
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4587
+ continue;
4588
+ }
4589
+ case 6: {
4590
+ if (tag !== 50) {
4591
+ break;
4592
+ }
4593
+
4594
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4595
+ continue;
4596
+ }
4597
+ case 7: {
4598
+ if (tag !== 58) {
4599
+ break;
4600
+ }
4601
+
4602
+ message.health = SloDashboardHealth.decode(reader, reader.uint32());
4603
+ continue;
4604
+ }
4605
+ }
4606
+ if ((tag & 7) === 4 || tag === 0) {
4607
+ break;
4608
+ }
4609
+ reader.skip(tag & 7);
4610
+ }
4611
+ return message;
4612
+ },
4613
+
4614
+ fromJSON(object: any): SloDashboardSummary {
4615
+ return {
4616
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
4617
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
4618
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
4619
+ sloCount: isSet(object.sloCount)
4620
+ ? globalThis.Number(object.sloCount)
4621
+ : isSet(object.slo_count)
4622
+ ? globalThis.Number(object.slo_count)
4623
+ : 0,
4624
+ createdAt: isSet(object.createdAt)
4625
+ ? fromJsonTimestamp(object.createdAt)
4626
+ : isSet(object.created_at)
4627
+ ? fromJsonTimestamp(object.created_at)
4628
+ : undefined,
4629
+ updatedAt: isSet(object.updatedAt)
4630
+ ? fromJsonTimestamp(object.updatedAt)
4631
+ : isSet(object.updated_at)
4632
+ ? fromJsonTimestamp(object.updated_at)
4633
+ : undefined,
4634
+ health: isSet(object.health) ? SloDashboardHealth.fromJSON(object.health) : undefined,
4635
+ };
4636
+ },
4637
+
4638
+ toJSON(message: SloDashboardSummary): unknown {
4639
+ const obj: any = {};
4640
+ if (message.id !== "") {
4641
+ obj.id = message.id;
4642
+ }
4643
+ if (message.name !== "") {
4644
+ obj.name = message.name;
4645
+ }
4646
+ if (message.description !== "") {
4647
+ obj.description = message.description;
4648
+ }
4649
+ if (message.sloCount !== 0) {
4650
+ obj.sloCount = Math.round(message.sloCount);
4651
+ }
4652
+ if (message.createdAt !== undefined) {
4653
+ obj.createdAt = message.createdAt.toISOString();
4654
+ }
4655
+ if (message.updatedAt !== undefined) {
4656
+ obj.updatedAt = message.updatedAt.toISOString();
4657
+ }
4658
+ if (message.health !== undefined) {
4659
+ obj.health = SloDashboardHealth.toJSON(message.health);
4660
+ }
4661
+ return obj;
4662
+ },
4663
+
4664
+ create<I extends Exact<DeepPartial<SloDashboardSummary>, I>>(base?: I): SloDashboardSummary {
4665
+ return SloDashboardSummary.fromPartial(base ?? ({} as any));
4666
+ },
4667
+ fromPartial<I extends Exact<DeepPartial<SloDashboardSummary>, I>>(object: I): SloDashboardSummary {
4668
+ const message = createBaseSloDashboardSummary();
4669
+ message.id = object.id ?? "";
4670
+ message.name = object.name ?? "";
4671
+ message.description = object.description ?? "";
4672
+ message.sloCount = object.sloCount ?? 0;
4673
+ message.createdAt = object.createdAt ?? undefined;
4674
+ message.updatedAt = object.updatedAt ?? undefined;
4675
+ message.health = (object.health !== undefined && object.health !== null)
4676
+ ? SloDashboardHealth.fromPartial(object.health)
4677
+ : undefined;
4678
+ return message;
4679
+ },
4680
+ };
4681
+
4682
+ function createBaseSloDashboardHealth(): SloDashboardHealth {
4683
+ return {
4684
+ okCount: 0,
4685
+ breachedCount: 0,
4686
+ noDataCount: 0,
4687
+ lowestBudgetRemaining: 0,
4688
+ worstState: 0,
4689
+ worstEntryId: "",
4690
+ atRiskCount: 0,
4691
+ };
4692
+ }
4693
+
4694
+ export const SloDashboardHealth: MessageFns<SloDashboardHealth> = {
4695
+ encode(message: SloDashboardHealth, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4696
+ if (message.okCount !== 0) {
4697
+ writer.uint32(8).uint32(message.okCount);
4698
+ }
4699
+ if (message.breachedCount !== 0) {
4700
+ writer.uint32(16).uint32(message.breachedCount);
4701
+ }
4702
+ if (message.noDataCount !== 0) {
4703
+ writer.uint32(24).uint32(message.noDataCount);
4704
+ }
4705
+ if (message.lowestBudgetRemaining !== 0) {
4706
+ writer.uint32(33).double(message.lowestBudgetRemaining);
4707
+ }
4708
+ if (message.worstState !== 0) {
4709
+ writer.uint32(40).int32(message.worstState);
4710
+ }
4711
+ if (message.worstEntryId !== "") {
4712
+ writer.uint32(50).string(message.worstEntryId);
4713
+ }
4714
+ if (message.atRiskCount !== 0) {
4715
+ writer.uint32(56).uint32(message.atRiskCount);
4716
+ }
4717
+ return writer;
4718
+ },
4719
+
4720
+ decode(input: BinaryReader | Uint8Array, length?: number): SloDashboardHealth {
4721
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4722
+ const end = length === undefined ? reader.len : reader.pos + length;
4723
+ const message = createBaseSloDashboardHealth();
4724
+ while (reader.pos < end) {
4725
+ const tag = reader.uint32();
4726
+ switch (tag >>> 3) {
4727
+ case 1: {
4728
+ if (tag !== 8) {
4729
+ break;
4730
+ }
4731
+
4732
+ message.okCount = reader.uint32();
4733
+ continue;
4734
+ }
4735
+ case 2: {
4736
+ if (tag !== 16) {
4737
+ break;
4738
+ }
4739
+
4740
+ message.breachedCount = reader.uint32();
4741
+ continue;
4742
+ }
4743
+ case 3: {
4744
+ if (tag !== 24) {
4745
+ break;
4746
+ }
4747
+
4748
+ message.noDataCount = reader.uint32();
4749
+ continue;
4750
+ }
4751
+ case 4: {
4752
+ if (tag !== 33) {
4753
+ break;
4754
+ }
4755
+
4756
+ message.lowestBudgetRemaining = reader.double();
4757
+ continue;
4758
+ }
4759
+ case 5: {
4760
+ if (tag !== 40) {
4761
+ break;
4762
+ }
4763
+
4764
+ message.worstState = reader.int32() as any;
4765
+ continue;
4766
+ }
4767
+ case 6: {
4768
+ if (tag !== 50) {
4769
+ break;
4770
+ }
4771
+
4772
+ message.worstEntryId = reader.string();
4773
+ continue;
4774
+ }
4775
+ case 7: {
4776
+ if (tag !== 56) {
4777
+ break;
4778
+ }
4779
+
4780
+ message.atRiskCount = reader.uint32();
4781
+ continue;
4782
+ }
4783
+ }
4784
+ if ((tag & 7) === 4 || tag === 0) {
4785
+ break;
4786
+ }
4787
+ reader.skip(tag & 7);
4788
+ }
4789
+ return message;
4790
+ },
4791
+
4792
+ fromJSON(object: any): SloDashboardHealth {
4793
+ return {
4794
+ okCount: isSet(object.okCount)
4795
+ ? globalThis.Number(object.okCount)
4796
+ : isSet(object.ok_count)
4797
+ ? globalThis.Number(object.ok_count)
4798
+ : 0,
4799
+ breachedCount: isSet(object.breachedCount)
4800
+ ? globalThis.Number(object.breachedCount)
4801
+ : isSet(object.breached_count)
4802
+ ? globalThis.Number(object.breached_count)
4803
+ : 0,
4804
+ noDataCount: isSet(object.noDataCount)
4805
+ ? globalThis.Number(object.noDataCount)
4806
+ : isSet(object.no_data_count)
4807
+ ? globalThis.Number(object.no_data_count)
4808
+ : 0,
4809
+ lowestBudgetRemaining: isSet(object.lowestBudgetRemaining)
4810
+ ? globalThis.Number(object.lowestBudgetRemaining)
4811
+ : isSet(object.lowest_budget_remaining)
4812
+ ? globalThis.Number(object.lowest_budget_remaining)
4813
+ : 0,
4814
+ worstState: isSet(object.worstState)
4815
+ ? sloCorridorStateFromJSON(object.worstState)
4816
+ : isSet(object.worst_state)
4817
+ ? sloCorridorStateFromJSON(object.worst_state)
4818
+ : 0,
4819
+ worstEntryId: isSet(object.worstEntryId)
4820
+ ? globalThis.String(object.worstEntryId)
4821
+ : isSet(object.worst_entry_id)
4822
+ ? globalThis.String(object.worst_entry_id)
4823
+ : "",
4824
+ atRiskCount: isSet(object.atRiskCount)
4825
+ ? globalThis.Number(object.atRiskCount)
4826
+ : isSet(object.at_risk_count)
4827
+ ? globalThis.Number(object.at_risk_count)
4828
+ : 0,
4829
+ };
4830
+ },
4831
+
4832
+ toJSON(message: SloDashboardHealth): unknown {
4833
+ const obj: any = {};
4834
+ if (message.okCount !== 0) {
4835
+ obj.okCount = Math.round(message.okCount);
4836
+ }
4837
+ if (message.breachedCount !== 0) {
4838
+ obj.breachedCount = Math.round(message.breachedCount);
4839
+ }
4840
+ if (message.noDataCount !== 0) {
4841
+ obj.noDataCount = Math.round(message.noDataCount);
4842
+ }
4843
+ if (message.lowestBudgetRemaining !== 0) {
4844
+ obj.lowestBudgetRemaining = message.lowestBudgetRemaining;
4845
+ }
4846
+ if (message.worstState !== 0) {
4847
+ obj.worstState = sloCorridorStateToJSON(message.worstState);
4848
+ }
4849
+ if (message.worstEntryId !== "") {
4850
+ obj.worstEntryId = message.worstEntryId;
4851
+ }
4852
+ if (message.atRiskCount !== 0) {
4853
+ obj.atRiskCount = Math.round(message.atRiskCount);
4854
+ }
4855
+ return obj;
4856
+ },
4857
+
4858
+ create<I extends Exact<DeepPartial<SloDashboardHealth>, I>>(base?: I): SloDashboardHealth {
4859
+ return SloDashboardHealth.fromPartial(base ?? ({} as any));
4860
+ },
4861
+ fromPartial<I extends Exact<DeepPartial<SloDashboardHealth>, I>>(object: I): SloDashboardHealth {
4862
+ const message = createBaseSloDashboardHealth();
4863
+ message.okCount = object.okCount ?? 0;
4864
+ message.breachedCount = object.breachedCount ?? 0;
4865
+ message.noDataCount = object.noDataCount ?? 0;
4866
+ message.lowestBudgetRemaining = object.lowestBudgetRemaining ?? 0;
4867
+ message.worstState = object.worstState ?? 0;
4868
+ message.worstEntryId = object.worstEntryId ?? "";
4869
+ message.atRiskCount = object.atRiskCount ?? 0;
4870
+ return message;
4871
+ },
4872
+ };
4873
+
4874
+ function createBaseUpdateSloDashboardRequest(): UpdateSloDashboardRequest {
4875
+ return { organizationId: "", projectId: "", dashboardId: "", name: "", description: "", entries: [], version: 0 };
4876
+ }
4877
+
4878
+ export const UpdateSloDashboardRequest: MessageFns<UpdateSloDashboardRequest> = {
4879
+ encode(message: UpdateSloDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
4880
+ if (message.organizationId !== "") {
4881
+ writer.uint32(10).string(message.organizationId);
4882
+ }
4883
+ if (message.projectId !== "") {
4884
+ writer.uint32(18).string(message.projectId);
4885
+ }
4886
+ if (message.dashboardId !== "") {
4887
+ writer.uint32(26).string(message.dashboardId);
4888
+ }
4889
+ if (message.name !== "") {
4890
+ writer.uint32(34).string(message.name);
4891
+ }
4892
+ if (message.description !== "") {
4893
+ writer.uint32(42).string(message.description);
4894
+ }
4895
+ for (const v of message.entries) {
4896
+ SloDashboardEntry.encode(v!, writer.uint32(50).fork()).join();
4897
+ }
4898
+ if (message.version !== 0) {
4899
+ writer.uint32(56).int64(message.version);
4900
+ }
4901
+ return writer;
4902
+ },
4903
+
4904
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateSloDashboardRequest {
4905
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
4906
+ const end = length === undefined ? reader.len : reader.pos + length;
4907
+ const message = createBaseUpdateSloDashboardRequest();
4908
+ while (reader.pos < end) {
4909
+ const tag = reader.uint32();
4910
+ switch (tag >>> 3) {
4911
+ case 1: {
4912
+ if (tag !== 10) {
4913
+ break;
4914
+ }
4915
+
4916
+ message.organizationId = reader.string();
4917
+ continue;
4918
+ }
4919
+ case 2: {
4920
+ if (tag !== 18) {
4921
+ break;
4922
+ }
4923
+
4924
+ message.projectId = reader.string();
4925
+ continue;
4926
+ }
4927
+ case 3: {
4928
+ if (tag !== 26) {
4929
+ break;
4930
+ }
4931
+
4932
+ message.dashboardId = reader.string();
4933
+ continue;
4934
+ }
4935
+ case 4: {
4936
+ if (tag !== 34) {
4937
+ break;
4938
+ }
4939
+
4940
+ message.name = reader.string();
4941
+ continue;
4942
+ }
4943
+ case 5: {
4944
+ if (tag !== 42) {
4945
+ break;
4946
+ }
4947
+
4948
+ message.description = reader.string();
4949
+ continue;
4950
+ }
4951
+ case 6: {
4952
+ if (tag !== 50) {
4953
+ break;
4954
+ }
4955
+
4956
+ message.entries.push(SloDashboardEntry.decode(reader, reader.uint32()));
4957
+ continue;
4958
+ }
4959
+ case 7: {
4960
+ if (tag !== 56) {
4961
+ break;
4962
+ }
4963
+
4964
+ message.version = longToNumber(reader.int64());
4965
+ continue;
4966
+ }
4967
+ }
4968
+ if ((tag & 7) === 4 || tag === 0) {
4969
+ break;
4970
+ }
4971
+ reader.skip(tag & 7);
4972
+ }
4973
+ return message;
4974
+ },
4975
+
4976
+ fromJSON(object: any): UpdateSloDashboardRequest {
4977
+ return {
4978
+ organizationId: isSet(object.organizationId)
4979
+ ? globalThis.String(object.organizationId)
4980
+ : isSet(object.organization_id)
4981
+ ? globalThis.String(object.organization_id)
4982
+ : "",
4983
+ projectId: isSet(object.projectId)
4984
+ ? globalThis.String(object.projectId)
4985
+ : isSet(object.project_id)
4986
+ ? globalThis.String(object.project_id)
4987
+ : "",
4988
+ dashboardId: isSet(object.dashboardId)
4989
+ ? globalThis.String(object.dashboardId)
4990
+ : isSet(object.dashboard_id)
4991
+ ? globalThis.String(object.dashboard_id)
4992
+ : "",
4993
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
4994
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
4995
+ entries: globalThis.Array.isArray(object?.entries)
4996
+ ? object.entries.map((e: any) => SloDashboardEntry.fromJSON(e))
4997
+ : [],
4998
+ version: isSet(object.version) ? globalThis.Number(object.version) : 0,
4999
+ };
5000
+ },
5001
+
5002
+ toJSON(message: UpdateSloDashboardRequest): unknown {
5003
+ const obj: any = {};
5004
+ if (message.organizationId !== "") {
5005
+ obj.organizationId = message.organizationId;
5006
+ }
5007
+ if (message.projectId !== "") {
5008
+ obj.projectId = message.projectId;
5009
+ }
5010
+ if (message.dashboardId !== "") {
5011
+ obj.dashboardId = message.dashboardId;
5012
+ }
5013
+ if (message.name !== "") {
5014
+ obj.name = message.name;
5015
+ }
5016
+ if (message.description !== "") {
5017
+ obj.description = message.description;
5018
+ }
5019
+ if (message.entries?.length) {
5020
+ obj.entries = message.entries.map((e) => SloDashboardEntry.toJSON(e));
5021
+ }
5022
+ if (message.version !== 0) {
5023
+ obj.version = Math.round(message.version);
5024
+ }
5025
+ return obj;
5026
+ },
5027
+
5028
+ create<I extends Exact<DeepPartial<UpdateSloDashboardRequest>, I>>(base?: I): UpdateSloDashboardRequest {
5029
+ return UpdateSloDashboardRequest.fromPartial(base ?? ({} as any));
5030
+ },
5031
+ fromPartial<I extends Exact<DeepPartial<UpdateSloDashboardRequest>, I>>(object: I): UpdateSloDashboardRequest {
5032
+ const message = createBaseUpdateSloDashboardRequest();
5033
+ message.organizationId = object.organizationId ?? "";
5034
+ message.projectId = object.projectId ?? "";
5035
+ message.dashboardId = object.dashboardId ?? "";
5036
+ message.name = object.name ?? "";
5037
+ message.description = object.description ?? "";
5038
+ message.entries = object.entries?.map((e) => SloDashboardEntry.fromPartial(e)) || [];
5039
+ message.version = object.version ?? 0;
5040
+ return message;
5041
+ },
5042
+ };
5043
+
5044
+ function createBaseUpdateSloDashboardResponse(): UpdateSloDashboardResponse {
5045
+ return { status: undefined, dashboard: undefined };
5046
+ }
5047
+
5048
+ export const UpdateSloDashboardResponse: MessageFns<UpdateSloDashboardResponse> = {
5049
+ encode(message: UpdateSloDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5050
+ if (message.status !== undefined) {
5051
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
5052
+ }
5053
+ if (message.dashboard !== undefined) {
5054
+ SloDashboard.encode(message.dashboard, writer.uint32(18).fork()).join();
5055
+ }
5056
+ return writer;
5057
+ },
5058
+
5059
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateSloDashboardResponse {
5060
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5061
+ const end = length === undefined ? reader.len : reader.pos + length;
5062
+ const message = createBaseUpdateSloDashboardResponse();
5063
+ while (reader.pos < end) {
5064
+ const tag = reader.uint32();
5065
+ switch (tag >>> 3) {
5066
+ case 1: {
5067
+ if (tag !== 10) {
5068
+ break;
5069
+ }
5070
+
5071
+ message.status = ResponseStatus.decode(reader, reader.uint32());
5072
+ continue;
5073
+ }
5074
+ case 2: {
5075
+ if (tag !== 18) {
5076
+ break;
5077
+ }
5078
+
5079
+ message.dashboard = SloDashboard.decode(reader, reader.uint32());
5080
+ continue;
5081
+ }
5082
+ }
5083
+ if ((tag & 7) === 4 || tag === 0) {
5084
+ break;
5085
+ }
5086
+ reader.skip(tag & 7);
5087
+ }
5088
+ return message;
5089
+ },
5090
+
5091
+ fromJSON(object: any): UpdateSloDashboardResponse {
5092
+ return {
5093
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
5094
+ dashboard: isSet(object.dashboard) ? SloDashboard.fromJSON(object.dashboard) : undefined,
5095
+ };
5096
+ },
5097
+
5098
+ toJSON(message: UpdateSloDashboardResponse): unknown {
5099
+ const obj: any = {};
5100
+ if (message.status !== undefined) {
5101
+ obj.status = ResponseStatus.toJSON(message.status);
5102
+ }
5103
+ if (message.dashboard !== undefined) {
5104
+ obj.dashboard = SloDashboard.toJSON(message.dashboard);
5105
+ }
5106
+ return obj;
5107
+ },
5108
+
5109
+ create<I extends Exact<DeepPartial<UpdateSloDashboardResponse>, I>>(base?: I): UpdateSloDashboardResponse {
5110
+ return UpdateSloDashboardResponse.fromPartial(base ?? ({} as any));
5111
+ },
5112
+ fromPartial<I extends Exact<DeepPartial<UpdateSloDashboardResponse>, I>>(object: I): UpdateSloDashboardResponse {
5113
+ const message = createBaseUpdateSloDashboardResponse();
5114
+ message.status = (object.status !== undefined && object.status !== null)
5115
+ ? ResponseStatus.fromPartial(object.status)
5116
+ : undefined;
5117
+ message.dashboard = (object.dashboard !== undefined && object.dashboard !== null)
5118
+ ? SloDashboard.fromPartial(object.dashboard)
5119
+ : undefined;
5120
+ return message;
5121
+ },
5122
+ };
5123
+
5124
+ function createBaseDeleteSloDashboardRequest(): DeleteSloDashboardRequest {
5125
+ return { organizationId: "", projectId: "", dashboardId: "" };
5126
+ }
5127
+
5128
+ export const DeleteSloDashboardRequest: MessageFns<DeleteSloDashboardRequest> = {
5129
+ encode(message: DeleteSloDashboardRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5130
+ if (message.organizationId !== "") {
5131
+ writer.uint32(10).string(message.organizationId);
5132
+ }
5133
+ if (message.projectId !== "") {
5134
+ writer.uint32(18).string(message.projectId);
5135
+ }
5136
+ if (message.dashboardId !== "") {
5137
+ writer.uint32(26).string(message.dashboardId);
5138
+ }
5139
+ return writer;
5140
+ },
5141
+
5142
+ decode(input: BinaryReader | Uint8Array, length?: number): DeleteSloDashboardRequest {
5143
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5144
+ const end = length === undefined ? reader.len : reader.pos + length;
5145
+ const message = createBaseDeleteSloDashboardRequest();
5146
+ while (reader.pos < end) {
5147
+ const tag = reader.uint32();
5148
+ switch (tag >>> 3) {
5149
+ case 1: {
5150
+ if (tag !== 10) {
5151
+ break;
5152
+ }
5153
+
5154
+ message.organizationId = reader.string();
5155
+ continue;
5156
+ }
5157
+ case 2: {
5158
+ if (tag !== 18) {
5159
+ break;
5160
+ }
5161
+
5162
+ message.projectId = reader.string();
5163
+ continue;
5164
+ }
5165
+ case 3: {
5166
+ if (tag !== 26) {
5167
+ break;
5168
+ }
5169
+
5170
+ message.dashboardId = reader.string();
5171
+ continue;
5172
+ }
5173
+ }
5174
+ if ((tag & 7) === 4 || tag === 0) {
5175
+ break;
5176
+ }
5177
+ reader.skip(tag & 7);
5178
+ }
5179
+ return message;
5180
+ },
5181
+
5182
+ fromJSON(object: any): DeleteSloDashboardRequest {
5183
+ return {
5184
+ organizationId: isSet(object.organizationId)
5185
+ ? globalThis.String(object.organizationId)
5186
+ : isSet(object.organization_id)
5187
+ ? globalThis.String(object.organization_id)
5188
+ : "",
5189
+ projectId: isSet(object.projectId)
5190
+ ? globalThis.String(object.projectId)
5191
+ : isSet(object.project_id)
5192
+ ? globalThis.String(object.project_id)
5193
+ : "",
5194
+ dashboardId: isSet(object.dashboardId)
5195
+ ? globalThis.String(object.dashboardId)
5196
+ : isSet(object.dashboard_id)
5197
+ ? globalThis.String(object.dashboard_id)
5198
+ : "",
5199
+ };
5200
+ },
5201
+
5202
+ toJSON(message: DeleteSloDashboardRequest): unknown {
5203
+ const obj: any = {};
5204
+ if (message.organizationId !== "") {
5205
+ obj.organizationId = message.organizationId;
5206
+ }
5207
+ if (message.projectId !== "") {
5208
+ obj.projectId = message.projectId;
5209
+ }
5210
+ if (message.dashboardId !== "") {
5211
+ obj.dashboardId = message.dashboardId;
5212
+ }
5213
+ return obj;
5214
+ },
5215
+
5216
+ create<I extends Exact<DeepPartial<DeleteSloDashboardRequest>, I>>(base?: I): DeleteSloDashboardRequest {
5217
+ return DeleteSloDashboardRequest.fromPartial(base ?? ({} as any));
5218
+ },
5219
+ fromPartial<I extends Exact<DeepPartial<DeleteSloDashboardRequest>, I>>(object: I): DeleteSloDashboardRequest {
5220
+ const message = createBaseDeleteSloDashboardRequest();
5221
+ message.organizationId = object.organizationId ?? "";
5222
+ message.projectId = object.projectId ?? "";
5223
+ message.dashboardId = object.dashboardId ?? "";
5224
+ return message;
5225
+ },
5226
+ };
5227
+
5228
+ function createBaseDeleteSloDashboardResponse(): DeleteSloDashboardResponse {
5229
+ return { status: undefined };
5230
+ }
5231
+
5232
+ export const DeleteSloDashboardResponse: MessageFns<DeleteSloDashboardResponse> = {
5233
+ encode(message: DeleteSloDashboardResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5234
+ if (message.status !== undefined) {
5235
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
5236
+ }
5237
+ return writer;
5238
+ },
5239
+
5240
+ decode(input: BinaryReader | Uint8Array, length?: number): DeleteSloDashboardResponse {
5241
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5242
+ const end = length === undefined ? reader.len : reader.pos + length;
5243
+ const message = createBaseDeleteSloDashboardResponse();
5244
+ while (reader.pos < end) {
5245
+ const tag = reader.uint32();
5246
+ switch (tag >>> 3) {
5247
+ case 1: {
5248
+ if (tag !== 10) {
5249
+ break;
5250
+ }
5251
+
5252
+ message.status = ResponseStatus.decode(reader, reader.uint32());
5253
+ continue;
5254
+ }
5255
+ }
5256
+ if ((tag & 7) === 4 || tag === 0) {
5257
+ break;
5258
+ }
5259
+ reader.skip(tag & 7);
5260
+ }
5261
+ return message;
5262
+ },
5263
+
5264
+ fromJSON(object: any): DeleteSloDashboardResponse {
5265
+ return { status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined };
5266
+ },
5267
+
5268
+ toJSON(message: DeleteSloDashboardResponse): unknown {
5269
+ const obj: any = {};
5270
+ if (message.status !== undefined) {
5271
+ obj.status = ResponseStatus.toJSON(message.status);
5272
+ }
5273
+ return obj;
5274
+ },
5275
+
5276
+ create<I extends Exact<DeepPartial<DeleteSloDashboardResponse>, I>>(base?: I): DeleteSloDashboardResponse {
5277
+ return DeleteSloDashboardResponse.fromPartial(base ?? ({} as any));
5278
+ },
5279
+ fromPartial<I extends Exact<DeepPartial<DeleteSloDashboardResponse>, I>>(object: I): DeleteSloDashboardResponse {
5280
+ const message = createBaseDeleteSloDashboardResponse();
5281
+ message.status = (object.status !== undefined && object.status !== null)
5282
+ ? ResponseStatus.fromPartial(object.status)
5283
+ : undefined;
5284
+ return message;
5285
+ },
5286
+ };
5287
+
5288
+ function createBaseStreamSloDashboardDataRequest(): StreamSloDashboardDataRequest {
5289
+ return { organizationId: "", projectId: "", dashboardId: "", entryIds: [] };
5290
+ }
5291
+
5292
+ export const StreamSloDashboardDataRequest: MessageFns<StreamSloDashboardDataRequest> = {
5293
+ encode(message: StreamSloDashboardDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5294
+ if (message.organizationId !== "") {
5295
+ writer.uint32(10).string(message.organizationId);
5296
+ }
5297
+ if (message.projectId !== "") {
5298
+ writer.uint32(18).string(message.projectId);
5299
+ }
5300
+ if (message.dashboardId !== "") {
5301
+ writer.uint32(26).string(message.dashboardId);
5302
+ }
5303
+ for (const v of message.entryIds) {
5304
+ writer.uint32(34).string(v!);
5305
+ }
5306
+ return writer;
5307
+ },
5308
+
5309
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamSloDashboardDataRequest {
5310
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5311
+ const end = length === undefined ? reader.len : reader.pos + length;
5312
+ const message = createBaseStreamSloDashboardDataRequest();
5313
+ while (reader.pos < end) {
5314
+ const tag = reader.uint32();
5315
+ switch (tag >>> 3) {
5316
+ case 1: {
5317
+ if (tag !== 10) {
5318
+ break;
5319
+ }
5320
+
5321
+ message.organizationId = reader.string();
5322
+ continue;
5323
+ }
5324
+ case 2: {
5325
+ if (tag !== 18) {
5326
+ break;
5327
+ }
5328
+
5329
+ message.projectId = reader.string();
5330
+ continue;
5331
+ }
5332
+ case 3: {
5333
+ if (tag !== 26) {
5334
+ break;
5335
+ }
5336
+
5337
+ message.dashboardId = reader.string();
5338
+ continue;
5339
+ }
5340
+ case 4: {
5341
+ if (tag !== 34) {
5342
+ break;
5343
+ }
5344
+
5345
+ message.entryIds.push(reader.string());
5346
+ continue;
5347
+ }
5348
+ }
5349
+ if ((tag & 7) === 4 || tag === 0) {
5350
+ break;
5351
+ }
5352
+ reader.skip(tag & 7);
5353
+ }
5354
+ return message;
5355
+ },
5356
+
5357
+ fromJSON(object: any): StreamSloDashboardDataRequest {
5358
+ return {
5359
+ organizationId: isSet(object.organizationId)
5360
+ ? globalThis.String(object.organizationId)
5361
+ : isSet(object.organization_id)
5362
+ ? globalThis.String(object.organization_id)
5363
+ : "",
5364
+ projectId: isSet(object.projectId)
5365
+ ? globalThis.String(object.projectId)
5366
+ : isSet(object.project_id)
5367
+ ? globalThis.String(object.project_id)
5368
+ : "",
5369
+ dashboardId: isSet(object.dashboardId)
5370
+ ? globalThis.String(object.dashboardId)
5371
+ : isSet(object.dashboard_id)
5372
+ ? globalThis.String(object.dashboard_id)
5373
+ : "",
5374
+ entryIds: globalThis.Array.isArray(object?.entryIds)
5375
+ ? object.entryIds.map((e: any) => globalThis.String(e))
5376
+ : globalThis.Array.isArray(object?.entry_ids)
5377
+ ? object.entry_ids.map((e: any) => globalThis.String(e))
5378
+ : [],
5379
+ };
5380
+ },
5381
+
5382
+ toJSON(message: StreamSloDashboardDataRequest): unknown {
5383
+ const obj: any = {};
5384
+ if (message.organizationId !== "") {
5385
+ obj.organizationId = message.organizationId;
5386
+ }
5387
+ if (message.projectId !== "") {
5388
+ obj.projectId = message.projectId;
5389
+ }
5390
+ if (message.dashboardId !== "") {
5391
+ obj.dashboardId = message.dashboardId;
5392
+ }
5393
+ if (message.entryIds?.length) {
5394
+ obj.entryIds = message.entryIds;
5395
+ }
5396
+ return obj;
5397
+ },
5398
+
5399
+ create<I extends Exact<DeepPartial<StreamSloDashboardDataRequest>, I>>(base?: I): StreamSloDashboardDataRequest {
5400
+ return StreamSloDashboardDataRequest.fromPartial(base ?? ({} as any));
5401
+ },
5402
+ fromPartial<I extends Exact<DeepPartial<StreamSloDashboardDataRequest>, I>>(
5403
+ object: I,
5404
+ ): StreamSloDashboardDataRequest {
5405
+ const message = createBaseStreamSloDashboardDataRequest();
5406
+ message.organizationId = object.organizationId ?? "";
5407
+ message.projectId = object.projectId ?? "";
5408
+ message.dashboardId = object.dashboardId ?? "";
5409
+ message.entryIds = object.entryIds?.map((e) => e) || [];
5410
+ return message;
5411
+ },
5412
+ };
5413
+
5414
+ function createBaseSloDashboardDataEnvelope(): SloDashboardDataEnvelope {
5415
+ return { entryId: "", status: undefined, error: undefined };
5416
+ }
5417
+
5418
+ export const SloDashboardDataEnvelope: MessageFns<SloDashboardDataEnvelope> = {
5419
+ encode(message: SloDashboardDataEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5420
+ if (message.entryId !== "") {
5421
+ writer.uint32(10).string(message.entryId);
5422
+ }
5423
+ if (message.status !== undefined) {
5424
+ SloStatus.encode(message.status, writer.uint32(18).fork()).join();
5425
+ }
5426
+ if (message.error !== undefined) {
5427
+ SloPanelError.encode(message.error, writer.uint32(26).fork()).join();
5428
+ }
5429
+ return writer;
5430
+ },
5431
+
5432
+ decode(input: BinaryReader | Uint8Array, length?: number): SloDashboardDataEnvelope {
5433
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5434
+ const end = length === undefined ? reader.len : reader.pos + length;
5435
+ const message = createBaseSloDashboardDataEnvelope();
5436
+ while (reader.pos < end) {
5437
+ const tag = reader.uint32();
5438
+ switch (tag >>> 3) {
5439
+ case 1: {
5440
+ if (tag !== 10) {
5441
+ break;
5442
+ }
5443
+
5444
+ message.entryId = reader.string();
5445
+ continue;
5446
+ }
5447
+ case 2: {
5448
+ if (tag !== 18) {
5449
+ break;
5450
+ }
5451
+
5452
+ message.status = SloStatus.decode(reader, reader.uint32());
5453
+ continue;
5454
+ }
5455
+ case 3: {
5456
+ if (tag !== 26) {
5457
+ break;
5458
+ }
5459
+
5460
+ message.error = SloPanelError.decode(reader, reader.uint32());
5461
+ continue;
5462
+ }
5463
+ }
5464
+ if ((tag & 7) === 4 || tag === 0) {
5465
+ break;
5466
+ }
5467
+ reader.skip(tag & 7);
5468
+ }
5469
+ return message;
5470
+ },
5471
+
5472
+ fromJSON(object: any): SloDashboardDataEnvelope {
5473
+ return {
5474
+ entryId: isSet(object.entryId)
5475
+ ? globalThis.String(object.entryId)
5476
+ : isSet(object.entry_id)
5477
+ ? globalThis.String(object.entry_id)
5478
+ : "",
5479
+ status: isSet(object.status) ? SloStatus.fromJSON(object.status) : undefined,
5480
+ error: isSet(object.error) ? SloPanelError.fromJSON(object.error) : undefined,
5481
+ };
5482
+ },
5483
+
5484
+ toJSON(message: SloDashboardDataEnvelope): unknown {
5485
+ const obj: any = {};
5486
+ if (message.entryId !== "") {
5487
+ obj.entryId = message.entryId;
5488
+ }
5489
+ if (message.status !== undefined) {
5490
+ obj.status = SloStatus.toJSON(message.status);
5491
+ }
5492
+ if (message.error !== undefined) {
5493
+ obj.error = SloPanelError.toJSON(message.error);
5494
+ }
5495
+ return obj;
5496
+ },
5497
+
5498
+ create<I extends Exact<DeepPartial<SloDashboardDataEnvelope>, I>>(base?: I): SloDashboardDataEnvelope {
5499
+ return SloDashboardDataEnvelope.fromPartial(base ?? ({} as any));
5500
+ },
5501
+ fromPartial<I extends Exact<DeepPartial<SloDashboardDataEnvelope>, I>>(object: I): SloDashboardDataEnvelope {
5502
+ const message = createBaseSloDashboardDataEnvelope();
5503
+ message.entryId = object.entryId ?? "";
5504
+ message.status = (object.status !== undefined && object.status !== null)
5505
+ ? SloStatus.fromPartial(object.status)
5506
+ : undefined;
5507
+ message.error = (object.error !== undefined && object.error !== null)
5508
+ ? SloPanelError.fromPartial(object.error)
5509
+ : undefined;
5510
+ return message;
5511
+ },
5512
+ };
5513
+
5514
+ function createBaseSloPanelError(): SloPanelError {
5515
+ return { message: "" };
5516
+ }
5517
+
5518
+ export const SloPanelError: MessageFns<SloPanelError> = {
5519
+ encode(message: SloPanelError, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
5520
+ if (message.message !== "") {
5521
+ writer.uint32(10).string(message.message);
5522
+ }
5523
+ return writer;
5524
+ },
5525
+
5526
+ decode(input: BinaryReader | Uint8Array, length?: number): SloPanelError {
5527
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5528
+ const end = length === undefined ? reader.len : reader.pos + length;
5529
+ const message = createBaseSloPanelError();
5530
+ while (reader.pos < end) {
5531
+ const tag = reader.uint32();
5532
+ switch (tag >>> 3) {
5533
+ case 1: {
5534
+ if (tag !== 10) {
5535
+ break;
5536
+ }
5537
+
5538
+ message.message = reader.string();
5539
+ continue;
5540
+ }
5541
+ }
5542
+ if ((tag & 7) === 4 || tag === 0) {
5543
+ break;
5544
+ }
5545
+ reader.skip(tag & 7);
5546
+ }
5547
+ return message;
5548
+ },
5549
+
5550
+ fromJSON(object: any): SloPanelError {
5551
+ return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
5552
+ },
5553
+
5554
+ toJSON(message: SloPanelError): unknown {
5555
+ const obj: any = {};
5556
+ if (message.message !== "") {
5557
+ obj.message = message.message;
5558
+ }
5559
+ return obj;
5560
+ },
5561
+
5562
+ create<I extends Exact<DeepPartial<SloPanelError>, I>>(base?: I): SloPanelError {
5563
+ return SloPanelError.fromPartial(base ?? ({} as any));
5564
+ },
5565
+ fromPartial<I extends Exact<DeepPartial<SloPanelError>, I>>(object: I): SloPanelError {
5566
+ const message = createBaseSloPanelError();
5567
+ message.message = object.message ?? "";
5568
+ return message;
5569
+ },
5570
+ };
5571
+
5572
+ /**
5573
+ * SloGatewayService provides web client access to SLO definitions, their live compliance
5574
+ * reads, and SLO dashboards.
5575
+ */
5576
+ export interface SloGatewayService {
5577
+ CreateSlo(request: CreateSloRequest, metadata?: Metadata): Promise<CreateSloResponse>;
5578
+ GetSlo(request: GetSloRequest, metadata?: Metadata): Promise<GetSloResponse>;
5579
+ ListSlos(request: ListSlosRequest, metadata?: Metadata): Promise<ListSlosResponse>;
5580
+ UpdateSlo(request: UpdateSloRequest, metadata?: Metadata): Promise<UpdateSloResponse>;
5581
+ DeleteSlo(request: DeleteSloRequest, metadata?: Metadata): Promise<DeleteSloResponse>;
5582
+ GetSloStatus(request: GetSloStatusRequest, metadata?: Metadata): Promise<GetSloStatusResponse>;
5583
+ GetSloTimeline(request: GetSloTimelineRequest, metadata?: Metadata): Promise<GetSloTimelineResponse>;
5584
+ /** PreviewSlo scores an unsaved objective (status + timeline) for the authoring UI. */
5585
+ PreviewSlo(request: PreviewSloRequest, metadata?: Metadata): Promise<PreviewSloResponse>;
5586
+ /** StreamSloStatus pushes a full SloStatus, then a fresh one each refresh tick. */
5587
+ StreamSloStatus(request: StreamSloStatusRequest, metadata?: Metadata): Observable<SloStatus>;
5588
+ CreateSloDashboard(request: CreateSloDashboardRequest, metadata?: Metadata): Promise<CreateSloDashboardResponse>;
5589
+ GetSloDashboard(request: GetSloDashboardRequest, metadata?: Metadata): Promise<GetSloDashboardResponse>;
5590
+ ListSloDashboards(request: ListSloDashboardsRequest, metadata?: Metadata): Promise<ListSloDashboardsResponse>;
5591
+ UpdateSloDashboard(request: UpdateSloDashboardRequest, metadata?: Metadata): Promise<UpdateSloDashboardResponse>;
5592
+ DeleteSloDashboard(request: DeleteSloDashboardRequest, metadata?: Metadata): Promise<DeleteSloDashboardResponse>;
5593
+ /**
5594
+ * StreamSloDashboardData multiplexes every dashboard entry's live status onto one
5595
+ * stream, each frame tagged with entry_id.
5596
+ */
5597
+ StreamSloDashboardData(
5598
+ request: StreamSloDashboardDataRequest,
5599
+ metadata?: Metadata,
5600
+ ): Observable<SloDashboardDataEnvelope>;
5601
+ }
5602
+
5603
+ export const SloGatewayServiceServiceName = "gateway.web.v1.SloGatewayService";
5604
+ export class SloGatewayServiceClientImpl implements SloGatewayService {
5605
+ private readonly rpc: Rpc;
5606
+ private readonly service: string;
5607
+ constructor(rpc: Rpc, opts?: { service?: string }) {
5608
+ this.service = opts?.service || SloGatewayServiceServiceName;
5609
+ this.rpc = rpc;
5610
+ this.CreateSlo = this.CreateSlo.bind(this);
5611
+ this.GetSlo = this.GetSlo.bind(this);
5612
+ this.ListSlos = this.ListSlos.bind(this);
5613
+ this.UpdateSlo = this.UpdateSlo.bind(this);
5614
+ this.DeleteSlo = this.DeleteSlo.bind(this);
5615
+ this.GetSloStatus = this.GetSloStatus.bind(this);
5616
+ this.GetSloTimeline = this.GetSloTimeline.bind(this);
5617
+ this.PreviewSlo = this.PreviewSlo.bind(this);
5618
+ this.StreamSloStatus = this.StreamSloStatus.bind(this);
5619
+ this.CreateSloDashboard = this.CreateSloDashboard.bind(this);
5620
+ this.GetSloDashboard = this.GetSloDashboard.bind(this);
5621
+ this.ListSloDashboards = this.ListSloDashboards.bind(this);
5622
+ this.UpdateSloDashboard = this.UpdateSloDashboard.bind(this);
5623
+ this.DeleteSloDashboard = this.DeleteSloDashboard.bind(this);
5624
+ this.StreamSloDashboardData = this.StreamSloDashboardData.bind(this);
5625
+ }
5626
+ CreateSlo(request: CreateSloRequest, metadata?: Metadata): Promise<CreateSloResponse> {
5627
+ const data = CreateSloRequest.encode(request).finish();
5628
+ const promise = this.rpc.request(this.service, "CreateSlo", data, metadata);
5629
+ return promise.then((data) => CreateSloResponse.decode(new BinaryReader(data)));
2864
5630
  }
2865
5631
 
2866
5632
  GetSlo(request: GetSloRequest, metadata?: Metadata): Promise<GetSloResponse> {
@@ -2898,10 +5664,79 @@ export class SloGatewayServiceClientImpl implements SloGatewayService {
2898
5664
  const promise = this.rpc.request(this.service, "GetSloTimeline", data, metadata);
2899
5665
  return promise.then((data) => GetSloTimelineResponse.decode(new BinaryReader(data)));
2900
5666
  }
5667
+
5668
+ PreviewSlo(request: PreviewSloRequest, metadata?: Metadata): Promise<PreviewSloResponse> {
5669
+ const data = PreviewSloRequest.encode(request).finish();
5670
+ const promise = this.rpc.request(this.service, "PreviewSlo", data, metadata);
5671
+ return promise.then((data) => PreviewSloResponse.decode(new BinaryReader(data)));
5672
+ }
5673
+
5674
+ StreamSloStatus(request: StreamSloStatusRequest, metadata?: Metadata): Observable<SloStatus> {
5675
+ const data = StreamSloStatusRequest.encode(request).finish();
5676
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSloStatus", data, metadata);
5677
+ return result.pipe(map((data) => SloStatus.decode(new BinaryReader(data))));
5678
+ }
5679
+
5680
+ CreateSloDashboard(request: CreateSloDashboardRequest, metadata?: Metadata): Promise<CreateSloDashboardResponse> {
5681
+ const data = CreateSloDashboardRequest.encode(request).finish();
5682
+ const promise = this.rpc.request(this.service, "CreateSloDashboard", data, metadata);
5683
+ return promise.then((data) => CreateSloDashboardResponse.decode(new BinaryReader(data)));
5684
+ }
5685
+
5686
+ GetSloDashboard(request: GetSloDashboardRequest, metadata?: Metadata): Promise<GetSloDashboardResponse> {
5687
+ const data = GetSloDashboardRequest.encode(request).finish();
5688
+ const promise = this.rpc.request(this.service, "GetSloDashboard", data, metadata);
5689
+ return promise.then((data) => GetSloDashboardResponse.decode(new BinaryReader(data)));
5690
+ }
5691
+
5692
+ ListSloDashboards(request: ListSloDashboardsRequest, metadata?: Metadata): Promise<ListSloDashboardsResponse> {
5693
+ const data = ListSloDashboardsRequest.encode(request).finish();
5694
+ const promise = this.rpc.request(this.service, "ListSloDashboards", data, metadata);
5695
+ return promise.then((data) => ListSloDashboardsResponse.decode(new BinaryReader(data)));
5696
+ }
5697
+
5698
+ UpdateSloDashboard(request: UpdateSloDashboardRequest, metadata?: Metadata): Promise<UpdateSloDashboardResponse> {
5699
+ const data = UpdateSloDashboardRequest.encode(request).finish();
5700
+ const promise = this.rpc.request(this.service, "UpdateSloDashboard", data, metadata);
5701
+ return promise.then((data) => UpdateSloDashboardResponse.decode(new BinaryReader(data)));
5702
+ }
5703
+
5704
+ DeleteSloDashboard(request: DeleteSloDashboardRequest, metadata?: Metadata): Promise<DeleteSloDashboardResponse> {
5705
+ const data = DeleteSloDashboardRequest.encode(request).finish();
5706
+ const promise = this.rpc.request(this.service, "DeleteSloDashboard", data, metadata);
5707
+ return promise.then((data) => DeleteSloDashboardResponse.decode(new BinaryReader(data)));
5708
+ }
5709
+
5710
+ StreamSloDashboardData(
5711
+ request: StreamSloDashboardDataRequest,
5712
+ metadata?: Metadata,
5713
+ ): Observable<SloDashboardDataEnvelope> {
5714
+ const data = StreamSloDashboardDataRequest.encode(request).finish();
5715
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSloDashboardData", data, metadata);
5716
+ return result.pipe(map((data) => SloDashboardDataEnvelope.decode(new BinaryReader(data))));
5717
+ }
2901
5718
  }
2902
5719
 
2903
5720
  interface Rpc {
2904
5721
  request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
5722
+ clientStreamingRequest(
5723
+ service: string,
5724
+ method: string,
5725
+ data: Observable<Uint8Array>,
5726
+ metadata?: Metadata,
5727
+ ): Promise<Uint8Array>;
5728
+ serverStreamingRequest(
5729
+ service: string,
5730
+ method: string,
5731
+ data: Uint8Array,
5732
+ metadata?: Metadata,
5733
+ ): Observable<Uint8Array>;
5734
+ bidirectionalStreamingRequest(
5735
+ service: string,
5736
+ method: string,
5737
+ data: Observable<Uint8Array>,
5738
+ metadata?: Metadata,
5739
+ ): Observable<Uint8Array>;
2905
5740
  }
2906
5741
 
2907
5742
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
@@ -2949,6 +5784,10 @@ function longToNumber(int64: { toString(): string }): number {
2949
5784
  return num;
2950
5785
  }
2951
5786
 
5787
+ function isObject(value: any): boolean {
5788
+ return typeof value === "object" && value !== null;
5789
+ }
5790
+
2952
5791
  function isSet(value: any): boolean {
2953
5792
  return value !== null && value !== undefined;
2954
5793
  }