@distilled.cloud/cloudflare 0.5.5 → 0.6.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,2962 @@
1
+ /**
2
+ * Cloudflare CONTAINERS API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service containers
6
+ */
7
+
8
+ import * as Schema from "effect/Schema";
9
+ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
+ import * as API from "../client/api.ts";
11
+ import * as T from "../traits.ts";
12
+ import type { Credentials } from "../credentials.ts";
13
+ import { type DefaultErrors } from "../errors.ts";
14
+ import { SensitiveString } from "../sensitive.ts";
15
+
16
+ // =============================================================================
17
+ // Errors
18
+ // =============================================================================
19
+
20
+ export class ContainerApplicationNotFound extends Schema.TaggedErrorClass<ContainerApplicationNotFound>()(
21
+ "ContainerApplicationNotFound",
22
+ { code: Schema.Number, message: Schema.String },
23
+ ) {}
24
+ T.applyErrorMatchers(ContainerApplicationNotFound, [
25
+ { code: 1609, message: { includes: "Container application not found" } },
26
+ { code: 1609, message: { includes: "APPLICATION_NOT_FOUND" } },
27
+ ]);
28
+
29
+ export class DurableObjectAlreadyHasApplication extends Schema.TaggedErrorClass<DurableObjectAlreadyHasApplication>()(
30
+ "DurableObjectAlreadyHasApplication",
31
+ { code: Schema.Number, message: Schema.String },
32
+ ) {}
33
+ T.applyErrorMatchers(DurableObjectAlreadyHasApplication, [
34
+ {
35
+ code: 1608,
36
+ message: { includes: "DURABLE_OBJECT_ALREADY_HAS_APPLICATION" },
37
+ },
38
+ ]);
39
+
40
+ export class InvalidRoute extends Schema.TaggedErrorClass<InvalidRoute>()(
41
+ "InvalidRoute",
42
+ { code: Schema.Number, message: Schema.String },
43
+ ) {}
44
+ T.applyErrorMatchers(InvalidRoute, [
45
+ { code: 7003, message: { includes: "Could not route" } },
46
+ ]);
47
+
48
+ // =============================================================================
49
+ // ContainerApplication
50
+ // =============================================================================
51
+
52
+ export interface GetContainerApplicationRequest {
53
+ accountId: string;
54
+ applicationId: string;
55
+ }
56
+
57
+ export const GetContainerApplicationRequest =
58
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
59
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
60
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
61
+ }).pipe(
62
+ T.Http({
63
+ method: "GET",
64
+ path: "/accounts/{account_id}/containers/applications/{application_id}",
65
+ }),
66
+ ) as unknown as Schema.Schema<GetContainerApplicationRequest>;
67
+
68
+ export interface GetContainerApplicationResponse {
69
+ id: string;
70
+ accountId: string;
71
+ name: string;
72
+ schedulingPolicy: "moon" | "gpu" | "regional" | "fill_metals" | "default";
73
+ instances: number;
74
+ maxInstances: number;
75
+ constraints: { tier?: number | null };
76
+ affinities?: { colocation?: "datacenter" | null } | null;
77
+ configuration: {
78
+ image: string;
79
+ instanceType?:
80
+ | "lite"
81
+ | "dev"
82
+ | "basic"
83
+ | "standard"
84
+ | "standard-1"
85
+ | "standard-2"
86
+ | "standard-3"
87
+ | "standard-4"
88
+ | null;
89
+ observability?: { logs?: { enabled: boolean } | null } | null;
90
+ sshPublicKeyIds?: string[] | null;
91
+ secrets?: { name: string; type: "env"; secret: string }[] | null;
92
+ vcpu?: number | null;
93
+ memory?: string | null;
94
+ disk?: { size: string } | null;
95
+ environmentVariables?: { name: string; value: string }[] | null;
96
+ labels?: { name: string; value: string }[] | null;
97
+ network?: {
98
+ assignIpv4?: "none" | "predefined" | "account" | null;
99
+ assignIpv6?: "none" | "predefined" | "account" | null;
100
+ mode?: "public" | "private" | null;
101
+ } | null;
102
+ command?: string[] | null;
103
+ entrypoint?: string[] | null;
104
+ dns?: { servers?: string[] | null; searches?: string[] | null } | null;
105
+ ports?: { name: string; port?: number | null }[] | null;
106
+ checks?:
107
+ | {
108
+ name?: string | null;
109
+ type: "http" | "tcp";
110
+ tls?: boolean | null;
111
+ port: string;
112
+ http?: {
113
+ method?:
114
+ | "GET"
115
+ | "POST"
116
+ | "PUT"
117
+ | "PATCH"
118
+ | "DELETE"
119
+ | "OPTIONS"
120
+ | "HEAD"
121
+ | null;
122
+ body?: string | null;
123
+ path?: string | null;
124
+ headers?: unknown | null;
125
+ } | null;
126
+ interval: string;
127
+ timeout: string;
128
+ retries?: number | null;
129
+ kind: "health" | "ready";
130
+ }[]
131
+ | null;
132
+ };
133
+ durableObjects?: { namespaceId: string } | null;
134
+ createdAt: string;
135
+ version: number;
136
+ durableObjectNamespaceId?: string | null;
137
+ health: { instances: unknown };
138
+ }
139
+
140
+ export const GetContainerApplicationResponse =
141
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
142
+ id: Schema.String,
143
+ accountId: Schema.String,
144
+ name: Schema.String,
145
+ schedulingPolicy: Schema.Literals([
146
+ "moon",
147
+ "gpu",
148
+ "regional",
149
+ "fill_metals",
150
+ "default",
151
+ ]),
152
+ instances: Schema.Number,
153
+ maxInstances: Schema.Number,
154
+ constraints: Schema.Struct({
155
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
156
+ }),
157
+ affinities: Schema.optional(
158
+ Schema.Union([
159
+ Schema.Struct({
160
+ colocation: Schema.optional(
161
+ Schema.Union([Schema.Literal("datacenter"), Schema.Null]),
162
+ ),
163
+ }),
164
+ Schema.Null,
165
+ ]),
166
+ ),
167
+ configuration: Schema.Struct({
168
+ image: Schema.String,
169
+ instanceType: Schema.optional(
170
+ Schema.Union([
171
+ Schema.Literals([
172
+ "lite",
173
+ "dev",
174
+ "basic",
175
+ "standard",
176
+ "standard-1",
177
+ "standard-2",
178
+ "standard-3",
179
+ "standard-4",
180
+ ]),
181
+ Schema.Null,
182
+ ]),
183
+ ),
184
+ observability: Schema.optional(
185
+ Schema.Union([
186
+ Schema.Struct({
187
+ logs: Schema.optional(
188
+ Schema.Union([
189
+ Schema.Struct({
190
+ enabled: Schema.Boolean,
191
+ }),
192
+ Schema.Null,
193
+ ]),
194
+ ),
195
+ }),
196
+ Schema.Null,
197
+ ]),
198
+ ),
199
+ sshPublicKeyIds: Schema.optional(
200
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
201
+ ),
202
+ secrets: Schema.optional(
203
+ Schema.Union([
204
+ Schema.Array(
205
+ Schema.Struct({
206
+ name: Schema.String,
207
+ type: Schema.Literal("env"),
208
+ secret: SensitiveString,
209
+ }),
210
+ ),
211
+ Schema.Null,
212
+ ]),
213
+ ),
214
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
215
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
216
+ disk: Schema.optional(
217
+ Schema.Union([
218
+ Schema.Struct({
219
+ size: Schema.String,
220
+ }),
221
+ Schema.Null,
222
+ ]),
223
+ ),
224
+ environmentVariables: Schema.optional(
225
+ Schema.Union([
226
+ Schema.Array(
227
+ Schema.Struct({
228
+ name: Schema.String,
229
+ value: Schema.String,
230
+ }),
231
+ ),
232
+ Schema.Null,
233
+ ]),
234
+ ),
235
+ labels: Schema.optional(
236
+ Schema.Union([
237
+ Schema.Array(
238
+ Schema.Struct({
239
+ name: Schema.String,
240
+ value: Schema.String,
241
+ }),
242
+ ),
243
+ Schema.Null,
244
+ ]),
245
+ ),
246
+ network: Schema.optional(
247
+ Schema.Union([
248
+ Schema.Struct({
249
+ assignIpv4: Schema.optional(
250
+ Schema.Union([
251
+ Schema.Literals(["none", "predefined", "account"]),
252
+ Schema.Null,
253
+ ]),
254
+ ),
255
+ assignIpv6: Schema.optional(
256
+ Schema.Union([
257
+ Schema.Literals(["none", "predefined", "account"]),
258
+ Schema.Null,
259
+ ]),
260
+ ),
261
+ mode: Schema.optional(
262
+ Schema.Union([
263
+ Schema.Literals(["public", "private"]),
264
+ Schema.Null,
265
+ ]),
266
+ ),
267
+ }).pipe(
268
+ Schema.encodeKeys({
269
+ assignIpv4: "assign_ipv4",
270
+ assignIpv6: "assign_ipv6",
271
+ mode: "mode",
272
+ }),
273
+ ),
274
+ Schema.Null,
275
+ ]),
276
+ ),
277
+ command: Schema.optional(
278
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
279
+ ),
280
+ entrypoint: Schema.optional(
281
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
282
+ ),
283
+ dns: Schema.optional(
284
+ Schema.Union([
285
+ Schema.Struct({
286
+ servers: Schema.optional(
287
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
288
+ ),
289
+ searches: Schema.optional(
290
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
291
+ ),
292
+ }),
293
+ Schema.Null,
294
+ ]),
295
+ ),
296
+ ports: Schema.optional(
297
+ Schema.Union([
298
+ Schema.Array(
299
+ Schema.Struct({
300
+ name: Schema.String,
301
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
302
+ }),
303
+ ),
304
+ Schema.Null,
305
+ ]),
306
+ ),
307
+ checks: Schema.optional(
308
+ Schema.Union([
309
+ Schema.Array(
310
+ Schema.Struct({
311
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
312
+ type: Schema.Literals(["http", "tcp"]),
313
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
314
+ port: Schema.String,
315
+ http: Schema.optional(
316
+ Schema.Union([
317
+ Schema.Struct({
318
+ method: Schema.optional(
319
+ Schema.Union([
320
+ Schema.Literals([
321
+ "GET",
322
+ "POST",
323
+ "PUT",
324
+ "PATCH",
325
+ "DELETE",
326
+ "OPTIONS",
327
+ "HEAD",
328
+ ]),
329
+ Schema.Null,
330
+ ]),
331
+ ),
332
+ body: Schema.optional(
333
+ Schema.Union([Schema.String, Schema.Null]),
334
+ ),
335
+ path: Schema.optional(
336
+ Schema.Union([Schema.String, Schema.Null]),
337
+ ),
338
+ headers: Schema.optional(
339
+ Schema.Union([Schema.Unknown, Schema.Null]),
340
+ ),
341
+ }),
342
+ Schema.Null,
343
+ ]),
344
+ ),
345
+ interval: Schema.String,
346
+ timeout: Schema.String,
347
+ retries: Schema.optional(
348
+ Schema.Union([Schema.Number, Schema.Null]),
349
+ ),
350
+ kind: Schema.Literals(["health", "ready"]),
351
+ }),
352
+ ),
353
+ Schema.Null,
354
+ ]),
355
+ ),
356
+ }).pipe(
357
+ Schema.encodeKeys({
358
+ image: "image",
359
+ instanceType: "instance_type",
360
+ observability: "observability",
361
+ sshPublicKeyIds: "ssh_public_key_ids",
362
+ secrets: "secrets",
363
+ vcpu: "vcpu",
364
+ memory: "memory",
365
+ disk: "disk",
366
+ environmentVariables: "environment_variables",
367
+ labels: "labels",
368
+ network: "network",
369
+ command: "command",
370
+ entrypoint: "entrypoint",
371
+ dns: "dns",
372
+ ports: "ports",
373
+ checks: "checks",
374
+ }),
375
+ ),
376
+ durableObjects: Schema.optional(
377
+ Schema.Union([
378
+ Schema.Struct({
379
+ namespaceId: Schema.String,
380
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
381
+ Schema.Null,
382
+ ]),
383
+ ),
384
+ createdAt: Schema.String,
385
+ version: Schema.Number,
386
+ durableObjectNamespaceId: Schema.optional(
387
+ Schema.Union([Schema.String, Schema.Null]),
388
+ ),
389
+ health: Schema.Struct({
390
+ instances: Schema.Unknown,
391
+ }),
392
+ })
393
+ .pipe(
394
+ Schema.encodeKeys({
395
+ id: "id",
396
+ accountId: "account_id",
397
+ name: "name",
398
+ schedulingPolicy: "scheduling_policy",
399
+ instances: "instances",
400
+ maxInstances: "max_instances",
401
+ constraints: "constraints",
402
+ affinities: "affinities",
403
+ configuration: "configuration",
404
+ durableObjects: "durable_objects",
405
+ createdAt: "created_at",
406
+ version: "version",
407
+ durableObjectNamespaceId: "durable_object_namespace_id",
408
+ health: "health",
409
+ }),
410
+ )
411
+ .pipe(
412
+ T.ResponsePath("result"),
413
+ ) as unknown as Schema.Schema<GetContainerApplicationResponse>;
414
+
415
+ export type GetContainerApplicationError =
416
+ | DefaultErrors
417
+ | InvalidRoute
418
+ | ContainerApplicationNotFound;
419
+
420
+ export const getContainerApplication: API.OperationMethod<
421
+ GetContainerApplicationRequest,
422
+ GetContainerApplicationResponse,
423
+ GetContainerApplicationError,
424
+ Credentials | HttpClient.HttpClient
425
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
426
+ input: GetContainerApplicationRequest,
427
+ output: GetContainerApplicationResponse,
428
+ errors: [InvalidRoute, ContainerApplicationNotFound],
429
+ }));
430
+
431
+ export interface ListContainerApplicationsRequest {
432
+ accountId: string;
433
+ }
434
+
435
+ export const ListContainerApplicationsRequest =
436
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
437
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
438
+ }).pipe(
439
+ T.Http({
440
+ method: "GET",
441
+ path: "/accounts/{account_id}/containers/applications",
442
+ }),
443
+ ) as unknown as Schema.Schema<ListContainerApplicationsRequest>;
444
+
445
+ export type ListContainerApplicationsResponse = {
446
+ id: string;
447
+ accountId: string;
448
+ name: string;
449
+ schedulingPolicy: "moon" | "gpu" | "regional" | "fill_metals" | "default";
450
+ instances: number;
451
+ maxInstances: number;
452
+ constraints: { tier?: number | null };
453
+ affinities?: { colocation?: "datacenter" | null } | null;
454
+ configuration: {
455
+ image: string;
456
+ instanceType?:
457
+ | "lite"
458
+ | "dev"
459
+ | "basic"
460
+ | "standard"
461
+ | "standard-1"
462
+ | "standard-2"
463
+ | "standard-3"
464
+ | "standard-4"
465
+ | null;
466
+ observability?: { logs?: { enabled: boolean } | null } | null;
467
+ sshPublicKeyIds?: string[] | null;
468
+ secrets?: { name: string; type: "env"; secret: string }[] | null;
469
+ vcpu?: number | null;
470
+ memory?: string | null;
471
+ disk?: { size: string } | null;
472
+ environmentVariables?: { name: string; value: string }[] | null;
473
+ labels?: { name: string; value: string }[] | null;
474
+ network?: {
475
+ assignIpv4?: "none" | "predefined" | "account" | null;
476
+ assignIpv6?: "none" | "predefined" | "account" | null;
477
+ mode?: "public" | "private" | null;
478
+ } | null;
479
+ command?: string[] | null;
480
+ entrypoint?: string[] | null;
481
+ dns?: { servers?: string[] | null; searches?: string[] | null } | null;
482
+ ports?: { name: string; port?: number | null }[] | null;
483
+ checks?:
484
+ | {
485
+ name?: string | null;
486
+ type: "http" | "tcp";
487
+ tls?: boolean | null;
488
+ port: string;
489
+ http?: {
490
+ method?:
491
+ | "GET"
492
+ | "POST"
493
+ | "PUT"
494
+ | "PATCH"
495
+ | "DELETE"
496
+ | "OPTIONS"
497
+ | "HEAD"
498
+ | null;
499
+ body?: string | null;
500
+ path?: string | null;
501
+ headers?: unknown | null;
502
+ } | null;
503
+ interval: string;
504
+ timeout: string;
505
+ retries?: number | null;
506
+ kind: "health" | "ready";
507
+ }[]
508
+ | null;
509
+ };
510
+ durableObjects?: { namespaceId: string } | null;
511
+ createdAt: string;
512
+ version: number;
513
+ durableObjectNamespaceId?: string | null;
514
+ health: { instances: unknown };
515
+ }[];
516
+
517
+ export const ListContainerApplicationsResponse =
518
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Array(
519
+ Schema.Struct({
520
+ id: Schema.String,
521
+ accountId: Schema.String,
522
+ name: Schema.String,
523
+ schedulingPolicy: Schema.Literals([
524
+ "moon",
525
+ "gpu",
526
+ "regional",
527
+ "fill_metals",
528
+ "default",
529
+ ]),
530
+ instances: Schema.Number,
531
+ maxInstances: Schema.Number,
532
+ constraints: Schema.Struct({
533
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
534
+ }),
535
+ affinities: Schema.optional(
536
+ Schema.Union([
537
+ Schema.Struct({
538
+ colocation: Schema.optional(
539
+ Schema.Union([Schema.Literal("datacenter"), Schema.Null]),
540
+ ),
541
+ }),
542
+ Schema.Null,
543
+ ]),
544
+ ),
545
+ configuration: Schema.Struct({
546
+ image: Schema.String,
547
+ instanceType: Schema.optional(
548
+ Schema.Union([
549
+ Schema.Literals([
550
+ "lite",
551
+ "dev",
552
+ "basic",
553
+ "standard",
554
+ "standard-1",
555
+ "standard-2",
556
+ "standard-3",
557
+ "standard-4",
558
+ ]),
559
+ Schema.Null,
560
+ ]),
561
+ ),
562
+ observability: Schema.optional(
563
+ Schema.Union([
564
+ Schema.Struct({
565
+ logs: Schema.optional(
566
+ Schema.Union([
567
+ Schema.Struct({
568
+ enabled: Schema.Boolean,
569
+ }),
570
+ Schema.Null,
571
+ ]),
572
+ ),
573
+ }),
574
+ Schema.Null,
575
+ ]),
576
+ ),
577
+ sshPublicKeyIds: Schema.optional(
578
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
579
+ ),
580
+ secrets: Schema.optional(
581
+ Schema.Union([
582
+ Schema.Array(
583
+ Schema.Struct({
584
+ name: Schema.String,
585
+ type: Schema.Literal("env"),
586
+ secret: SensitiveString,
587
+ }),
588
+ ),
589
+ Schema.Null,
590
+ ]),
591
+ ),
592
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
593
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
594
+ disk: Schema.optional(
595
+ Schema.Union([
596
+ Schema.Struct({
597
+ size: Schema.String,
598
+ }),
599
+ Schema.Null,
600
+ ]),
601
+ ),
602
+ environmentVariables: Schema.optional(
603
+ Schema.Union([
604
+ Schema.Array(
605
+ Schema.Struct({
606
+ name: Schema.String,
607
+ value: Schema.String,
608
+ }),
609
+ ),
610
+ Schema.Null,
611
+ ]),
612
+ ),
613
+ labels: Schema.optional(
614
+ Schema.Union([
615
+ Schema.Array(
616
+ Schema.Struct({
617
+ name: Schema.String,
618
+ value: Schema.String,
619
+ }),
620
+ ),
621
+ Schema.Null,
622
+ ]),
623
+ ),
624
+ network: Schema.optional(
625
+ Schema.Union([
626
+ Schema.Struct({
627
+ assignIpv4: Schema.optional(
628
+ Schema.Union([
629
+ Schema.Literals(["none", "predefined", "account"]),
630
+ Schema.Null,
631
+ ]),
632
+ ),
633
+ assignIpv6: Schema.optional(
634
+ Schema.Union([
635
+ Schema.Literals(["none", "predefined", "account"]),
636
+ Schema.Null,
637
+ ]),
638
+ ),
639
+ mode: Schema.optional(
640
+ Schema.Union([
641
+ Schema.Literals(["public", "private"]),
642
+ Schema.Null,
643
+ ]),
644
+ ),
645
+ }).pipe(
646
+ Schema.encodeKeys({
647
+ assignIpv4: "assign_ipv4",
648
+ assignIpv6: "assign_ipv6",
649
+ mode: "mode",
650
+ }),
651
+ ),
652
+ Schema.Null,
653
+ ]),
654
+ ),
655
+ command: Schema.optional(
656
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
657
+ ),
658
+ entrypoint: Schema.optional(
659
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
660
+ ),
661
+ dns: Schema.optional(
662
+ Schema.Union([
663
+ Schema.Struct({
664
+ servers: Schema.optional(
665
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
666
+ ),
667
+ searches: Schema.optional(
668
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
669
+ ),
670
+ }),
671
+ Schema.Null,
672
+ ]),
673
+ ),
674
+ ports: Schema.optional(
675
+ Schema.Union([
676
+ Schema.Array(
677
+ Schema.Struct({
678
+ name: Schema.String,
679
+ port: Schema.optional(
680
+ Schema.Union([Schema.Number, Schema.Null]),
681
+ ),
682
+ }),
683
+ ),
684
+ Schema.Null,
685
+ ]),
686
+ ),
687
+ checks: Schema.optional(
688
+ Schema.Union([
689
+ Schema.Array(
690
+ Schema.Struct({
691
+ name: Schema.optional(
692
+ Schema.Union([Schema.String, Schema.Null]),
693
+ ),
694
+ type: Schema.Literals(["http", "tcp"]),
695
+ tls: Schema.optional(
696
+ Schema.Union([Schema.Boolean, Schema.Null]),
697
+ ),
698
+ port: Schema.String,
699
+ http: Schema.optional(
700
+ Schema.Union([
701
+ Schema.Struct({
702
+ method: Schema.optional(
703
+ Schema.Union([
704
+ Schema.Literals([
705
+ "GET",
706
+ "POST",
707
+ "PUT",
708
+ "PATCH",
709
+ "DELETE",
710
+ "OPTIONS",
711
+ "HEAD",
712
+ ]),
713
+ Schema.Null,
714
+ ]),
715
+ ),
716
+ body: Schema.optional(
717
+ Schema.Union([Schema.String, Schema.Null]),
718
+ ),
719
+ path: Schema.optional(
720
+ Schema.Union([Schema.String, Schema.Null]),
721
+ ),
722
+ headers: Schema.optional(
723
+ Schema.Union([Schema.Unknown, Schema.Null]),
724
+ ),
725
+ }),
726
+ Schema.Null,
727
+ ]),
728
+ ),
729
+ interval: Schema.String,
730
+ timeout: Schema.String,
731
+ retries: Schema.optional(
732
+ Schema.Union([Schema.Number, Schema.Null]),
733
+ ),
734
+ kind: Schema.Literals(["health", "ready"]),
735
+ }),
736
+ ),
737
+ Schema.Null,
738
+ ]),
739
+ ),
740
+ }).pipe(
741
+ Schema.encodeKeys({
742
+ image: "image",
743
+ instanceType: "instance_type",
744
+ observability: "observability",
745
+ sshPublicKeyIds: "ssh_public_key_ids",
746
+ secrets: "secrets",
747
+ vcpu: "vcpu",
748
+ memory: "memory",
749
+ disk: "disk",
750
+ environmentVariables: "environment_variables",
751
+ labels: "labels",
752
+ network: "network",
753
+ command: "command",
754
+ entrypoint: "entrypoint",
755
+ dns: "dns",
756
+ ports: "ports",
757
+ checks: "checks",
758
+ }),
759
+ ),
760
+ durableObjects: Schema.optional(
761
+ Schema.Union([
762
+ Schema.Struct({
763
+ namespaceId: Schema.String,
764
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
765
+ Schema.Null,
766
+ ]),
767
+ ),
768
+ createdAt: Schema.String,
769
+ version: Schema.Number,
770
+ durableObjectNamespaceId: Schema.optional(
771
+ Schema.Union([Schema.String, Schema.Null]),
772
+ ),
773
+ health: Schema.Struct({
774
+ instances: Schema.Unknown,
775
+ }),
776
+ }).pipe(
777
+ Schema.encodeKeys({
778
+ id: "id",
779
+ accountId: "account_id",
780
+ name: "name",
781
+ schedulingPolicy: "scheduling_policy",
782
+ instances: "instances",
783
+ maxInstances: "max_instances",
784
+ constraints: "constraints",
785
+ affinities: "affinities",
786
+ configuration: "configuration",
787
+ durableObjects: "durable_objects",
788
+ createdAt: "created_at",
789
+ version: "version",
790
+ durableObjectNamespaceId: "durable_object_namespace_id",
791
+ health: "health",
792
+ }),
793
+ ),
794
+ ).pipe(
795
+ T.ResponsePath("result"),
796
+ ) as unknown as Schema.Schema<ListContainerApplicationsResponse>;
797
+
798
+ export type ListContainerApplicationsError = DefaultErrors | InvalidRoute;
799
+
800
+ export const listContainerApplications: API.OperationMethod<
801
+ ListContainerApplicationsRequest,
802
+ ListContainerApplicationsResponse,
803
+ ListContainerApplicationsError,
804
+ Credentials | HttpClient.HttpClient
805
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
806
+ input: ListContainerApplicationsRequest,
807
+ output: ListContainerApplicationsResponse,
808
+ errors: [InvalidRoute],
809
+ }));
810
+
811
+ export interface CreateContainerApplicationRequest {
812
+ accountId: string;
813
+ name: string;
814
+ maxInstances: number;
815
+ configuration: {
816
+ image: string;
817
+ instanceType?:
818
+ | "lite"
819
+ | "dev"
820
+ | "basic"
821
+ | "standard"
822
+ | "standard-1"
823
+ | "standard-2"
824
+ | "standard-3"
825
+ | "standard-4";
826
+ observability?: { logs?: { enabled: boolean } };
827
+ sshPublicKeyIds?: string[];
828
+ secrets?: { name: string; type: "env"; secret: string }[];
829
+ vcpu?: number;
830
+ memory?: string;
831
+ disk?: { size: string };
832
+ environmentVariables?: { name: string; value: string }[];
833
+ labels?: { name: string; value: string }[];
834
+ network?: {
835
+ assignIpv4?: "none" | "predefined" | "account";
836
+ assignIpv6?: "none" | "predefined" | "account";
837
+ mode?: "public" | "private";
838
+ };
839
+ command?: string[];
840
+ entrypoint?: string[];
841
+ dns?: { servers?: string[]; searches?: string[] };
842
+ ports?: { name: string; port?: number }[];
843
+ checks?: {
844
+ name?: string;
845
+ type: "http" | "tcp";
846
+ tls?: boolean;
847
+ port: string;
848
+ http?: {
849
+ method?:
850
+ | "GET"
851
+ | "POST"
852
+ | "PUT"
853
+ | "PATCH"
854
+ | "DELETE"
855
+ | "OPTIONS"
856
+ | "HEAD";
857
+ body?: string;
858
+ path?: string;
859
+ headers?: unknown;
860
+ };
861
+ interval: string;
862
+ timeout: string;
863
+ retries?: number;
864
+ kind: "health" | "ready";
865
+ }[];
866
+ };
867
+ durableObjects?: { namespaceId: string };
868
+ instances?: number;
869
+ schedulingPolicy?: "moon" | "gpu" | "regional" | "fill_metals" | "default";
870
+ constraints?: { tier?: number };
871
+ affinities?: { colocation?: "datacenter" };
872
+ }
873
+
874
+ export const CreateContainerApplicationRequest =
875
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
876
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
877
+ name: Schema.String,
878
+ maxInstances: Schema.Number,
879
+ configuration: Schema.Struct({
880
+ image: Schema.String,
881
+ instanceType: Schema.optional(
882
+ Schema.Literals([
883
+ "lite",
884
+ "dev",
885
+ "basic",
886
+ "standard",
887
+ "standard-1",
888
+ "standard-2",
889
+ "standard-3",
890
+ "standard-4",
891
+ ]),
892
+ ),
893
+ observability: Schema.optional(
894
+ Schema.Struct({
895
+ logs: Schema.optional(
896
+ Schema.Struct({
897
+ enabled: Schema.Boolean,
898
+ }),
899
+ ),
900
+ }),
901
+ ),
902
+ sshPublicKeyIds: Schema.optional(Schema.Array(Schema.String)),
903
+ secrets: Schema.optional(
904
+ Schema.Array(
905
+ Schema.Struct({
906
+ name: Schema.String,
907
+ type: Schema.Literal("env"),
908
+ secret: SensitiveString,
909
+ }),
910
+ ),
911
+ ),
912
+ vcpu: Schema.optional(Schema.Number),
913
+ memory: Schema.optional(Schema.String),
914
+ disk: Schema.optional(
915
+ Schema.Struct({
916
+ size: Schema.String,
917
+ }),
918
+ ),
919
+ environmentVariables: Schema.optional(
920
+ Schema.Array(
921
+ Schema.Struct({
922
+ name: Schema.String,
923
+ value: Schema.String,
924
+ }),
925
+ ),
926
+ ),
927
+ labels: Schema.optional(
928
+ Schema.Array(
929
+ Schema.Struct({
930
+ name: Schema.String,
931
+ value: Schema.String,
932
+ }),
933
+ ),
934
+ ),
935
+ network: Schema.optional(
936
+ Schema.Struct({
937
+ assignIpv4: Schema.optional(
938
+ Schema.Literals(["none", "predefined", "account"]),
939
+ ),
940
+ assignIpv6: Schema.optional(
941
+ Schema.Literals(["none", "predefined", "account"]),
942
+ ),
943
+ mode: Schema.optional(Schema.Literals(["public", "private"])),
944
+ }).pipe(
945
+ Schema.encodeKeys({
946
+ assignIpv4: "assign_ipv4",
947
+ assignIpv6: "assign_ipv6",
948
+ mode: "mode",
949
+ }),
950
+ ),
951
+ ),
952
+ command: Schema.optional(Schema.Array(Schema.String)),
953
+ entrypoint: Schema.optional(Schema.Array(Schema.String)),
954
+ dns: Schema.optional(
955
+ Schema.Struct({
956
+ servers: Schema.optional(Schema.Array(Schema.String)),
957
+ searches: Schema.optional(Schema.Array(Schema.String)),
958
+ }),
959
+ ),
960
+ ports: Schema.optional(
961
+ Schema.Array(
962
+ Schema.Struct({
963
+ name: Schema.String,
964
+ port: Schema.optional(Schema.Number),
965
+ }),
966
+ ),
967
+ ),
968
+ checks: Schema.optional(
969
+ Schema.Array(
970
+ Schema.Struct({
971
+ name: Schema.optional(Schema.String),
972
+ type: Schema.Literals(["http", "tcp"]),
973
+ tls: Schema.optional(Schema.Boolean),
974
+ port: Schema.String,
975
+ http: Schema.optional(
976
+ Schema.Struct({
977
+ method: Schema.optional(
978
+ Schema.Literals([
979
+ "GET",
980
+ "POST",
981
+ "PUT",
982
+ "PATCH",
983
+ "DELETE",
984
+ "OPTIONS",
985
+ "HEAD",
986
+ ]),
987
+ ),
988
+ body: Schema.optional(Schema.String),
989
+ path: Schema.optional(Schema.String),
990
+ headers: Schema.optional(Schema.Unknown),
991
+ }),
992
+ ),
993
+ interval: Schema.String,
994
+ timeout: Schema.String,
995
+ retries: Schema.optional(Schema.Number),
996
+ kind: Schema.Literals(["health", "ready"]),
997
+ }),
998
+ ),
999
+ ),
1000
+ }).pipe(
1001
+ Schema.encodeKeys({
1002
+ image: "image",
1003
+ instanceType: "instance_type",
1004
+ observability: "observability",
1005
+ sshPublicKeyIds: "ssh_public_key_ids",
1006
+ secrets: "secrets",
1007
+ vcpu: "vcpu",
1008
+ memory: "memory",
1009
+ disk: "disk",
1010
+ environmentVariables: "environment_variables",
1011
+ labels: "labels",
1012
+ network: "network",
1013
+ command: "command",
1014
+ entrypoint: "entrypoint",
1015
+ dns: "dns",
1016
+ ports: "ports",
1017
+ checks: "checks",
1018
+ }),
1019
+ ),
1020
+ durableObjects: Schema.optional(
1021
+ Schema.Struct({
1022
+ namespaceId: Schema.String,
1023
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
1024
+ ),
1025
+ instances: Schema.optional(Schema.Number),
1026
+ schedulingPolicy: Schema.optional(
1027
+ Schema.Literals(["moon", "gpu", "regional", "fill_metals", "default"]),
1028
+ ),
1029
+ constraints: Schema.optional(
1030
+ Schema.Struct({
1031
+ tier: Schema.optional(Schema.Number),
1032
+ }),
1033
+ ),
1034
+ affinities: Schema.optional(
1035
+ Schema.Struct({
1036
+ colocation: Schema.optional(Schema.Literal("datacenter")),
1037
+ }),
1038
+ ),
1039
+ }).pipe(
1040
+ Schema.encodeKeys({
1041
+ name: "name",
1042
+ maxInstances: "max_instances",
1043
+ configuration: "configuration",
1044
+ durableObjects: "durable_objects",
1045
+ instances: "instances",
1046
+ schedulingPolicy: "scheduling_policy",
1047
+ constraints: "constraints",
1048
+ affinities: "affinities",
1049
+ }),
1050
+ T.Http({
1051
+ method: "POST",
1052
+ path: "/accounts/{account_id}/containers/applications",
1053
+ }),
1054
+ ) as unknown as Schema.Schema<CreateContainerApplicationRequest>;
1055
+
1056
+ export interface CreateContainerApplicationResponse {
1057
+ id: string;
1058
+ accountId: string;
1059
+ name: string;
1060
+ schedulingPolicy: "moon" | "gpu" | "regional" | "fill_metals" | "default";
1061
+ instances: number;
1062
+ maxInstances: number;
1063
+ constraints: { tier?: number | null };
1064
+ affinities?: { colocation?: "datacenter" | null } | null;
1065
+ configuration: {
1066
+ image: string;
1067
+ instanceType?:
1068
+ | "lite"
1069
+ | "dev"
1070
+ | "basic"
1071
+ | "standard"
1072
+ | "standard-1"
1073
+ | "standard-2"
1074
+ | "standard-3"
1075
+ | "standard-4"
1076
+ | null;
1077
+ observability?: { logs?: { enabled: boolean } | null } | null;
1078
+ sshPublicKeyIds?: string[] | null;
1079
+ secrets?: { name: string; type: "env"; secret: string }[] | null;
1080
+ vcpu?: number | null;
1081
+ memory?: string | null;
1082
+ disk?: { size: string } | null;
1083
+ environmentVariables?: { name: string; value: string }[] | null;
1084
+ labels?: { name: string; value: string }[] | null;
1085
+ network?: {
1086
+ assignIpv4?: "none" | "predefined" | "account" | null;
1087
+ assignIpv6?: "none" | "predefined" | "account" | null;
1088
+ mode?: "public" | "private" | null;
1089
+ } | null;
1090
+ command?: string[] | null;
1091
+ entrypoint?: string[] | null;
1092
+ dns?: { servers?: string[] | null; searches?: string[] | null } | null;
1093
+ ports?: { name: string; port?: number | null }[] | null;
1094
+ checks?:
1095
+ | {
1096
+ name?: string | null;
1097
+ type: "http" | "tcp";
1098
+ tls?: boolean | null;
1099
+ port: string;
1100
+ http?: {
1101
+ method?:
1102
+ | "GET"
1103
+ | "POST"
1104
+ | "PUT"
1105
+ | "PATCH"
1106
+ | "DELETE"
1107
+ | "OPTIONS"
1108
+ | "HEAD"
1109
+ | null;
1110
+ body?: string | null;
1111
+ path?: string | null;
1112
+ headers?: unknown | null;
1113
+ } | null;
1114
+ interval: string;
1115
+ timeout: string;
1116
+ retries?: number | null;
1117
+ kind: "health" | "ready";
1118
+ }[]
1119
+ | null;
1120
+ };
1121
+ durableObjects?: { namespaceId: string } | null;
1122
+ createdAt: string;
1123
+ version: number;
1124
+ durableObjectNamespaceId?: string | null;
1125
+ health: { instances: unknown };
1126
+ }
1127
+
1128
+ export const CreateContainerApplicationResponse =
1129
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1130
+ id: Schema.String,
1131
+ accountId: Schema.String,
1132
+ name: Schema.String,
1133
+ schedulingPolicy: Schema.Literals([
1134
+ "moon",
1135
+ "gpu",
1136
+ "regional",
1137
+ "fill_metals",
1138
+ "default",
1139
+ ]),
1140
+ instances: Schema.Number,
1141
+ maxInstances: Schema.Number,
1142
+ constraints: Schema.Struct({
1143
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1144
+ }),
1145
+ affinities: Schema.optional(
1146
+ Schema.Union([
1147
+ Schema.Struct({
1148
+ colocation: Schema.optional(
1149
+ Schema.Union([Schema.Literal("datacenter"), Schema.Null]),
1150
+ ),
1151
+ }),
1152
+ Schema.Null,
1153
+ ]),
1154
+ ),
1155
+ configuration: Schema.Struct({
1156
+ image: Schema.String,
1157
+ instanceType: Schema.optional(
1158
+ Schema.Union([
1159
+ Schema.Literals([
1160
+ "lite",
1161
+ "dev",
1162
+ "basic",
1163
+ "standard",
1164
+ "standard-1",
1165
+ "standard-2",
1166
+ "standard-3",
1167
+ "standard-4",
1168
+ ]),
1169
+ Schema.Null,
1170
+ ]),
1171
+ ),
1172
+ observability: Schema.optional(
1173
+ Schema.Union([
1174
+ Schema.Struct({
1175
+ logs: Schema.optional(
1176
+ Schema.Union([
1177
+ Schema.Struct({
1178
+ enabled: Schema.Boolean,
1179
+ }),
1180
+ Schema.Null,
1181
+ ]),
1182
+ ),
1183
+ }),
1184
+ Schema.Null,
1185
+ ]),
1186
+ ),
1187
+ sshPublicKeyIds: Schema.optional(
1188
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1189
+ ),
1190
+ secrets: Schema.optional(
1191
+ Schema.Union([
1192
+ Schema.Array(
1193
+ Schema.Struct({
1194
+ name: Schema.String,
1195
+ type: Schema.Literal("env"),
1196
+ secret: SensitiveString,
1197
+ }),
1198
+ ),
1199
+ Schema.Null,
1200
+ ]),
1201
+ ),
1202
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1203
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1204
+ disk: Schema.optional(
1205
+ Schema.Union([
1206
+ Schema.Struct({
1207
+ size: Schema.String,
1208
+ }),
1209
+ Schema.Null,
1210
+ ]),
1211
+ ),
1212
+ environmentVariables: Schema.optional(
1213
+ Schema.Union([
1214
+ Schema.Array(
1215
+ Schema.Struct({
1216
+ name: Schema.String,
1217
+ value: Schema.String,
1218
+ }),
1219
+ ),
1220
+ Schema.Null,
1221
+ ]),
1222
+ ),
1223
+ labels: Schema.optional(
1224
+ Schema.Union([
1225
+ Schema.Array(
1226
+ Schema.Struct({
1227
+ name: Schema.String,
1228
+ value: Schema.String,
1229
+ }),
1230
+ ),
1231
+ Schema.Null,
1232
+ ]),
1233
+ ),
1234
+ network: Schema.optional(
1235
+ Schema.Union([
1236
+ Schema.Struct({
1237
+ assignIpv4: Schema.optional(
1238
+ Schema.Union([
1239
+ Schema.Literals(["none", "predefined", "account"]),
1240
+ Schema.Null,
1241
+ ]),
1242
+ ),
1243
+ assignIpv6: Schema.optional(
1244
+ Schema.Union([
1245
+ Schema.Literals(["none", "predefined", "account"]),
1246
+ Schema.Null,
1247
+ ]),
1248
+ ),
1249
+ mode: Schema.optional(
1250
+ Schema.Union([
1251
+ Schema.Literals(["public", "private"]),
1252
+ Schema.Null,
1253
+ ]),
1254
+ ),
1255
+ }).pipe(
1256
+ Schema.encodeKeys({
1257
+ assignIpv4: "assign_ipv4",
1258
+ assignIpv6: "assign_ipv6",
1259
+ mode: "mode",
1260
+ }),
1261
+ ),
1262
+ Schema.Null,
1263
+ ]),
1264
+ ),
1265
+ command: Schema.optional(
1266
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1267
+ ),
1268
+ entrypoint: Schema.optional(
1269
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1270
+ ),
1271
+ dns: Schema.optional(
1272
+ Schema.Union([
1273
+ Schema.Struct({
1274
+ servers: Schema.optional(
1275
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1276
+ ),
1277
+ searches: Schema.optional(
1278
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1279
+ ),
1280
+ }),
1281
+ Schema.Null,
1282
+ ]),
1283
+ ),
1284
+ ports: Schema.optional(
1285
+ Schema.Union([
1286
+ Schema.Array(
1287
+ Schema.Struct({
1288
+ name: Schema.String,
1289
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1290
+ }),
1291
+ ),
1292
+ Schema.Null,
1293
+ ]),
1294
+ ),
1295
+ checks: Schema.optional(
1296
+ Schema.Union([
1297
+ Schema.Array(
1298
+ Schema.Struct({
1299
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1300
+ type: Schema.Literals(["http", "tcp"]),
1301
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1302
+ port: Schema.String,
1303
+ http: Schema.optional(
1304
+ Schema.Union([
1305
+ Schema.Struct({
1306
+ method: Schema.optional(
1307
+ Schema.Union([
1308
+ Schema.Literals([
1309
+ "GET",
1310
+ "POST",
1311
+ "PUT",
1312
+ "PATCH",
1313
+ "DELETE",
1314
+ "OPTIONS",
1315
+ "HEAD",
1316
+ ]),
1317
+ Schema.Null,
1318
+ ]),
1319
+ ),
1320
+ body: Schema.optional(
1321
+ Schema.Union([Schema.String, Schema.Null]),
1322
+ ),
1323
+ path: Schema.optional(
1324
+ Schema.Union([Schema.String, Schema.Null]),
1325
+ ),
1326
+ headers: Schema.optional(
1327
+ Schema.Union([Schema.Unknown, Schema.Null]),
1328
+ ),
1329
+ }),
1330
+ Schema.Null,
1331
+ ]),
1332
+ ),
1333
+ interval: Schema.String,
1334
+ timeout: Schema.String,
1335
+ retries: Schema.optional(
1336
+ Schema.Union([Schema.Number, Schema.Null]),
1337
+ ),
1338
+ kind: Schema.Literals(["health", "ready"]),
1339
+ }),
1340
+ ),
1341
+ Schema.Null,
1342
+ ]),
1343
+ ),
1344
+ }).pipe(
1345
+ Schema.encodeKeys({
1346
+ image: "image",
1347
+ instanceType: "instance_type",
1348
+ observability: "observability",
1349
+ sshPublicKeyIds: "ssh_public_key_ids",
1350
+ secrets: "secrets",
1351
+ vcpu: "vcpu",
1352
+ memory: "memory",
1353
+ disk: "disk",
1354
+ environmentVariables: "environment_variables",
1355
+ labels: "labels",
1356
+ network: "network",
1357
+ command: "command",
1358
+ entrypoint: "entrypoint",
1359
+ dns: "dns",
1360
+ ports: "ports",
1361
+ checks: "checks",
1362
+ }),
1363
+ ),
1364
+ durableObjects: Schema.optional(
1365
+ Schema.Union([
1366
+ Schema.Struct({
1367
+ namespaceId: Schema.String,
1368
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
1369
+ Schema.Null,
1370
+ ]),
1371
+ ),
1372
+ createdAt: Schema.String,
1373
+ version: Schema.Number,
1374
+ durableObjectNamespaceId: Schema.optional(
1375
+ Schema.Union([Schema.String, Schema.Null]),
1376
+ ),
1377
+ health: Schema.Struct({
1378
+ instances: Schema.Unknown,
1379
+ }),
1380
+ })
1381
+ .pipe(
1382
+ Schema.encodeKeys({
1383
+ id: "id",
1384
+ accountId: "account_id",
1385
+ name: "name",
1386
+ schedulingPolicy: "scheduling_policy",
1387
+ instances: "instances",
1388
+ maxInstances: "max_instances",
1389
+ constraints: "constraints",
1390
+ affinities: "affinities",
1391
+ configuration: "configuration",
1392
+ durableObjects: "durable_objects",
1393
+ createdAt: "created_at",
1394
+ version: "version",
1395
+ durableObjectNamespaceId: "durable_object_namespace_id",
1396
+ health: "health",
1397
+ }),
1398
+ )
1399
+ .pipe(
1400
+ T.ResponsePath("result"),
1401
+ ) as unknown as Schema.Schema<CreateContainerApplicationResponse>;
1402
+
1403
+ export type CreateContainerApplicationError =
1404
+ | DefaultErrors
1405
+ | InvalidRoute
1406
+ | DurableObjectAlreadyHasApplication;
1407
+
1408
+ export const createContainerApplication: API.OperationMethod<
1409
+ CreateContainerApplicationRequest,
1410
+ CreateContainerApplicationResponse,
1411
+ CreateContainerApplicationError,
1412
+ Credentials | HttpClient.HttpClient
1413
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1414
+ input: CreateContainerApplicationRequest,
1415
+ output: CreateContainerApplicationResponse,
1416
+ errors: [InvalidRoute, DurableObjectAlreadyHasApplication],
1417
+ }));
1418
+
1419
+ export interface UpdateContainerApplicationRequest {
1420
+ accountId: string;
1421
+ applicationId: string;
1422
+ instances?: number;
1423
+ maxInstances?: number;
1424
+ affinities?: { colocation?: "datacenter" };
1425
+ schedulingPolicy?: "moon" | "gpu" | "regional" | "fill_metals" | "default";
1426
+ constraints?: {
1427
+ tier?: number;
1428
+ region?:
1429
+ | "AFR"
1430
+ | "APAC"
1431
+ | "EEUR"
1432
+ | "ENAM"
1433
+ | "WNAM"
1434
+ | "ME"
1435
+ | "OC"
1436
+ | "SAM"
1437
+ | "WEUR";
1438
+ regions?: (
1439
+ | "AFR"
1440
+ | "APAC"
1441
+ | "EEUR"
1442
+ | "ENAM"
1443
+ | "WNAM"
1444
+ | "ME"
1445
+ | "OC"
1446
+ | "SAM"
1447
+ | "WEUR"
1448
+ )[];
1449
+ cities?: (
1450
+ | "AFR"
1451
+ | "APAC"
1452
+ | "EEUR"
1453
+ | "ENAM"
1454
+ | "WNAM"
1455
+ | "ME"
1456
+ | "OC"
1457
+ | "SAM"
1458
+ | "WEUR"
1459
+ )[];
1460
+ };
1461
+ configuration?: {
1462
+ image: string;
1463
+ instanceType?:
1464
+ | "lite"
1465
+ | "dev"
1466
+ | "basic"
1467
+ | "standard"
1468
+ | "standard-1"
1469
+ | "standard-2"
1470
+ | "standard-3"
1471
+ | "standard-4";
1472
+ observability?: { logs?: { enabled: boolean } };
1473
+ sshPublicKeyIds?: string[];
1474
+ secrets?: { name: string; type: "env"; secret: string }[];
1475
+ vcpu?: number;
1476
+ memory?: string;
1477
+ disk?: { size: string };
1478
+ environmentVariables?: { name: string; value: string }[];
1479
+ labels?: { name: string; value: string }[];
1480
+ network?: {
1481
+ assignIpv4?: "none" | "predefined" | "account";
1482
+ assignIpv6?: "none" | "predefined" | "account";
1483
+ mode?: "public" | "private";
1484
+ };
1485
+ command?: string[];
1486
+ entrypoint?: string[];
1487
+ dns?: { servers?: string[]; searches?: string[] };
1488
+ ports?: { name: string; port?: number }[];
1489
+ checks?: {
1490
+ name?: string;
1491
+ type: "http" | "tcp";
1492
+ tls?: boolean;
1493
+ port: string;
1494
+ http?: {
1495
+ method?:
1496
+ | "GET"
1497
+ | "POST"
1498
+ | "PUT"
1499
+ | "PATCH"
1500
+ | "DELETE"
1501
+ | "OPTIONS"
1502
+ | "HEAD";
1503
+ body?: string;
1504
+ path?: string;
1505
+ headers?: unknown;
1506
+ };
1507
+ interval: string;
1508
+ timeout: string;
1509
+ retries?: number;
1510
+ kind: "health" | "ready";
1511
+ }[];
1512
+ };
1513
+ }
1514
+
1515
+ export const UpdateContainerApplicationRequest =
1516
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1517
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1518
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
1519
+ instances: Schema.optional(Schema.Number),
1520
+ maxInstances: Schema.optional(Schema.Number),
1521
+ affinities: Schema.optional(
1522
+ Schema.Struct({
1523
+ colocation: Schema.optional(Schema.Literal("datacenter")),
1524
+ }),
1525
+ ),
1526
+ schedulingPolicy: Schema.optional(
1527
+ Schema.Literals(["moon", "gpu", "regional", "fill_metals", "default"]),
1528
+ ),
1529
+ constraints: Schema.optional(
1530
+ Schema.Struct({
1531
+ tier: Schema.optional(Schema.Number),
1532
+ region: Schema.optional(
1533
+ Schema.Literals([
1534
+ "AFR",
1535
+ "APAC",
1536
+ "EEUR",
1537
+ "ENAM",
1538
+ "WNAM",
1539
+ "ME",
1540
+ "OC",
1541
+ "SAM",
1542
+ "WEUR",
1543
+ ]),
1544
+ ),
1545
+ regions: Schema.optional(
1546
+ Schema.Array(
1547
+ Schema.Literals([
1548
+ "AFR",
1549
+ "APAC",
1550
+ "EEUR",
1551
+ "ENAM",
1552
+ "WNAM",
1553
+ "ME",
1554
+ "OC",
1555
+ "SAM",
1556
+ "WEUR",
1557
+ ]),
1558
+ ),
1559
+ ),
1560
+ cities: Schema.optional(
1561
+ Schema.Array(
1562
+ Schema.Literals([
1563
+ "AFR",
1564
+ "APAC",
1565
+ "EEUR",
1566
+ "ENAM",
1567
+ "WNAM",
1568
+ "ME",
1569
+ "OC",
1570
+ "SAM",
1571
+ "WEUR",
1572
+ ]),
1573
+ ),
1574
+ ),
1575
+ }),
1576
+ ),
1577
+ configuration: Schema.optional(
1578
+ Schema.Struct({
1579
+ image: Schema.String,
1580
+ instanceType: Schema.optional(
1581
+ Schema.Literals([
1582
+ "lite",
1583
+ "dev",
1584
+ "basic",
1585
+ "standard",
1586
+ "standard-1",
1587
+ "standard-2",
1588
+ "standard-3",
1589
+ "standard-4",
1590
+ ]),
1591
+ ),
1592
+ observability: Schema.optional(
1593
+ Schema.Struct({
1594
+ logs: Schema.optional(
1595
+ Schema.Struct({
1596
+ enabled: Schema.Boolean,
1597
+ }),
1598
+ ),
1599
+ }),
1600
+ ),
1601
+ sshPublicKeyIds: Schema.optional(Schema.Array(Schema.String)),
1602
+ secrets: Schema.optional(
1603
+ Schema.Array(
1604
+ Schema.Struct({
1605
+ name: Schema.String,
1606
+ type: Schema.Literal("env"),
1607
+ secret: SensitiveString,
1608
+ }),
1609
+ ),
1610
+ ),
1611
+ vcpu: Schema.optional(Schema.Number),
1612
+ memory: Schema.optional(Schema.String),
1613
+ disk: Schema.optional(
1614
+ Schema.Struct({
1615
+ size: Schema.String,
1616
+ }),
1617
+ ),
1618
+ environmentVariables: Schema.optional(
1619
+ Schema.Array(
1620
+ Schema.Struct({
1621
+ name: Schema.String,
1622
+ value: Schema.String,
1623
+ }),
1624
+ ),
1625
+ ),
1626
+ labels: Schema.optional(
1627
+ Schema.Array(
1628
+ Schema.Struct({
1629
+ name: Schema.String,
1630
+ value: Schema.String,
1631
+ }),
1632
+ ),
1633
+ ),
1634
+ network: Schema.optional(
1635
+ Schema.Struct({
1636
+ assignIpv4: Schema.optional(
1637
+ Schema.Literals(["none", "predefined", "account"]),
1638
+ ),
1639
+ assignIpv6: Schema.optional(
1640
+ Schema.Literals(["none", "predefined", "account"]),
1641
+ ),
1642
+ mode: Schema.optional(Schema.Literals(["public", "private"])),
1643
+ }).pipe(
1644
+ Schema.encodeKeys({
1645
+ assignIpv4: "assign_ipv4",
1646
+ assignIpv6: "assign_ipv6",
1647
+ mode: "mode",
1648
+ }),
1649
+ ),
1650
+ ),
1651
+ command: Schema.optional(Schema.Array(Schema.String)),
1652
+ entrypoint: Schema.optional(Schema.Array(Schema.String)),
1653
+ dns: Schema.optional(
1654
+ Schema.Struct({
1655
+ servers: Schema.optional(Schema.Array(Schema.String)),
1656
+ searches: Schema.optional(Schema.Array(Schema.String)),
1657
+ }),
1658
+ ),
1659
+ ports: Schema.optional(
1660
+ Schema.Array(
1661
+ Schema.Struct({
1662
+ name: Schema.String,
1663
+ port: Schema.optional(Schema.Number),
1664
+ }),
1665
+ ),
1666
+ ),
1667
+ checks: Schema.optional(
1668
+ Schema.Array(
1669
+ Schema.Struct({
1670
+ name: Schema.optional(Schema.String),
1671
+ type: Schema.Literals(["http", "tcp"]),
1672
+ tls: Schema.optional(Schema.Boolean),
1673
+ port: Schema.String,
1674
+ http: Schema.optional(
1675
+ Schema.Struct({
1676
+ method: Schema.optional(
1677
+ Schema.Literals([
1678
+ "GET",
1679
+ "POST",
1680
+ "PUT",
1681
+ "PATCH",
1682
+ "DELETE",
1683
+ "OPTIONS",
1684
+ "HEAD",
1685
+ ]),
1686
+ ),
1687
+ body: Schema.optional(Schema.String),
1688
+ path: Schema.optional(Schema.String),
1689
+ headers: Schema.optional(Schema.Unknown),
1690
+ }),
1691
+ ),
1692
+ interval: Schema.String,
1693
+ timeout: Schema.String,
1694
+ retries: Schema.optional(Schema.Number),
1695
+ kind: Schema.Literals(["health", "ready"]),
1696
+ }),
1697
+ ),
1698
+ ),
1699
+ }).pipe(
1700
+ Schema.encodeKeys({
1701
+ image: "image",
1702
+ instanceType: "instance_type",
1703
+ observability: "observability",
1704
+ sshPublicKeyIds: "ssh_public_key_ids",
1705
+ secrets: "secrets",
1706
+ vcpu: "vcpu",
1707
+ memory: "memory",
1708
+ disk: "disk",
1709
+ environmentVariables: "environment_variables",
1710
+ labels: "labels",
1711
+ network: "network",
1712
+ command: "command",
1713
+ entrypoint: "entrypoint",
1714
+ dns: "dns",
1715
+ ports: "ports",
1716
+ checks: "checks",
1717
+ }),
1718
+ ),
1719
+ ),
1720
+ }).pipe(
1721
+ Schema.encodeKeys({
1722
+ instances: "instances",
1723
+ maxInstances: "max_instances",
1724
+ affinities: "affinities",
1725
+ schedulingPolicy: "scheduling_policy",
1726
+ constraints: "constraints",
1727
+ configuration: "configuration",
1728
+ }),
1729
+ T.Http({
1730
+ method: "PATCH",
1731
+ path: "/accounts/{account_id}/containers/applications/{application_id}",
1732
+ }),
1733
+ ) as unknown as Schema.Schema<UpdateContainerApplicationRequest>;
1734
+
1735
+ export interface UpdateContainerApplicationResponse {
1736
+ id: string;
1737
+ accountId: string;
1738
+ name: string;
1739
+ schedulingPolicy: "moon" | "gpu" | "regional" | "fill_metals" | "default";
1740
+ instances: number;
1741
+ maxInstances: number;
1742
+ constraints: { tier?: number | null };
1743
+ affinities?: { colocation?: "datacenter" | null } | null;
1744
+ configuration: {
1745
+ image: string;
1746
+ instanceType?:
1747
+ | "lite"
1748
+ | "dev"
1749
+ | "basic"
1750
+ | "standard"
1751
+ | "standard-1"
1752
+ | "standard-2"
1753
+ | "standard-3"
1754
+ | "standard-4"
1755
+ | null;
1756
+ observability?: { logs?: { enabled: boolean } | null } | null;
1757
+ sshPublicKeyIds?: string[] | null;
1758
+ secrets?: { name: string; type: "env"; secret: string }[] | null;
1759
+ vcpu?: number | null;
1760
+ memory?: string | null;
1761
+ disk?: { size: string } | null;
1762
+ environmentVariables?: { name: string; value: string }[] | null;
1763
+ labels?: { name: string; value: string }[] | null;
1764
+ network?: {
1765
+ assignIpv4?: "none" | "predefined" | "account" | null;
1766
+ assignIpv6?: "none" | "predefined" | "account" | null;
1767
+ mode?: "public" | "private" | null;
1768
+ } | null;
1769
+ command?: string[] | null;
1770
+ entrypoint?: string[] | null;
1771
+ dns?: { servers?: string[] | null; searches?: string[] | null } | null;
1772
+ ports?: { name: string; port?: number | null }[] | null;
1773
+ checks?:
1774
+ | {
1775
+ name?: string | null;
1776
+ type: "http" | "tcp";
1777
+ tls?: boolean | null;
1778
+ port: string;
1779
+ http?: {
1780
+ method?:
1781
+ | "GET"
1782
+ | "POST"
1783
+ | "PUT"
1784
+ | "PATCH"
1785
+ | "DELETE"
1786
+ | "OPTIONS"
1787
+ | "HEAD"
1788
+ | null;
1789
+ body?: string | null;
1790
+ path?: string | null;
1791
+ headers?: unknown | null;
1792
+ } | null;
1793
+ interval: string;
1794
+ timeout: string;
1795
+ retries?: number | null;
1796
+ kind: "health" | "ready";
1797
+ }[]
1798
+ | null;
1799
+ };
1800
+ durableObjects?: { namespaceId: string } | null;
1801
+ createdAt: string;
1802
+ version: number;
1803
+ durableObjectNamespaceId?: string | null;
1804
+ health: { instances: unknown };
1805
+ }
1806
+
1807
+ export const UpdateContainerApplicationResponse =
1808
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1809
+ id: Schema.String,
1810
+ accountId: Schema.String,
1811
+ name: Schema.String,
1812
+ schedulingPolicy: Schema.Literals([
1813
+ "moon",
1814
+ "gpu",
1815
+ "regional",
1816
+ "fill_metals",
1817
+ "default",
1818
+ ]),
1819
+ instances: Schema.Number,
1820
+ maxInstances: Schema.Number,
1821
+ constraints: Schema.Struct({
1822
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1823
+ }),
1824
+ affinities: Schema.optional(
1825
+ Schema.Union([
1826
+ Schema.Struct({
1827
+ colocation: Schema.optional(
1828
+ Schema.Union([Schema.Literal("datacenter"), Schema.Null]),
1829
+ ),
1830
+ }),
1831
+ Schema.Null,
1832
+ ]),
1833
+ ),
1834
+ configuration: Schema.Struct({
1835
+ image: Schema.String,
1836
+ instanceType: Schema.optional(
1837
+ Schema.Union([
1838
+ Schema.Literals([
1839
+ "lite",
1840
+ "dev",
1841
+ "basic",
1842
+ "standard",
1843
+ "standard-1",
1844
+ "standard-2",
1845
+ "standard-3",
1846
+ "standard-4",
1847
+ ]),
1848
+ Schema.Null,
1849
+ ]),
1850
+ ),
1851
+ observability: Schema.optional(
1852
+ Schema.Union([
1853
+ Schema.Struct({
1854
+ logs: Schema.optional(
1855
+ Schema.Union([
1856
+ Schema.Struct({
1857
+ enabled: Schema.Boolean,
1858
+ }),
1859
+ Schema.Null,
1860
+ ]),
1861
+ ),
1862
+ }),
1863
+ Schema.Null,
1864
+ ]),
1865
+ ),
1866
+ sshPublicKeyIds: Schema.optional(
1867
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1868
+ ),
1869
+ secrets: Schema.optional(
1870
+ Schema.Union([
1871
+ Schema.Array(
1872
+ Schema.Struct({
1873
+ name: Schema.String,
1874
+ type: Schema.Literal("env"),
1875
+ secret: SensitiveString,
1876
+ }),
1877
+ ),
1878
+ Schema.Null,
1879
+ ]),
1880
+ ),
1881
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1882
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1883
+ disk: Schema.optional(
1884
+ Schema.Union([
1885
+ Schema.Struct({
1886
+ size: Schema.String,
1887
+ }),
1888
+ Schema.Null,
1889
+ ]),
1890
+ ),
1891
+ environmentVariables: Schema.optional(
1892
+ Schema.Union([
1893
+ Schema.Array(
1894
+ Schema.Struct({
1895
+ name: Schema.String,
1896
+ value: Schema.String,
1897
+ }),
1898
+ ),
1899
+ Schema.Null,
1900
+ ]),
1901
+ ),
1902
+ labels: Schema.optional(
1903
+ Schema.Union([
1904
+ Schema.Array(
1905
+ Schema.Struct({
1906
+ name: Schema.String,
1907
+ value: Schema.String,
1908
+ }),
1909
+ ),
1910
+ Schema.Null,
1911
+ ]),
1912
+ ),
1913
+ network: Schema.optional(
1914
+ Schema.Union([
1915
+ Schema.Struct({
1916
+ assignIpv4: Schema.optional(
1917
+ Schema.Union([
1918
+ Schema.Literals(["none", "predefined", "account"]),
1919
+ Schema.Null,
1920
+ ]),
1921
+ ),
1922
+ assignIpv6: Schema.optional(
1923
+ Schema.Union([
1924
+ Schema.Literals(["none", "predefined", "account"]),
1925
+ Schema.Null,
1926
+ ]),
1927
+ ),
1928
+ mode: Schema.optional(
1929
+ Schema.Union([
1930
+ Schema.Literals(["public", "private"]),
1931
+ Schema.Null,
1932
+ ]),
1933
+ ),
1934
+ }).pipe(
1935
+ Schema.encodeKeys({
1936
+ assignIpv4: "assign_ipv4",
1937
+ assignIpv6: "assign_ipv6",
1938
+ mode: "mode",
1939
+ }),
1940
+ ),
1941
+ Schema.Null,
1942
+ ]),
1943
+ ),
1944
+ command: Schema.optional(
1945
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1946
+ ),
1947
+ entrypoint: Schema.optional(
1948
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1949
+ ),
1950
+ dns: Schema.optional(
1951
+ Schema.Union([
1952
+ Schema.Struct({
1953
+ servers: Schema.optional(
1954
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1955
+ ),
1956
+ searches: Schema.optional(
1957
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1958
+ ),
1959
+ }),
1960
+ Schema.Null,
1961
+ ]),
1962
+ ),
1963
+ ports: Schema.optional(
1964
+ Schema.Union([
1965
+ Schema.Array(
1966
+ Schema.Struct({
1967
+ name: Schema.String,
1968
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1969
+ }),
1970
+ ),
1971
+ Schema.Null,
1972
+ ]),
1973
+ ),
1974
+ checks: Schema.optional(
1975
+ Schema.Union([
1976
+ Schema.Array(
1977
+ Schema.Struct({
1978
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1979
+ type: Schema.Literals(["http", "tcp"]),
1980
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1981
+ port: Schema.String,
1982
+ http: Schema.optional(
1983
+ Schema.Union([
1984
+ Schema.Struct({
1985
+ method: Schema.optional(
1986
+ Schema.Union([
1987
+ Schema.Literals([
1988
+ "GET",
1989
+ "POST",
1990
+ "PUT",
1991
+ "PATCH",
1992
+ "DELETE",
1993
+ "OPTIONS",
1994
+ "HEAD",
1995
+ ]),
1996
+ Schema.Null,
1997
+ ]),
1998
+ ),
1999
+ body: Schema.optional(
2000
+ Schema.Union([Schema.String, Schema.Null]),
2001
+ ),
2002
+ path: Schema.optional(
2003
+ Schema.Union([Schema.String, Schema.Null]),
2004
+ ),
2005
+ headers: Schema.optional(
2006
+ Schema.Union([Schema.Unknown, Schema.Null]),
2007
+ ),
2008
+ }),
2009
+ Schema.Null,
2010
+ ]),
2011
+ ),
2012
+ interval: Schema.String,
2013
+ timeout: Schema.String,
2014
+ retries: Schema.optional(
2015
+ Schema.Union([Schema.Number, Schema.Null]),
2016
+ ),
2017
+ kind: Schema.Literals(["health", "ready"]),
2018
+ }),
2019
+ ),
2020
+ Schema.Null,
2021
+ ]),
2022
+ ),
2023
+ }).pipe(
2024
+ Schema.encodeKeys({
2025
+ image: "image",
2026
+ instanceType: "instance_type",
2027
+ observability: "observability",
2028
+ sshPublicKeyIds: "ssh_public_key_ids",
2029
+ secrets: "secrets",
2030
+ vcpu: "vcpu",
2031
+ memory: "memory",
2032
+ disk: "disk",
2033
+ environmentVariables: "environment_variables",
2034
+ labels: "labels",
2035
+ network: "network",
2036
+ command: "command",
2037
+ entrypoint: "entrypoint",
2038
+ dns: "dns",
2039
+ ports: "ports",
2040
+ checks: "checks",
2041
+ }),
2042
+ ),
2043
+ durableObjects: Schema.optional(
2044
+ Schema.Union([
2045
+ Schema.Struct({
2046
+ namespaceId: Schema.String,
2047
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
2048
+ Schema.Null,
2049
+ ]),
2050
+ ),
2051
+ createdAt: Schema.String,
2052
+ version: Schema.Number,
2053
+ durableObjectNamespaceId: Schema.optional(
2054
+ Schema.Union([Schema.String, Schema.Null]),
2055
+ ),
2056
+ health: Schema.Struct({
2057
+ instances: Schema.Unknown,
2058
+ }),
2059
+ })
2060
+ .pipe(
2061
+ Schema.encodeKeys({
2062
+ id: "id",
2063
+ accountId: "account_id",
2064
+ name: "name",
2065
+ schedulingPolicy: "scheduling_policy",
2066
+ instances: "instances",
2067
+ maxInstances: "max_instances",
2068
+ constraints: "constraints",
2069
+ affinities: "affinities",
2070
+ configuration: "configuration",
2071
+ durableObjects: "durable_objects",
2072
+ createdAt: "created_at",
2073
+ version: "version",
2074
+ durableObjectNamespaceId: "durable_object_namespace_id",
2075
+ health: "health",
2076
+ }),
2077
+ )
2078
+ .pipe(
2079
+ T.ResponsePath("result"),
2080
+ ) as unknown as Schema.Schema<UpdateContainerApplicationResponse>;
2081
+
2082
+ export type UpdateContainerApplicationError =
2083
+ | DefaultErrors
2084
+ | InvalidRoute
2085
+ | ContainerApplicationNotFound;
2086
+
2087
+ export const updateContainerApplication: API.OperationMethod<
2088
+ UpdateContainerApplicationRequest,
2089
+ UpdateContainerApplicationResponse,
2090
+ UpdateContainerApplicationError,
2091
+ Credentials | HttpClient.HttpClient
2092
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2093
+ input: UpdateContainerApplicationRequest,
2094
+ output: UpdateContainerApplicationResponse,
2095
+ errors: [InvalidRoute, ContainerApplicationNotFound],
2096
+ }));
2097
+
2098
+ export interface DeleteContainerApplicationRequest {
2099
+ accountId: string;
2100
+ applicationId: string;
2101
+ }
2102
+
2103
+ export const DeleteContainerApplicationRequest =
2104
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2105
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2106
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
2107
+ }).pipe(
2108
+ T.Http({
2109
+ method: "DELETE",
2110
+ path: "/accounts/{account_id}/containers/applications/{application_id}",
2111
+ }),
2112
+ ) as unknown as Schema.Schema<DeleteContainerApplicationRequest>;
2113
+
2114
+ export type DeleteContainerApplicationResponse = unknown;
2115
+
2116
+ export const DeleteContainerApplicationResponse =
2117
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(
2118
+ T.ResponsePath("result"),
2119
+ ) as unknown as Schema.Schema<DeleteContainerApplicationResponse>;
2120
+
2121
+ export type DeleteContainerApplicationError =
2122
+ | DefaultErrors
2123
+ | InvalidRoute
2124
+ | ContainerApplicationNotFound;
2125
+
2126
+ export const deleteContainerApplication: API.OperationMethod<
2127
+ DeleteContainerApplicationRequest,
2128
+ DeleteContainerApplicationResponse,
2129
+ DeleteContainerApplicationError,
2130
+ Credentials | HttpClient.HttpClient
2131
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2132
+ input: DeleteContainerApplicationRequest,
2133
+ output: DeleteContainerApplicationResponse,
2134
+ errors: [InvalidRoute, ContainerApplicationNotFound],
2135
+ }));
2136
+
2137
+ // =============================================================================
2138
+ // ContainerApplicationRollout
2139
+ // =============================================================================
2140
+
2141
+ export interface CreateContainerApplicationRolloutRequest {
2142
+ accountId: string;
2143
+ applicationId: string;
2144
+ description: string;
2145
+ strategy: "rolling";
2146
+ kind?: "full_auto";
2147
+ stepPercentage: number;
2148
+ targetConfiguration: {
2149
+ image: string;
2150
+ instanceType?:
2151
+ | "lite"
2152
+ | "dev"
2153
+ | "basic"
2154
+ | "standard"
2155
+ | "standard-1"
2156
+ | "standard-2"
2157
+ | "standard-3"
2158
+ | "standard-4";
2159
+ observability?: { logs?: { enabled: boolean } };
2160
+ sshPublicKeyIds?: string[];
2161
+ secrets?: { name: string; type: "env"; secret: string }[];
2162
+ vcpu?: number;
2163
+ memory?: string;
2164
+ disk?: { size: string };
2165
+ environmentVariables?: { name: string; value: string }[];
2166
+ labels?: { name: string; value: string }[];
2167
+ network?: {
2168
+ assignIpv4?: "none" | "predefined" | "account";
2169
+ assignIpv6?: "none" | "predefined" | "account";
2170
+ mode?: "public" | "private";
2171
+ };
2172
+ command?: string[];
2173
+ entrypoint?: string[];
2174
+ dns?: { servers?: string[]; searches?: string[] };
2175
+ ports?: { name: string; port?: number }[];
2176
+ checks?: {
2177
+ name?: string;
2178
+ type: "http" | "tcp";
2179
+ tls?: boolean;
2180
+ port: string;
2181
+ http?: {
2182
+ method?:
2183
+ | "GET"
2184
+ | "POST"
2185
+ | "PUT"
2186
+ | "PATCH"
2187
+ | "DELETE"
2188
+ | "OPTIONS"
2189
+ | "HEAD";
2190
+ body?: string;
2191
+ path?: string;
2192
+ headers?: unknown;
2193
+ };
2194
+ interval: string;
2195
+ timeout: string;
2196
+ retries?: number;
2197
+ kind: "health" | "ready";
2198
+ }[];
2199
+ };
2200
+ }
2201
+
2202
+ export const CreateContainerApplicationRolloutRequest =
2203
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2204
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2205
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
2206
+ description: Schema.String,
2207
+ strategy: Schema.Literal("rolling"),
2208
+ kind: Schema.optional(Schema.Literal("full_auto")),
2209
+ stepPercentage: Schema.Number,
2210
+ targetConfiguration: Schema.Struct({
2211
+ image: Schema.String,
2212
+ instanceType: Schema.optional(
2213
+ Schema.Literals([
2214
+ "lite",
2215
+ "dev",
2216
+ "basic",
2217
+ "standard",
2218
+ "standard-1",
2219
+ "standard-2",
2220
+ "standard-3",
2221
+ "standard-4",
2222
+ ]),
2223
+ ),
2224
+ observability: Schema.optional(
2225
+ Schema.Struct({
2226
+ logs: Schema.optional(
2227
+ Schema.Struct({
2228
+ enabled: Schema.Boolean,
2229
+ }),
2230
+ ),
2231
+ }),
2232
+ ),
2233
+ sshPublicKeyIds: Schema.optional(Schema.Array(Schema.String)),
2234
+ secrets: Schema.optional(
2235
+ Schema.Array(
2236
+ Schema.Struct({
2237
+ name: Schema.String,
2238
+ type: Schema.Literal("env"),
2239
+ secret: SensitiveString,
2240
+ }),
2241
+ ),
2242
+ ),
2243
+ vcpu: Schema.optional(Schema.Number),
2244
+ memory: Schema.optional(Schema.String),
2245
+ disk: Schema.optional(
2246
+ Schema.Struct({
2247
+ size: Schema.String,
2248
+ }),
2249
+ ),
2250
+ environmentVariables: Schema.optional(
2251
+ Schema.Array(
2252
+ Schema.Struct({
2253
+ name: Schema.String,
2254
+ value: Schema.String,
2255
+ }),
2256
+ ),
2257
+ ),
2258
+ labels: Schema.optional(
2259
+ Schema.Array(
2260
+ Schema.Struct({
2261
+ name: Schema.String,
2262
+ value: Schema.String,
2263
+ }),
2264
+ ),
2265
+ ),
2266
+ network: Schema.optional(
2267
+ Schema.Struct({
2268
+ assignIpv4: Schema.optional(
2269
+ Schema.Literals(["none", "predefined", "account"]),
2270
+ ),
2271
+ assignIpv6: Schema.optional(
2272
+ Schema.Literals(["none", "predefined", "account"]),
2273
+ ),
2274
+ mode: Schema.optional(Schema.Literals(["public", "private"])),
2275
+ }).pipe(
2276
+ Schema.encodeKeys({
2277
+ assignIpv4: "assign_ipv4",
2278
+ assignIpv6: "assign_ipv6",
2279
+ mode: "mode",
2280
+ }),
2281
+ ),
2282
+ ),
2283
+ command: Schema.optional(Schema.Array(Schema.String)),
2284
+ entrypoint: Schema.optional(Schema.Array(Schema.String)),
2285
+ dns: Schema.optional(
2286
+ Schema.Struct({
2287
+ servers: Schema.optional(Schema.Array(Schema.String)),
2288
+ searches: Schema.optional(Schema.Array(Schema.String)),
2289
+ }),
2290
+ ),
2291
+ ports: Schema.optional(
2292
+ Schema.Array(
2293
+ Schema.Struct({
2294
+ name: Schema.String,
2295
+ port: Schema.optional(Schema.Number),
2296
+ }),
2297
+ ),
2298
+ ),
2299
+ checks: Schema.optional(
2300
+ Schema.Array(
2301
+ Schema.Struct({
2302
+ name: Schema.optional(Schema.String),
2303
+ type: Schema.Literals(["http", "tcp"]),
2304
+ tls: Schema.optional(Schema.Boolean),
2305
+ port: Schema.String,
2306
+ http: Schema.optional(
2307
+ Schema.Struct({
2308
+ method: Schema.optional(
2309
+ Schema.Literals([
2310
+ "GET",
2311
+ "POST",
2312
+ "PUT",
2313
+ "PATCH",
2314
+ "DELETE",
2315
+ "OPTIONS",
2316
+ "HEAD",
2317
+ ]),
2318
+ ),
2319
+ body: Schema.optional(Schema.String),
2320
+ path: Schema.optional(Schema.String),
2321
+ headers: Schema.optional(Schema.Unknown),
2322
+ }),
2323
+ ),
2324
+ interval: Schema.String,
2325
+ timeout: Schema.String,
2326
+ retries: Schema.optional(Schema.Number),
2327
+ kind: Schema.Literals(["health", "ready"]),
2328
+ }),
2329
+ ),
2330
+ ),
2331
+ }).pipe(
2332
+ Schema.encodeKeys({
2333
+ image: "image",
2334
+ instanceType: "instance_type",
2335
+ observability: "observability",
2336
+ sshPublicKeyIds: "ssh_public_key_ids",
2337
+ secrets: "secrets",
2338
+ vcpu: "vcpu",
2339
+ memory: "memory",
2340
+ disk: "disk",
2341
+ environmentVariables: "environment_variables",
2342
+ labels: "labels",
2343
+ network: "network",
2344
+ command: "command",
2345
+ entrypoint: "entrypoint",
2346
+ dns: "dns",
2347
+ ports: "ports",
2348
+ checks: "checks",
2349
+ }),
2350
+ ),
2351
+ }).pipe(
2352
+ Schema.encodeKeys({
2353
+ description: "description",
2354
+ strategy: "strategy",
2355
+ kind: "kind",
2356
+ stepPercentage: "step_percentage",
2357
+ targetConfiguration: "target_configuration",
2358
+ }),
2359
+ T.Http({
2360
+ method: "POST",
2361
+ path: "/accounts/{account_id}/containers/applications/{application_id}/rollouts",
2362
+ }),
2363
+ ) as unknown as Schema.Schema<CreateContainerApplicationRolloutRequest>;
2364
+
2365
+ export interface CreateContainerApplicationRolloutResponse {
2366
+ id: string;
2367
+ createdAt: string;
2368
+ lastUpdatedAt: string;
2369
+ description: string;
2370
+ status: "progressing" | "completed" | "failed";
2371
+ health: {
2372
+ instances: {
2373
+ healthy: number;
2374
+ failed: number;
2375
+ starting: number;
2376
+ scheduling: number;
2377
+ };
2378
+ };
2379
+ kind: "full_auto";
2380
+ strategy: "rolling";
2381
+ currentConfiguration: {
2382
+ image: string;
2383
+ observability?: { logs?: { enabled: boolean } | null } | null;
2384
+ };
2385
+ targetConfiguration: {
2386
+ image: string;
2387
+ instanceType?:
2388
+ | "lite"
2389
+ | "dev"
2390
+ | "basic"
2391
+ | "standard"
2392
+ | "standard-1"
2393
+ | "standard-2"
2394
+ | "standard-3"
2395
+ | "standard-4"
2396
+ | null;
2397
+ observability?: { logs?: { enabled: boolean } | null } | null;
2398
+ sshPublicKeyIds?: string[] | null;
2399
+ secrets?: { name: string; type: "env"; secret: string }[] | null;
2400
+ vcpu?: number | null;
2401
+ memory?: string | null;
2402
+ disk?: { size: string } | null;
2403
+ environmentVariables?: { name: string; value: string }[] | null;
2404
+ labels?: { name: string; value: string }[] | null;
2405
+ network?: {
2406
+ assignIpv4?: "none" | "predefined" | "account" | null;
2407
+ assignIpv6?: "none" | "predefined" | "account" | null;
2408
+ mode?: "public" | "private" | null;
2409
+ } | null;
2410
+ command?: string[] | null;
2411
+ entrypoint?: string[] | null;
2412
+ dns?: { servers?: string[] | null; searches?: string[] | null } | null;
2413
+ ports?: { name: string; port?: number | null }[] | null;
2414
+ checks?:
2415
+ | {
2416
+ name?: string | null;
2417
+ type: "http" | "tcp";
2418
+ tls?: boolean | null;
2419
+ port: string;
2420
+ http?: {
2421
+ method?:
2422
+ | "GET"
2423
+ | "POST"
2424
+ | "PUT"
2425
+ | "PATCH"
2426
+ | "DELETE"
2427
+ | "OPTIONS"
2428
+ | "HEAD"
2429
+ | null;
2430
+ body?: string | null;
2431
+ path?: string | null;
2432
+ headers?: unknown | null;
2433
+ } | null;
2434
+ interval: string;
2435
+ timeout: string;
2436
+ retries?: number | null;
2437
+ kind: "health" | "ready";
2438
+ }[]
2439
+ | null;
2440
+ };
2441
+ currentVersion: number;
2442
+ targetVersion: number;
2443
+ steps: {
2444
+ id: number;
2445
+ status: "progressing" | "pending" | "completed" | "failed";
2446
+ stepSize: { percentage: number };
2447
+ description: string;
2448
+ startedAt?: string | null;
2449
+ }[];
2450
+ progress: {
2451
+ totalSteps: number;
2452
+ currentStep: number;
2453
+ updatedInstances: number;
2454
+ totalInstances: number;
2455
+ };
2456
+ }
2457
+
2458
+ export const CreateContainerApplicationRolloutResponse =
2459
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2460
+ id: Schema.String,
2461
+ createdAt: Schema.String,
2462
+ lastUpdatedAt: Schema.String,
2463
+ description: Schema.String,
2464
+ status: Schema.Literals(["progressing", "completed", "failed"]),
2465
+ health: Schema.Struct({
2466
+ instances: Schema.Struct({
2467
+ healthy: Schema.Number,
2468
+ failed: Schema.Number,
2469
+ starting: Schema.Number,
2470
+ scheduling: Schema.Number,
2471
+ }),
2472
+ }),
2473
+ kind: Schema.Literal("full_auto"),
2474
+ strategy: Schema.Literal("rolling"),
2475
+ currentConfiguration: Schema.Struct({
2476
+ image: Schema.String,
2477
+ observability: Schema.optional(
2478
+ Schema.Union([
2479
+ Schema.Struct({
2480
+ logs: Schema.optional(
2481
+ Schema.Union([
2482
+ Schema.Struct({
2483
+ enabled: Schema.Boolean,
2484
+ }),
2485
+ Schema.Null,
2486
+ ]),
2487
+ ),
2488
+ }),
2489
+ Schema.Null,
2490
+ ]),
2491
+ ),
2492
+ }),
2493
+ targetConfiguration: Schema.Struct({
2494
+ image: Schema.String,
2495
+ instanceType: Schema.optional(
2496
+ Schema.Union([
2497
+ Schema.Literals([
2498
+ "lite",
2499
+ "dev",
2500
+ "basic",
2501
+ "standard",
2502
+ "standard-1",
2503
+ "standard-2",
2504
+ "standard-3",
2505
+ "standard-4",
2506
+ ]),
2507
+ Schema.Null,
2508
+ ]),
2509
+ ),
2510
+ observability: Schema.optional(
2511
+ Schema.Union([
2512
+ Schema.Struct({
2513
+ logs: Schema.optional(
2514
+ Schema.Union([
2515
+ Schema.Struct({
2516
+ enabled: Schema.Boolean,
2517
+ }),
2518
+ Schema.Null,
2519
+ ]),
2520
+ ),
2521
+ }),
2522
+ Schema.Null,
2523
+ ]),
2524
+ ),
2525
+ sshPublicKeyIds: Schema.optional(
2526
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2527
+ ),
2528
+ secrets: Schema.optional(
2529
+ Schema.Union([
2530
+ Schema.Array(
2531
+ Schema.Struct({
2532
+ name: Schema.String,
2533
+ type: Schema.Literal("env"),
2534
+ secret: SensitiveString,
2535
+ }),
2536
+ ),
2537
+ Schema.Null,
2538
+ ]),
2539
+ ),
2540
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2541
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2542
+ disk: Schema.optional(
2543
+ Schema.Union([
2544
+ Schema.Struct({
2545
+ size: Schema.String,
2546
+ }),
2547
+ Schema.Null,
2548
+ ]),
2549
+ ),
2550
+ environmentVariables: Schema.optional(
2551
+ Schema.Union([
2552
+ Schema.Array(
2553
+ Schema.Struct({
2554
+ name: Schema.String,
2555
+ value: Schema.String,
2556
+ }),
2557
+ ),
2558
+ Schema.Null,
2559
+ ]),
2560
+ ),
2561
+ labels: Schema.optional(
2562
+ Schema.Union([
2563
+ Schema.Array(
2564
+ Schema.Struct({
2565
+ name: Schema.String,
2566
+ value: Schema.String,
2567
+ }),
2568
+ ),
2569
+ Schema.Null,
2570
+ ]),
2571
+ ),
2572
+ network: Schema.optional(
2573
+ Schema.Union([
2574
+ Schema.Struct({
2575
+ assignIpv4: Schema.optional(
2576
+ Schema.Union([
2577
+ Schema.Literals(["none", "predefined", "account"]),
2578
+ Schema.Null,
2579
+ ]),
2580
+ ),
2581
+ assignIpv6: Schema.optional(
2582
+ Schema.Union([
2583
+ Schema.Literals(["none", "predefined", "account"]),
2584
+ Schema.Null,
2585
+ ]),
2586
+ ),
2587
+ mode: Schema.optional(
2588
+ Schema.Union([
2589
+ Schema.Literals(["public", "private"]),
2590
+ Schema.Null,
2591
+ ]),
2592
+ ),
2593
+ }).pipe(
2594
+ Schema.encodeKeys({
2595
+ assignIpv4: "assign_ipv4",
2596
+ assignIpv6: "assign_ipv6",
2597
+ mode: "mode",
2598
+ }),
2599
+ ),
2600
+ Schema.Null,
2601
+ ]),
2602
+ ),
2603
+ command: Schema.optional(
2604
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2605
+ ),
2606
+ entrypoint: Schema.optional(
2607
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2608
+ ),
2609
+ dns: Schema.optional(
2610
+ Schema.Union([
2611
+ Schema.Struct({
2612
+ servers: Schema.optional(
2613
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2614
+ ),
2615
+ searches: Schema.optional(
2616
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2617
+ ),
2618
+ }),
2619
+ Schema.Null,
2620
+ ]),
2621
+ ),
2622
+ ports: Schema.optional(
2623
+ Schema.Union([
2624
+ Schema.Array(
2625
+ Schema.Struct({
2626
+ name: Schema.String,
2627
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2628
+ }),
2629
+ ),
2630
+ Schema.Null,
2631
+ ]),
2632
+ ),
2633
+ checks: Schema.optional(
2634
+ Schema.Union([
2635
+ Schema.Array(
2636
+ Schema.Struct({
2637
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2638
+ type: Schema.Literals(["http", "tcp"]),
2639
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
2640
+ port: Schema.String,
2641
+ http: Schema.optional(
2642
+ Schema.Union([
2643
+ Schema.Struct({
2644
+ method: Schema.optional(
2645
+ Schema.Union([
2646
+ Schema.Literals([
2647
+ "GET",
2648
+ "POST",
2649
+ "PUT",
2650
+ "PATCH",
2651
+ "DELETE",
2652
+ "OPTIONS",
2653
+ "HEAD",
2654
+ ]),
2655
+ Schema.Null,
2656
+ ]),
2657
+ ),
2658
+ body: Schema.optional(
2659
+ Schema.Union([Schema.String, Schema.Null]),
2660
+ ),
2661
+ path: Schema.optional(
2662
+ Schema.Union([Schema.String, Schema.Null]),
2663
+ ),
2664
+ headers: Schema.optional(
2665
+ Schema.Union([Schema.Unknown, Schema.Null]),
2666
+ ),
2667
+ }),
2668
+ Schema.Null,
2669
+ ]),
2670
+ ),
2671
+ interval: Schema.String,
2672
+ timeout: Schema.String,
2673
+ retries: Schema.optional(
2674
+ Schema.Union([Schema.Number, Schema.Null]),
2675
+ ),
2676
+ kind: Schema.Literals(["health", "ready"]),
2677
+ }),
2678
+ ),
2679
+ Schema.Null,
2680
+ ]),
2681
+ ),
2682
+ }).pipe(
2683
+ Schema.encodeKeys({
2684
+ image: "image",
2685
+ instanceType: "instance_type",
2686
+ observability: "observability",
2687
+ sshPublicKeyIds: "ssh_public_key_ids",
2688
+ secrets: "secrets",
2689
+ vcpu: "vcpu",
2690
+ memory: "memory",
2691
+ disk: "disk",
2692
+ environmentVariables: "environment_variables",
2693
+ labels: "labels",
2694
+ network: "network",
2695
+ command: "command",
2696
+ entrypoint: "entrypoint",
2697
+ dns: "dns",
2698
+ ports: "ports",
2699
+ checks: "checks",
2700
+ }),
2701
+ ),
2702
+ currentVersion: Schema.Number,
2703
+ targetVersion: Schema.Number,
2704
+ steps: Schema.Array(
2705
+ Schema.Struct({
2706
+ id: Schema.Number,
2707
+ status: Schema.Literals([
2708
+ "progressing",
2709
+ "pending",
2710
+ "completed",
2711
+ "failed",
2712
+ ]),
2713
+ stepSize: Schema.Struct({
2714
+ percentage: Schema.Number,
2715
+ }),
2716
+ description: Schema.String,
2717
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2718
+ }).pipe(
2719
+ Schema.encodeKeys({
2720
+ id: "id",
2721
+ status: "status",
2722
+ stepSize: "step_size",
2723
+ description: "description",
2724
+ startedAt: "started_at",
2725
+ }),
2726
+ ),
2727
+ ),
2728
+ progress: Schema.Struct({
2729
+ totalSteps: Schema.Number,
2730
+ currentStep: Schema.Number,
2731
+ updatedInstances: Schema.Number,
2732
+ totalInstances: Schema.Number,
2733
+ }).pipe(
2734
+ Schema.encodeKeys({
2735
+ totalSteps: "total_steps",
2736
+ currentStep: "current_step",
2737
+ updatedInstances: "updated_instances",
2738
+ totalInstances: "total_instances",
2739
+ }),
2740
+ ),
2741
+ })
2742
+ .pipe(
2743
+ Schema.encodeKeys({
2744
+ id: "id",
2745
+ createdAt: "created_at",
2746
+ lastUpdatedAt: "last_updated_at",
2747
+ description: "description",
2748
+ status: "status",
2749
+ health: "health",
2750
+ kind: "kind",
2751
+ strategy: "strategy",
2752
+ currentConfiguration: "current_configuration",
2753
+ targetConfiguration: "target_configuration",
2754
+ currentVersion: "current_version",
2755
+ targetVersion: "target_version",
2756
+ steps: "steps",
2757
+ progress: "progress",
2758
+ }),
2759
+ )
2760
+ .pipe(
2761
+ T.ResponsePath("result"),
2762
+ ) as unknown as Schema.Schema<CreateContainerApplicationRolloutResponse>;
2763
+
2764
+ export type CreateContainerApplicationRolloutError =
2765
+ | DefaultErrors
2766
+ | InvalidRoute
2767
+ | ContainerApplicationNotFound;
2768
+
2769
+ export const createContainerApplicationRollout: API.OperationMethod<
2770
+ CreateContainerApplicationRolloutRequest,
2771
+ CreateContainerApplicationRolloutResponse,
2772
+ CreateContainerApplicationRolloutError,
2773
+ Credentials | HttpClient.HttpClient
2774
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2775
+ input: CreateContainerApplicationRolloutRequest,
2776
+ output: CreateContainerApplicationRolloutResponse,
2777
+ errors: [InvalidRoute, ContainerApplicationNotFound],
2778
+ }));
2779
+
2780
+ // =============================================================================
2781
+ // ContainerIdentity
2782
+ // =============================================================================
2783
+
2784
+ export interface GetContainerIdentityRequest {
2785
+ accountId: string;
2786
+ }
2787
+
2788
+ export const GetContainerIdentityRequest =
2789
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2790
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2791
+ }).pipe(
2792
+ T.Http({ method: "GET", path: "/accounts/{account_id}/containers/me" }),
2793
+ ) as unknown as Schema.Schema<GetContainerIdentityRequest>;
2794
+
2795
+ export interface GetContainerIdentityResponse {
2796
+ accountId?: string | null;
2797
+ externalAccountId: string;
2798
+ legacyIdentity: string;
2799
+ capabilities?: string[] | null;
2800
+ limits: {
2801
+ accountId: string;
2802
+ vcpuPerDeployment: number;
2803
+ memoryMibPerDeployment: number;
2804
+ memoryPerDeployment: string;
2805
+ diskPerDeployment: string;
2806
+ diskMbPerDeployment: number;
2807
+ totalVcpu: number;
2808
+ totalMemoryMib: number;
2809
+ nodeGroup: string;
2810
+ ipv4s: number;
2811
+ networkModes: string[];
2812
+ totalDiskMb: number;
2813
+ totalMemory: string;
2814
+ };
2815
+ locations: unknown[];
2816
+ defaults: {
2817
+ vcpus: number;
2818
+ memoryMib: number;
2819
+ memory: string;
2820
+ diskMb: number;
2821
+ };
2822
+ }
2823
+
2824
+ export const GetContainerIdentityResponse =
2825
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2826
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2827
+ externalAccountId: Schema.String,
2828
+ legacyIdentity: Schema.String,
2829
+ capabilities: Schema.optional(
2830
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
2831
+ ),
2832
+ limits: Schema.Struct({
2833
+ accountId: Schema.String,
2834
+ vcpuPerDeployment: Schema.Number,
2835
+ memoryMibPerDeployment: Schema.Number,
2836
+ memoryPerDeployment: Schema.String,
2837
+ diskPerDeployment: Schema.String,
2838
+ diskMbPerDeployment: Schema.Number,
2839
+ totalVcpu: Schema.Number,
2840
+ totalMemoryMib: Schema.Number,
2841
+ nodeGroup: Schema.String,
2842
+ ipv4s: Schema.Number,
2843
+ networkModes: Schema.Array(Schema.String),
2844
+ totalDiskMb: Schema.Number,
2845
+ totalMemory: Schema.String,
2846
+ }).pipe(
2847
+ Schema.encodeKeys({
2848
+ accountId: "account_id",
2849
+ vcpuPerDeployment: "vcpu_per_deployment",
2850
+ memoryMibPerDeployment: "memory_mib_per_deployment",
2851
+ memoryPerDeployment: "memory_per_deployment",
2852
+ diskPerDeployment: "disk_per_deployment",
2853
+ diskMbPerDeployment: "disk_mb_per_deployment",
2854
+ totalVcpu: "total_vcpu",
2855
+ totalMemoryMib: "total_memory_mib",
2856
+ nodeGroup: "node_group",
2857
+ ipv4s: "ipv4s",
2858
+ networkModes: "network_modes",
2859
+ totalDiskMb: "total_disk_mb",
2860
+ totalMemory: "total_memory",
2861
+ }),
2862
+ ),
2863
+ locations: Schema.Array(Schema.Unknown),
2864
+ defaults: Schema.Struct({
2865
+ vcpus: Schema.Number,
2866
+ memoryMib: Schema.Number,
2867
+ memory: Schema.String,
2868
+ diskMb: Schema.Number,
2869
+ }).pipe(
2870
+ Schema.encodeKeys({
2871
+ vcpus: "vcpus",
2872
+ memoryMib: "memory_mib",
2873
+ memory: "memory",
2874
+ diskMb: "disk_mb",
2875
+ }),
2876
+ ),
2877
+ })
2878
+ .pipe(
2879
+ Schema.encodeKeys({
2880
+ accountId: "account_id",
2881
+ externalAccountId: "external_account_id",
2882
+ legacyIdentity: "legacy_identity",
2883
+ capabilities: "capabilities",
2884
+ limits: "limits",
2885
+ locations: "locations",
2886
+ defaults: "defaults",
2887
+ }),
2888
+ )
2889
+ .pipe(
2890
+ T.ResponsePath("result"),
2891
+ ) as unknown as Schema.Schema<GetContainerIdentityResponse>;
2892
+
2893
+ export type GetContainerIdentityError = DefaultErrors | InvalidRoute;
2894
+
2895
+ export const getContainerIdentity: API.OperationMethod<
2896
+ GetContainerIdentityRequest,
2897
+ GetContainerIdentityResponse,
2898
+ GetContainerIdentityError,
2899
+ Credentials | HttpClient.HttpClient
2900
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2901
+ input: GetContainerIdentityRequest,
2902
+ output: GetContainerIdentityResponse,
2903
+ errors: [InvalidRoute],
2904
+ }));
2905
+
2906
+ // =============================================================================
2907
+ // ContainerRegistryCredential
2908
+ // =============================================================================
2909
+
2910
+ export interface CreateContainerRegistryCredentialsRequest {
2911
+ accountId: string;
2912
+ registryId: string;
2913
+ permissions: ("pull" | "push")[];
2914
+ expirationMinutes: number;
2915
+ }
2916
+
2917
+ export const CreateContainerRegistryCredentialsRequest =
2918
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2919
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
2920
+ registryId: Schema.String.pipe(T.HttpPath("registry_id")),
2921
+ permissions: Schema.Array(Schema.Literals(["pull", "push"])),
2922
+ expirationMinutes: Schema.Number,
2923
+ }).pipe(
2924
+ Schema.encodeKeys({
2925
+ permissions: "permissions",
2926
+ expirationMinutes: "expiration_minutes",
2927
+ }),
2928
+ T.Http({
2929
+ method: "POST",
2930
+ path: "/accounts/{account_id}/containers/registries/{registry_id}/credentials",
2931
+ }),
2932
+ ) as unknown as Schema.Schema<CreateContainerRegistryCredentialsRequest>;
2933
+
2934
+ export interface CreateContainerRegistryCredentialsResponse {
2935
+ user?: string | null;
2936
+ username?: string | null;
2937
+ password: string;
2938
+ }
2939
+
2940
+ export const CreateContainerRegistryCredentialsResponse =
2941
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2942
+ user: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2943
+ username: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2944
+ password: Schema.String,
2945
+ }).pipe(
2946
+ T.ResponsePath("result"),
2947
+ ) as unknown as Schema.Schema<CreateContainerRegistryCredentialsResponse>;
2948
+
2949
+ export type CreateContainerRegistryCredentialsError =
2950
+ | DefaultErrors
2951
+ | InvalidRoute;
2952
+
2953
+ export const createContainerRegistryCredentials: API.OperationMethod<
2954
+ CreateContainerRegistryCredentialsRequest,
2955
+ CreateContainerRegistryCredentialsResponse,
2956
+ CreateContainerRegistryCredentialsError,
2957
+ Credentials | HttpClient.HttpClient
2958
+ > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
2959
+ input: CreateContainerRegistryCredentialsRequest,
2960
+ output: CreateContainerRegistryCredentialsResponse,
2961
+ errors: [InvalidRoute],
2962
+ }));