@7k-inari/api-client 0.3.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.
@@ -0,0 +1,4692 @@
1
+ /**
2
+ * Generated by orval v7.21.0 🍺
3
+ * Do not edit manually.
4
+ * Inari Control Plane API
5
+ * REST surface of the Inari control plane for console and CLI clients
6
+ (platform plan §4.3). Agents use the gRPC EventStream contract instead.
7
+ All operations are tenant-scoped.
8
+
9
+ * OpenAPI spec version: 0.1.0
10
+ */
11
+
12
+ // https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
13
+ type IfEquals<X, Y, A = X, B = never> = (<T>() => T extends X ? 1 : 2) extends <
14
+ T,
15
+ >() => T extends Y ? 1 : 2
16
+ ? A
17
+ : B;
18
+
19
+ type WritableKeys<T> = {
20
+ [P in keyof T]-?: IfEquals<
21
+ { [Q in P]: T[P] },
22
+ { -readonly [Q in P]: T[P] },
23
+ P
24
+ >;
25
+ }[keyof T];
26
+
27
+ type UnionToIntersection<U> =
28
+ (U extends any ? (k: U)=>void : never) extends ((k: infer I)=>void) ? I : never;
29
+ type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never;
30
+
31
+ type Writable<T> = Pick<T, WritableKeys<T>>;
32
+ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
33
+ [P in keyof Writable<T>]: T[P] extends object
34
+ ? NonReadonly<NonNullable<T[P]>>
35
+ : T[P];
36
+ } : DistributeReadOnlyOverUnions<T>;
37
+
38
+ export type HealthStatusStatus = typeof HealthStatusStatus[keyof typeof HealthStatusStatus];
39
+
40
+
41
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
42
+ export const HealthStatusStatus = {
43
+ ok: 'ok',
44
+ } as const;
45
+
46
+ export interface HealthStatus {
47
+ status: HealthStatusStatus;
48
+ version?: string;
49
+ }
50
+
51
+ export interface AccountOutputBody {
52
+ /** A URL to the JSON Schema for this object. */
53
+ readonly $schema?: string;
54
+ account: CloudAccount;
55
+ }
56
+
57
+ export interface AddMemberInputBody {
58
+ /** A URL to the JSON Schema for this object. */
59
+ readonly $schema?: string;
60
+ /**
61
+ * Keycloak user id
62
+ * @minLength 1
63
+ */
64
+ subject: string;
65
+ }
66
+
67
+ export interface ApprovalOutputBody {
68
+ /** A URL to the JSON Schema for this object. */
69
+ readonly $schema?: string;
70
+ approval: ApprovalRequest;
71
+ }
72
+
73
+ export interface ApprovalRequest {
74
+ action?: string;
75
+ approver?: string;
76
+ cancelledBy?: string;
77
+ channel?: string;
78
+ clusterId: string;
79
+ createdAt: string;
80
+ decidedAt?: string;
81
+ expiresAt?: string;
82
+ id: string;
83
+ instanceId?: string;
84
+ itemId: string;
85
+ name?: string;
86
+ namespace?: string;
87
+ orgId: string;
88
+ ownerTeam?: string;
89
+ reason?: string;
90
+ requester: string;
91
+ spec: unknown;
92
+ state: string;
93
+ version: string;
94
+ }
95
+
96
+ export interface AssignPackInputBody {
97
+ /** A URL to the JSON Schema for this object. */
98
+ readonly $schema?: string;
99
+ targetId: string;
100
+ /** clusterset | tenant | cluster */
101
+ targetType: string;
102
+ }
103
+
104
+ export interface AssignPackOutputBody {
105
+ /** A URL to the JSON Schema for this object. */
106
+ readonly $schema?: string;
107
+ assignment: PolicyAssignment;
108
+ }
109
+
110
+ export interface Capability {
111
+ clusterId: string;
112
+ deletedAt?: string;
113
+ firstSeenAt: string;
114
+ group?: string;
115
+ id: string;
116
+ kind: string;
117
+ lastSeenAt: string;
118
+ managementMode: string;
119
+ name: string;
120
+ schema?: unknown;
121
+ uiHints?: unknown;
122
+ version?: string;
123
+ }
124
+
125
+ export interface CapabilityRef {
126
+ group?: string;
127
+ kind: string;
128
+ name: string;
129
+ }
130
+
131
+ export interface CatalogItemVersion {
132
+ channel: string;
133
+ id: string;
134
+ itemId: string;
135
+ payload?: unknown;
136
+ schema?: unknown;
137
+ uiHints?: unknown;
138
+ version: string;
139
+ }
140
+
141
+ export interface CloudAccount {
142
+ accountId: string;
143
+ createdAt: string;
144
+ createdBy?: string;
145
+ externalId?: string;
146
+ id: string;
147
+ issuerUrl?: string;
148
+ orgId: string;
149
+ provider: string;
150
+ roleArn: string;
151
+ runContext: string;
152
+ state: string;
153
+ validatedAt?: string;
154
+ validationError?: string;
155
+ }
156
+
157
+ export type ClusterLabels = {[key: string]: string};
158
+
159
+ export interface Cluster {
160
+ capabilityChecksum?: string;
161
+ connectedAt?: string;
162
+ createdAt: string;
163
+ distribution?: string;
164
+ id: string;
165
+ keycloakClientId?: string;
166
+ kubernetesVersion?: string;
167
+ labels?: ClusterLabels;
168
+ lastSeenAt?: string;
169
+ name: string;
170
+ oidcIssuerUrl?: string;
171
+ orgId: string;
172
+ state: string;
173
+ }
174
+
175
+ export interface ClusterOutputBody {
176
+ /** A URL to the JSON Schema for this object. */
177
+ readonly $schema?: string;
178
+ cluster: Cluster;
179
+ }
180
+
181
+ export type ClusterSetLabelSelector = {[key: string]: string};
182
+
183
+ export interface ClusterSet {
184
+ createdAt: string;
185
+ id: string;
186
+ labelSelector: ClusterSetLabelSelector;
187
+ name: string;
188
+ orgId: string;
189
+ }
190
+
191
+ export interface ClusterSetOutputBody {
192
+ /** A URL to the JSON Schema for this object. */
193
+ readonly $schema?: string;
194
+ clusterSet: ClusterSet;
195
+ }
196
+
197
+ export type CreateClusterInputBodyLabels = {[key: string]: string};
198
+
199
+ export interface CreateClusterInputBody {
200
+ /** A URL to the JSON Schema for this object. */
201
+ readonly $schema?: string;
202
+ labels?: CreateClusterInputBodyLabels;
203
+ /**
204
+ * @minLength 1
205
+ * @maxLength 100
206
+ */
207
+ name: string;
208
+ }
209
+
210
+ export type CreateClusterSetInputBodyLabelSelector = {[key: string]: string};
211
+
212
+ export interface CreateClusterSetInputBody {
213
+ /** A URL to the JSON Schema for this object. */
214
+ readonly $schema?: string;
215
+ labelSelector: CreateClusterSetInputBodyLabelSelector;
216
+ name: string;
217
+ }
218
+
219
+ export interface CreateInputBody {
220
+ /** A URL to the JSON Schema for this object. */
221
+ readonly $schema?: string;
222
+ enabled?: boolean;
223
+ /**
224
+ * Empty = all events
225
+ * @nullable
226
+ */
227
+ events?: string[] | null;
228
+ /** slack | webhook */
229
+ kind: string;
230
+ name: string;
231
+ secret?: string;
232
+ url: string;
233
+ }
234
+
235
+ export interface CreatePackInputBody {
236
+ /** A URL to the JSON Schema for this object. */
237
+ readonly $schema?: string;
238
+ /** kyverno | cel-vap */
239
+ engine: string;
240
+ manifests: unknown;
241
+ name: string;
242
+ ociRef?: string;
243
+ parameters?: unknown;
244
+ version: string;
245
+ }
246
+
247
+ export interface CreatePolicyInputBody {
248
+ /** A URL to the JSON Schema for this object. */
249
+ readonly $schema?: string;
250
+ /** rego */
251
+ engine: string;
252
+ name: string;
253
+ /** Rego source (package inari.policy) */
254
+ source: string;
255
+ /** request | render */
256
+ target: string;
257
+ }
258
+
259
+ export interface CreateTenantInputBody {
260
+ /** A URL to the JSON Schema for this object. */
261
+ readonly $schema?: string;
262
+ /**
263
+ * @minLength 1
264
+ * @maxLength 200
265
+ */
266
+ displayName: string;
267
+ /**
268
+ * URL-safe tenant slug
269
+ * @minLength 2
270
+ * @maxLength 63
271
+ * @pattern ^[a-z0-9][a-z0-9-]*$
272
+ */
273
+ slug: string;
274
+ }
275
+
276
+ export interface DecideExemptionInputBody {
277
+ /** A URL to the JSON Schema for this object. */
278
+ readonly $schema?: string;
279
+ approve: boolean;
280
+ }
281
+
282
+ export interface DecideInputBody {
283
+ /** A URL to the JSON Schema for this object. */
284
+ readonly $schema?: string;
285
+ approve: boolean;
286
+ reason?: string;
287
+ }
288
+
289
+ export interface DecideOutputBody {
290
+ /** A URL to the JSON Schema for this object. */
291
+ readonly $schema?: string;
292
+ approval: ApprovalRequest;
293
+ }
294
+
295
+ export interface DecommissionInputBody {
296
+ /** A URL to the JSON Schema for this object. */
297
+ readonly $schema?: string;
298
+ /** Drain even when non-Inari-managed resources exist (§10 override) */
299
+ force?: boolean;
300
+ }
301
+
302
+ export interface DecommissionOutputBody {
303
+ /** A URL to the JSON Schema for this object. */
304
+ readonly $schema?: string;
305
+ cluster: Cluster;
306
+ /** @nullable */
307
+ drainedInstanceIds: string[] | null;
308
+ }
309
+
310
+ export interface DecommissionOutputBody1 {
311
+ /** A URL to the JSON Schema for this object. */
312
+ readonly $schema?: string;
313
+ approvalId?: string;
314
+ }
315
+
316
+ export interface DeployInputBody {
317
+ /** A URL to the JSON Schema for this object. */
318
+ readonly $schema?: string;
319
+ channel?: string;
320
+ /** @minLength 1 */
321
+ clusterId: string;
322
+ /** @minLength 1 */
323
+ itemId: string;
324
+ /**
325
+ * Instance name (DNS-1123 label); becomes the instance ID and repo path segment
326
+ * @maxLength 63
327
+ * @pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
328
+ */
329
+ name?: string;
330
+ /**
331
+ * @maxLength 63
332
+ * @pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
333
+ */
334
+ namespace?: string;
335
+ ownerTeam?: string;
336
+ spec: unknown;
337
+ version?: string;
338
+ }
339
+
340
+ export interface DeployOutputBody {
341
+ /** A URL to the JSON Schema for this object. */
342
+ readonly $schema?: string;
343
+ deploy: DeployResult;
344
+ }
345
+
346
+ export interface DeployResult {
347
+ ApprovalID: string;
348
+ CommitSHA: string;
349
+ InstanceID: string;
350
+ PRURL: string;
351
+ Status: string;
352
+ Version: string;
353
+ }
354
+
355
+ export interface DiffOutputBody {
356
+ /** A URL to the JSON Schema for this object. */
357
+ readonly $schema?: string;
358
+ diff: DiffPreview;
359
+ }
360
+
361
+ export interface DiffPreview {
362
+ currentManifest: string;
363
+ currentSchema?: unknown;
364
+ currentVersion: string;
365
+ instanceId: string;
366
+ itemId: string;
367
+ targetManifest: string;
368
+ targetSchema?: unknown;
369
+ targetVersion: string;
370
+ }
371
+
372
+ export interface EndpointOutputBody {
373
+ /** A URL to the JSON Schema for this object. */
374
+ readonly $schema?: string;
375
+ endpoint: NotificationEndpoint;
376
+ }
377
+
378
+ export interface ErrorDetail {
379
+ /** Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' */
380
+ location?: string;
381
+ /** Error message text */
382
+ message?: string;
383
+ /** The value at the given location */
384
+ value?: unknown;
385
+ }
386
+
387
+ export interface ErrorModel {
388
+ /** A URL to the JSON Schema for this object. */
389
+ readonly $schema?: string;
390
+ /** A human-readable explanation specific to this occurrence of the problem. */
391
+ detail?: string;
392
+ /**
393
+ * Optional list of individual error details
394
+ * @nullable
395
+ */
396
+ errors?: ErrorDetail[] | null;
397
+ /** A URI reference that identifies the specific occurrence of the problem. */
398
+ instance?: string;
399
+ /** HTTP status code */
400
+ status?: number;
401
+ /** A short, human-readable summary of the problem type. This value should not change between occurrences of the error. */
402
+ title?: string;
403
+ /** A URI reference to human-readable documentation for the error. */
404
+ type?: string;
405
+ }
406
+
407
+ export interface EvaluateInputBody {
408
+ /** A URL to the JSON Schema for this object. */
409
+ readonly $schema?: string;
410
+ clusterId: string;
411
+ itemId: string;
412
+ spec: unknown;
413
+ version: string;
414
+ }
415
+
416
+ export interface EvaluateOutputBody {
417
+ /** A URL to the JSON Schema for this object. */
418
+ readonly $schema?: string;
419
+ decision: PolicyDecision;
420
+ }
421
+
422
+ export interface Exemption {
423
+ approvedBy?: string;
424
+ createdAt: string;
425
+ createdBy?: string;
426
+ expiresAt: string;
427
+ id: string;
428
+ orgId: string;
429
+ policyId: string;
430
+ reason: string;
431
+ scope: unknown;
432
+ state: string;
433
+ }
434
+
435
+ export interface ExemptionOutputBody {
436
+ /** A URL to the JSON Schema for this object. */
437
+ readonly $schema?: string;
438
+ exemption: Exemption;
439
+ }
440
+
441
+ export interface GetOutputBody {
442
+ /** A URL to the JSON Schema for this object. */
443
+ readonly $schema?: string;
444
+ instance: InstanceView;
445
+ }
446
+
447
+ export type GetZoneOutputBodySteps = {[key: string]: TenantZoneStep};
448
+
449
+ export interface GetZoneOutputBody {
450
+ /** A URL to the JSON Schema for this object. */
451
+ readonly $schema?: string;
452
+ steps: GetZoneOutputBodySteps;
453
+ zone: TenantZone;
454
+ }
455
+
456
+ export type GitConfigInputBodyCommitPolicy = typeof GitConfigInputBodyCommitPolicy[keyof typeof GitConfigInputBodyCommitPolicy];
457
+
458
+
459
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
460
+ export const GitConfigInputBodyCommitPolicy = {
461
+ direct: 'direct',
462
+ pull_request: 'pull_request',
463
+ } as const;
464
+
465
+ export interface GitConfigInputBody {
466
+ /** A URL to the JSON Schema for this object. */
467
+ readonly $schema?: string;
468
+ baseBranch?: string;
469
+ commitPolicy: GitConfigInputBodyCommitPolicy;
470
+ /**
471
+ * owner/name or https URL of the <tenant>-inari-state repo
472
+ * @minLength 1
473
+ */
474
+ repo: string;
475
+ }
476
+
477
+ export interface GitConfigOutputBody {
478
+ /** A URL to the JSON Schema for this object. */
479
+ readonly $schema?: string;
480
+ config: TenantGitConfig;
481
+ }
482
+
483
+ export interface InstanceView {
484
+ catalogItemId: string;
485
+ clusterId: string;
486
+ commitSha?: string;
487
+ createdAt: string;
488
+ generation: number;
489
+ health: string;
490
+ id: string;
491
+ latestVersion?: string;
492
+ managementMode: string;
493
+ newVersionAvailable: boolean;
494
+ orgId: string;
495
+ ownerTeam: string;
496
+ prUrl?: string;
497
+ resourceRef: ResourceRef;
498
+ spec: unknown;
499
+ state: string;
500
+ statusMessage?: string;
501
+ syncState?: string;
502
+ updatedAt: string;
503
+ version: string;
504
+ }
505
+
506
+ export interface Item {
507
+ clusterId?: string;
508
+ /** @minLength 1 */
509
+ orgId: string;
510
+ }
511
+
512
+ export interface ItemOutputBody {
513
+ /** A URL to the JSON Schema for this object. */
514
+ readonly $schema?: string;
515
+ item: ItemView;
516
+ }
517
+
518
+ export interface ItemView {
519
+ approvalPolicy: string;
520
+ capabilityRef?: CapabilityRef;
521
+ createdAt: string;
522
+ description: string;
523
+ displayName: string;
524
+ id: string;
525
+ name: string;
526
+ ociRef?: string;
527
+ pinnedVersion?: string;
528
+ source: string;
529
+ /** @nullable */
530
+ versions?: CatalogItemVersion[] | null;
531
+ }
532
+
533
+ export interface ListAccountsOutputBody {
534
+ /** A URL to the JSON Schema for this object. */
535
+ readonly $schema?: string;
536
+ /** @nullable */
537
+ accounts: CloudAccount[] | null;
538
+ }
539
+
540
+ export interface ListCapabilitiesOutputBody {
541
+ /** A URL to the JSON Schema for this object. */
542
+ readonly $schema?: string;
543
+ /** @nullable */
544
+ capabilities: Capability[] | null;
545
+ }
546
+
547
+ export interface ListCatalogOutputBody {
548
+ /** A URL to the JSON Schema for this object. */
549
+ readonly $schema?: string;
550
+ /** @nullable */
551
+ items: ItemView[] | null;
552
+ }
553
+
554
+ export interface ListClusterSetsOutputBody {
555
+ /** A URL to the JSON Schema for this object. */
556
+ readonly $schema?: string;
557
+ /** @nullable */
558
+ clusterSets: ClusterSet[] | null;
559
+ }
560
+
561
+ export interface ListClustersOutputBody {
562
+ /** A URL to the JSON Schema for this object. */
563
+ readonly $schema?: string;
564
+ /** @nullable */
565
+ clusters: Cluster[] | null;
566
+ }
567
+
568
+ export interface ListExemptionsOutputBody {
569
+ /** A URL to the JSON Schema for this object. */
570
+ readonly $schema?: string;
571
+ /** @nullable */
572
+ exemptions: Exemption[] | null;
573
+ }
574
+
575
+ export interface ListMembersOutputBody {
576
+ /** A URL to the JSON Schema for this object. */
577
+ readonly $schema?: string;
578
+ /** @nullable */
579
+ members: MemberView[] | null;
580
+ }
581
+
582
+ export interface ListOutputBody {
583
+ /** A URL to the JSON Schema for this object. */
584
+ readonly $schema?: string;
585
+ /** @nullable */
586
+ approvals: ApprovalRequest[] | null;
587
+ }
588
+
589
+ export interface ListOutputBody1 {
590
+ /** A URL to the JSON Schema for this object. */
591
+ readonly $schema?: string;
592
+ /** @nullable */
593
+ instances: InstanceView[] | null;
594
+ }
595
+
596
+ export interface ListOutputBody2 {
597
+ /** A URL to the JSON Schema for this object. */
598
+ readonly $schema?: string;
599
+ /** @nullable */
600
+ endpoints: NotificationEndpoint[] | null;
601
+ }
602
+
603
+ export interface ListPacksOutputBody {
604
+ /** A URL to the JSON Schema for this object. */
605
+ readonly $schema?: string;
606
+ /** @nullable */
607
+ packs: PolicyPack[] | null;
608
+ }
609
+
610
+ export interface ListPoliciesOutputBody {
611
+ /** A URL to the JSON Schema for this object. */
612
+ readonly $schema?: string;
613
+ /** @nullable */
614
+ policies: Policy[] | null;
615
+ }
616
+
617
+ export interface ListTeamsOutputBody {
618
+ /** A URL to the JSON Schema for this object. */
619
+ readonly $schema?: string;
620
+ /** @nullable */
621
+ teams: Team[] | null;
622
+ }
623
+
624
+ export interface ListTenantsOutputBody {
625
+ /** A URL to the JSON Schema for this object. */
626
+ readonly $schema?: string;
627
+ /** @nullable */
628
+ tenants: Organization[] | null;
629
+ }
630
+
631
+ export interface ListZonesOutputBody {
632
+ /** A URL to the JSON Schema for this object. */
633
+ readonly $schema?: string;
634
+ /** @nullable */
635
+ zones: TenantZone[] | null;
636
+ }
637
+
638
+ export interface MemberView {
639
+ displayName: string;
640
+ email: string;
641
+ role: string;
642
+ userId: string;
643
+ }
644
+
645
+ export interface NotificationDelivery {
646
+ attempts: number;
647
+ createdAt: string;
648
+ deliveredAt?: string;
649
+ endpointId: string;
650
+ eventType: string;
651
+ id: string;
652
+ lastError?: string;
653
+ payload: unknown;
654
+ status: string;
655
+ }
656
+
657
+ export interface NotificationEndpoint {
658
+ createdAt: string;
659
+ enabled: boolean;
660
+ /** @nullable */
661
+ events: string[] | null;
662
+ id: string;
663
+ kind: string;
664
+ name: string;
665
+ orgId: string;
666
+ url: string;
667
+ }
668
+
669
+ export interface Organization {
670
+ createdAt: string;
671
+ displayName: string;
672
+ id: string;
673
+ keycloakOrgId: string;
674
+ slug: string;
675
+ }
676
+
677
+ export interface PackOutputBody {
678
+ /** A URL to the JSON Schema for this object. */
679
+ readonly $schema?: string;
680
+ pack: PolicyPack;
681
+ }
682
+
683
+ export interface PinInputBody {
684
+ /** A URL to the JSON Schema for this object. */
685
+ readonly $schema?: string;
686
+ /** @minLength 1 */
687
+ version: string;
688
+ }
689
+
690
+ export interface Policy {
691
+ createdAt: string;
692
+ enabled: boolean;
693
+ engine: string;
694
+ id: string;
695
+ name: string;
696
+ orgId?: string;
697
+ source: string;
698
+ target: string;
699
+ updatedAt: string;
700
+ version: number;
701
+ }
702
+
703
+ export interface PolicyAssignment {
704
+ createdAt: string;
705
+ id: string;
706
+ packId: string;
707
+ state: string;
708
+ targetId: string;
709
+ targetType: string;
710
+ }
711
+
712
+ export interface PolicyDecision {
713
+ allow: boolean;
714
+ /** @nullable */
715
+ violations?: PolicyViolation[] | null;
716
+ /** @nullable */
717
+ warnings?: PolicyViolation[] | null;
718
+ }
719
+
720
+ export interface PolicyOutputBody {
721
+ /** A URL to the JSON Schema for this object. */
722
+ readonly $schema?: string;
723
+ policy: Policy;
724
+ }
725
+
726
+ export interface PolicyPack {
727
+ createdAt: string;
728
+ engine: string;
729
+ id: string;
730
+ manifests: unknown;
731
+ name: string;
732
+ ociRef?: string;
733
+ orgId?: string;
734
+ parameters?: unknown;
735
+ version: string;
736
+ }
737
+
738
+ export interface PolicyViolation {
739
+ exempted?: boolean;
740
+ reason: string;
741
+ remediation: string;
742
+ rule: string;
743
+ }
744
+
745
+ export interface RegisterInputBody {
746
+ /** A URL to the JSON Schema for this object. */
747
+ readonly $schema?: string;
748
+ /** 12-digit AWS account ID */
749
+ accountId: string;
750
+ externalId?: string;
751
+ issuerUrl?: string;
752
+ /** Cloud provider (aws) */
753
+ provider?: string;
754
+ /** arn:aws:iam::<acct>:role/<name> */
755
+ roleArn: string;
756
+ /** tenant (default) | platform */
757
+ runContext?: string;
758
+ }
759
+
760
+ export interface RegistrationToken {
761
+ clusterId: string;
762
+ createdAt: string;
763
+ createdBy: string;
764
+ expiresAt: string;
765
+ id: string;
766
+ usedAt?: string;
767
+ }
768
+
769
+ export interface RequestExemptionInputBody {
770
+ /** A URL to the JSON Schema for this object. */
771
+ readonly $schema?: string;
772
+ expiresAt: string;
773
+ policyId: string;
774
+ reason: string;
775
+ scope?: unknown;
776
+ }
777
+
778
+ export type RequestZoneInputBodyTags = {[key: string]: string};
779
+
780
+ export interface RequestZoneInputBody {
781
+ /** A URL to the JSON Schema for this object. */
782
+ readonly $schema?: string;
783
+ /**
784
+ * @minLength 1
785
+ * @maxLength 100
786
+ */
787
+ displayName: string;
788
+ /** @minLength 1 */
789
+ managementAccountId: string;
790
+ /** @minLength 1 */
791
+ ouId: string;
792
+ /** @minLength 1 */
793
+ region: string;
794
+ /**
795
+ * @minLength 3
796
+ * @maxLength 32
797
+ */
798
+ slug: string;
799
+ tags?: RequestZoneInputBodyTags;
800
+ /** @minLength 1 */
801
+ tier: string;
802
+ }
803
+
804
+ export interface RequestZoneOutputBody {
805
+ /** A URL to the JSON Schema for this object. */
806
+ readonly $schema?: string;
807
+ approvalId?: string;
808
+ zone: TenantZone;
809
+ }
810
+
811
+ export interface ResourceRef {
812
+ group?: string;
813
+ kind: string;
814
+ name: string;
815
+ namespace?: string;
816
+ }
817
+
818
+ export interface SyncOutputBody {
819
+ /** A URL to the JSON Schema for this object. */
820
+ readonly $schema?: string;
821
+ synced: number;
822
+ }
823
+
824
+ export interface Team {
825
+ createdAt: string;
826
+ id: string;
827
+ keycloakGroupPath: string;
828
+ name: string;
829
+ orgId: string;
830
+ }
831
+
832
+ export interface TenantGitConfig {
833
+ baseBranch: string;
834
+ commitPolicy: string;
835
+ orgId: string;
836
+ repo: string;
837
+ }
838
+
839
+ export interface TenantOutputBody {
840
+ /** A URL to the JSON Schema for this object. */
841
+ readonly $schema?: string;
842
+ organization: Organization;
843
+ /** @nullable */
844
+ teams: Team[] | null;
845
+ }
846
+
847
+ export type TenantZoneTags = {[key: string]: string};
848
+
849
+ export interface TenantZone {
850
+ awsAccountId?: string;
851
+ cloudAccountId?: string;
852
+ clusterId?: string;
853
+ createdAt: string;
854
+ createdBy: string;
855
+ displayName: string;
856
+ error?: string;
857
+ gitRepo?: string;
858
+ id: string;
859
+ keycloakOrgId?: string;
860
+ managementAccountId: string;
861
+ orgId?: string;
862
+ ouId: string;
863
+ ownerOrgId: string;
864
+ region: string;
865
+ slug: string;
866
+ state: string;
867
+ tags?: TenantZoneTags;
868
+ tier: string;
869
+ updatedAt: string;
870
+ }
871
+
872
+ export interface TenantZoneStep {
873
+ attempts: number;
874
+ detail?: unknown;
875
+ externalRef?: string;
876
+ status: string;
877
+ step: string;
878
+ updatedAt: string;
879
+ zoneId: string;
880
+ }
881
+
882
+ export interface TestOutputBody {
883
+ /** A URL to the JSON Schema for this object. */
884
+ readonly $schema?: string;
885
+ delivery: NotificationDelivery;
886
+ }
887
+
888
+ export interface TokenOutputBody {
889
+ /** A URL to the JSON Schema for this object. */
890
+ readonly $schema?: string;
891
+ expiresAt: string;
892
+ record: RegistrationToken;
893
+ /** Plaintext bootstrap token, returned once */
894
+ token: string;
895
+ }
896
+
897
+ export interface UpdateInputBody {
898
+ /** A URL to the JSON Schema for this object. */
899
+ readonly $schema?: string;
900
+ enabled?: boolean;
901
+ /** @nullable */
902
+ events?: string[] | null;
903
+ name?: string;
904
+ secret?: string;
905
+ url?: string;
906
+ }
907
+
908
+ export interface UpdatePolicyInputBody {
909
+ /** A URL to the JSON Schema for this object. */
910
+ readonly $schema?: string;
911
+ enabled: boolean;
912
+ source: string;
913
+ }
914
+
915
+ export interface UpgradeInputBody {
916
+ /** A URL to the JSON Schema for this object. */
917
+ readonly $schema?: string;
918
+ /** @minLength 1 */
919
+ toVersion: string;
920
+ }
921
+
922
+ export interface VisibilityInputBody {
923
+ /** A URL to the JSON Schema for this object. */
924
+ readonly $schema?: string;
925
+ /** @nullable */
926
+ rules: Item[] | null;
927
+ }
928
+
929
+ export type ListApprovalsParams = {
930
+ /**
931
+ * Filter by state (pending|approved|rejected|cancelled|expired)
932
+ */
933
+ state?: string;
934
+ /**
935
+ * Pass 'me' for the caller's own requests (inbox filter)
936
+ */
937
+ requester?: string;
938
+ };
939
+
940
+ export type ListCatalogParams = {
941
+ /**
942
+ * Cluster ID; intersects discovered capabilities
943
+ */
944
+ cluster?: string;
945
+ };
946
+
947
+ export type GetCatalogItemParams = {
948
+ cluster?: string;
949
+ };
950
+
951
+ export type UnpinCatalogVersionParams = {
952
+ cluster?: string;
953
+ };
954
+
955
+ export type RenderCloudAccountProviderConfigParams = {
956
+ /**
957
+ * Cluster to render the ProviderConfig for
958
+ */
959
+ clusterId: string;
960
+ };
961
+
962
+ export type ListInstancesParams = {
963
+ cluster?: string;
964
+ item?: string;
965
+ health?: string;
966
+ ownerTeam?: string;
967
+ };
968
+
969
+ export type InstanceDiffParams = {
970
+ /**
971
+ * Target version
972
+ */
973
+ to: string;
974
+ };
975
+
976
+ export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
977
+ export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
978
+ export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
979
+ export type HTTPStatusCode4xx = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451;
980
+ export type HTTPStatusCode5xx = 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
981
+ export type HTTPStatusCodes = HTTPStatusCode1xx | HTTPStatusCode2xx | HTTPStatusCode3xx | HTTPStatusCode4xx | HTTPStatusCode5xx;
982
+
983
+ /**
984
+ * @summary Liveness probe
985
+ */
986
+ export type getHealthResponse200 = {
987
+ data: HealthStatus
988
+ status: 200
989
+ }
990
+
991
+ export type getHealthResponseSuccess = (getHealthResponse200) & {
992
+ headers: Headers;
993
+ };
994
+ ;
995
+
996
+ export type getHealthResponse = (getHealthResponseSuccess)
997
+
998
+ export const getGetHealthUrl = () => {
999
+
1000
+
1001
+
1002
+
1003
+ return `/healthz`
1004
+ }
1005
+
1006
+ export const getHealth = async ( options?: RequestInit): Promise<getHealthResponse> => {
1007
+
1008
+ const res = await fetch(getGetHealthUrl(),
1009
+ {
1010
+ ...options,
1011
+ method: 'GET'
1012
+
1013
+
1014
+ }
1015
+ )
1016
+
1017
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1018
+
1019
+ const data: getHealthResponse['data'] = body ? JSON.parse(body) : {}
1020
+ return { data, status: res.status, headers: res.headers } as getHealthResponse
1021
+ }
1022
+
1023
+
1024
+
1025
+ /**
1026
+ * @summary Readiness probe
1027
+ */
1028
+ export type getReadyResponse200 = {
1029
+ data: HealthStatus
1030
+ status: 200
1031
+ }
1032
+
1033
+ export type getReadyResponse503 = {
1034
+ data: HealthStatus
1035
+ status: 503
1036
+ }
1037
+
1038
+ export type getReadyResponseSuccess = (getReadyResponse200) & {
1039
+ headers: Headers;
1040
+ };
1041
+ export type getReadyResponseError = (getReadyResponse503) & {
1042
+ headers: Headers;
1043
+ };
1044
+
1045
+ export type getReadyResponse = (getReadyResponseSuccess | getReadyResponseError)
1046
+
1047
+ export const getGetReadyUrl = () => {
1048
+
1049
+
1050
+
1051
+
1052
+ return `/readyz`
1053
+ }
1054
+
1055
+ export const getReady = async ( options?: RequestInit): Promise<getReadyResponse> => {
1056
+
1057
+ const res = await fetch(getGetReadyUrl(),
1058
+ {
1059
+ ...options,
1060
+ method: 'GET'
1061
+
1062
+
1063
+ }
1064
+ )
1065
+
1066
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1067
+
1068
+ const data: getReadyResponse['data'] = body ? JSON.parse(body) : {}
1069
+ return { data, status: res.status, headers: res.headers } as getReadyResponse
1070
+ }
1071
+
1072
+
1073
+
1074
+ /**
1075
+ * @summary Sync curated packages from the catalog registry (platform engineer)
1076
+ */
1077
+ export type syncCatalogResponse200 = {
1078
+ data: SyncOutputBody
1079
+ status: 200
1080
+ }
1081
+
1082
+ export type syncCatalogResponseDefault = {
1083
+ data: ErrorModel
1084
+ status: Exclude<HTTPStatusCodes, 200>
1085
+ }
1086
+
1087
+ export type syncCatalogResponseSuccess = (syncCatalogResponse200) & {
1088
+ headers: Headers;
1089
+ };
1090
+ export type syncCatalogResponseError = (syncCatalogResponseDefault) & {
1091
+ headers: Headers;
1092
+ };
1093
+
1094
+ export type syncCatalogResponse = (syncCatalogResponseSuccess | syncCatalogResponseError)
1095
+
1096
+ export const getSyncCatalogUrl = () => {
1097
+
1098
+
1099
+
1100
+
1101
+ return `/api/v1/admin/catalog/sync`
1102
+ }
1103
+
1104
+ export const syncCatalog = async ( options?: RequestInit): Promise<syncCatalogResponse> => {
1105
+
1106
+ const res = await fetch(getSyncCatalogUrl(),
1107
+ {
1108
+ ...options,
1109
+ method: 'POST'
1110
+
1111
+
1112
+ }
1113
+ )
1114
+
1115
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1116
+
1117
+ const data: syncCatalogResponse['data'] = body ? JSON.parse(body) : {}
1118
+ return { data, status: res.status, headers: res.headers } as syncCatalogResponse
1119
+ }
1120
+
1121
+
1122
+
1123
+ /**
1124
+ * @summary Set per-tenant/cluster visibility rules (platform engineer)
1125
+ */
1126
+ export type setCatalogVisibilityResponse204 = {
1127
+ data: void
1128
+ status: 204
1129
+ }
1130
+
1131
+ export type setCatalogVisibilityResponseDefault = {
1132
+ data: ErrorModel
1133
+ status: Exclude<HTTPStatusCodes, 204>
1134
+ }
1135
+
1136
+ export type setCatalogVisibilityResponseSuccess = (setCatalogVisibilityResponse204) & {
1137
+ headers: Headers;
1138
+ };
1139
+ export type setCatalogVisibilityResponseError = (setCatalogVisibilityResponseDefault) & {
1140
+ headers: Headers;
1141
+ };
1142
+
1143
+ export type setCatalogVisibilityResponse = (setCatalogVisibilityResponseSuccess | setCatalogVisibilityResponseError)
1144
+
1145
+ export const getSetCatalogVisibilityUrl = (item: string,) => {
1146
+
1147
+
1148
+
1149
+
1150
+ return `/api/v1/admin/catalog/${item}/visibility`
1151
+ }
1152
+
1153
+ export const setCatalogVisibility = async (item: string,
1154
+ visibilityInputBody: NonReadonly<VisibilityInputBody>, options?: RequestInit): Promise<setCatalogVisibilityResponse> => {
1155
+
1156
+ const res = await fetch(getSetCatalogVisibilityUrl(item),
1157
+ {
1158
+ ...options,
1159
+ method: 'PUT',
1160
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1161
+ body: JSON.stringify(
1162
+ visibilityInputBody,)
1163
+ }
1164
+ )
1165
+
1166
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1167
+
1168
+ const data: setCatalogVisibilityResponse['data'] = body ? JSON.parse(body) : {}
1169
+ return { data, status: res.status, headers: res.headers } as setCatalogVisibilityResponse
1170
+ }
1171
+
1172
+
1173
+
1174
+ /**
1175
+ * @summary List tenants visible to the caller (tenant switcher)
1176
+ */
1177
+ export type listTenantsResponse200 = {
1178
+ data: ListTenantsOutputBody
1179
+ status: 200
1180
+ }
1181
+
1182
+ export type listTenantsResponseDefault = {
1183
+ data: ErrorModel
1184
+ status: Exclude<HTTPStatusCodes, 200>
1185
+ }
1186
+
1187
+ export type listTenantsResponseSuccess = (listTenantsResponse200) & {
1188
+ headers: Headers;
1189
+ };
1190
+ export type listTenantsResponseError = (listTenantsResponseDefault) & {
1191
+ headers: Headers;
1192
+ };
1193
+
1194
+ export type listTenantsResponse = (listTenantsResponseSuccess | listTenantsResponseError)
1195
+
1196
+ export const getListTenantsUrl = () => {
1197
+
1198
+
1199
+
1200
+
1201
+ return `/api/v1/tenants`
1202
+ }
1203
+
1204
+ export const listTenants = async ( options?: RequestInit): Promise<listTenantsResponse> => {
1205
+
1206
+ const res = await fetch(getListTenantsUrl(),
1207
+ {
1208
+ ...options,
1209
+ method: 'GET'
1210
+
1211
+
1212
+ }
1213
+ )
1214
+
1215
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1216
+
1217
+ const data: listTenantsResponse['data'] = body ? JSON.parse(body) : {}
1218
+ return { data, status: res.status, headers: res.headers } as listTenantsResponse
1219
+ }
1220
+
1221
+
1222
+
1223
+ /**
1224
+ * @summary Create a tenant (Keycloak Organization + default teams)
1225
+ */
1226
+ export type createTenantResponse200 = {
1227
+ data: TenantOutputBody
1228
+ status: 200
1229
+ }
1230
+
1231
+ export type createTenantResponseDefault = {
1232
+ data: ErrorModel
1233
+ status: Exclude<HTTPStatusCodes, 200>
1234
+ }
1235
+
1236
+ export type createTenantResponseSuccess = (createTenantResponse200) & {
1237
+ headers: Headers;
1238
+ };
1239
+ export type createTenantResponseError = (createTenantResponseDefault) & {
1240
+ headers: Headers;
1241
+ };
1242
+
1243
+ export type createTenantResponse = (createTenantResponseSuccess | createTenantResponseError)
1244
+
1245
+ export const getCreateTenantUrl = () => {
1246
+
1247
+
1248
+
1249
+
1250
+ return `/api/v1/tenants`
1251
+ }
1252
+
1253
+ export const createTenant = async (createTenantInputBody: NonReadonly<CreateTenantInputBody>, options?: RequestInit): Promise<createTenantResponse> => {
1254
+
1255
+ const res = await fetch(getCreateTenantUrl(),
1256
+ {
1257
+ ...options,
1258
+ method: 'POST',
1259
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1260
+ body: JSON.stringify(
1261
+ createTenantInputBody,)
1262
+ }
1263
+ )
1264
+
1265
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1266
+
1267
+ const data: createTenantResponse['data'] = body ? JSON.parse(body) : {}
1268
+ return { data, status: res.status, headers: res.headers } as createTenantResponse
1269
+ }
1270
+
1271
+
1272
+
1273
+ /**
1274
+ * @summary Get a tenant by slug
1275
+ */
1276
+ export type getTenantResponse200 = {
1277
+ data: TenantOutputBody
1278
+ status: 200
1279
+ }
1280
+
1281
+ export type getTenantResponseDefault = {
1282
+ data: ErrorModel
1283
+ status: Exclude<HTTPStatusCodes, 200>
1284
+ }
1285
+
1286
+ export type getTenantResponseSuccess = (getTenantResponse200) & {
1287
+ headers: Headers;
1288
+ };
1289
+ export type getTenantResponseError = (getTenantResponseDefault) & {
1290
+ headers: Headers;
1291
+ };
1292
+
1293
+ export type getTenantResponse = (getTenantResponseSuccess | getTenantResponseError)
1294
+
1295
+ export const getGetTenantUrl = (org: string,) => {
1296
+
1297
+
1298
+
1299
+
1300
+ return `/api/v1/tenants/${org}`
1301
+ }
1302
+
1303
+ export const getTenant = async (org: string, options?: RequestInit): Promise<getTenantResponse> => {
1304
+
1305
+ const res = await fetch(getGetTenantUrl(org),
1306
+ {
1307
+ ...options,
1308
+ method: 'GET'
1309
+
1310
+
1311
+ }
1312
+ )
1313
+
1314
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1315
+
1316
+ const data: getTenantResponse['data'] = body ? JSON.parse(body) : {}
1317
+ return { data, status: res.status, headers: res.headers } as getTenantResponse
1318
+ }
1319
+
1320
+
1321
+
1322
+ /**
1323
+ * @summary List approval requests (default: pending)
1324
+ */
1325
+ export type listApprovalsResponse200 = {
1326
+ data: ListOutputBody
1327
+ status: 200
1328
+ }
1329
+
1330
+ export type listApprovalsResponseDefault = {
1331
+ data: ErrorModel
1332
+ status: Exclude<HTTPStatusCodes, 200>
1333
+ }
1334
+
1335
+ export type listApprovalsResponseSuccess = (listApprovalsResponse200) & {
1336
+ headers: Headers;
1337
+ };
1338
+ export type listApprovalsResponseError = (listApprovalsResponseDefault) & {
1339
+ headers: Headers;
1340
+ };
1341
+
1342
+ export type listApprovalsResponse = (listApprovalsResponseSuccess | listApprovalsResponseError)
1343
+
1344
+ export const getListApprovalsUrl = (org: string,
1345
+ params?: ListApprovalsParams,) => {
1346
+ const normalizedParams = new URLSearchParams();
1347
+
1348
+ Object.entries(params || {}).forEach(([key, value]) => {
1349
+
1350
+ if (value !== undefined) {
1351
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1352
+ }
1353
+ });
1354
+
1355
+ const stringifiedParams = normalizedParams.toString();
1356
+
1357
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/approvals?${stringifiedParams}` : `/api/v1/tenants/${org}/approvals`
1358
+ }
1359
+
1360
+ export const listApprovals = async (org: string,
1361
+ params?: ListApprovalsParams, options?: RequestInit): Promise<listApprovalsResponse> => {
1362
+
1363
+ const res = await fetch(getListApprovalsUrl(org,params),
1364
+ {
1365
+ ...options,
1366
+ method: 'GET'
1367
+
1368
+
1369
+ }
1370
+ )
1371
+
1372
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1373
+
1374
+ const data: listApprovalsResponse['data'] = body ? JSON.parse(body) : {}
1375
+ return { data, status: res.status, headers: res.headers } as listApprovalsResponse
1376
+ }
1377
+
1378
+
1379
+
1380
+ /**
1381
+ * @summary Get one approval request
1382
+ */
1383
+ export type getApprovalResponse200 = {
1384
+ data: ApprovalOutputBody
1385
+ status: 200
1386
+ }
1387
+
1388
+ export type getApprovalResponseDefault = {
1389
+ data: ErrorModel
1390
+ status: Exclude<HTTPStatusCodes, 200>
1391
+ }
1392
+
1393
+ export type getApprovalResponseSuccess = (getApprovalResponse200) & {
1394
+ headers: Headers;
1395
+ };
1396
+ export type getApprovalResponseError = (getApprovalResponseDefault) & {
1397
+ headers: Headers;
1398
+ };
1399
+
1400
+ export type getApprovalResponse = (getApprovalResponseSuccess | getApprovalResponseError)
1401
+
1402
+ export const getGetApprovalUrl = (org: string,
1403
+ id: string,) => {
1404
+
1405
+
1406
+
1407
+
1408
+ return `/api/v1/tenants/${org}/approvals/${id}`
1409
+ }
1410
+
1411
+ export const getApproval = async (org: string,
1412
+ id: string, options?: RequestInit): Promise<getApprovalResponse> => {
1413
+
1414
+ const res = await fetch(getGetApprovalUrl(org,id),
1415
+ {
1416
+ ...options,
1417
+ method: 'GET'
1418
+
1419
+
1420
+ }
1421
+ )
1422
+
1423
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1424
+
1425
+ const data: getApprovalResponse['data'] = body ? JSON.parse(body) : {}
1426
+ return { data, status: res.status, headers: res.headers } as getApprovalResponse
1427
+ }
1428
+
1429
+
1430
+
1431
+ /**
1432
+ * @summary Withdraw a pending approval request (requester only)
1433
+ */
1434
+ export type cancelApprovalResponse200 = {
1435
+ data: ApprovalOutputBody
1436
+ status: 200
1437
+ }
1438
+
1439
+ export type cancelApprovalResponseDefault = {
1440
+ data: ErrorModel
1441
+ status: Exclude<HTTPStatusCodes, 200>
1442
+ }
1443
+
1444
+ export type cancelApprovalResponseSuccess = (cancelApprovalResponse200) & {
1445
+ headers: Headers;
1446
+ };
1447
+ export type cancelApprovalResponseError = (cancelApprovalResponseDefault) & {
1448
+ headers: Headers;
1449
+ };
1450
+
1451
+ export type cancelApprovalResponse = (cancelApprovalResponseSuccess | cancelApprovalResponseError)
1452
+
1453
+ export const getCancelApprovalUrl = (org: string,
1454
+ id: string,) => {
1455
+
1456
+
1457
+
1458
+
1459
+ return `/api/v1/tenants/${org}/approvals/${id}/cancel`
1460
+ }
1461
+
1462
+ export const cancelApproval = async (org: string,
1463
+ id: string, options?: RequestInit): Promise<cancelApprovalResponse> => {
1464
+
1465
+ const res = await fetch(getCancelApprovalUrl(org,id),
1466
+ {
1467
+ ...options,
1468
+ method: 'POST'
1469
+
1470
+
1471
+ }
1472
+ )
1473
+
1474
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1475
+
1476
+ const data: cancelApprovalResponse['data'] = body ? JSON.parse(body) : {}
1477
+ return { data, status: res.status, headers: res.headers } as cancelApprovalResponse
1478
+ }
1479
+
1480
+
1481
+
1482
+ /**
1483
+ * @summary Approve or reject a pending approval request
1484
+ */
1485
+ export type decideApprovalResponse200 = {
1486
+ data: DecideOutputBody
1487
+ status: 200
1488
+ }
1489
+
1490
+ export type decideApprovalResponseDefault = {
1491
+ data: ErrorModel
1492
+ status: Exclude<HTTPStatusCodes, 200>
1493
+ }
1494
+
1495
+ export type decideApprovalResponseSuccess = (decideApprovalResponse200) & {
1496
+ headers: Headers;
1497
+ };
1498
+ export type decideApprovalResponseError = (decideApprovalResponseDefault) & {
1499
+ headers: Headers;
1500
+ };
1501
+
1502
+ export type decideApprovalResponse = (decideApprovalResponseSuccess | decideApprovalResponseError)
1503
+
1504
+ export const getDecideApprovalUrl = (org: string,
1505
+ id: string,) => {
1506
+
1507
+
1508
+
1509
+
1510
+ return `/api/v1/tenants/${org}/approvals/${id}/decide`
1511
+ }
1512
+
1513
+ export const decideApproval = async (org: string,
1514
+ id: string,
1515
+ decideInputBody: NonReadonly<DecideInputBody>, options?: RequestInit): Promise<decideApprovalResponse> => {
1516
+
1517
+ const res = await fetch(getDecideApprovalUrl(org,id),
1518
+ {
1519
+ ...options,
1520
+ method: 'POST',
1521
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1522
+ body: JSON.stringify(
1523
+ decideInputBody,)
1524
+ }
1525
+ )
1526
+
1527
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1528
+
1529
+ const data: decideApprovalResponse['data'] = body ? JSON.parse(body) : {}
1530
+ return { data, status: res.status, headers: res.headers } as decideApprovalResponse
1531
+ }
1532
+
1533
+
1534
+
1535
+ /**
1536
+ * @summary List catalog items visible to the tenant (optionally per cluster)
1537
+ */
1538
+ export type listCatalogResponse200 = {
1539
+ data: ListCatalogOutputBody
1540
+ status: 200
1541
+ }
1542
+
1543
+ export type listCatalogResponseDefault = {
1544
+ data: ErrorModel
1545
+ status: Exclude<HTTPStatusCodes, 200>
1546
+ }
1547
+
1548
+ export type listCatalogResponseSuccess = (listCatalogResponse200) & {
1549
+ headers: Headers;
1550
+ };
1551
+ export type listCatalogResponseError = (listCatalogResponseDefault) & {
1552
+ headers: Headers;
1553
+ };
1554
+
1555
+ export type listCatalogResponse = (listCatalogResponseSuccess | listCatalogResponseError)
1556
+
1557
+ export const getListCatalogUrl = (org: string,
1558
+ params?: ListCatalogParams,) => {
1559
+ const normalizedParams = new URLSearchParams();
1560
+
1561
+ Object.entries(params || {}).forEach(([key, value]) => {
1562
+
1563
+ if (value !== undefined) {
1564
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1565
+ }
1566
+ });
1567
+
1568
+ const stringifiedParams = normalizedParams.toString();
1569
+
1570
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/catalog?${stringifiedParams}` : `/api/v1/tenants/${org}/catalog`
1571
+ }
1572
+
1573
+ export const listCatalog = async (org: string,
1574
+ params?: ListCatalogParams, options?: RequestInit): Promise<listCatalogResponse> => {
1575
+
1576
+ const res = await fetch(getListCatalogUrl(org,params),
1577
+ {
1578
+ ...options,
1579
+ method: 'GET'
1580
+
1581
+
1582
+ }
1583
+ )
1584
+
1585
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1586
+
1587
+ const data: listCatalogResponse['data'] = body ? JSON.parse(body) : {}
1588
+ return { data, status: res.status, headers: res.headers } as listCatalogResponse
1589
+ }
1590
+
1591
+
1592
+
1593
+ /**
1594
+ * @summary Get a catalog item with schema, UI hints, and versions
1595
+ */
1596
+ export type getCatalogItemResponse200 = {
1597
+ data: ItemOutputBody
1598
+ status: 200
1599
+ }
1600
+
1601
+ export type getCatalogItemResponseDefault = {
1602
+ data: ErrorModel
1603
+ status: Exclude<HTTPStatusCodes, 200>
1604
+ }
1605
+
1606
+ export type getCatalogItemResponseSuccess = (getCatalogItemResponse200) & {
1607
+ headers: Headers;
1608
+ };
1609
+ export type getCatalogItemResponseError = (getCatalogItemResponseDefault) & {
1610
+ headers: Headers;
1611
+ };
1612
+
1613
+ export type getCatalogItemResponse = (getCatalogItemResponseSuccess | getCatalogItemResponseError)
1614
+
1615
+ export const getGetCatalogItemUrl = (org: string,
1616
+ item: string,
1617
+ params?: GetCatalogItemParams,) => {
1618
+ const normalizedParams = new URLSearchParams();
1619
+
1620
+ Object.entries(params || {}).forEach(([key, value]) => {
1621
+
1622
+ if (value !== undefined) {
1623
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1624
+ }
1625
+ });
1626
+
1627
+ const stringifiedParams = normalizedParams.toString();
1628
+
1629
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/catalog/${item}?${stringifiedParams}` : `/api/v1/tenants/${org}/catalog/${item}`
1630
+ }
1631
+
1632
+ export const getCatalogItem = async (org: string,
1633
+ item: string,
1634
+ params?: GetCatalogItemParams, options?: RequestInit): Promise<getCatalogItemResponse> => {
1635
+
1636
+ const res = await fetch(getGetCatalogItemUrl(org,item,params),
1637
+ {
1638
+ ...options,
1639
+ method: 'GET'
1640
+
1641
+
1642
+ }
1643
+ )
1644
+
1645
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1646
+
1647
+ const data: getCatalogItemResponse['data'] = body ? JSON.parse(body) : {}
1648
+ return { data, status: res.status, headers: res.headers } as getCatalogItemResponse
1649
+ }
1650
+
1651
+
1652
+
1653
+ /**
1654
+ * @summary Remove the tenant's version pin
1655
+ */
1656
+ export type unpinCatalogVersionResponse204 = {
1657
+ data: void
1658
+ status: 204
1659
+ }
1660
+
1661
+ export type unpinCatalogVersionResponseDefault = {
1662
+ data: ErrorModel
1663
+ status: Exclude<HTTPStatusCodes, 204>
1664
+ }
1665
+
1666
+ export type unpinCatalogVersionResponseSuccess = (unpinCatalogVersionResponse204) & {
1667
+ headers: Headers;
1668
+ };
1669
+ export type unpinCatalogVersionResponseError = (unpinCatalogVersionResponseDefault) & {
1670
+ headers: Headers;
1671
+ };
1672
+
1673
+ export type unpinCatalogVersionResponse = (unpinCatalogVersionResponseSuccess | unpinCatalogVersionResponseError)
1674
+
1675
+ export const getUnpinCatalogVersionUrl = (org: string,
1676
+ item: string,
1677
+ params?: UnpinCatalogVersionParams,) => {
1678
+ const normalizedParams = new URLSearchParams();
1679
+
1680
+ Object.entries(params || {}).forEach(([key, value]) => {
1681
+
1682
+ if (value !== undefined) {
1683
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1684
+ }
1685
+ });
1686
+
1687
+ const stringifiedParams = normalizedParams.toString();
1688
+
1689
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/catalog/${item}/pin?${stringifiedParams}` : `/api/v1/tenants/${org}/catalog/${item}/pin`
1690
+ }
1691
+
1692
+ export const unpinCatalogVersion = async (org: string,
1693
+ item: string,
1694
+ params?: UnpinCatalogVersionParams, options?: RequestInit): Promise<unpinCatalogVersionResponse> => {
1695
+
1696
+ const res = await fetch(getUnpinCatalogVersionUrl(org,item,params),
1697
+ {
1698
+ ...options,
1699
+ method: 'DELETE'
1700
+
1701
+
1702
+ }
1703
+ )
1704
+
1705
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1706
+
1707
+ const data: unpinCatalogVersionResponse['data'] = body ? JSON.parse(body) : {}
1708
+ return { data, status: res.status, headers: res.headers } as unpinCatalogVersionResponse
1709
+ }
1710
+
1711
+
1712
+
1713
+ /**
1714
+ * @summary Pin the tenant to a catalog item version
1715
+ */
1716
+ export type pinCatalogVersionResponse204 = {
1717
+ data: void
1718
+ status: 204
1719
+ }
1720
+
1721
+ export type pinCatalogVersionResponseDefault = {
1722
+ data: ErrorModel
1723
+ status: Exclude<HTTPStatusCodes, 204>
1724
+ }
1725
+
1726
+ export type pinCatalogVersionResponseSuccess = (pinCatalogVersionResponse204) & {
1727
+ headers: Headers;
1728
+ };
1729
+ export type pinCatalogVersionResponseError = (pinCatalogVersionResponseDefault) & {
1730
+ headers: Headers;
1731
+ };
1732
+
1733
+ export type pinCatalogVersionResponse = (pinCatalogVersionResponseSuccess | pinCatalogVersionResponseError)
1734
+
1735
+ export const getPinCatalogVersionUrl = (org: string,
1736
+ item: string,) => {
1737
+
1738
+
1739
+
1740
+
1741
+ return `/api/v1/tenants/${org}/catalog/${item}/pin`
1742
+ }
1743
+
1744
+ export const pinCatalogVersion = async (org: string,
1745
+ item: string,
1746
+ pinInputBody: NonReadonly<PinInputBody>, options?: RequestInit): Promise<pinCatalogVersionResponse> => {
1747
+
1748
+ const res = await fetch(getPinCatalogVersionUrl(org,item),
1749
+ {
1750
+ ...options,
1751
+ method: 'PUT',
1752
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1753
+ body: JSON.stringify(
1754
+ pinInputBody,)
1755
+ }
1756
+ )
1757
+
1758
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1759
+
1760
+ const data: pinCatalogVersionResponse['data'] = body ? JSON.parse(body) : {}
1761
+ return { data, status: res.status, headers: res.headers } as pinCatalogVersionResponse
1762
+ }
1763
+
1764
+
1765
+
1766
+ /**
1767
+ * @summary List cloud accounts of a tenant
1768
+ */
1769
+ export type listCloudAccountsResponse200 = {
1770
+ data: ListAccountsOutputBody
1771
+ status: 200
1772
+ }
1773
+
1774
+ export type listCloudAccountsResponseDefault = {
1775
+ data: ErrorModel
1776
+ status: Exclude<HTTPStatusCodes, 200>
1777
+ }
1778
+
1779
+ export type listCloudAccountsResponseSuccess = (listCloudAccountsResponse200) & {
1780
+ headers: Headers;
1781
+ };
1782
+ export type listCloudAccountsResponseError = (listCloudAccountsResponseDefault) & {
1783
+ headers: Headers;
1784
+ };
1785
+
1786
+ export type listCloudAccountsResponse = (listCloudAccountsResponseSuccess | listCloudAccountsResponseError)
1787
+
1788
+ export const getListCloudAccountsUrl = (org: string,) => {
1789
+
1790
+
1791
+
1792
+
1793
+ return `/api/v1/tenants/${org}/cloud-accounts`
1794
+ }
1795
+
1796
+ export const listCloudAccounts = async (org: string, options?: RequestInit): Promise<listCloudAccountsResponse> => {
1797
+
1798
+ const res = await fetch(getListCloudAccountsUrl(org),
1799
+ {
1800
+ ...options,
1801
+ method: 'GET'
1802
+
1803
+
1804
+ }
1805
+ )
1806
+
1807
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1808
+
1809
+ const data: listCloudAccountsResponse['data'] = body ? JSON.parse(body) : {}
1810
+ return { data, status: res.status, headers: res.headers } as listCloudAccountsResponse
1811
+ }
1812
+
1813
+
1814
+
1815
+ /**
1816
+ * @summary Register a cloud account (role ARN + external ID, never keys)
1817
+ */
1818
+ export type registerCloudAccountResponse200 = {
1819
+ data: AccountOutputBody
1820
+ status: 200
1821
+ }
1822
+
1823
+ export type registerCloudAccountResponseDefault = {
1824
+ data: ErrorModel
1825
+ status: Exclude<HTTPStatusCodes, 200>
1826
+ }
1827
+
1828
+ export type registerCloudAccountResponseSuccess = (registerCloudAccountResponse200) & {
1829
+ headers: Headers;
1830
+ };
1831
+ export type registerCloudAccountResponseError = (registerCloudAccountResponseDefault) & {
1832
+ headers: Headers;
1833
+ };
1834
+
1835
+ export type registerCloudAccountResponse = (registerCloudAccountResponseSuccess | registerCloudAccountResponseError)
1836
+
1837
+ export const getRegisterCloudAccountUrl = (org: string,) => {
1838
+
1839
+
1840
+
1841
+
1842
+ return `/api/v1/tenants/${org}/cloud-accounts`
1843
+ }
1844
+
1845
+ export const registerCloudAccount = async (org: string,
1846
+ registerInputBody: NonReadonly<RegisterInputBody>, options?: RequestInit): Promise<registerCloudAccountResponse> => {
1847
+
1848
+ const res = await fetch(getRegisterCloudAccountUrl(org),
1849
+ {
1850
+ ...options,
1851
+ method: 'POST',
1852
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
1853
+ body: JSON.stringify(
1854
+ registerInputBody,)
1855
+ }
1856
+ )
1857
+
1858
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1859
+
1860
+ const data: registerCloudAccountResponse['data'] = body ? JSON.parse(body) : {}
1861
+ return { data, status: res.status, headers: res.headers } as registerCloudAccountResponse
1862
+ }
1863
+
1864
+
1865
+
1866
+ /**
1867
+ * @summary Delete the control-plane record (AWS-side role deletion is tenant-owned)
1868
+ */
1869
+ export type deregisterCloudAccountResponse204 = {
1870
+ data: void
1871
+ status: 204
1872
+ }
1873
+
1874
+ export type deregisterCloudAccountResponseDefault = {
1875
+ data: ErrorModel
1876
+ status: Exclude<HTTPStatusCodes, 204>
1877
+ }
1878
+
1879
+ export type deregisterCloudAccountResponseSuccess = (deregisterCloudAccountResponse204) & {
1880
+ headers: Headers;
1881
+ };
1882
+ export type deregisterCloudAccountResponseError = (deregisterCloudAccountResponseDefault) & {
1883
+ headers: Headers;
1884
+ };
1885
+
1886
+ export type deregisterCloudAccountResponse = (deregisterCloudAccountResponseSuccess | deregisterCloudAccountResponseError)
1887
+
1888
+ export const getDeregisterCloudAccountUrl = (org: string,
1889
+ id: string,) => {
1890
+
1891
+
1892
+
1893
+
1894
+ return `/api/v1/tenants/${org}/cloud-accounts/${id}`
1895
+ }
1896
+
1897
+ export const deregisterCloudAccount = async (org: string,
1898
+ id: string, options?: RequestInit): Promise<deregisterCloudAccountResponse> => {
1899
+
1900
+ const res = await fetch(getDeregisterCloudAccountUrl(org,id),
1901
+ {
1902
+ ...options,
1903
+ method: 'DELETE'
1904
+
1905
+
1906
+ }
1907
+ )
1908
+
1909
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1910
+
1911
+ const data: deregisterCloudAccountResponse['data'] = body ? JSON.parse(body) : {}
1912
+ return { data, status: res.status, headers: res.headers } as deregisterCloudAccountResponse
1913
+ }
1914
+
1915
+
1916
+
1917
+ /**
1918
+ * @summary Get a cloud account
1919
+ */
1920
+ export type getCloudAccountResponse200 = {
1921
+ data: AccountOutputBody
1922
+ status: 200
1923
+ }
1924
+
1925
+ export type getCloudAccountResponseDefault = {
1926
+ data: ErrorModel
1927
+ status: Exclude<HTTPStatusCodes, 200>
1928
+ }
1929
+
1930
+ export type getCloudAccountResponseSuccess = (getCloudAccountResponse200) & {
1931
+ headers: Headers;
1932
+ };
1933
+ export type getCloudAccountResponseError = (getCloudAccountResponseDefault) & {
1934
+ headers: Headers;
1935
+ };
1936
+
1937
+ export type getCloudAccountResponse = (getCloudAccountResponseSuccess | getCloudAccountResponseError)
1938
+
1939
+ export const getGetCloudAccountUrl = (org: string,
1940
+ id: string,) => {
1941
+
1942
+
1943
+
1944
+
1945
+ return `/api/v1/tenants/${org}/cloud-accounts/${id}`
1946
+ }
1947
+
1948
+ export const getCloudAccount = async (org: string,
1949
+ id: string, options?: RequestInit): Promise<getCloudAccountResponse> => {
1950
+
1951
+ const res = await fetch(getGetCloudAccountUrl(org,id),
1952
+ {
1953
+ ...options,
1954
+ method: 'GET'
1955
+
1956
+
1957
+ }
1958
+ )
1959
+
1960
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
1961
+
1962
+ const data: getCloudAccountResponse['data'] = body ? JSON.parse(body) : {}
1963
+ return { data, status: res.status, headers: res.headers } as getCloudAccountResponse
1964
+ }
1965
+
1966
+
1967
+
1968
+ /**
1969
+ * @summary Render the Crossplane ProviderConfig manifest for a cluster
1970
+ */
1971
+ export type renderCloudAccountProviderConfigResponse200 = {
1972
+ data: string
1973
+ status: 200
1974
+ }
1975
+
1976
+ export type renderCloudAccountProviderConfigResponseDefault = {
1977
+ data: ErrorModel
1978
+ status: Exclude<HTTPStatusCodes, 200>
1979
+ }
1980
+
1981
+ export type renderCloudAccountProviderConfigResponseSuccess = (renderCloudAccountProviderConfigResponse200) & {
1982
+ headers: Headers;
1983
+ };
1984
+ export type renderCloudAccountProviderConfigResponseError = (renderCloudAccountProviderConfigResponseDefault) & {
1985
+ headers: Headers;
1986
+ };
1987
+
1988
+ export type renderCloudAccountProviderConfigResponse = (renderCloudAccountProviderConfigResponseSuccess | renderCloudAccountProviderConfigResponseError)
1989
+
1990
+ export const getRenderCloudAccountProviderConfigUrl = (org: string,
1991
+ id: string,
1992
+ params: RenderCloudAccountProviderConfigParams,) => {
1993
+ const normalizedParams = new URLSearchParams();
1994
+
1995
+ Object.entries(params || {}).forEach(([key, value]) => {
1996
+
1997
+ if (value !== undefined) {
1998
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
1999
+ }
2000
+ });
2001
+
2002
+ const stringifiedParams = normalizedParams.toString();
2003
+
2004
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/cloud-accounts/${id}/providerconfig?${stringifiedParams}` : `/api/v1/tenants/${org}/cloud-accounts/${id}/providerconfig`
2005
+ }
2006
+
2007
+ export const renderCloudAccountProviderConfig = async (org: string,
2008
+ id: string,
2009
+ params: RenderCloudAccountProviderConfigParams, options?: RequestInit): Promise<renderCloudAccountProviderConfigResponse> => {
2010
+
2011
+ const res = await fetch(getRenderCloudAccountProviderConfigUrl(org,id,params),
2012
+ {
2013
+ ...options,
2014
+ method: 'GET'
2015
+
2016
+
2017
+ }
2018
+ )
2019
+
2020
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2021
+
2022
+ const data: renderCloudAccountProviderConfigResponse['data'] = body ? JSON.parse(body) : {}
2023
+ return { data, status: res.status, headers: res.headers } as renderCloudAccountProviderConfigResponse
2024
+ }
2025
+
2026
+
2027
+
2028
+ /**
2029
+ * @summary Run the STS AssumeRole dry-run against the registered role
2030
+ */
2031
+ export type validateCloudAccountResponse200 = {
2032
+ data: AccountOutputBody
2033
+ status: 200
2034
+ }
2035
+
2036
+ export type validateCloudAccountResponseDefault = {
2037
+ data: ErrorModel
2038
+ status: Exclude<HTTPStatusCodes, 200>
2039
+ }
2040
+
2041
+ export type validateCloudAccountResponseSuccess = (validateCloudAccountResponse200) & {
2042
+ headers: Headers;
2043
+ };
2044
+ export type validateCloudAccountResponseError = (validateCloudAccountResponseDefault) & {
2045
+ headers: Headers;
2046
+ };
2047
+
2048
+ export type validateCloudAccountResponse = (validateCloudAccountResponseSuccess | validateCloudAccountResponseError)
2049
+
2050
+ export const getValidateCloudAccountUrl = (org: string,
2051
+ id: string,) => {
2052
+
2053
+
2054
+
2055
+
2056
+ return `/api/v1/tenants/${org}/cloud-accounts/${id}/validate`
2057
+ }
2058
+
2059
+ export const validateCloudAccount = async (org: string,
2060
+ id: string, options?: RequestInit): Promise<validateCloudAccountResponse> => {
2061
+
2062
+ const res = await fetch(getValidateCloudAccountUrl(org,id),
2063
+ {
2064
+ ...options,
2065
+ method: 'POST'
2066
+
2067
+
2068
+ }
2069
+ )
2070
+
2071
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2072
+
2073
+ const data: validateCloudAccountResponse['data'] = body ? JSON.parse(body) : {}
2074
+ return { data, status: res.status, headers: res.headers } as validateCloudAccountResponse
2075
+ }
2076
+
2077
+
2078
+
2079
+ /**
2080
+ * @summary List cluster sets
2081
+ */
2082
+ export type listClusterSetsResponse200 = {
2083
+ data: ListClusterSetsOutputBody
2084
+ status: 200
2085
+ }
2086
+
2087
+ export type listClusterSetsResponseDefault = {
2088
+ data: ErrorModel
2089
+ status: Exclude<HTTPStatusCodes, 200>
2090
+ }
2091
+
2092
+ export type listClusterSetsResponseSuccess = (listClusterSetsResponse200) & {
2093
+ headers: Headers;
2094
+ };
2095
+ export type listClusterSetsResponseError = (listClusterSetsResponseDefault) & {
2096
+ headers: Headers;
2097
+ };
2098
+
2099
+ export type listClusterSetsResponse = (listClusterSetsResponseSuccess | listClusterSetsResponseError)
2100
+
2101
+ export const getListClusterSetsUrl = (org: string,) => {
2102
+
2103
+
2104
+
2105
+
2106
+ return `/api/v1/tenants/${org}/cluster-sets`
2107
+ }
2108
+
2109
+ export const listClusterSets = async (org: string, options?: RequestInit): Promise<listClusterSetsResponse> => {
2110
+
2111
+ const res = await fetch(getListClusterSetsUrl(org),
2112
+ {
2113
+ ...options,
2114
+ method: 'GET'
2115
+
2116
+
2117
+ }
2118
+ )
2119
+
2120
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2121
+
2122
+ const data: listClusterSetsResponse['data'] = body ? JSON.parse(body) : {}
2123
+ return { data, status: res.status, headers: res.headers } as listClusterSetsResponse
2124
+ }
2125
+
2126
+
2127
+
2128
+ /**
2129
+ * @summary Create a cluster set
2130
+ */
2131
+ export type createClusterSetResponse200 = {
2132
+ data: ClusterSetOutputBody
2133
+ status: 200
2134
+ }
2135
+
2136
+ export type createClusterSetResponseDefault = {
2137
+ data: ErrorModel
2138
+ status: Exclude<HTTPStatusCodes, 200>
2139
+ }
2140
+
2141
+ export type createClusterSetResponseSuccess = (createClusterSetResponse200) & {
2142
+ headers: Headers;
2143
+ };
2144
+ export type createClusterSetResponseError = (createClusterSetResponseDefault) & {
2145
+ headers: Headers;
2146
+ };
2147
+
2148
+ export type createClusterSetResponse = (createClusterSetResponseSuccess | createClusterSetResponseError)
2149
+
2150
+ export const getCreateClusterSetUrl = (org: string,) => {
2151
+
2152
+
2153
+
2154
+
2155
+ return `/api/v1/tenants/${org}/cluster-sets`
2156
+ }
2157
+
2158
+ export const createClusterSet = async (org: string,
2159
+ createClusterSetInputBody: NonReadonly<CreateClusterSetInputBody>, options?: RequestInit): Promise<createClusterSetResponse> => {
2160
+
2161
+ const res = await fetch(getCreateClusterSetUrl(org),
2162
+ {
2163
+ ...options,
2164
+ method: 'POST',
2165
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2166
+ body: JSON.stringify(
2167
+ createClusterSetInputBody,)
2168
+ }
2169
+ )
2170
+
2171
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2172
+
2173
+ const data: createClusterSetResponse['data'] = body ? JSON.parse(body) : {}
2174
+ return { data, status: res.status, headers: res.headers } as createClusterSetResponse
2175
+ }
2176
+
2177
+
2178
+
2179
+ /**
2180
+ * @summary Delete a cluster set
2181
+ */
2182
+ export type deleteClusterSetResponse204 = {
2183
+ data: void
2184
+ status: 204
2185
+ }
2186
+
2187
+ export type deleteClusterSetResponseDefault = {
2188
+ data: ErrorModel
2189
+ status: Exclude<HTTPStatusCodes, 204>
2190
+ }
2191
+
2192
+ export type deleteClusterSetResponseSuccess = (deleteClusterSetResponse204) & {
2193
+ headers: Headers;
2194
+ };
2195
+ export type deleteClusterSetResponseError = (deleteClusterSetResponseDefault) & {
2196
+ headers: Headers;
2197
+ };
2198
+
2199
+ export type deleteClusterSetResponse = (deleteClusterSetResponseSuccess | deleteClusterSetResponseError)
2200
+
2201
+ export const getDeleteClusterSetUrl = (org: string,
2202
+ id: string,) => {
2203
+
2204
+
2205
+
2206
+
2207
+ return `/api/v1/tenants/${org}/cluster-sets/${id}`
2208
+ }
2209
+
2210
+ export const deleteClusterSet = async (org: string,
2211
+ id: string, options?: RequestInit): Promise<deleteClusterSetResponse> => {
2212
+
2213
+ const res = await fetch(getDeleteClusterSetUrl(org,id),
2214
+ {
2215
+ ...options,
2216
+ method: 'DELETE'
2217
+
2218
+
2219
+ }
2220
+ )
2221
+
2222
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2223
+
2224
+ const data: deleteClusterSetResponse['data'] = body ? JSON.parse(body) : {}
2225
+ return { data, status: res.status, headers: res.headers } as deleteClusterSetResponse
2226
+ }
2227
+
2228
+
2229
+
2230
+ /**
2231
+ * @summary Get a cluster set
2232
+ */
2233
+ export type getClusterSetResponse200 = {
2234
+ data: ClusterSetOutputBody
2235
+ status: 200
2236
+ }
2237
+
2238
+ export type getClusterSetResponseDefault = {
2239
+ data: ErrorModel
2240
+ status: Exclude<HTTPStatusCodes, 200>
2241
+ }
2242
+
2243
+ export type getClusterSetResponseSuccess = (getClusterSetResponse200) & {
2244
+ headers: Headers;
2245
+ };
2246
+ export type getClusterSetResponseError = (getClusterSetResponseDefault) & {
2247
+ headers: Headers;
2248
+ };
2249
+
2250
+ export type getClusterSetResponse = (getClusterSetResponseSuccess | getClusterSetResponseError)
2251
+
2252
+ export const getGetClusterSetUrl = (org: string,
2253
+ id: string,) => {
2254
+
2255
+
2256
+
2257
+
2258
+ return `/api/v1/tenants/${org}/cluster-sets/${id}`
2259
+ }
2260
+
2261
+ export const getClusterSet = async (org: string,
2262
+ id: string, options?: RequestInit): Promise<getClusterSetResponse> => {
2263
+
2264
+ const res = await fetch(getGetClusterSetUrl(org,id),
2265
+ {
2266
+ ...options,
2267
+ method: 'GET'
2268
+
2269
+
2270
+ }
2271
+ )
2272
+
2273
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2274
+
2275
+ const data: getClusterSetResponse['data'] = body ? JSON.parse(body) : {}
2276
+ return { data, status: res.status, headers: res.headers } as getClusterSetResponse
2277
+ }
2278
+
2279
+
2280
+
2281
+ /**
2282
+ * @summary List clusters of a tenant with connection health
2283
+ */
2284
+ export type listClustersResponse200 = {
2285
+ data: ListClustersOutputBody
2286
+ status: 200
2287
+ }
2288
+
2289
+ export type listClustersResponseDefault = {
2290
+ data: ErrorModel
2291
+ status: Exclude<HTTPStatusCodes, 200>
2292
+ }
2293
+
2294
+ export type listClustersResponseSuccess = (listClustersResponse200) & {
2295
+ headers: Headers;
2296
+ };
2297
+ export type listClustersResponseError = (listClustersResponseDefault) & {
2298
+ headers: Headers;
2299
+ };
2300
+
2301
+ export type listClustersResponse = (listClustersResponseSuccess | listClustersResponseError)
2302
+
2303
+ export const getListClustersUrl = (org: string,) => {
2304
+
2305
+
2306
+
2307
+
2308
+ return `/api/v1/tenants/${org}/clusters`
2309
+ }
2310
+
2311
+ export const listClusters = async (org: string, options?: RequestInit): Promise<listClustersResponse> => {
2312
+
2313
+ const res = await fetch(getListClustersUrl(org),
2314
+ {
2315
+ ...options,
2316
+ method: 'GET'
2317
+
2318
+
2319
+ }
2320
+ )
2321
+
2322
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2323
+
2324
+ const data: listClustersResponse['data'] = body ? JSON.parse(body) : {}
2325
+ return { data, status: res.status, headers: res.headers } as listClustersResponse
2326
+ }
2327
+
2328
+
2329
+
2330
+ /**
2331
+ * @summary Register a new cluster record
2332
+ */
2333
+ export type createClusterResponse200 = {
2334
+ data: ClusterOutputBody
2335
+ status: 200
2336
+ }
2337
+
2338
+ export type createClusterResponseDefault = {
2339
+ data: ErrorModel
2340
+ status: Exclude<HTTPStatusCodes, 200>
2341
+ }
2342
+
2343
+ export type createClusterResponseSuccess = (createClusterResponse200) & {
2344
+ headers: Headers;
2345
+ };
2346
+ export type createClusterResponseError = (createClusterResponseDefault) & {
2347
+ headers: Headers;
2348
+ };
2349
+
2350
+ export type createClusterResponse = (createClusterResponseSuccess | createClusterResponseError)
2351
+
2352
+ export const getCreateClusterUrl = (org: string,) => {
2353
+
2354
+
2355
+
2356
+
2357
+ return `/api/v1/tenants/${org}/clusters`
2358
+ }
2359
+
2360
+ export const createCluster = async (org: string,
2361
+ createClusterInputBody: NonReadonly<CreateClusterInputBody>, options?: RequestInit): Promise<createClusterResponse> => {
2362
+
2363
+ const res = await fetch(getCreateClusterUrl(org),
2364
+ {
2365
+ ...options,
2366
+ method: 'POST',
2367
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2368
+ body: JSON.stringify(
2369
+ createClusterInputBody,)
2370
+ }
2371
+ )
2372
+
2373
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2374
+
2375
+ const data: createClusterResponse['data'] = body ? JSON.parse(body) : {}
2376
+ return { data, status: res.status, headers: res.headers } as createClusterResponse
2377
+ }
2378
+
2379
+
2380
+
2381
+ /**
2382
+ * @summary Get a cluster
2383
+ */
2384
+ export type getClusterResponse200 = {
2385
+ data: ClusterOutputBody
2386
+ status: 200
2387
+ }
2388
+
2389
+ export type getClusterResponseDefault = {
2390
+ data: ErrorModel
2391
+ status: Exclude<HTTPStatusCodes, 200>
2392
+ }
2393
+
2394
+ export type getClusterResponseSuccess = (getClusterResponse200) & {
2395
+ headers: Headers;
2396
+ };
2397
+ export type getClusterResponseError = (getClusterResponseDefault) & {
2398
+ headers: Headers;
2399
+ };
2400
+
2401
+ export type getClusterResponse = (getClusterResponseSuccess | getClusterResponseError)
2402
+
2403
+ export const getGetClusterUrl = (org: string,
2404
+ id: string,) => {
2405
+
2406
+
2407
+
2408
+
2409
+ return `/api/v1/tenants/${org}/clusters/${id}`
2410
+ }
2411
+
2412
+ export const getCluster = async (org: string,
2413
+ id: string, options?: RequestInit): Promise<getClusterResponse> => {
2414
+
2415
+ const res = await fetch(getGetClusterUrl(org,id),
2416
+ {
2417
+ ...options,
2418
+ method: 'GET'
2419
+
2420
+
2421
+ }
2422
+ )
2423
+
2424
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2425
+
2426
+ const data: getClusterResponse['data'] = body ? JSON.parse(body) : {}
2427
+ return { data, status: res.status, headers: res.headers } as getClusterResponse
2428
+ }
2429
+
2430
+
2431
+
2432
+ /**
2433
+ * @summary Approve cluster enrollment (double opt-in)
2434
+ */
2435
+ export type approveClusterResponse200 = {
2436
+ data: ClusterOutputBody
2437
+ status: 200
2438
+ }
2439
+
2440
+ export type approveClusterResponseDefault = {
2441
+ data: ErrorModel
2442
+ status: Exclude<HTTPStatusCodes, 200>
2443
+ }
2444
+
2445
+ export type approveClusterResponseSuccess = (approveClusterResponse200) & {
2446
+ headers: Headers;
2447
+ };
2448
+ export type approveClusterResponseError = (approveClusterResponseDefault) & {
2449
+ headers: Headers;
2450
+ };
2451
+
2452
+ export type approveClusterResponse = (approveClusterResponseSuccess | approveClusterResponseError)
2453
+
2454
+ export const getApproveClusterUrl = (org: string,
2455
+ id: string,) => {
2456
+
2457
+
2458
+
2459
+
2460
+ return `/api/v1/tenants/${org}/clusters/${id}/approve`
2461
+ }
2462
+
2463
+ export const approveCluster = async (org: string,
2464
+ id: string, options?: RequestInit): Promise<approveClusterResponse> => {
2465
+
2466
+ const res = await fetch(getApproveClusterUrl(org,id),
2467
+ {
2468
+ ...options,
2469
+ method: 'POST'
2470
+
2471
+
2472
+ }
2473
+ )
2474
+
2475
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2476
+
2477
+ const data: approveClusterResponse['data'] = body ? JSON.parse(body) : {}
2478
+ return { data, status: res.status, headers: res.headers } as approveClusterResponse
2479
+ }
2480
+
2481
+
2482
+
2483
+ /**
2484
+ * @summary List the live discovered capabilities of a cluster
2485
+ */
2486
+ export type listCapabilitiesResponse200 = {
2487
+ data: ListCapabilitiesOutputBody
2488
+ status: 200
2489
+ }
2490
+
2491
+ export type listCapabilitiesResponseDefault = {
2492
+ data: ErrorModel
2493
+ status: Exclude<HTTPStatusCodes, 200>
2494
+ }
2495
+
2496
+ export type listCapabilitiesResponseSuccess = (listCapabilitiesResponse200) & {
2497
+ headers: Headers;
2498
+ };
2499
+ export type listCapabilitiesResponseError = (listCapabilitiesResponseDefault) & {
2500
+ headers: Headers;
2501
+ };
2502
+
2503
+ export type listCapabilitiesResponse = (listCapabilitiesResponseSuccess | listCapabilitiesResponseError)
2504
+
2505
+ export const getListCapabilitiesUrl = (org: string,
2506
+ id: string,) => {
2507
+
2508
+
2509
+
2510
+
2511
+ return `/api/v1/tenants/${org}/clusters/${id}/capabilities`
2512
+ }
2513
+
2514
+ export const listCapabilities = async (org: string,
2515
+ id: string, options?: RequestInit): Promise<listCapabilitiesResponse> => {
2516
+
2517
+ const res = await fetch(getListCapabilitiesUrl(org,id),
2518
+ {
2519
+ ...options,
2520
+ method: 'GET'
2521
+
2522
+
2523
+ }
2524
+ )
2525
+
2526
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2527
+
2528
+ const data: listCapabilitiesResponse['data'] = body ? JSON.parse(body) : {}
2529
+ return { data, status: res.status, headers: res.headers } as listCapabilitiesResponse
2530
+ }
2531
+
2532
+
2533
+
2534
+ /**
2535
+ * @summary Cordon a cluster (blocks new deploys; workloads keep running)
2536
+ */
2537
+ export type cordonClusterResponse200 = {
2538
+ data: ClusterOutputBody
2539
+ status: 200
2540
+ }
2541
+
2542
+ export type cordonClusterResponseDefault = {
2543
+ data: ErrorModel
2544
+ status: Exclude<HTTPStatusCodes, 200>
2545
+ }
2546
+
2547
+ export type cordonClusterResponseSuccess = (cordonClusterResponse200) & {
2548
+ headers: Headers;
2549
+ };
2550
+ export type cordonClusterResponseError = (cordonClusterResponseDefault) & {
2551
+ headers: Headers;
2552
+ };
2553
+
2554
+ export type cordonClusterResponse = (cordonClusterResponseSuccess | cordonClusterResponseError)
2555
+
2556
+ export const getCordonClusterUrl = (org: string,
2557
+ id: string,) => {
2558
+
2559
+
2560
+
2561
+
2562
+ return `/api/v1/tenants/${org}/clusters/${id}/cordon`
2563
+ }
2564
+
2565
+ export const cordonCluster = async (org: string,
2566
+ id: string, options?: RequestInit): Promise<cordonClusterResponse> => {
2567
+
2568
+ const res = await fetch(getCordonClusterUrl(org,id),
2569
+ {
2570
+ ...options,
2571
+ method: 'POST'
2572
+
2573
+
2574
+ }
2575
+ )
2576
+
2577
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2578
+
2579
+ const data: cordonClusterResponse['data'] = body ? JSON.parse(body) : {}
2580
+ return { data, status: res.status, headers: res.headers } as cordonClusterResponse
2581
+ }
2582
+
2583
+
2584
+
2585
+ /**
2586
+ * @summary Decommission a cluster (ownership-checked drain, identity revocation, archived audit)
2587
+ */
2588
+ export type decommissionClusterResponse200 = {
2589
+ data: DecommissionOutputBody
2590
+ status: 200
2591
+ }
2592
+
2593
+ export type decommissionClusterResponseDefault = {
2594
+ data: ErrorModel
2595
+ status: Exclude<HTTPStatusCodes, 200>
2596
+ }
2597
+
2598
+ export type decommissionClusterResponseSuccess = (decommissionClusterResponse200) & {
2599
+ headers: Headers;
2600
+ };
2601
+ export type decommissionClusterResponseError = (decommissionClusterResponseDefault) & {
2602
+ headers: Headers;
2603
+ };
2604
+
2605
+ export type decommissionClusterResponse = (decommissionClusterResponseSuccess | decommissionClusterResponseError)
2606
+
2607
+ export const getDecommissionClusterUrl = (org: string,
2608
+ id: string,) => {
2609
+
2610
+
2611
+
2612
+
2613
+ return `/api/v1/tenants/${org}/clusters/${id}/decommission`
2614
+ }
2615
+
2616
+ export const decommissionCluster = async (org: string,
2617
+ id: string,
2618
+ decommissionInputBody: NonReadonly<DecommissionInputBody>, options?: RequestInit): Promise<decommissionClusterResponse> => {
2619
+
2620
+ const res = await fetch(getDecommissionClusterUrl(org,id),
2621
+ {
2622
+ ...options,
2623
+ method: 'POST',
2624
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2625
+ body: JSON.stringify(
2626
+ decommissionInputBody,)
2627
+ }
2628
+ )
2629
+
2630
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2631
+
2632
+ const data: decommissionClusterResponse['data'] = body ? JSON.parse(body) : {}
2633
+ return { data, status: res.status, headers: res.headers } as decommissionClusterResponse
2634
+ }
2635
+
2636
+
2637
+
2638
+ /**
2639
+ * @summary Render the agent install manifest embedding a fresh registration token
2640
+ */
2641
+ export type renderInstallManifestResponse200 = {
2642
+ data: string
2643
+ status: 200
2644
+ }
2645
+
2646
+ export type renderInstallManifestResponseDefault = {
2647
+ data: ErrorModel
2648
+ status: Exclude<HTTPStatusCodes, 200>
2649
+ }
2650
+
2651
+ export type renderInstallManifestResponseSuccess = (renderInstallManifestResponse200) & {
2652
+ headers: Headers;
2653
+ };
2654
+ export type renderInstallManifestResponseError = (renderInstallManifestResponseDefault) & {
2655
+ headers: Headers;
2656
+ };
2657
+
2658
+ export type renderInstallManifestResponse = (renderInstallManifestResponseSuccess | renderInstallManifestResponseError)
2659
+
2660
+ export const getRenderInstallManifestUrl = (org: string,
2661
+ id: string,) => {
2662
+
2663
+
2664
+
2665
+
2666
+ return `/api/v1/tenants/${org}/clusters/${id}/install-manifest`
2667
+ }
2668
+
2669
+ export const renderInstallManifest = async (org: string,
2670
+ id: string, options?: RequestInit): Promise<renderInstallManifestResponse> => {
2671
+
2672
+ const res = await fetch(getRenderInstallManifestUrl(org,id),
2673
+ {
2674
+ ...options,
2675
+ method: 'POST'
2676
+
2677
+
2678
+ }
2679
+ )
2680
+
2681
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2682
+
2683
+ const data: renderInstallManifestResponse['data'] = body ? JSON.parse(body) : {}
2684
+ return { data, status: res.status, headers: res.headers } as renderInstallManifestResponse
2685
+ }
2686
+
2687
+
2688
+
2689
+ /**
2690
+ * @summary Revoke a cluster (disables its Keycloak client)
2691
+ */
2692
+ export type revokeClusterResponse204 = {
2693
+ data: void
2694
+ status: 204
2695
+ }
2696
+
2697
+ export type revokeClusterResponseDefault = {
2698
+ data: ErrorModel
2699
+ status: Exclude<HTTPStatusCodes, 204>
2700
+ }
2701
+
2702
+ export type revokeClusterResponseSuccess = (revokeClusterResponse204) & {
2703
+ headers: Headers;
2704
+ };
2705
+ export type revokeClusterResponseError = (revokeClusterResponseDefault) & {
2706
+ headers: Headers;
2707
+ };
2708
+
2709
+ export type revokeClusterResponse = (revokeClusterResponseSuccess | revokeClusterResponseError)
2710
+
2711
+ export const getRevokeClusterUrl = (org: string,
2712
+ id: string,) => {
2713
+
2714
+
2715
+
2716
+
2717
+ return `/api/v1/tenants/${org}/clusters/${id}/revoke`
2718
+ }
2719
+
2720
+ export const revokeCluster = async (org: string,
2721
+ id: string, options?: RequestInit): Promise<revokeClusterResponse> => {
2722
+
2723
+ const res = await fetch(getRevokeClusterUrl(org,id),
2724
+ {
2725
+ ...options,
2726
+ method: 'POST'
2727
+
2728
+
2729
+ }
2730
+ )
2731
+
2732
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2733
+
2734
+ const data: revokeClusterResponse['data'] = body ? JSON.parse(body) : {}
2735
+ return { data, status: res.status, headers: res.headers } as revokeClusterResponse
2736
+ }
2737
+
2738
+
2739
+
2740
+ /**
2741
+ * @summary Issue a one-time TTL'd registration token
2742
+ */
2743
+ export type issueRegistrationTokenResponse200 = {
2744
+ data: TokenOutputBody
2745
+ status: 200
2746
+ }
2747
+
2748
+ export type issueRegistrationTokenResponseDefault = {
2749
+ data: ErrorModel
2750
+ status: Exclude<HTTPStatusCodes, 200>
2751
+ }
2752
+
2753
+ export type issueRegistrationTokenResponseSuccess = (issueRegistrationTokenResponse200) & {
2754
+ headers: Headers;
2755
+ };
2756
+ export type issueRegistrationTokenResponseError = (issueRegistrationTokenResponseDefault) & {
2757
+ headers: Headers;
2758
+ };
2759
+
2760
+ export type issueRegistrationTokenResponse = (issueRegistrationTokenResponseSuccess | issueRegistrationTokenResponseError)
2761
+
2762
+ export const getIssueRegistrationTokenUrl = (org: string,
2763
+ id: string,) => {
2764
+
2765
+
2766
+
2767
+
2768
+ return `/api/v1/tenants/${org}/clusters/${id}/tokens`
2769
+ }
2770
+
2771
+ export const issueRegistrationToken = async (org: string,
2772
+ id: string, options?: RequestInit): Promise<issueRegistrationTokenResponse> => {
2773
+
2774
+ const res = await fetch(getIssueRegistrationTokenUrl(org,id),
2775
+ {
2776
+ ...options,
2777
+ method: 'POST'
2778
+
2779
+
2780
+ }
2781
+ )
2782
+
2783
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2784
+
2785
+ const data: issueRegistrationTokenResponse['data'] = body ? JSON.parse(body) : {}
2786
+ return { data, status: res.status, headers: res.headers } as issueRegistrationTokenResponse
2787
+ }
2788
+
2789
+
2790
+
2791
+ /**
2792
+ * @summary Uncordon a cluster (returns it to service)
2793
+ */
2794
+ export type uncordonClusterResponse200 = {
2795
+ data: ClusterOutputBody
2796
+ status: 200
2797
+ }
2798
+
2799
+ export type uncordonClusterResponseDefault = {
2800
+ data: ErrorModel
2801
+ status: Exclude<HTTPStatusCodes, 200>
2802
+ }
2803
+
2804
+ export type uncordonClusterResponseSuccess = (uncordonClusterResponse200) & {
2805
+ headers: Headers;
2806
+ };
2807
+ export type uncordonClusterResponseError = (uncordonClusterResponseDefault) & {
2808
+ headers: Headers;
2809
+ };
2810
+
2811
+ export type uncordonClusterResponse = (uncordonClusterResponseSuccess | uncordonClusterResponseError)
2812
+
2813
+ export const getUncordonClusterUrl = (org: string,
2814
+ id: string,) => {
2815
+
2816
+
2817
+
2818
+
2819
+ return `/api/v1/tenants/${org}/clusters/${id}/uncordon`
2820
+ }
2821
+
2822
+ export const uncordonCluster = async (org: string,
2823
+ id: string, options?: RequestInit): Promise<uncordonClusterResponse> => {
2824
+
2825
+ const res = await fetch(getUncordonClusterUrl(org,id),
2826
+ {
2827
+ ...options,
2828
+ method: 'POST'
2829
+
2830
+
2831
+ }
2832
+ )
2833
+
2834
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2835
+
2836
+ const data: uncordonClusterResponse['data'] = body ? JSON.parse(body) : {}
2837
+ return { data, status: res.status, headers: res.headers } as uncordonClusterResponse
2838
+ }
2839
+
2840
+
2841
+
2842
+ /**
2843
+ * @summary Deploy a catalog item to a cluster
2844
+ */
2845
+ export type deployCatalogItemResponse200 = {
2846
+ data: DeployOutputBody
2847
+ status: 200
2848
+ }
2849
+
2850
+ export type deployCatalogItemResponseDefault = {
2851
+ data: ErrorModel
2852
+ status: Exclude<HTTPStatusCodes, 200>
2853
+ }
2854
+
2855
+ export type deployCatalogItemResponseSuccess = (deployCatalogItemResponse200) & {
2856
+ headers: Headers;
2857
+ };
2858
+ export type deployCatalogItemResponseError = (deployCatalogItemResponseDefault) & {
2859
+ headers: Headers;
2860
+ };
2861
+
2862
+ export type deployCatalogItemResponse = (deployCatalogItemResponseSuccess | deployCatalogItemResponseError)
2863
+
2864
+ export const getDeployCatalogItemUrl = (org: string,) => {
2865
+
2866
+
2867
+
2868
+
2869
+ return `/api/v1/tenants/${org}/deploys`
2870
+ }
2871
+
2872
+ export const deployCatalogItem = async (org: string,
2873
+ deployInputBody: NonReadonly<DeployInputBody>, options?: RequestInit): Promise<deployCatalogItemResponse> => {
2874
+
2875
+ const res = await fetch(getDeployCatalogItemUrl(org),
2876
+ {
2877
+ ...options,
2878
+ method: 'POST',
2879
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2880
+ body: JSON.stringify(
2881
+ deployInputBody,)
2882
+ }
2883
+ )
2884
+
2885
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2886
+
2887
+ const data: deployCatalogItemResponse['data'] = body ? JSON.parse(body) : {}
2888
+ return { data, status: res.status, headers: res.headers } as deployCatalogItemResponse
2889
+ }
2890
+
2891
+
2892
+
2893
+ /**
2894
+ * @summary List exemptions
2895
+ */
2896
+ export type listExemptionsResponse200 = {
2897
+ data: ListExemptionsOutputBody
2898
+ status: 200
2899
+ }
2900
+
2901
+ export type listExemptionsResponseDefault = {
2902
+ data: ErrorModel
2903
+ status: Exclude<HTTPStatusCodes, 200>
2904
+ }
2905
+
2906
+ export type listExemptionsResponseSuccess = (listExemptionsResponse200) & {
2907
+ headers: Headers;
2908
+ };
2909
+ export type listExemptionsResponseError = (listExemptionsResponseDefault) & {
2910
+ headers: Headers;
2911
+ };
2912
+
2913
+ export type listExemptionsResponse = (listExemptionsResponseSuccess | listExemptionsResponseError)
2914
+
2915
+ export const getListExemptionsUrl = (org: string,) => {
2916
+
2917
+
2918
+
2919
+
2920
+ return `/api/v1/tenants/${org}/exemptions`
2921
+ }
2922
+
2923
+ export const listExemptions = async (org: string, options?: RequestInit): Promise<listExemptionsResponse> => {
2924
+
2925
+ const res = await fetch(getListExemptionsUrl(org),
2926
+ {
2927
+ ...options,
2928
+ method: 'GET'
2929
+
2930
+
2931
+ }
2932
+ )
2933
+
2934
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2935
+
2936
+ const data: listExemptionsResponse['data'] = body ? JSON.parse(body) : {}
2937
+ return { data, status: res.status, headers: res.headers } as listExemptionsResponse
2938
+ }
2939
+
2940
+
2941
+
2942
+ /**
2943
+ * @summary Request a time-boxed policy exemption
2944
+ */
2945
+ export type requestExemptionResponse200 = {
2946
+ data: ExemptionOutputBody
2947
+ status: 200
2948
+ }
2949
+
2950
+ export type requestExemptionResponseDefault = {
2951
+ data: ErrorModel
2952
+ status: Exclude<HTTPStatusCodes, 200>
2953
+ }
2954
+
2955
+ export type requestExemptionResponseSuccess = (requestExemptionResponse200) & {
2956
+ headers: Headers;
2957
+ };
2958
+ export type requestExemptionResponseError = (requestExemptionResponseDefault) & {
2959
+ headers: Headers;
2960
+ };
2961
+
2962
+ export type requestExemptionResponse = (requestExemptionResponseSuccess | requestExemptionResponseError)
2963
+
2964
+ export const getRequestExemptionUrl = (org: string,) => {
2965
+
2966
+
2967
+
2968
+
2969
+ return `/api/v1/tenants/${org}/exemptions`
2970
+ }
2971
+
2972
+ export const requestExemption = async (org: string,
2973
+ requestExemptionInputBody: NonReadonly<RequestExemptionInputBody>, options?: RequestInit): Promise<requestExemptionResponse> => {
2974
+
2975
+ const res = await fetch(getRequestExemptionUrl(org),
2976
+ {
2977
+ ...options,
2978
+ method: 'POST',
2979
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
2980
+ body: JSON.stringify(
2981
+ requestExemptionInputBody,)
2982
+ }
2983
+ )
2984
+
2985
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
2986
+
2987
+ const data: requestExemptionResponse['data'] = body ? JSON.parse(body) : {}
2988
+ return { data, status: res.status, headers: res.headers } as requestExemptionResponse
2989
+ }
2990
+
2991
+
2992
+
2993
+ /**
2994
+ * @summary Approve or reject a pending exemption (platform_engineer only, v1 gate)
2995
+ */
2996
+ export type decideExemptionResponse200 = {
2997
+ data: ExemptionOutputBody
2998
+ status: 200
2999
+ }
3000
+
3001
+ export type decideExemptionResponseDefault = {
3002
+ data: ErrorModel
3003
+ status: Exclude<HTTPStatusCodes, 200>
3004
+ }
3005
+
3006
+ export type decideExemptionResponseSuccess = (decideExemptionResponse200) & {
3007
+ headers: Headers;
3008
+ };
3009
+ export type decideExemptionResponseError = (decideExemptionResponseDefault) & {
3010
+ headers: Headers;
3011
+ };
3012
+
3013
+ export type decideExemptionResponse = (decideExemptionResponseSuccess | decideExemptionResponseError)
3014
+
3015
+ export const getDecideExemptionUrl = (org: string,
3016
+ id: string,) => {
3017
+
3018
+
3019
+
3020
+
3021
+ return `/api/v1/tenants/${org}/exemptions/${id}/decide`
3022
+ }
3023
+
3024
+ export const decideExemption = async (org: string,
3025
+ id: string,
3026
+ decideExemptionInputBody: NonReadonly<DecideExemptionInputBody>, options?: RequestInit): Promise<decideExemptionResponse> => {
3027
+
3028
+ const res = await fetch(getDecideExemptionUrl(org,id),
3029
+ {
3030
+ ...options,
3031
+ method: 'POST',
3032
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3033
+ body: JSON.stringify(
3034
+ decideExemptionInputBody,)
3035
+ }
3036
+ )
3037
+
3038
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3039
+
3040
+ const data: decideExemptionResponse['data'] = body ? JSON.parse(body) : {}
3041
+ return { data, status: res.status, headers: res.headers } as decideExemptionResponse
3042
+ }
3043
+
3044
+
3045
+
3046
+ /**
3047
+ * @summary Read the tenant state repo config
3048
+ */
3049
+ export type getTenantGitConfigResponse200 = {
3050
+ data: GitConfigOutputBody
3051
+ status: 200
3052
+ }
3053
+
3054
+ export type getTenantGitConfigResponseDefault = {
3055
+ data: ErrorModel
3056
+ status: Exclude<HTTPStatusCodes, 200>
3057
+ }
3058
+
3059
+ export type getTenantGitConfigResponseSuccess = (getTenantGitConfigResponse200) & {
3060
+ headers: Headers;
3061
+ };
3062
+ export type getTenantGitConfigResponseError = (getTenantGitConfigResponseDefault) & {
3063
+ headers: Headers;
3064
+ };
3065
+
3066
+ export type getTenantGitConfigResponse = (getTenantGitConfigResponseSuccess | getTenantGitConfigResponseError)
3067
+
3068
+ export const getGetTenantGitConfigUrl = (org: string,) => {
3069
+
3070
+
3071
+
3072
+
3073
+ return `/api/v1/tenants/${org}/git-config`
3074
+ }
3075
+
3076
+ export const getTenantGitConfig = async (org: string, options?: RequestInit): Promise<getTenantGitConfigResponse> => {
3077
+
3078
+ const res = await fetch(getGetTenantGitConfigUrl(org),
3079
+ {
3080
+ ...options,
3081
+ method: 'GET'
3082
+
3083
+
3084
+ }
3085
+ )
3086
+
3087
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3088
+
3089
+ const data: getTenantGitConfigResponse['data'] = body ? JSON.parse(body) : {}
3090
+ return { data, status: res.status, headers: res.headers } as getTenantGitConfigResponse
3091
+ }
3092
+
3093
+
3094
+
3095
+ /**
3096
+ * @summary Set the tenant state repo + commit policy (platform engineer)
3097
+ */
3098
+ export type setTenantGitConfigResponse204 = {
3099
+ data: void
3100
+ status: 204
3101
+ }
3102
+
3103
+ export type setTenantGitConfigResponseDefault = {
3104
+ data: ErrorModel
3105
+ status: Exclude<HTTPStatusCodes, 204>
3106
+ }
3107
+
3108
+ export type setTenantGitConfigResponseSuccess = (setTenantGitConfigResponse204) & {
3109
+ headers: Headers;
3110
+ };
3111
+ export type setTenantGitConfigResponseError = (setTenantGitConfigResponseDefault) & {
3112
+ headers: Headers;
3113
+ };
3114
+
3115
+ export type setTenantGitConfigResponse = (setTenantGitConfigResponseSuccess | setTenantGitConfigResponseError)
3116
+
3117
+ export const getSetTenantGitConfigUrl = (org: string,) => {
3118
+
3119
+
3120
+
3121
+
3122
+ return `/api/v1/tenants/${org}/git-config`
3123
+ }
3124
+
3125
+ export const setTenantGitConfig = async (org: string,
3126
+ gitConfigInputBody: NonReadonly<GitConfigInputBody>, options?: RequestInit): Promise<setTenantGitConfigResponse> => {
3127
+
3128
+ const res = await fetch(getSetTenantGitConfigUrl(org),
3129
+ {
3130
+ ...options,
3131
+ method: 'PUT',
3132
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3133
+ body: JSON.stringify(
3134
+ gitConfigInputBody,)
3135
+ }
3136
+ )
3137
+
3138
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3139
+
3140
+ const data: setTenantGitConfigResponse['data'] = body ? JSON.parse(body) : {}
3141
+ return { data, status: res.status, headers: res.headers } as setTenantGitConfigResponse
3142
+ }
3143
+
3144
+
3145
+
3146
+ /**
3147
+ * @summary List resource instances (filterable by cluster, item, health, owner team)
3148
+ */
3149
+ export type listInstancesResponse200 = {
3150
+ data: ListOutputBody1
3151
+ status: 200
3152
+ }
3153
+
3154
+ export type listInstancesResponseDefault = {
3155
+ data: ErrorModel
3156
+ status: Exclude<HTTPStatusCodes, 200>
3157
+ }
3158
+
3159
+ export type listInstancesResponseSuccess = (listInstancesResponse200) & {
3160
+ headers: Headers;
3161
+ };
3162
+ export type listInstancesResponseError = (listInstancesResponseDefault) & {
3163
+ headers: Headers;
3164
+ };
3165
+
3166
+ export type listInstancesResponse = (listInstancesResponseSuccess | listInstancesResponseError)
3167
+
3168
+ export const getListInstancesUrl = (org: string,
3169
+ params?: ListInstancesParams,) => {
3170
+ const normalizedParams = new URLSearchParams();
3171
+
3172
+ Object.entries(params || {}).forEach(([key, value]) => {
3173
+
3174
+ if (value !== undefined) {
3175
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
3176
+ }
3177
+ });
3178
+
3179
+ const stringifiedParams = normalizedParams.toString();
3180
+
3181
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/instances?${stringifiedParams}` : `/api/v1/tenants/${org}/instances`
3182
+ }
3183
+
3184
+ export const listInstances = async (org: string,
3185
+ params?: ListInstancesParams, options?: RequestInit): Promise<listInstancesResponse> => {
3186
+
3187
+ const res = await fetch(getListInstancesUrl(org,params),
3188
+ {
3189
+ ...options,
3190
+ method: 'GET'
3191
+
3192
+
3193
+ }
3194
+ )
3195
+
3196
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3197
+
3198
+ const data: listInstancesResponse['data'] = body ? JSON.parse(body) : {}
3199
+ return { data, status: res.status, headers: res.headers } as listInstancesResponse
3200
+ }
3201
+
3202
+
3203
+
3204
+ /**
3205
+ * @summary Get one resource instance with version badge
3206
+ */
3207
+ export type getInstanceResponse200 = {
3208
+ data: GetOutputBody
3209
+ status: 200
3210
+ }
3211
+
3212
+ export type getInstanceResponseDefault = {
3213
+ data: ErrorModel
3214
+ status: Exclude<HTTPStatusCodes, 200>
3215
+ }
3216
+
3217
+ export type getInstanceResponseSuccess = (getInstanceResponse200) & {
3218
+ headers: Headers;
3219
+ };
3220
+ export type getInstanceResponseError = (getInstanceResponseDefault) & {
3221
+ headers: Headers;
3222
+ };
3223
+
3224
+ export type getInstanceResponse = (getInstanceResponseSuccess | getInstanceResponseError)
3225
+
3226
+ export const getGetInstanceUrl = (org: string,
3227
+ id: string,) => {
3228
+
3229
+
3230
+
3231
+
3232
+ return `/api/v1/tenants/${org}/instances/${id}`
3233
+ }
3234
+
3235
+ export const getInstance = async (org: string,
3236
+ id: string, options?: RequestInit): Promise<getInstanceResponse> => {
3237
+
3238
+ const res = await fetch(getGetInstanceUrl(org,id),
3239
+ {
3240
+ ...options,
3241
+ method: 'GET'
3242
+
3243
+
3244
+ }
3245
+ )
3246
+
3247
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3248
+
3249
+ const data: getInstanceResponse['data'] = body ? JSON.parse(body) : {}
3250
+ return { data, status: res.status, headers: res.headers } as getInstanceResponse
3251
+ }
3252
+
3253
+
3254
+
3255
+ /**
3256
+ * @summary Diff preview data for an upgrade
3257
+ */
3258
+ export type instanceDiffResponse200 = {
3259
+ data: DiffOutputBody
3260
+ status: 200
3261
+ }
3262
+
3263
+ export type instanceDiffResponseDefault = {
3264
+ data: ErrorModel
3265
+ status: Exclude<HTTPStatusCodes, 200>
3266
+ }
3267
+
3268
+ export type instanceDiffResponseSuccess = (instanceDiffResponse200) & {
3269
+ headers: Headers;
3270
+ };
3271
+ export type instanceDiffResponseError = (instanceDiffResponseDefault) & {
3272
+ headers: Headers;
3273
+ };
3274
+
3275
+ export type instanceDiffResponse = (instanceDiffResponseSuccess | instanceDiffResponseError)
3276
+
3277
+ export const getInstanceDiffUrl = (org: string,
3278
+ id: string,
3279
+ params: InstanceDiffParams,) => {
3280
+ const normalizedParams = new URLSearchParams();
3281
+
3282
+ Object.entries(params || {}).forEach(([key, value]) => {
3283
+
3284
+ if (value !== undefined) {
3285
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
3286
+ }
3287
+ });
3288
+
3289
+ const stringifiedParams = normalizedParams.toString();
3290
+
3291
+ return stringifiedParams.length > 0 ? `/api/v1/tenants/${org}/instances/${id}/diff?${stringifiedParams}` : `/api/v1/tenants/${org}/instances/${id}/diff`
3292
+ }
3293
+
3294
+ export const instanceDiff = async (org: string,
3295
+ id: string,
3296
+ params: InstanceDiffParams, options?: RequestInit): Promise<instanceDiffResponse> => {
3297
+
3298
+ const res = await fetch(getInstanceDiffUrl(org,id,params),
3299
+ {
3300
+ ...options,
3301
+ method: 'GET'
3302
+
3303
+
3304
+ }
3305
+ )
3306
+
3307
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3308
+
3309
+ const data: instanceDiffResponse['data'] = body ? JSON.parse(body) : {}
3310
+ return { data, status: res.status, headers: res.headers } as instanceDiffResponse
3311
+ }
3312
+
3313
+
3314
+
3315
+ /**
3316
+ * @summary One-click upgrade of an instance to a newer catalog version
3317
+ */
3318
+ export type upgradeInstanceResponse200 = {
3319
+ data: DeployOutputBody
3320
+ status: 200
3321
+ }
3322
+
3323
+ export type upgradeInstanceResponseDefault = {
3324
+ data: ErrorModel
3325
+ status: Exclude<HTTPStatusCodes, 200>
3326
+ }
3327
+
3328
+ export type upgradeInstanceResponseSuccess = (upgradeInstanceResponse200) & {
3329
+ headers: Headers;
3330
+ };
3331
+ export type upgradeInstanceResponseError = (upgradeInstanceResponseDefault) & {
3332
+ headers: Headers;
3333
+ };
3334
+
3335
+ export type upgradeInstanceResponse = (upgradeInstanceResponseSuccess | upgradeInstanceResponseError)
3336
+
3337
+ export const getUpgradeInstanceUrl = (org: string,
3338
+ id: string,) => {
3339
+
3340
+
3341
+
3342
+
3343
+ return `/api/v1/tenants/${org}/instances/${id}/upgrade`
3344
+ }
3345
+
3346
+ export const upgradeInstance = async (org: string,
3347
+ id: string,
3348
+ upgradeInputBody: NonReadonly<UpgradeInputBody>, options?: RequestInit): Promise<upgradeInstanceResponse> => {
3349
+
3350
+ const res = await fetch(getUpgradeInstanceUrl(org,id),
3351
+ {
3352
+ ...options,
3353
+ method: 'POST',
3354
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3355
+ body: JSON.stringify(
3356
+ upgradeInputBody,)
3357
+ }
3358
+ )
3359
+
3360
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3361
+
3362
+ const data: upgradeInstanceResponse['data'] = body ? JSON.parse(body) : {}
3363
+ return { data, status: res.status, headers: res.headers } as upgradeInstanceResponse
3364
+ }
3365
+
3366
+
3367
+
3368
+ /**
3369
+ * @summary List notification endpoints
3370
+ */
3371
+ export type listNotificationEndpointsResponse200 = {
3372
+ data: ListOutputBody2
3373
+ status: 200
3374
+ }
3375
+
3376
+ export type listNotificationEndpointsResponseDefault = {
3377
+ data: ErrorModel
3378
+ status: Exclude<HTTPStatusCodes, 200>
3379
+ }
3380
+
3381
+ export type listNotificationEndpointsResponseSuccess = (listNotificationEndpointsResponse200) & {
3382
+ headers: Headers;
3383
+ };
3384
+ export type listNotificationEndpointsResponseError = (listNotificationEndpointsResponseDefault) & {
3385
+ headers: Headers;
3386
+ };
3387
+
3388
+ export type listNotificationEndpointsResponse = (listNotificationEndpointsResponseSuccess | listNotificationEndpointsResponseError)
3389
+
3390
+ export const getListNotificationEndpointsUrl = (org: string,) => {
3391
+
3392
+
3393
+
3394
+
3395
+ return `/api/v1/tenants/${org}/notification-endpoints`
3396
+ }
3397
+
3398
+ export const listNotificationEndpoints = async (org: string, options?: RequestInit): Promise<listNotificationEndpointsResponse> => {
3399
+
3400
+ const res = await fetch(getListNotificationEndpointsUrl(org),
3401
+ {
3402
+ ...options,
3403
+ method: 'GET'
3404
+
3405
+
3406
+ }
3407
+ )
3408
+
3409
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3410
+
3411
+ const data: listNotificationEndpointsResponse['data'] = body ? JSON.parse(body) : {}
3412
+ return { data, status: res.status, headers: res.headers } as listNotificationEndpointsResponse
3413
+ }
3414
+
3415
+
3416
+
3417
+ /**
3418
+ * @summary Create a notification endpoint (slack|webhook)
3419
+ */
3420
+ export type createNotificationEndpointResponse200 = {
3421
+ data: EndpointOutputBody
3422
+ status: 200
3423
+ }
3424
+
3425
+ export type createNotificationEndpointResponseDefault = {
3426
+ data: ErrorModel
3427
+ status: Exclude<HTTPStatusCodes, 200>
3428
+ }
3429
+
3430
+ export type createNotificationEndpointResponseSuccess = (createNotificationEndpointResponse200) & {
3431
+ headers: Headers;
3432
+ };
3433
+ export type createNotificationEndpointResponseError = (createNotificationEndpointResponseDefault) & {
3434
+ headers: Headers;
3435
+ };
3436
+
3437
+ export type createNotificationEndpointResponse = (createNotificationEndpointResponseSuccess | createNotificationEndpointResponseError)
3438
+
3439
+ export const getCreateNotificationEndpointUrl = (org: string,) => {
3440
+
3441
+
3442
+
3443
+
3444
+ return `/api/v1/tenants/${org}/notification-endpoints`
3445
+ }
3446
+
3447
+ export const createNotificationEndpoint = async (org: string,
3448
+ createInputBody: NonReadonly<CreateInputBody>, options?: RequestInit): Promise<createNotificationEndpointResponse> => {
3449
+
3450
+ const res = await fetch(getCreateNotificationEndpointUrl(org),
3451
+ {
3452
+ ...options,
3453
+ method: 'POST',
3454
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3455
+ body: JSON.stringify(
3456
+ createInputBody,)
3457
+ }
3458
+ )
3459
+
3460
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3461
+
3462
+ const data: createNotificationEndpointResponse['data'] = body ? JSON.parse(body) : {}
3463
+ return { data, status: res.status, headers: res.headers } as createNotificationEndpointResponse
3464
+ }
3465
+
3466
+
3467
+
3468
+ /**
3469
+ * @summary Delete a notification endpoint
3470
+ */
3471
+ export type deleteNotificationEndpointResponse204 = {
3472
+ data: void
3473
+ status: 204
3474
+ }
3475
+
3476
+ export type deleteNotificationEndpointResponseDefault = {
3477
+ data: ErrorModel
3478
+ status: Exclude<HTTPStatusCodes, 204>
3479
+ }
3480
+
3481
+ export type deleteNotificationEndpointResponseSuccess = (deleteNotificationEndpointResponse204) & {
3482
+ headers: Headers;
3483
+ };
3484
+ export type deleteNotificationEndpointResponseError = (deleteNotificationEndpointResponseDefault) & {
3485
+ headers: Headers;
3486
+ };
3487
+
3488
+ export type deleteNotificationEndpointResponse = (deleteNotificationEndpointResponseSuccess | deleteNotificationEndpointResponseError)
3489
+
3490
+ export const getDeleteNotificationEndpointUrl = (org: string,
3491
+ id: string,) => {
3492
+
3493
+
3494
+
3495
+
3496
+ return `/api/v1/tenants/${org}/notification-endpoints/${id}`
3497
+ }
3498
+
3499
+ export const deleteNotificationEndpoint = async (org: string,
3500
+ id: string, options?: RequestInit): Promise<deleteNotificationEndpointResponse> => {
3501
+
3502
+ const res = await fetch(getDeleteNotificationEndpointUrl(org,id),
3503
+ {
3504
+ ...options,
3505
+ method: 'DELETE'
3506
+
3507
+
3508
+ }
3509
+ )
3510
+
3511
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3512
+
3513
+ const data: deleteNotificationEndpointResponse['data'] = body ? JSON.parse(body) : {}
3514
+ return { data, status: res.status, headers: res.headers } as deleteNotificationEndpointResponse
3515
+ }
3516
+
3517
+
3518
+
3519
+ /**
3520
+ * @summary Get a notification endpoint
3521
+ */
3522
+ export type getNotificationEndpointResponse200 = {
3523
+ data: EndpointOutputBody
3524
+ status: 200
3525
+ }
3526
+
3527
+ export type getNotificationEndpointResponseDefault = {
3528
+ data: ErrorModel
3529
+ status: Exclude<HTTPStatusCodes, 200>
3530
+ }
3531
+
3532
+ export type getNotificationEndpointResponseSuccess = (getNotificationEndpointResponse200) & {
3533
+ headers: Headers;
3534
+ };
3535
+ export type getNotificationEndpointResponseError = (getNotificationEndpointResponseDefault) & {
3536
+ headers: Headers;
3537
+ };
3538
+
3539
+ export type getNotificationEndpointResponse = (getNotificationEndpointResponseSuccess | getNotificationEndpointResponseError)
3540
+
3541
+ export const getGetNotificationEndpointUrl = (org: string,
3542
+ id: string,) => {
3543
+
3544
+
3545
+
3546
+
3547
+ return `/api/v1/tenants/${org}/notification-endpoints/${id}`
3548
+ }
3549
+
3550
+ export const getNotificationEndpoint = async (org: string,
3551
+ id: string, options?: RequestInit): Promise<getNotificationEndpointResponse> => {
3552
+
3553
+ const res = await fetch(getGetNotificationEndpointUrl(org,id),
3554
+ {
3555
+ ...options,
3556
+ method: 'GET'
3557
+
3558
+
3559
+ }
3560
+ )
3561
+
3562
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3563
+
3564
+ const data: getNotificationEndpointResponse['data'] = body ? JSON.parse(body) : {}
3565
+ return { data, status: res.status, headers: res.headers } as getNotificationEndpointResponse
3566
+ }
3567
+
3568
+
3569
+
3570
+ /**
3571
+ * @summary Update a notification endpoint
3572
+ */
3573
+ export type updateNotificationEndpointResponse200 = {
3574
+ data: EndpointOutputBody
3575
+ status: 200
3576
+ }
3577
+
3578
+ export type updateNotificationEndpointResponseDefault = {
3579
+ data: ErrorModel
3580
+ status: Exclude<HTTPStatusCodes, 200>
3581
+ }
3582
+
3583
+ export type updateNotificationEndpointResponseSuccess = (updateNotificationEndpointResponse200) & {
3584
+ headers: Headers;
3585
+ };
3586
+ export type updateNotificationEndpointResponseError = (updateNotificationEndpointResponseDefault) & {
3587
+ headers: Headers;
3588
+ };
3589
+
3590
+ export type updateNotificationEndpointResponse = (updateNotificationEndpointResponseSuccess | updateNotificationEndpointResponseError)
3591
+
3592
+ export const getUpdateNotificationEndpointUrl = (org: string,
3593
+ id: string,) => {
3594
+
3595
+
3596
+
3597
+
3598
+ return `/api/v1/tenants/${org}/notification-endpoints/${id}`
3599
+ }
3600
+
3601
+ export const updateNotificationEndpoint = async (org: string,
3602
+ id: string,
3603
+ updateInputBody: NonReadonly<UpdateInputBody>, options?: RequestInit): Promise<updateNotificationEndpointResponse> => {
3604
+
3605
+ const res = await fetch(getUpdateNotificationEndpointUrl(org,id),
3606
+ {
3607
+ ...options,
3608
+ method: 'PUT',
3609
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3610
+ body: JSON.stringify(
3611
+ updateInputBody,)
3612
+ }
3613
+ )
3614
+
3615
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3616
+
3617
+ const data: updateNotificationEndpointResponse['data'] = body ? JSON.parse(body) : {}
3618
+ return { data, status: res.status, headers: res.headers } as updateNotificationEndpointResponse
3619
+ }
3620
+
3621
+
3622
+
3623
+ /**
3624
+ * @summary Send a test notification to an endpoint
3625
+ */
3626
+ export type testNotificationEndpointResponse200 = {
3627
+ data: TestOutputBody
3628
+ status: 200
3629
+ }
3630
+
3631
+ export type testNotificationEndpointResponseDefault = {
3632
+ data: ErrorModel
3633
+ status: Exclude<HTTPStatusCodes, 200>
3634
+ }
3635
+
3636
+ export type testNotificationEndpointResponseSuccess = (testNotificationEndpointResponse200) & {
3637
+ headers: Headers;
3638
+ };
3639
+ export type testNotificationEndpointResponseError = (testNotificationEndpointResponseDefault) & {
3640
+ headers: Headers;
3641
+ };
3642
+
3643
+ export type testNotificationEndpointResponse = (testNotificationEndpointResponseSuccess | testNotificationEndpointResponseError)
3644
+
3645
+ export const getTestNotificationEndpointUrl = (org: string,
3646
+ id: string,) => {
3647
+
3648
+
3649
+
3650
+
3651
+ return `/api/v1/tenants/${org}/notification-endpoints/${id}/test`
3652
+ }
3653
+
3654
+ export const testNotificationEndpoint = async (org: string,
3655
+ id: string, options?: RequestInit): Promise<testNotificationEndpointResponse> => {
3656
+
3657
+ const res = await fetch(getTestNotificationEndpointUrl(org,id),
3658
+ {
3659
+ ...options,
3660
+ method: 'POST'
3661
+
3662
+
3663
+ }
3664
+ )
3665
+
3666
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3667
+
3668
+ const data: testNotificationEndpointResponse['data'] = body ? JSON.parse(body) : {}
3669
+ return { data, status: res.status, headers: res.headers } as testNotificationEndpointResponse
3670
+ }
3671
+
3672
+
3673
+
3674
+ /**
3675
+ * @summary List policies (org + platform-global)
3676
+ */
3677
+ export type listPoliciesResponse200 = {
3678
+ data: ListPoliciesOutputBody
3679
+ status: 200
3680
+ }
3681
+
3682
+ export type listPoliciesResponseDefault = {
3683
+ data: ErrorModel
3684
+ status: Exclude<HTTPStatusCodes, 200>
3685
+ }
3686
+
3687
+ export type listPoliciesResponseSuccess = (listPoliciesResponse200) & {
3688
+ headers: Headers;
3689
+ };
3690
+ export type listPoliciesResponseError = (listPoliciesResponseDefault) & {
3691
+ headers: Headers;
3692
+ };
3693
+
3694
+ export type listPoliciesResponse = (listPoliciesResponseSuccess | listPoliciesResponseError)
3695
+
3696
+ export const getListPoliciesUrl = (org: string,) => {
3697
+
3698
+
3699
+
3700
+
3701
+ return `/api/v1/tenants/${org}/policies`
3702
+ }
3703
+
3704
+ export const listPolicies = async (org: string, options?: RequestInit): Promise<listPoliciesResponse> => {
3705
+
3706
+ const res = await fetch(getListPoliciesUrl(org),
3707
+ {
3708
+ ...options,
3709
+ method: 'GET'
3710
+
3711
+
3712
+ }
3713
+ )
3714
+
3715
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3716
+
3717
+ const data: listPoliciesResponse['data'] = body ? JSON.parse(body) : {}
3718
+ return { data, status: res.status, headers: res.headers } as listPoliciesResponse
3719
+ }
3720
+
3721
+
3722
+
3723
+ /**
3724
+ * @summary Create a policy (rego, target request|render)
3725
+ */
3726
+ export type createPolicyResponse200 = {
3727
+ data: PolicyOutputBody
3728
+ status: 200
3729
+ }
3730
+
3731
+ export type createPolicyResponseDefault = {
3732
+ data: ErrorModel
3733
+ status: Exclude<HTTPStatusCodes, 200>
3734
+ }
3735
+
3736
+ export type createPolicyResponseSuccess = (createPolicyResponse200) & {
3737
+ headers: Headers;
3738
+ };
3739
+ export type createPolicyResponseError = (createPolicyResponseDefault) & {
3740
+ headers: Headers;
3741
+ };
3742
+
3743
+ export type createPolicyResponse = (createPolicyResponseSuccess | createPolicyResponseError)
3744
+
3745
+ export const getCreatePolicyUrl = (org: string,) => {
3746
+
3747
+
3748
+
3749
+
3750
+ return `/api/v1/tenants/${org}/policies`
3751
+ }
3752
+
3753
+ export const createPolicy = async (org: string,
3754
+ createPolicyInputBody: NonReadonly<CreatePolicyInputBody>, options?: RequestInit): Promise<createPolicyResponse> => {
3755
+
3756
+ const res = await fetch(getCreatePolicyUrl(org),
3757
+ {
3758
+ ...options,
3759
+ method: 'POST',
3760
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3761
+ body: JSON.stringify(
3762
+ createPolicyInputBody,)
3763
+ }
3764
+ )
3765
+
3766
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3767
+
3768
+ const data: createPolicyResponse['data'] = body ? JSON.parse(body) : {}
3769
+ return { data, status: res.status, headers: res.headers } as createPolicyResponse
3770
+ }
3771
+
3772
+
3773
+
3774
+ /**
3775
+ * @summary Dry-run pre-flight policy evaluation
3776
+ */
3777
+ export type evaluatePoliciesResponse200 = {
3778
+ data: EvaluateOutputBody
3779
+ status: 200
3780
+ }
3781
+
3782
+ export type evaluatePoliciesResponseDefault = {
3783
+ data: ErrorModel
3784
+ status: Exclude<HTTPStatusCodes, 200>
3785
+ }
3786
+
3787
+ export type evaluatePoliciesResponseSuccess = (evaluatePoliciesResponse200) & {
3788
+ headers: Headers;
3789
+ };
3790
+ export type evaluatePoliciesResponseError = (evaluatePoliciesResponseDefault) & {
3791
+ headers: Headers;
3792
+ };
3793
+
3794
+ export type evaluatePoliciesResponse = (evaluatePoliciesResponseSuccess | evaluatePoliciesResponseError)
3795
+
3796
+ export const getEvaluatePoliciesUrl = (org: string,) => {
3797
+
3798
+
3799
+
3800
+
3801
+ return `/api/v1/tenants/${org}/policies/evaluate`
3802
+ }
3803
+
3804
+ export const evaluatePolicies = async (org: string,
3805
+ evaluateInputBody: NonReadonly<EvaluateInputBody>, options?: RequestInit): Promise<evaluatePoliciesResponse> => {
3806
+
3807
+ const res = await fetch(getEvaluatePoliciesUrl(org),
3808
+ {
3809
+ ...options,
3810
+ method: 'POST',
3811
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3812
+ body: JSON.stringify(
3813
+ evaluateInputBody,)
3814
+ }
3815
+ )
3816
+
3817
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3818
+
3819
+ const data: evaluatePoliciesResponse['data'] = body ? JSON.parse(body) : {}
3820
+ return { data, status: res.status, headers: res.headers } as evaluatePoliciesResponse
3821
+ }
3822
+
3823
+
3824
+
3825
+ /**
3826
+ * @summary Delete a policy
3827
+ */
3828
+ export type deletePolicyResponse204 = {
3829
+ data: void
3830
+ status: 204
3831
+ }
3832
+
3833
+ export type deletePolicyResponseDefault = {
3834
+ data: ErrorModel
3835
+ status: Exclude<HTTPStatusCodes, 204>
3836
+ }
3837
+
3838
+ export type deletePolicyResponseSuccess = (deletePolicyResponse204) & {
3839
+ headers: Headers;
3840
+ };
3841
+ export type deletePolicyResponseError = (deletePolicyResponseDefault) & {
3842
+ headers: Headers;
3843
+ };
3844
+
3845
+ export type deletePolicyResponse = (deletePolicyResponseSuccess | deletePolicyResponseError)
3846
+
3847
+ export const getDeletePolicyUrl = (org: string,
3848
+ id: string,) => {
3849
+
3850
+
3851
+
3852
+
3853
+ return `/api/v1/tenants/${org}/policies/${id}`
3854
+ }
3855
+
3856
+ export const deletePolicy = async (org: string,
3857
+ id: string, options?: RequestInit): Promise<deletePolicyResponse> => {
3858
+
3859
+ const res = await fetch(getDeletePolicyUrl(org,id),
3860
+ {
3861
+ ...options,
3862
+ method: 'DELETE'
3863
+
3864
+
3865
+ }
3866
+ )
3867
+
3868
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3869
+
3870
+ const data: deletePolicyResponse['data'] = body ? JSON.parse(body) : {}
3871
+ return { data, status: res.status, headers: res.headers } as deletePolicyResponse
3872
+ }
3873
+
3874
+
3875
+
3876
+ /**
3877
+ * @summary Get a policy
3878
+ */
3879
+ export type getPolicyResponse200 = {
3880
+ data: PolicyOutputBody
3881
+ status: 200
3882
+ }
3883
+
3884
+ export type getPolicyResponseDefault = {
3885
+ data: ErrorModel
3886
+ status: Exclude<HTTPStatusCodes, 200>
3887
+ }
3888
+
3889
+ export type getPolicyResponseSuccess = (getPolicyResponse200) & {
3890
+ headers: Headers;
3891
+ };
3892
+ export type getPolicyResponseError = (getPolicyResponseDefault) & {
3893
+ headers: Headers;
3894
+ };
3895
+
3896
+ export type getPolicyResponse = (getPolicyResponseSuccess | getPolicyResponseError)
3897
+
3898
+ export const getGetPolicyUrl = (org: string,
3899
+ id: string,) => {
3900
+
3901
+
3902
+
3903
+
3904
+ return `/api/v1/tenants/${org}/policies/${id}`
3905
+ }
3906
+
3907
+ export const getPolicy = async (org: string,
3908
+ id: string, options?: RequestInit): Promise<getPolicyResponse> => {
3909
+
3910
+ const res = await fetch(getGetPolicyUrl(org,id),
3911
+ {
3912
+ ...options,
3913
+ method: 'GET'
3914
+
3915
+
3916
+ }
3917
+ )
3918
+
3919
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3920
+
3921
+ const data: getPolicyResponse['data'] = body ? JSON.parse(body) : {}
3922
+ return { data, status: res.status, headers: res.headers } as getPolicyResponse
3923
+ }
3924
+
3925
+
3926
+
3927
+ /**
3928
+ * @summary Update a policy (bumps version)
3929
+ */
3930
+ export type updatePolicyResponse200 = {
3931
+ data: PolicyOutputBody
3932
+ status: 200
3933
+ }
3934
+
3935
+ export type updatePolicyResponseDefault = {
3936
+ data: ErrorModel
3937
+ status: Exclude<HTTPStatusCodes, 200>
3938
+ }
3939
+
3940
+ export type updatePolicyResponseSuccess = (updatePolicyResponse200) & {
3941
+ headers: Headers;
3942
+ };
3943
+ export type updatePolicyResponseError = (updatePolicyResponseDefault) & {
3944
+ headers: Headers;
3945
+ };
3946
+
3947
+ export type updatePolicyResponse = (updatePolicyResponseSuccess | updatePolicyResponseError)
3948
+
3949
+ export const getUpdatePolicyUrl = (org: string,
3950
+ id: string,) => {
3951
+
3952
+
3953
+
3954
+
3955
+ return `/api/v1/tenants/${org}/policies/${id}`
3956
+ }
3957
+
3958
+ export const updatePolicy = async (org: string,
3959
+ id: string,
3960
+ updatePolicyInputBody: NonReadonly<UpdatePolicyInputBody>, options?: RequestInit): Promise<updatePolicyResponse> => {
3961
+
3962
+ const res = await fetch(getUpdatePolicyUrl(org,id),
3963
+ {
3964
+ ...options,
3965
+ method: 'PUT',
3966
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
3967
+ body: JSON.stringify(
3968
+ updatePolicyInputBody,)
3969
+ }
3970
+ )
3971
+
3972
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
3973
+
3974
+ const data: updatePolicyResponse['data'] = body ? JSON.parse(body) : {}
3975
+ return { data, status: res.status, headers: res.headers } as updatePolicyResponse
3976
+ }
3977
+
3978
+
3979
+
3980
+ /**
3981
+ * @summary List policy packs (org + platform-global)
3982
+ */
3983
+ export type listPolicyPacksResponse200 = {
3984
+ data: ListPacksOutputBody
3985
+ status: 200
3986
+ }
3987
+
3988
+ export type listPolicyPacksResponseDefault = {
3989
+ data: ErrorModel
3990
+ status: Exclude<HTTPStatusCodes, 200>
3991
+ }
3992
+
3993
+ export type listPolicyPacksResponseSuccess = (listPolicyPacksResponse200) & {
3994
+ headers: Headers;
3995
+ };
3996
+ export type listPolicyPacksResponseError = (listPolicyPacksResponseDefault) & {
3997
+ headers: Headers;
3998
+ };
3999
+
4000
+ export type listPolicyPacksResponse = (listPolicyPacksResponseSuccess | listPolicyPacksResponseError)
4001
+
4002
+ export const getListPolicyPacksUrl = (org: string,) => {
4003
+
4004
+
4005
+
4006
+
4007
+ return `/api/v1/tenants/${org}/policy-packs`
4008
+ }
4009
+
4010
+ export const listPolicyPacks = async (org: string, options?: RequestInit): Promise<listPolicyPacksResponse> => {
4011
+
4012
+ const res = await fetch(getListPolicyPacksUrl(org),
4013
+ {
4014
+ ...options,
4015
+ method: 'GET'
4016
+
4017
+
4018
+ }
4019
+ )
4020
+
4021
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4022
+
4023
+ const data: listPolicyPacksResponse['data'] = body ? JSON.parse(body) : {}
4024
+ return { data, status: res.status, headers: res.headers } as listPolicyPacksResponse
4025
+ }
4026
+
4027
+
4028
+
4029
+ /**
4030
+ * @summary Create a policy pack (kyverno|cel-vap)
4031
+ */
4032
+ export type createPolicyPackResponse200 = {
4033
+ data: PackOutputBody
4034
+ status: 200
4035
+ }
4036
+
4037
+ export type createPolicyPackResponseDefault = {
4038
+ data: ErrorModel
4039
+ status: Exclude<HTTPStatusCodes, 200>
4040
+ }
4041
+
4042
+ export type createPolicyPackResponseSuccess = (createPolicyPackResponse200) & {
4043
+ headers: Headers;
4044
+ };
4045
+ export type createPolicyPackResponseError = (createPolicyPackResponseDefault) & {
4046
+ headers: Headers;
4047
+ };
4048
+
4049
+ export type createPolicyPackResponse = (createPolicyPackResponseSuccess | createPolicyPackResponseError)
4050
+
4051
+ export const getCreatePolicyPackUrl = (org: string,) => {
4052
+
4053
+
4054
+
4055
+
4056
+ return `/api/v1/tenants/${org}/policy-packs`
4057
+ }
4058
+
4059
+ export const createPolicyPack = async (org: string,
4060
+ createPackInputBody: NonReadonly<CreatePackInputBody>, options?: RequestInit): Promise<createPolicyPackResponse> => {
4061
+
4062
+ const res = await fetch(getCreatePolicyPackUrl(org),
4063
+ {
4064
+ ...options,
4065
+ method: 'POST',
4066
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
4067
+ body: JSON.stringify(
4068
+ createPackInputBody,)
4069
+ }
4070
+ )
4071
+
4072
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4073
+
4074
+ const data: createPolicyPackResponse['data'] = body ? JSON.parse(body) : {}
4075
+ return { data, status: res.status, headers: res.headers } as createPolicyPackResponse
4076
+ }
4077
+
4078
+
4079
+
4080
+ /**
4081
+ * @summary Get a policy pack
4082
+ */
4083
+ export type getPolicyPackResponse200 = {
4084
+ data: PackOutputBody
4085
+ status: 200
4086
+ }
4087
+
4088
+ export type getPolicyPackResponseDefault = {
4089
+ data: ErrorModel
4090
+ status: Exclude<HTTPStatusCodes, 200>
4091
+ }
4092
+
4093
+ export type getPolicyPackResponseSuccess = (getPolicyPackResponse200) & {
4094
+ headers: Headers;
4095
+ };
4096
+ export type getPolicyPackResponseError = (getPolicyPackResponseDefault) & {
4097
+ headers: Headers;
4098
+ };
4099
+
4100
+ export type getPolicyPackResponse = (getPolicyPackResponseSuccess | getPolicyPackResponseError)
4101
+
4102
+ export const getGetPolicyPackUrl = (org: string,
4103
+ id: string,) => {
4104
+
4105
+
4106
+
4107
+
4108
+ return `/api/v1/tenants/${org}/policy-packs/${id}`
4109
+ }
4110
+
4111
+ export const getPolicyPack = async (org: string,
4112
+ id: string, options?: RequestInit): Promise<getPolicyPackResponse> => {
4113
+
4114
+ const res = await fetch(getGetPolicyPackUrl(org,id),
4115
+ {
4116
+ ...options,
4117
+ method: 'GET'
4118
+
4119
+
4120
+ }
4121
+ )
4122
+
4123
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4124
+
4125
+ const data: getPolicyPackResponse['data'] = body ? JSON.parse(body) : {}
4126
+ return { data, status: res.status, headers: res.headers } as getPolicyPackResponse
4127
+ }
4128
+
4129
+
4130
+
4131
+ /**
4132
+ * @summary Assign a policy pack to a clusterset|tenant|cluster
4133
+ */
4134
+ export type assignPolicyPackResponse200 = {
4135
+ data: AssignPackOutputBody
4136
+ status: 200
4137
+ }
4138
+
4139
+ export type assignPolicyPackResponseDefault = {
4140
+ data: ErrorModel
4141
+ status: Exclude<HTTPStatusCodes, 200>
4142
+ }
4143
+
4144
+ export type assignPolicyPackResponseSuccess = (assignPolicyPackResponse200) & {
4145
+ headers: Headers;
4146
+ };
4147
+ export type assignPolicyPackResponseError = (assignPolicyPackResponseDefault) & {
4148
+ headers: Headers;
4149
+ };
4150
+
4151
+ export type assignPolicyPackResponse = (assignPolicyPackResponseSuccess | assignPolicyPackResponseError)
4152
+
4153
+ export const getAssignPolicyPackUrl = (org: string,
4154
+ id: string,) => {
4155
+
4156
+
4157
+
4158
+
4159
+ return `/api/v1/tenants/${org}/policy-packs/${id}/assign`
4160
+ }
4161
+
4162
+ export const assignPolicyPack = async (org: string,
4163
+ id: string,
4164
+ assignPackInputBody: NonReadonly<AssignPackInputBody>, options?: RequestInit): Promise<assignPolicyPackResponse> => {
4165
+
4166
+ const res = await fetch(getAssignPolicyPackUrl(org,id),
4167
+ {
4168
+ ...options,
4169
+ method: 'POST',
4170
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
4171
+ body: JSON.stringify(
4172
+ assignPackInputBody,)
4173
+ }
4174
+ )
4175
+
4176
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4177
+
4178
+ const data: assignPolicyPackResponse['data'] = body ? JSON.parse(body) : {}
4179
+ return { data, status: res.status, headers: res.headers } as assignPolicyPackResponse
4180
+ }
4181
+
4182
+
4183
+
4184
+ /**
4185
+ * @summary Remove a policy pack assignment
4186
+ */
4187
+ export type unassignPolicyPackResponse204 = {
4188
+ data: void
4189
+ status: 204
4190
+ }
4191
+
4192
+ export type unassignPolicyPackResponseDefault = {
4193
+ data: ErrorModel
4194
+ status: Exclude<HTTPStatusCodes, 204>
4195
+ }
4196
+
4197
+ export type unassignPolicyPackResponseSuccess = (unassignPolicyPackResponse204) & {
4198
+ headers: Headers;
4199
+ };
4200
+ export type unassignPolicyPackResponseError = (unassignPolicyPackResponseDefault) & {
4201
+ headers: Headers;
4202
+ };
4203
+
4204
+ export type unassignPolicyPackResponse = (unassignPolicyPackResponseSuccess | unassignPolicyPackResponseError)
4205
+
4206
+ export const getUnassignPolicyPackUrl = (org: string,
4207
+ id: string,
4208
+ assignmentId: string,) => {
4209
+
4210
+
4211
+
4212
+
4213
+ return `/api/v1/tenants/${org}/policy-packs/${id}/assignments/${assignmentId}`
4214
+ }
4215
+
4216
+ export const unassignPolicyPack = async (org: string,
4217
+ id: string,
4218
+ assignmentId: string, options?: RequestInit): Promise<unassignPolicyPackResponse> => {
4219
+
4220
+ const res = await fetch(getUnassignPolicyPackUrl(org,id,assignmentId),
4221
+ {
4222
+ ...options,
4223
+ method: 'DELETE'
4224
+
4225
+
4226
+ }
4227
+ )
4228
+
4229
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4230
+
4231
+ const data: unassignPolicyPackResponse['data'] = body ? JSON.parse(body) : {}
4232
+ return { data, status: res.status, headers: res.headers } as unassignPolicyPackResponse
4233
+ }
4234
+
4235
+
4236
+
4237
+ /**
4238
+ * @summary List teams of a tenant
4239
+ */
4240
+ export type listTeamsResponse200 = {
4241
+ data: ListTeamsOutputBody
4242
+ status: 200
4243
+ }
4244
+
4245
+ export type listTeamsResponseDefault = {
4246
+ data: ErrorModel
4247
+ status: Exclude<HTTPStatusCodes, 200>
4248
+ }
4249
+
4250
+ export type listTeamsResponseSuccess = (listTeamsResponse200) & {
4251
+ headers: Headers;
4252
+ };
4253
+ export type listTeamsResponseError = (listTeamsResponseDefault) & {
4254
+ headers: Headers;
4255
+ };
4256
+
4257
+ export type listTeamsResponse = (listTeamsResponseSuccess | listTeamsResponseError)
4258
+
4259
+ export const getListTeamsUrl = (org: string,) => {
4260
+
4261
+
4262
+
4263
+
4264
+ return `/api/v1/tenants/${org}/teams`
4265
+ }
4266
+
4267
+ export const listTeams = async (org: string, options?: RequestInit): Promise<listTeamsResponse> => {
4268
+
4269
+ const res = await fetch(getListTeamsUrl(org),
4270
+ {
4271
+ ...options,
4272
+ method: 'GET'
4273
+
4274
+
4275
+ }
4276
+ )
4277
+
4278
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4279
+
4280
+ const data: listTeamsResponse['data'] = body ? JSON.parse(body) : {}
4281
+ return { data, status: res.status, headers: res.headers } as listTeamsResponse
4282
+ }
4283
+
4284
+
4285
+
4286
+ /**
4287
+ * @summary List members of a team
4288
+ */
4289
+ export type listMembersResponse200 = {
4290
+ data: ListMembersOutputBody
4291
+ status: 200
4292
+ }
4293
+
4294
+ export type listMembersResponseDefault = {
4295
+ data: ErrorModel
4296
+ status: Exclude<HTTPStatusCodes, 200>
4297
+ }
4298
+
4299
+ export type listMembersResponseSuccess = (listMembersResponse200) & {
4300
+ headers: Headers;
4301
+ };
4302
+ export type listMembersResponseError = (listMembersResponseDefault) & {
4303
+ headers: Headers;
4304
+ };
4305
+
4306
+ export type listMembersResponse = (listMembersResponseSuccess | listMembersResponseError)
4307
+
4308
+ export const getListMembersUrl = (org: string,
4309
+ team: string,) => {
4310
+
4311
+
4312
+
4313
+
4314
+ return `/api/v1/tenants/${org}/teams/${team}/members`
4315
+ }
4316
+
4317
+ export const listMembers = async (org: string,
4318
+ team: string, options?: RequestInit): Promise<listMembersResponse> => {
4319
+
4320
+ const res = await fetch(getListMembersUrl(org,team),
4321
+ {
4322
+ ...options,
4323
+ method: 'GET'
4324
+
4325
+
4326
+ }
4327
+ )
4328
+
4329
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4330
+
4331
+ const data: listMembersResponse['data'] = body ? JSON.parse(body) : {}
4332
+ return { data, status: res.status, headers: res.headers } as listMembersResponse
4333
+ }
4334
+
4335
+
4336
+
4337
+ /**
4338
+ * @summary Add a user to a team (platform-engineer/admin only)
4339
+ */
4340
+ export type addMemberResponse204 = {
4341
+ data: void
4342
+ status: 204
4343
+ }
4344
+
4345
+ export type addMemberResponseDefault = {
4346
+ data: ErrorModel
4347
+ status: Exclude<HTTPStatusCodes, 204>
4348
+ }
4349
+
4350
+ export type addMemberResponseSuccess = (addMemberResponse204) & {
4351
+ headers: Headers;
4352
+ };
4353
+ export type addMemberResponseError = (addMemberResponseDefault) & {
4354
+ headers: Headers;
4355
+ };
4356
+
4357
+ export type addMemberResponse = (addMemberResponseSuccess | addMemberResponseError)
4358
+
4359
+ export const getAddMemberUrl = (org: string,
4360
+ team: string,) => {
4361
+
4362
+
4363
+
4364
+
4365
+ return `/api/v1/tenants/${org}/teams/${team}/members`
4366
+ }
4367
+
4368
+ export const addMember = async (org: string,
4369
+ team: string,
4370
+ addMemberInputBody: NonReadonly<AddMemberInputBody>, options?: RequestInit): Promise<addMemberResponse> => {
4371
+
4372
+ const res = await fetch(getAddMemberUrl(org,team),
4373
+ {
4374
+ ...options,
4375
+ method: 'POST',
4376
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
4377
+ body: JSON.stringify(
4378
+ addMemberInputBody,)
4379
+ }
4380
+ )
4381
+
4382
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4383
+
4384
+ const data: addMemberResponse['data'] = body ? JSON.parse(body) : {}
4385
+ return { data, status: res.status, headers: res.headers } as addMemberResponse
4386
+ }
4387
+
4388
+
4389
+
4390
+ /**
4391
+ * @summary Remove a user from a team (platform-engineer/admin only)
4392
+ */
4393
+ export type removeMemberResponse204 = {
4394
+ data: void
4395
+ status: 204
4396
+ }
4397
+
4398
+ export type removeMemberResponseDefault = {
4399
+ data: ErrorModel
4400
+ status: Exclude<HTTPStatusCodes, 204>
4401
+ }
4402
+
4403
+ export type removeMemberResponseSuccess = (removeMemberResponse204) & {
4404
+ headers: Headers;
4405
+ };
4406
+ export type removeMemberResponseError = (removeMemberResponseDefault) & {
4407
+ headers: Headers;
4408
+ };
4409
+
4410
+ export type removeMemberResponse = (removeMemberResponseSuccess | removeMemberResponseError)
4411
+
4412
+ export const getRemoveMemberUrl = (org: string,
4413
+ team: string,
4414
+ subject: string,) => {
4415
+
4416
+
4417
+
4418
+
4419
+ return `/api/v1/tenants/${org}/teams/${team}/members/${subject}`
4420
+ }
4421
+
4422
+ export const removeMember = async (org: string,
4423
+ team: string,
4424
+ subject: string, options?: RequestInit): Promise<removeMemberResponse> => {
4425
+
4426
+ const res = await fetch(getRemoveMemberUrl(org,team,subject),
4427
+ {
4428
+ ...options,
4429
+ method: 'DELETE'
4430
+
4431
+
4432
+ }
4433
+ )
4434
+
4435
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4436
+
4437
+ const data: removeMemberResponse['data'] = body ? JSON.parse(body) : {}
4438
+ return { data, status: res.status, headers: res.headers } as removeMemberResponse
4439
+ }
4440
+
4441
+
4442
+
4443
+ /**
4444
+ * @summary List tenant zones owned by this org
4445
+ */
4446
+ export type listTenantZonesResponse200 = {
4447
+ data: ListZonesOutputBody
4448
+ status: 200
4449
+ }
4450
+
4451
+ export type listTenantZonesResponseDefault = {
4452
+ data: ErrorModel
4453
+ status: Exclude<HTTPStatusCodes, 200>
4454
+ }
4455
+
4456
+ export type listTenantZonesResponseSuccess = (listTenantZonesResponse200) & {
4457
+ headers: Headers;
4458
+ };
4459
+ export type listTenantZonesResponseError = (listTenantZonesResponseDefault) & {
4460
+ headers: Headers;
4461
+ };
4462
+
4463
+ export type listTenantZonesResponse = (listTenantZonesResponseSuccess | listTenantZonesResponseError)
4464
+
4465
+ export const getListTenantZonesUrl = (org: string,) => {
4466
+
4467
+
4468
+
4469
+
4470
+ return `/api/v1/tenants/${org}/zones`
4471
+ }
4472
+
4473
+ export const listTenantZones = async (org: string, options?: RequestInit): Promise<listTenantZonesResponse> => {
4474
+
4475
+ const res = await fetch(getListTenantZonesUrl(org),
4476
+ {
4477
+ ...options,
4478
+ method: 'GET'
4479
+
4480
+
4481
+ }
4482
+ )
4483
+
4484
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4485
+
4486
+ const data: listTenantZonesResponse['data'] = body ? JSON.parse(body) : {}
4487
+ return { data, status: res.status, headers: res.headers } as listTenantZonesResponse
4488
+ }
4489
+
4490
+
4491
+
4492
+ /**
4493
+ * @summary Request a new tenant zone (approval-gated by default)
4494
+ */
4495
+ export type requestTenantZoneResponse200 = {
4496
+ data: RequestZoneOutputBody
4497
+ status: 200
4498
+ }
4499
+
4500
+ export type requestTenantZoneResponseDefault = {
4501
+ data: ErrorModel
4502
+ status: Exclude<HTTPStatusCodes, 200>
4503
+ }
4504
+
4505
+ export type requestTenantZoneResponseSuccess = (requestTenantZoneResponse200) & {
4506
+ headers: Headers;
4507
+ };
4508
+ export type requestTenantZoneResponseError = (requestTenantZoneResponseDefault) & {
4509
+ headers: Headers;
4510
+ };
4511
+
4512
+ export type requestTenantZoneResponse = (requestTenantZoneResponseSuccess | requestTenantZoneResponseError)
4513
+
4514
+ export const getRequestTenantZoneUrl = (org: string,) => {
4515
+
4516
+
4517
+
4518
+
4519
+ return `/api/v1/tenants/${org}/zones`
4520
+ }
4521
+
4522
+ export const requestTenantZone = async (org: string,
4523
+ requestZoneInputBody: NonReadonly<RequestZoneInputBody>, options?: RequestInit): Promise<requestTenantZoneResponse> => {
4524
+
4525
+ const res = await fetch(getRequestTenantZoneUrl(org),
4526
+ {
4527
+ ...options,
4528
+ method: 'POST',
4529
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
4530
+ body: JSON.stringify(
4531
+ requestZoneInputBody,)
4532
+ }
4533
+ )
4534
+
4535
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4536
+
4537
+ const data: requestTenantZoneResponse['data'] = body ? JSON.parse(body) : {}
4538
+ return { data, status: res.status, headers: res.headers } as requestTenantZoneResponse
4539
+ }
4540
+
4541
+
4542
+
4543
+ /**
4544
+ * @summary Get a tenant zone with its step sub-resources
4545
+ */
4546
+ export type getTenantZoneResponse200 = {
4547
+ data: GetZoneOutputBody
4548
+ status: 200
4549
+ }
4550
+
4551
+ export type getTenantZoneResponseDefault = {
4552
+ data: ErrorModel
4553
+ status: Exclude<HTTPStatusCodes, 200>
4554
+ }
4555
+
4556
+ export type getTenantZoneResponseSuccess = (getTenantZoneResponse200) & {
4557
+ headers: Headers;
4558
+ };
4559
+ export type getTenantZoneResponseError = (getTenantZoneResponseDefault) & {
4560
+ headers: Headers;
4561
+ };
4562
+
4563
+ export type getTenantZoneResponse = (getTenantZoneResponseSuccess | getTenantZoneResponseError)
4564
+
4565
+ export const getGetTenantZoneUrl = (org: string,
4566
+ id: string,) => {
4567
+
4568
+
4569
+
4570
+
4571
+ return `/api/v1/tenants/${org}/zones/${id}`
4572
+ }
4573
+
4574
+ export const getTenantZone = async (org: string,
4575
+ id: string, options?: RequestInit): Promise<getTenantZoneResponse> => {
4576
+
4577
+ const res = await fetch(getGetTenantZoneUrl(org,id),
4578
+ {
4579
+ ...options,
4580
+ method: 'GET'
4581
+
4582
+
4583
+ }
4584
+ )
4585
+
4586
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4587
+
4588
+ const data: getTenantZoneResponse['data'] = body ? JSON.parse(body) : {}
4589
+ return { data, status: res.status, headers: res.headers } as getTenantZoneResponse
4590
+ }
4591
+
4592
+
4593
+
4594
+ /**
4595
+ * @summary Decommission a tenant zone (approval-gated, ownership-checked)
4596
+ */
4597
+ export type decommissionTenantZoneResponse200 = {
4598
+ data: DecommissionOutputBody1
4599
+ status: 200
4600
+ }
4601
+
4602
+ export type decommissionTenantZoneResponseDefault = {
4603
+ data: ErrorModel
4604
+ status: Exclude<HTTPStatusCodes, 200>
4605
+ }
4606
+
4607
+ export type decommissionTenantZoneResponseSuccess = (decommissionTenantZoneResponse200) & {
4608
+ headers: Headers;
4609
+ };
4610
+ export type decommissionTenantZoneResponseError = (decommissionTenantZoneResponseDefault) & {
4611
+ headers: Headers;
4612
+ };
4613
+
4614
+ export type decommissionTenantZoneResponse = (decommissionTenantZoneResponseSuccess | decommissionTenantZoneResponseError)
4615
+
4616
+ export const getDecommissionTenantZoneUrl = (org: string,
4617
+ id: string,) => {
4618
+
4619
+
4620
+
4621
+
4622
+ return `/api/v1/tenants/${org}/zones/${id}/decommission`
4623
+ }
4624
+
4625
+ export const decommissionTenantZone = async (org: string,
4626
+ id: string, options?: RequestInit): Promise<decommissionTenantZoneResponse> => {
4627
+
4628
+ const res = await fetch(getDecommissionTenantZoneUrl(org,id),
4629
+ {
4630
+ ...options,
4631
+ method: 'POST'
4632
+
4633
+
4634
+ }
4635
+ )
4636
+
4637
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4638
+
4639
+ const data: decommissionTenantZoneResponse['data'] = body ? JSON.parse(body) : {}
4640
+ return { data, status: res.status, headers: res.headers } as decommissionTenantZoneResponse
4641
+ }
4642
+
4643
+
4644
+
4645
+ /**
4646
+ * @summary Resume a zone after manual intervention (§10)
4647
+ */
4648
+ export type resumeTenantZoneResponse204 = {
4649
+ data: void
4650
+ status: 204
4651
+ }
4652
+
4653
+ export type resumeTenantZoneResponseDefault = {
4654
+ data: ErrorModel
4655
+ status: Exclude<HTTPStatusCodes, 204>
4656
+ }
4657
+
4658
+ export type resumeTenantZoneResponseSuccess = (resumeTenantZoneResponse204) & {
4659
+ headers: Headers;
4660
+ };
4661
+ export type resumeTenantZoneResponseError = (resumeTenantZoneResponseDefault) & {
4662
+ headers: Headers;
4663
+ };
4664
+
4665
+ export type resumeTenantZoneResponse = (resumeTenantZoneResponseSuccess | resumeTenantZoneResponseError)
4666
+
4667
+ export const getResumeTenantZoneUrl = (org: string,
4668
+ id: string,) => {
4669
+
4670
+
4671
+
4672
+
4673
+ return `/api/v1/tenants/${org}/zones/${id}/resume`
4674
+ }
4675
+
4676
+ export const resumeTenantZone = async (org: string,
4677
+ id: string, options?: RequestInit): Promise<resumeTenantZoneResponse> => {
4678
+
4679
+ const res = await fetch(getResumeTenantZoneUrl(org,id),
4680
+ {
4681
+ ...options,
4682
+ method: 'POST'
4683
+
4684
+
4685
+ }
4686
+ )
4687
+
4688
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
4689
+
4690
+ const data: resumeTenantZoneResponse['data'] = body ? JSON.parse(body) : {}
4691
+ return { data, status: res.status, headers: res.headers } as resumeTenantZoneResponse
4692
+ }