@distilled.cloud/cloudflare 0.12.2 → 0.12.3

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.
@@ -10,61 +10,79 @@ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
10
  import * as API from "../client/api.ts";
11
11
  import * as T from "../traits.ts";
12
12
  import type { Credentials } from "../credentials.ts";
13
- import { type DefaultErrors } from "../errors.ts";
13
+ import {
14
+ type DefaultErrors,
15
+ } from "../errors.ts";
14
16
 
15
17
  // =============================================================================
16
18
  // Errors
17
19
  // =============================================================================
18
20
 
21
+ export class ConsumerAlreadyExists extends Schema.TaggedErrorClass<ConsumerAlreadyExists>()(
22
+ "ConsumerAlreadyExists",
23
+ { code: Schema.Number, message: Schema.String },
24
+ ) {}
25
+ T.applyErrorMatchers(ConsumerAlreadyExists, [{"code":11004}]);
26
+
27
+ export class ConsumerNotFound extends Schema.TaggedErrorClass<ConsumerNotFound>()(
28
+ "ConsumerNotFound",
29
+ { code: Schema.Number, message: Schema.String },
30
+ ) {}
31
+ T.applyErrorMatchers(ConsumerNotFound, [{"code":10105},{"code":11006}]);
32
+
19
33
  export class InvalidMessageBody extends Schema.TaggedErrorClass<InvalidMessageBody>()(
20
34
  "InvalidMessageBody",
21
35
  { code: Schema.Number, message: Schema.String },
22
36
  ) {}
23
- T.applyErrorMatchers(InvalidMessageBody, [{ code: 10207 }, { code: 10013 }]);
37
+ T.applyErrorMatchers(InvalidMessageBody, [{"code":10207},{"code":10013}]);
24
38
 
25
39
  export class InvalidQueueId extends Schema.TaggedErrorClass<InvalidQueueId>()(
26
40
  "InvalidQueueId",
27
41
  { code: Schema.Number, message: Schema.String },
28
42
  ) {}
29
- T.applyErrorMatchers(InvalidQueueId, [{ code: 10107 }]);
43
+ T.applyErrorMatchers(InvalidQueueId, [{"code":10107}]);
30
44
 
31
45
  export class InvalidQueueName extends Schema.TaggedErrorClass<InvalidQueueName>()(
32
46
  "InvalidQueueName",
33
47
  { code: Schema.Number, message: Schema.String },
34
48
  ) {}
35
- T.applyErrorMatchers(InvalidQueueName, [{ code: 11003 }]);
49
+ T.applyErrorMatchers(InvalidQueueName, [{"code":11003}]);
36
50
 
37
51
  export class InvalidRequestBody extends Schema.TaggedErrorClass<InvalidRequestBody>()(
38
52
  "InvalidRequestBody",
39
53
  { code: Schema.Number, message: Schema.String },
40
54
  ) {}
41
- T.applyErrorMatchers(InvalidRequestBody, [{ code: 10026 }]);
55
+ T.applyErrorMatchers(InvalidRequestBody, [{"code":10026}]);
42
56
 
43
57
  export class InvalidRoute extends Schema.TaggedErrorClass<InvalidRoute>()(
44
58
  "InvalidRoute",
45
59
  { code: Schema.Number, message: Schema.String },
46
60
  ) {}
47
- T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
61
+ T.applyErrorMatchers(InvalidRoute, [{"code":7003}]);
48
62
 
49
63
  export class QueueAlreadyExists extends Schema.TaggedErrorClass<QueueAlreadyExists>()(
50
64
  "QueueAlreadyExists",
51
65
  { code: Schema.Number, message: Schema.String },
52
66
  ) {}
53
- T.applyErrorMatchers(QueueAlreadyExists, [{ code: 11009 }]);
67
+ T.applyErrorMatchers(QueueAlreadyExists, [{"code":11009}]);
54
68
 
55
69
  export class QueueNotFound extends Schema.TaggedErrorClass<QueueNotFound>()(
56
70
  "QueueNotFound",
57
71
  { code: Schema.Number, message: Schema.String },
58
72
  ) {}
59
- T.applyErrorMatchers(QueueNotFound, [{ code: 11000 }]);
73
+ T.applyErrorMatchers(QueueNotFound, [{"code":11000},{"code":0,"message":{"includes":"Queue does not exist"}}]);
60
74
 
61
75
  export class UnrecognizedEventType extends Schema.TaggedErrorClass<UnrecognizedEventType>()(
62
76
  "UnrecognizedEventType",
63
77
  { code: Schema.Number, message: Schema.String },
64
78
  ) {}
65
- T.applyErrorMatchers(UnrecognizedEventType, [
66
- { code: 0, message: { includes: "Unrecognized event types" } },
67
- ]);
79
+ T.applyErrorMatchers(UnrecognizedEventType, [{"code":0,"message":{"includes":"Unrecognized event types"}}]);
80
+
81
+ export class WorkerNotFound extends Schema.TaggedErrorClass<WorkerNotFound>()(
82
+ "WorkerNotFound",
83
+ { code: Schema.Number, message: Schema.String },
84
+ ) {}
85
+ T.applyErrorMatchers(WorkerNotFound, [{"code":10007}]);
68
86
 
69
87
  // =============================================================================
70
88
  // Consumer
@@ -80,141 +98,43 @@ export interface GetConsumerRequest {
80
98
  export const GetConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
81
99
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
82
100
  consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
83
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
84
- }).pipe(
85
- T.Http({
86
- method: "GET",
87
- path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
88
- }),
89
- ) as unknown as Schema.Schema<GetConsumerRequest>;
90
-
91
- export type GetConsumerResponse =
92
- | {
93
- consumerId?: string | null;
94
- createdOn?: string | null;
95
- queueId?: string | null;
96
- script?: string | null;
97
- settings?: {
98
- batchSize?: number | null;
99
- maxConcurrency?: number | null;
100
- maxRetries?: number | null;
101
- maxWaitTimeMs?: number | null;
102
- retryDelay?: number | null;
103
- } | null;
104
- type?: "worker" | null;
105
- }
106
- | {
107
- consumerId?: string | null;
108
- createdOn?: string | null;
109
- queueId?: string | null;
110
- settings?: {
111
- batchSize?: number | null;
112
- maxRetries?: number | null;
113
- retryDelay?: number | null;
114
- visibilityTimeoutMs?: number | null;
115
- } | null;
116
- type?: "http_pull" | null;
117
- };
118
-
119
- export const GetConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
120
- Schema.Struct({
121
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
122
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
123
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
124
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
125
- settings: Schema.optional(
126
- Schema.Union([
127
- Schema.Struct({
128
- batchSize: Schema.optional(
129
- Schema.Union([Schema.Number, Schema.Null]),
130
- ),
131
- maxConcurrency: Schema.optional(
132
- Schema.Union([Schema.Number, Schema.Null]),
133
- ),
134
- maxRetries: Schema.optional(
135
- Schema.Union([Schema.Number, Schema.Null]),
136
- ),
137
- maxWaitTimeMs: Schema.optional(
138
- Schema.Union([Schema.Number, Schema.Null]),
139
- ),
140
- retryDelay: Schema.optional(
141
- Schema.Union([Schema.Number, Schema.Null]),
142
- ),
143
- }).pipe(
144
- Schema.encodeKeys({
145
- batchSize: "batch_size",
146
- maxConcurrency: "max_concurrency",
147
- maxRetries: "max_retries",
148
- maxWaitTimeMs: "max_wait_time_ms",
149
- retryDelay: "retry_delay",
150
- }),
151
- ),
152
- Schema.Null,
153
- ]),
154
- ),
155
- type: Schema.optional(
156
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
157
- ),
158
- }).pipe(
159
- Schema.encodeKeys({
160
- consumerId: "consumer_id",
161
- createdOn: "created_on",
162
- queueId: "queue_id",
163
- script: "script",
164
- settings: "settings",
165
- type: "type",
166
- }),
167
- ),
168
- Schema.Struct({
169
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
170
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
171
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
172
- settings: Schema.optional(
173
- Schema.Union([
174
- Schema.Struct({
175
- batchSize: Schema.optional(
176
- Schema.Union([Schema.Number, Schema.Null]),
177
- ),
178
- maxRetries: Schema.optional(
179
- Schema.Union([Schema.Number, Schema.Null]),
180
- ),
181
- retryDelay: Schema.optional(
182
- Schema.Union([Schema.Number, Schema.Null]),
183
- ),
184
- visibilityTimeoutMs: Schema.optional(
185
- Schema.Union([Schema.Number, Schema.Null]),
186
- ),
187
- }).pipe(
188
- Schema.encodeKeys({
189
- batchSize: "batch_size",
190
- maxRetries: "max_retries",
191
- retryDelay: "retry_delay",
192
- visibilityTimeoutMs: "visibility_timeout_ms",
193
- }),
194
- ),
195
- Schema.Null,
196
- ]),
197
- ),
198
- type: Schema.optional(
199
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
200
- ),
201
- }).pipe(
202
- Schema.encodeKeys({
203
- consumerId: "consumer_id",
204
- createdOn: "created_on",
205
- queueId: "queue_id",
206
- settings: "settings",
207
- type: "type",
208
- }),
209
- ),
210
- ]).pipe(
211
- T.ResponsePath("result"),
212
- ) as unknown as Schema.Schema<GetConsumerResponse>;
101
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
102
+ })
103
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}" })) as unknown as Schema.Schema<GetConsumerRequest>;
104
+
105
+ export type GetConsumerResponse = { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null };
106
+
107
+ export const GetConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.Struct({
108
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
109
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
110
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
111
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
112
+ settings: Schema.optional(Schema.Union([Schema.Struct({
113
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
114
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
115
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
116
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
117
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
118
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
119
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
120
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
121
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
122
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
123
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
124
+ settings: Schema.optional(Schema.Union([Schema.Struct({
125
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
126
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
127
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
128
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
129
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
130
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
131
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetConsumerResponse>;
213
132
 
214
133
  export type GetConsumerError =
215
134
  | DefaultErrors
216
135
  | InvalidRequestBody
217
136
  | QueueNotFound
137
+ | ConsumerNotFound
218
138
  | InvalidRoute;
219
139
 
220
140
  export const getConsumer: API.OperationMethod<
@@ -225,7 +145,7 @@ export const getConsumer: API.OperationMethod<
225
145
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
226
146
  input: GetConsumerRequest,
227
147
  output: GetConsumerResponse,
228
- errors: [InvalidRequestBody, QueueNotFound, InvalidRoute],
148
+ errors: [InvalidRequestBody, QueueNotFound, ConsumerNotFound, InvalidRoute],
229
149
  }));
230
150
 
231
151
  export interface ListConsumersRequest {
@@ -236,140 +156,40 @@ export interface ListConsumersRequest {
236
156
 
237
157
  export const ListConsumersRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
238
158
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
239
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
240
- }).pipe(
241
- T.Http({
242
- method: "GET",
243
- path: "/accounts/{account_id}/queues/{queueId}/consumers",
244
- }),
245
- ) as unknown as Schema.Schema<ListConsumersRequest>;
159
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
160
+ })
161
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}/consumers" })) as unknown as Schema.Schema<ListConsumersRequest>;
246
162
 
247
163
  export interface ListConsumersResponse {
248
- result: (
249
- | {
250
- consumerId?: string | null;
251
- createdOn?: string | null;
252
- queueId?: string | null;
253
- script?: string | null;
254
- settings?: {
255
- batchSize?: number | null;
256
- maxConcurrency?: number | null;
257
- maxRetries?: number | null;
258
- maxWaitTimeMs?: number | null;
259
- retryDelay?: number | null;
260
- } | null;
261
- type?: "worker" | null;
262
- }
263
- | {
264
- consumerId?: string | null;
265
- createdOn?: string | null;
266
- queueId?: string | null;
267
- settings?: {
268
- batchSize?: number | null;
269
- maxRetries?: number | null;
270
- retryDelay?: number | null;
271
- visibilityTimeoutMs?: number | null;
272
- } | null;
273
- type?: "http_pull" | null;
274
- }
275
- )[];
164
+ result: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[];
276
165
  }
277
166
 
278
167
  export const ListConsumersResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
279
- result: Schema.Array(
280
- Schema.Union([
281
- Schema.Struct({
282
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
283
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
284
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
285
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
286
- settings: Schema.optional(
287
- Schema.Union([
288
- Schema.Struct({
289
- batchSize: Schema.optional(
290
- Schema.Union([Schema.Number, Schema.Null]),
291
- ),
292
- maxConcurrency: Schema.optional(
293
- Schema.Union([Schema.Number, Schema.Null]),
294
- ),
295
- maxRetries: Schema.optional(
296
- Schema.Union([Schema.Number, Schema.Null]),
297
- ),
298
- maxWaitTimeMs: Schema.optional(
299
- Schema.Union([Schema.Number, Schema.Null]),
300
- ),
301
- retryDelay: Schema.optional(
302
- Schema.Union([Schema.Number, Schema.Null]),
303
- ),
304
- }).pipe(
305
- Schema.encodeKeys({
306
- batchSize: "batch_size",
307
- maxConcurrency: "max_concurrency",
308
- maxRetries: "max_retries",
309
- maxWaitTimeMs: "max_wait_time_ms",
310
- retryDelay: "retry_delay",
311
- }),
312
- ),
313
- Schema.Null,
314
- ]),
315
- ),
316
- type: Schema.optional(
317
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
318
- ),
319
- }).pipe(
320
- Schema.encodeKeys({
321
- consumerId: "consumer_id",
322
- createdOn: "created_on",
323
- queueId: "queue_id",
324
- script: "script",
325
- settings: "settings",
326
- type: "type",
327
- }),
328
- ),
329
- Schema.Struct({
330
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
331
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
332
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
333
- settings: Schema.optional(
334
- Schema.Union([
335
- Schema.Struct({
336
- batchSize: Schema.optional(
337
- Schema.Union([Schema.Number, Schema.Null]),
338
- ),
339
- maxRetries: Schema.optional(
340
- Schema.Union([Schema.Number, Schema.Null]),
341
- ),
342
- retryDelay: Schema.optional(
343
- Schema.Union([Schema.Number, Schema.Null]),
344
- ),
345
- visibilityTimeoutMs: Schema.optional(
346
- Schema.Union([Schema.Number, Schema.Null]),
347
- ),
348
- }).pipe(
349
- Schema.encodeKeys({
350
- batchSize: "batch_size",
351
- maxRetries: "max_retries",
352
- retryDelay: "retry_delay",
353
- visibilityTimeoutMs: "visibility_timeout_ms",
354
- }),
355
- ),
356
- Schema.Null,
357
- ]),
358
- ),
359
- type: Schema.optional(
360
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
361
- ),
362
- }).pipe(
363
- Schema.encodeKeys({
364
- consumerId: "consumer_id",
365
- createdOn: "created_on",
366
- queueId: "queue_id",
367
- settings: "settings",
368
- type: "type",
369
- }),
370
- ),
371
- ]),
372
- ),
168
+ result: Schema.Array(Schema.Union([Schema.Struct({
169
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
170
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
171
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
172
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
173
+ settings: Schema.optional(Schema.Union([Schema.Struct({
174
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
175
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
176
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
177
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
178
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
179
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
180
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
181
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
182
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
183
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
184
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
185
+ settings: Schema.optional(Schema.Union([Schema.Struct({
186
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
187
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
188
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
189
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
190
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
191
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
192
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]))
373
193
  }) as unknown as Schema.Schema<ListConsumersResponse>;
374
194
 
375
195
  export type ListConsumersError =
@@ -402,13 +222,7 @@ export interface CreateConsumerRequest {
402
222
  /** Body param: Name of a Worker */
403
223
  scriptName?: string;
404
224
  /** Body param: */
405
- settings?: {
406
- batchSize?: number;
407
- maxConcurrency?: number;
408
- maxRetries?: number;
409
- maxWaitTimeMs?: number;
410
- retryDelay?: number;
411
- };
225
+ settings?: { batchSize?: number; maxConcurrency?: number; maxRetries?: number; maxWaitTimeMs?: number; retryDelay?: number };
412
226
  /** Body param: */
413
227
  type: "worker" | "http_pull";
414
228
  }
@@ -418,164 +232,51 @@ export const CreateConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
418
232
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
419
233
  deadLetterQueue: Schema.optional(Schema.String),
420
234
  scriptName: Schema.optional(Schema.String),
421
- settings: Schema.optional(
422
- Schema.Struct({
423
- batchSize: Schema.optional(Schema.Number),
424
- maxConcurrency: Schema.optional(Schema.Number),
425
- maxRetries: Schema.optional(Schema.Number),
426
- maxWaitTimeMs: Schema.optional(Schema.Number),
427
- retryDelay: Schema.optional(Schema.Number),
428
- }).pipe(
429
- Schema.encodeKeys({
430
- batchSize: "batch_size",
431
- maxConcurrency: "max_concurrency",
432
- maxRetries: "max_retries",
433
- maxWaitTimeMs: "max_wait_time_ms",
434
- retryDelay: "retry_delay",
435
- }),
436
- ),
437
- ),
438
- type: Schema.Literals(["worker", "http_pull"]),
439
- }).pipe(
440
- Schema.encodeKeys({
441
- deadLetterQueue: "dead_letter_queue",
442
- scriptName: "script_name",
443
- settings: "settings",
444
- type: "type",
445
- }),
446
- T.Http({
447
- method: "POST",
448
- path: "/accounts/{account_id}/queues/{queueId}/consumers",
449
- }),
450
- ) as unknown as Schema.Schema<CreateConsumerRequest>;
451
-
452
- export type CreateConsumerResponse =
453
- | {
454
- consumerId?: string | null;
455
- createdOn?: string | null;
456
- queueId?: string | null;
457
- script?: string | null;
458
- settings?: {
459
- batchSize?: number | null;
460
- maxConcurrency?: number | null;
461
- maxRetries?: number | null;
462
- maxWaitTimeMs?: number | null;
463
- retryDelay?: number | null;
464
- } | null;
465
- type?: "worker" | null;
466
- }
467
- | {
468
- consumerId?: string | null;
469
- createdOn?: string | null;
470
- queueId?: string | null;
471
- settings?: {
472
- batchSize?: number | null;
473
- maxRetries?: number | null;
474
- retryDelay?: number | null;
475
- visibilityTimeoutMs?: number | null;
476
- } | null;
477
- type?: "http_pull" | null;
478
- };
479
-
480
- export const CreateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
481
- Schema.Struct({
482
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
483
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
484
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
485
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
486
- settings: Schema.optional(
487
- Schema.Union([
488
- Schema.Struct({
489
- batchSize: Schema.optional(
490
- Schema.Union([Schema.Number, Schema.Null]),
491
- ),
492
- maxConcurrency: Schema.optional(
493
- Schema.Union([Schema.Number, Schema.Null]),
494
- ),
495
- maxRetries: Schema.optional(
496
- Schema.Union([Schema.Number, Schema.Null]),
497
- ),
498
- maxWaitTimeMs: Schema.optional(
499
- Schema.Union([Schema.Number, Schema.Null]),
500
- ),
501
- retryDelay: Schema.optional(
502
- Schema.Union([Schema.Number, Schema.Null]),
503
- ),
504
- }).pipe(
505
- Schema.encodeKeys({
506
- batchSize: "batch_size",
507
- maxConcurrency: "max_concurrency",
508
- maxRetries: "max_retries",
509
- maxWaitTimeMs: "max_wait_time_ms",
510
- retryDelay: "retry_delay",
511
- }),
512
- ),
513
- Schema.Null,
514
- ]),
515
- ),
516
- type: Schema.optional(
517
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
518
- ),
519
- }).pipe(
520
- Schema.encodeKeys({
521
- consumerId: "consumer_id",
522
- createdOn: "created_on",
523
- queueId: "queue_id",
524
- script: "script",
525
- settings: "settings",
526
- type: "type",
527
- }),
528
- ),
529
- Schema.Struct({
530
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
531
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
532
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
533
- settings: Schema.optional(
534
- Schema.Union([
535
- Schema.Struct({
536
- batchSize: Schema.optional(
537
- Schema.Union([Schema.Number, Schema.Null]),
538
- ),
539
- maxRetries: Schema.optional(
540
- Schema.Union([Schema.Number, Schema.Null]),
541
- ),
542
- retryDelay: Schema.optional(
543
- Schema.Union([Schema.Number, Schema.Null]),
544
- ),
545
- visibilityTimeoutMs: Schema.optional(
546
- Schema.Union([Schema.Number, Schema.Null]),
547
- ),
548
- }).pipe(
549
- Schema.encodeKeys({
550
- batchSize: "batch_size",
551
- maxRetries: "max_retries",
552
- retryDelay: "retry_delay",
553
- visibilityTimeoutMs: "visibility_timeout_ms",
554
- }),
555
- ),
556
- Schema.Null,
557
- ]),
558
- ),
559
- type: Schema.optional(
560
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
561
- ),
562
- }).pipe(
563
- Schema.encodeKeys({
564
- consumerId: "consumer_id",
565
- createdOn: "created_on",
566
- queueId: "queue_id",
567
- settings: "settings",
568
- type: "type",
569
- }),
570
- ),
571
- ]).pipe(
572
- T.ResponsePath("result"),
573
- ) as unknown as Schema.Schema<CreateConsumerResponse>;
235
+ settings: Schema.optional(Schema.Struct({
236
+ batchSize: Schema.optional(Schema.Number),
237
+ maxConcurrency: Schema.optional(Schema.Number),
238
+ maxRetries: Schema.optional(Schema.Number),
239
+ maxWaitTimeMs: Schema.optional(Schema.Number),
240
+ retryDelay: Schema.optional(Schema.Number)
241
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" }))),
242
+ type: Schema.Literals(["worker", "http_pull"])
243
+ })
244
+ .pipe(Schema.encodeKeys({ deadLetterQueue: "dead_letter_queue", scriptName: "script_name", settings: "settings", type: "type" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/consumers" })) as unknown as Schema.Schema<CreateConsumerRequest>;
245
+
246
+ export type CreateConsumerResponse = { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null };
247
+
248
+ export const CreateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.Struct({
249
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
250
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
251
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
252
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
253
+ settings: Schema.optional(Schema.Union([Schema.Struct({
254
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
255
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
256
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
257
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
258
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
259
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
260
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
261
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
262
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
263
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
264
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
265
+ settings: Schema.optional(Schema.Union([Schema.Struct({
266
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
267
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
268
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
269
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
270
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
271
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
272
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<CreateConsumerResponse>;
574
273
 
575
274
  export type CreateConsumerError =
576
275
  | DefaultErrors
577
276
  | InvalidRequestBody
578
277
  | QueueNotFound
278
+ | ConsumerAlreadyExists
279
+ | WorkerNotFound
579
280
  | InvalidRoute;
580
281
 
581
282
  export const createConsumer: API.OperationMethod<
@@ -586,7 +287,7 @@ export const createConsumer: API.OperationMethod<
586
287
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
587
288
  input: CreateConsumerRequest,
588
289
  output: CreateConsumerResponse,
589
- errors: [InvalidRequestBody, QueueNotFound, InvalidRoute],
290
+ errors: [InvalidRequestBody, QueueNotFound, ConsumerAlreadyExists, WorkerNotFound, InvalidRoute],
590
291
  }));
591
292
 
592
293
  export interface UpdateConsumerRequest {
@@ -599,13 +300,7 @@ export interface UpdateConsumerRequest {
599
300
  /** Body param: Name of a Worker */
600
301
  scriptName?: string;
601
302
  /** Body param: */
602
- settings?: {
603
- batchSize?: number;
604
- maxConcurrency?: number;
605
- maxRetries?: number;
606
- maxWaitTimeMs?: number;
607
- retryDelay?: number;
608
- };
303
+ settings?: { batchSize?: number; maxConcurrency?: number; maxRetries?: number; maxWaitTimeMs?: number; retryDelay?: number };
609
304
  /** Body param: */
610
305
  type?: "worker";
611
306
  }
@@ -616,164 +311,51 @@ export const UpdateConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
616
311
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
617
312
  deadLetterQueue: Schema.optional(Schema.String),
618
313
  scriptName: Schema.optional(Schema.String),
619
- settings: Schema.optional(
620
- Schema.Struct({
621
- batchSize: Schema.optional(Schema.Number),
622
- maxConcurrency: Schema.optional(Schema.Number),
623
- maxRetries: Schema.optional(Schema.Number),
624
- maxWaitTimeMs: Schema.optional(Schema.Number),
625
- retryDelay: Schema.optional(Schema.Number),
626
- }).pipe(
627
- Schema.encodeKeys({
628
- batchSize: "batch_size",
629
- maxConcurrency: "max_concurrency",
630
- maxRetries: "max_retries",
631
- maxWaitTimeMs: "max_wait_time_ms",
632
- retryDelay: "retry_delay",
633
- }),
634
- ),
635
- ),
636
- type: Schema.optional(Schema.Literal("worker")),
637
- }).pipe(
638
- Schema.encodeKeys({
639
- deadLetterQueue: "dead_letter_queue",
640
- scriptName: "script_name",
641
- settings: "settings",
642
- type: "type",
643
- }),
644
- T.Http({
645
- method: "PUT",
646
- path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
647
- }),
648
- ) as unknown as Schema.Schema<UpdateConsumerRequest>;
649
-
650
- export type UpdateConsumerResponse =
651
- | {
652
- consumerId?: string | null;
653
- createdOn?: string | null;
654
- queueId?: string | null;
655
- script?: string | null;
656
- settings?: {
657
- batchSize?: number | null;
658
- maxConcurrency?: number | null;
659
- maxRetries?: number | null;
660
- maxWaitTimeMs?: number | null;
661
- retryDelay?: number | null;
662
- } | null;
663
- type?: "worker" | null;
664
- }
665
- | {
666
- consumerId?: string | null;
667
- createdOn?: string | null;
668
- queueId?: string | null;
669
- settings?: {
670
- batchSize?: number | null;
671
- maxRetries?: number | null;
672
- retryDelay?: number | null;
673
- visibilityTimeoutMs?: number | null;
674
- } | null;
675
- type?: "http_pull" | null;
676
- };
677
-
678
- export const UpdateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
679
- Schema.Struct({
680
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
681
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
682
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
683
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
684
- settings: Schema.optional(
685
- Schema.Union([
686
- Schema.Struct({
687
- batchSize: Schema.optional(
688
- Schema.Union([Schema.Number, Schema.Null]),
689
- ),
690
- maxConcurrency: Schema.optional(
691
- Schema.Union([Schema.Number, Schema.Null]),
692
- ),
693
- maxRetries: Schema.optional(
694
- Schema.Union([Schema.Number, Schema.Null]),
695
- ),
696
- maxWaitTimeMs: Schema.optional(
697
- Schema.Union([Schema.Number, Schema.Null]),
698
- ),
699
- retryDelay: Schema.optional(
700
- Schema.Union([Schema.Number, Schema.Null]),
701
- ),
702
- }).pipe(
703
- Schema.encodeKeys({
704
- batchSize: "batch_size",
705
- maxConcurrency: "max_concurrency",
706
- maxRetries: "max_retries",
707
- maxWaitTimeMs: "max_wait_time_ms",
708
- retryDelay: "retry_delay",
709
- }),
710
- ),
711
- Schema.Null,
712
- ]),
713
- ),
714
- type: Schema.optional(
715
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
716
- ),
717
- }).pipe(
718
- Schema.encodeKeys({
719
- consumerId: "consumer_id",
720
- createdOn: "created_on",
721
- queueId: "queue_id",
722
- script: "script",
723
- settings: "settings",
724
- type: "type",
725
- }),
726
- ),
727
- Schema.Struct({
728
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
729
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
730
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
731
- settings: Schema.optional(
732
- Schema.Union([
733
- Schema.Struct({
734
- batchSize: Schema.optional(
735
- Schema.Union([Schema.Number, Schema.Null]),
736
- ),
737
- maxRetries: Schema.optional(
738
- Schema.Union([Schema.Number, Schema.Null]),
739
- ),
740
- retryDelay: Schema.optional(
741
- Schema.Union([Schema.Number, Schema.Null]),
742
- ),
743
- visibilityTimeoutMs: Schema.optional(
744
- Schema.Union([Schema.Number, Schema.Null]),
745
- ),
746
- }).pipe(
747
- Schema.encodeKeys({
748
- batchSize: "batch_size",
749
- maxRetries: "max_retries",
750
- retryDelay: "retry_delay",
751
- visibilityTimeoutMs: "visibility_timeout_ms",
752
- }),
753
- ),
754
- Schema.Null,
755
- ]),
756
- ),
757
- type: Schema.optional(
758
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
759
- ),
760
- }).pipe(
761
- Schema.encodeKeys({
762
- consumerId: "consumer_id",
763
- createdOn: "created_on",
764
- queueId: "queue_id",
765
- settings: "settings",
766
- type: "type",
767
- }),
768
- ),
769
- ]).pipe(
770
- T.ResponsePath("result"),
771
- ) as unknown as Schema.Schema<UpdateConsumerResponse>;
314
+ settings: Schema.optional(Schema.Struct({
315
+ batchSize: Schema.optional(Schema.Number),
316
+ maxConcurrency: Schema.optional(Schema.Number),
317
+ maxRetries: Schema.optional(Schema.Number),
318
+ maxWaitTimeMs: Schema.optional(Schema.Number),
319
+ retryDelay: Schema.optional(Schema.Number)
320
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" }))),
321
+ type: Schema.optional(Schema.Literal("worker"))
322
+ })
323
+ .pipe(Schema.encodeKeys({ deadLetterQueue: "dead_letter_queue", scriptName: "script_name", settings: "settings", type: "type" }), T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}" })) as unknown as Schema.Schema<UpdateConsumerRequest>;
324
+
325
+ export type UpdateConsumerResponse = { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null };
326
+
327
+ export const UpdateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.Struct({
328
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
329
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
330
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
331
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
332
+ settings: Schema.optional(Schema.Union([Schema.Struct({
333
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
334
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
335
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
336
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
337
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
338
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
339
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
340
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
341
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
342
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
343
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
344
+ settings: Schema.optional(Schema.Union([Schema.Struct({
345
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
346
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
347
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
348
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
349
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
350
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
351
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<UpdateConsumerResponse>;
772
352
 
773
353
  export type UpdateConsumerError =
774
354
  | DefaultErrors
775
355
  | InvalidRequestBody
776
356
  | QueueNotFound
357
+ | ConsumerNotFound
358
+ | WorkerNotFound
777
359
  | InvalidRoute;
778
360
 
779
361
  export const updateConsumer: API.OperationMethod<
@@ -784,7 +366,7 @@ export const updateConsumer: API.OperationMethod<
784
366
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
785
367
  input: UpdateConsumerRequest,
786
368
  output: UpdateConsumerResponse,
787
- errors: [InvalidRequestBody, QueueNotFound, InvalidRoute],
369
+ errors: [InvalidRequestBody, QueueNotFound, ConsumerNotFound, WorkerNotFound, InvalidRoute],
788
370
  }));
789
371
 
790
372
  export interface DeleteConsumerRequest {
@@ -797,72 +379,35 @@ export interface DeleteConsumerRequest {
797
379
  export const DeleteConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
798
380
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
799
381
  consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
800
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
801
- }).pipe(
802
- T.Http({
803
- method: "DELETE",
804
- path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
805
- }),
806
- ) as unknown as Schema.Schema<DeleteConsumerRequest>;
382
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
383
+ })
384
+ .pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}" })) as unknown as Schema.Schema<DeleteConsumerRequest>;
807
385
 
808
386
  export interface DeleteConsumerResponse {
809
- errors?:
810
- | {
811
- code: number;
812
- message: string;
813
- documentationUrl?: string | null;
814
- source?: { pointer?: string | null } | null;
815
- }[]
816
- | null;
387
+ errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
817
388
  messages?: string[] | null;
818
389
  /** Indicates if the API call was successful or not. */
819
390
  success?: true | null;
820
391
  }
821
392
 
822
- export const DeleteConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
823
- {
824
- errors: Schema.optional(
825
- Schema.Union([
826
- Schema.Array(
827
- Schema.Struct({
828
- code: Schema.Number,
829
- message: Schema.String,
830
- documentationUrl: Schema.optional(
831
- Schema.Union([Schema.String, Schema.Null]),
832
- ),
833
- source: Schema.optional(
834
- Schema.Union([
835
- Schema.Struct({
836
- pointer: Schema.optional(
837
- Schema.Union([Schema.String, Schema.Null]),
838
- ),
839
- }),
840
- Schema.Null,
841
- ]),
842
- ),
843
- }).pipe(
844
- Schema.encodeKeys({
845
- code: "code",
846
- message: "message",
847
- documentationUrl: "documentation_url",
848
- source: "source",
849
- }),
850
- ),
851
- ),
852
- Schema.Null,
853
- ]),
854
- ),
855
- messages: Schema.optional(
856
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
857
- ),
858
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
859
- },
860
- ) as unknown as Schema.Schema<DeleteConsumerResponse>;
393
+ export const DeleteConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
394
+ errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
395
+ code: Schema.Number,
396
+ message: Schema.String,
397
+ documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
398
+ source: Schema.optional(Schema.Union([Schema.Struct({
399
+ pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
400
+ }), Schema.Null]))
401
+ }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
402
+ messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
403
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
404
+ }) as unknown as Schema.Schema<DeleteConsumerResponse>;
861
405
 
862
406
  export type DeleteConsumerError =
863
407
  | DefaultErrors
864
408
  | InvalidRequestBody
865
409
  | QueueNotFound
410
+ | ConsumerNotFound
866
411
  | InvalidRoute;
867
412
 
868
413
  export const deleteConsumer: API.OperationMethod<
@@ -873,9 +418,10 @@ export const deleteConsumer: API.OperationMethod<
873
418
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
874
419
  input: DeleteConsumerRequest,
875
420
  output: DeleteConsumerResponse,
876
- errors: [InvalidRequestBody, QueueNotFound, InvalidRoute],
421
+ errors: [InvalidRequestBody, QueueNotFound, ConsumerNotFound, InvalidRoute],
877
422
  }));
878
423
 
424
+
879
425
  // =============================================================================
880
426
  // Message
881
427
  // =============================================================================
@@ -887,105 +433,44 @@ export interface BulkPushMessagesRequest {
887
433
  /** Body param: The number of seconds to wait for attempting to deliver this batch to consumers */
888
434
  delaySeconds?: number;
889
435
  /** Body param: */
890
- messages?: (
891
- | { body?: string; contentType?: "text"; delaySeconds?: number }
892
- | { body?: unknown; contentType?: "json"; delaySeconds?: number }
893
- )[];
436
+ messages?: ({ body?: string; contentType?: "text"; delaySeconds?: number } | { body?: unknown; contentType?: "json"; delaySeconds?: number })[];
894
437
  }
895
438
 
896
- export const BulkPushMessagesRequest =
897
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
898
- queueId: Schema.String.pipe(T.HttpPath("queueId")),
899
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
900
- delaySeconds: Schema.optional(Schema.Number),
901
- messages: Schema.optional(
902
- Schema.Array(
903
- Schema.Union([
904
- Schema.Struct({
905
- body: Schema.optional(Schema.String),
906
- contentType: Schema.optional(Schema.Literal("text")),
907
- delaySeconds: Schema.optional(Schema.Number),
908
- }).pipe(
909
- Schema.encodeKeys({
910
- body: "body",
911
- contentType: "content_type",
912
- delaySeconds: "delay_seconds",
913
- }),
914
- ),
915
- Schema.Struct({
916
- body: Schema.optional(Schema.Unknown),
917
- contentType: Schema.optional(Schema.Literal("json")),
918
- delaySeconds: Schema.optional(Schema.Number),
919
- }).pipe(
920
- Schema.encodeKeys({
921
- body: "body",
922
- contentType: "content_type",
923
- delaySeconds: "delay_seconds",
924
- }),
925
- ),
926
- ]),
927
- ),
928
- ),
929
- }).pipe(
930
- Schema.encodeKeys({ delaySeconds: "delay_seconds", messages: "messages" }),
931
- T.Http({
932
- method: "POST",
933
- path: "/accounts/{account_id}/queues/{queueId}/messages/batch",
934
- }),
935
- ) as unknown as Schema.Schema<BulkPushMessagesRequest>;
439
+ export const BulkPushMessagesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
440
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
441
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
442
+ delaySeconds: Schema.optional(Schema.Number),
443
+ messages: Schema.optional(Schema.Array(Schema.Union([Schema.Struct({
444
+ body: Schema.optional(Schema.String),
445
+ contentType: Schema.optional(Schema.Literal("text")),
446
+ delaySeconds: Schema.optional(Schema.Number)
447
+ }).pipe(Schema.encodeKeys({ body: "body", contentType: "content_type", delaySeconds: "delay_seconds" })), Schema.Struct({
448
+ body: Schema.optional(Schema.Unknown),
449
+ contentType: Schema.optional(Schema.Literal("json")),
450
+ delaySeconds: Schema.optional(Schema.Number)
451
+ }).pipe(Schema.encodeKeys({ body: "body", contentType: "content_type", delaySeconds: "delay_seconds" }))])))
452
+ })
453
+ .pipe(Schema.encodeKeys({ delaySeconds: "delay_seconds", messages: "messages" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages/batch" })) as unknown as Schema.Schema<BulkPushMessagesRequest>;
936
454
 
937
455
  export interface BulkPushMessagesResponse {
938
- errors?:
939
- | {
940
- code: number;
941
- message: string;
942
- documentationUrl?: string | null;
943
- source?: { pointer?: string | null } | null;
944
- }[]
945
- | null;
456
+ errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
946
457
  messages?: string[] | null;
947
458
  /** Indicates if the API call was successful or not. */
948
459
  success?: true | null;
949
460
  }
950
461
 
951
- export const BulkPushMessagesResponse =
952
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
953
- errors: Schema.optional(
954
- Schema.Union([
955
- Schema.Array(
956
- Schema.Struct({
957
- code: Schema.Number,
958
- message: Schema.String,
959
- documentationUrl: Schema.optional(
960
- Schema.Union([Schema.String, Schema.Null]),
961
- ),
962
- source: Schema.optional(
963
- Schema.Union([
964
- Schema.Struct({
965
- pointer: Schema.optional(
966
- Schema.Union([Schema.String, Schema.Null]),
967
- ),
968
- }),
969
- Schema.Null,
970
- ]),
971
- ),
972
- }).pipe(
973
- Schema.encodeKeys({
974
- code: "code",
975
- message: "message",
976
- documentationUrl: "documentation_url",
977
- source: "source",
978
- }),
979
- ),
980
- ),
981
- Schema.Null,
982
- ]),
983
- ),
984
- messages: Schema.optional(
985
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
986
- ),
987
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
988
- }) as unknown as Schema.Schema<BulkPushMessagesResponse>;
462
+ export const BulkPushMessagesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
463
+ errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
464
+ code: Schema.Number,
465
+ message: Schema.String,
466
+ documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
467
+ source: Schema.optional(Schema.Union([Schema.Struct({
468
+ pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
469
+ }), Schema.Null]))
470
+ }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
471
+ messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
472
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
473
+ }) as unknown as Schema.Schema<BulkPushMessagesResponse>;
989
474
 
990
475
  export type BulkPushMessagesError =
991
476
  | DefaultErrors
@@ -1018,80 +503,33 @@ export const PullMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1018
503
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1019
504
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1020
505
  batchSize: Schema.optional(Schema.Number),
1021
- visibilityTimeoutMs: Schema.optional(Schema.Number),
1022
- }).pipe(
1023
- Schema.encodeKeys({
1024
- batchSize: "batch_size",
1025
- visibilityTimeoutMs: "visibility_timeout_ms",
1026
- }),
1027
- T.Http({
1028
- method: "POST",
1029
- path: "/accounts/{account_id}/queues/{queueId}/messages/pull",
1030
- }),
1031
- ) as unknown as Schema.Schema<PullMessageRequest>;
506
+ visibilityTimeoutMs: Schema.optional(Schema.Number)
507
+ })
508
+ .pipe(Schema.encodeKeys({ batchSize: "batch_size", visibilityTimeoutMs: "visibility_timeout_ms" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages/pull" })) as unknown as Schema.Schema<PullMessageRequest>;
1032
509
 
1033
510
  export interface PullMessageResponse {
1034
511
  /** The number of unacknowledged messages in the queue */
1035
512
  messageBacklogCount?: number | null;
1036
- messages?:
1037
- | {
1038
- id?: string | null;
1039
- attempts?: number | null;
1040
- body?: string | null;
1041
- leaseId?: string | null;
1042
- metadata?: unknown | null;
1043
- timestampMs?: number | null;
1044
- }[]
1045
- | null;
513
+ messages?: ({ id?: string | null; attempts?: number | null; body?: string | null; leaseId?: string | null; metadata?: unknown | null; timestampMs?: number | null })[] | null;
1046
514
  }
1047
515
 
1048
516
  export const PullMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1049
- messageBacklogCount: Schema.optional(
1050
- Schema.Union([Schema.Number, Schema.Null]),
1051
- ),
1052
- messages: Schema.optional(
1053
- Schema.Union([
1054
- Schema.Array(
1055
- Schema.Struct({
1056
- id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1057
- attempts: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1058
- body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1059
- leaseId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1060
- metadata: Schema.optional(
1061
- Schema.Union([Schema.Unknown, Schema.Null]),
1062
- ),
1063
- timestampMs: Schema.optional(
1064
- Schema.Union([Schema.Number, Schema.Null]),
1065
- ),
1066
- }).pipe(
1067
- Schema.encodeKeys({
1068
- id: "id",
1069
- attempts: "attempts",
1070
- body: "body",
1071
- leaseId: "lease_id",
1072
- metadata: "metadata",
1073
- timestampMs: "timestamp_ms",
1074
- }),
1075
- ),
1076
- ),
1077
- Schema.Null,
1078
- ]),
1079
- ),
1080
- })
1081
- .pipe(
1082
- Schema.encodeKeys({
1083
- messageBacklogCount: "message_backlog_count",
1084
- messages: "messages",
1085
- }),
1086
- )
1087
- .pipe(
1088
- T.ResponsePath("result"),
1089
- ) as unknown as Schema.Schema<PullMessageResponse>;
517
+ messageBacklogCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
518
+ messages: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
519
+ id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
520
+ attempts: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
521
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
522
+ leaseId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
523
+ metadata: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
524
+ timestampMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
525
+ }).pipe(Schema.encodeKeys({ id: "id", attempts: "attempts", body: "body", leaseId: "lease_id", metadata: "metadata", timestampMs: "timestamp_ms" }))), Schema.Null]))
526
+ }).pipe(Schema.encodeKeys({ messageBacklogCount: "message_backlog_count", messages: "messages" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<PullMessageResponse>;
1090
527
 
1091
528
  export type PullMessageError =
1092
529
  | DefaultErrors
1093
530
  | InvalidRequestBody
1094
531
  | InvalidQueueId
532
+ | QueueNotFound
1095
533
  | InvalidRoute;
1096
534
 
1097
535
  export const pullMessage: API.OperationMethod<
@@ -1102,7 +540,7 @@ export const pullMessage: API.OperationMethod<
1102
540
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1103
541
  input: PullMessageRequest,
1104
542
  output: PullMessageResponse,
1105
- errors: [InvalidRequestBody, InvalidQueueId, InvalidRoute],
543
+ errors: [InvalidRequestBody, InvalidQueueId, QueueNotFound, InvalidRoute],
1106
544
  }));
1107
545
 
1108
546
  export interface PushMessageRequest {
@@ -1122,69 +560,28 @@ export const PushMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1122
560
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1123
561
  body: Schema.optional(Schema.String),
1124
562
  contentType: Schema.optional(Schema.Literal("text")),
1125
- delaySeconds: Schema.optional(Schema.Number),
1126
- }).pipe(
1127
- Schema.encodeKeys({
1128
- body: "body",
1129
- contentType: "content_type",
1130
- delaySeconds: "delay_seconds",
1131
- }),
1132
- T.Http({
1133
- method: "POST",
1134
- path: "/accounts/{account_id}/queues/{queueId}/messages",
1135
- }),
1136
- ) as unknown as Schema.Schema<PushMessageRequest>;
563
+ delaySeconds: Schema.optional(Schema.Number)
564
+ })
565
+ .pipe(Schema.encodeKeys({ body: "body", contentType: "content_type", delaySeconds: "delay_seconds" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages" })) as unknown as Schema.Schema<PushMessageRequest>;
1137
566
 
1138
567
  export interface PushMessageResponse {
1139
- errors?:
1140
- | {
1141
- code: number;
1142
- message: string;
1143
- documentationUrl?: string | null;
1144
- source?: { pointer?: string | null } | null;
1145
- }[]
1146
- | null;
568
+ errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
1147
569
  messages?: string[] | null;
1148
570
  /** Indicates if the API call was successful or not. */
1149
571
  success?: true | null;
1150
572
  }
1151
573
 
1152
574
  export const PushMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1153
- errors: Schema.optional(
1154
- Schema.Union([
1155
- Schema.Array(
1156
- Schema.Struct({
1157
- code: Schema.Number,
1158
- message: Schema.String,
1159
- documentationUrl: Schema.optional(
1160
- Schema.Union([Schema.String, Schema.Null]),
1161
- ),
1162
- source: Schema.optional(
1163
- Schema.Union([
1164
- Schema.Struct({
1165
- pointer: Schema.optional(
1166
- Schema.Union([Schema.String, Schema.Null]),
1167
- ),
1168
- }),
1169
- Schema.Null,
1170
- ]),
1171
- ),
1172
- }).pipe(
1173
- Schema.encodeKeys({
1174
- code: "code",
1175
- message: "message",
1176
- documentationUrl: "documentation_url",
1177
- source: "source",
1178
- }),
1179
- ),
1180
- ),
1181
- Schema.Null,
1182
- ]),
1183
- ),
1184
- messages: Schema.optional(
1185
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1186
- ),
1187
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
575
+ errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
576
+ code: Schema.Number,
577
+ message: Schema.String,
578
+ documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
579
+ source: Schema.optional(Schema.Union([Schema.Struct({
580
+ pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
581
+ }), Schema.Null]))
582
+ }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
583
+ messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
584
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
1188
585
  }) as unknown as Schema.Schema<PushMessageResponse>;
1189
586
 
1190
587
  export type PushMessageError =
@@ -1217,32 +614,15 @@ export interface AckMessageRequest {
1217
614
  export const AckMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1218
615
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1219
616
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1220
- acks: Schema.optional(
1221
- Schema.Array(
1222
- Schema.Struct({
1223
- leaseId: Schema.optional(Schema.String),
1224
- }).pipe(Schema.encodeKeys({ leaseId: "lease_id" })),
1225
- ),
1226
- ),
1227
- retries: Schema.optional(
1228
- Schema.Array(
1229
- Schema.Struct({
1230
- delaySeconds: Schema.optional(Schema.Number),
1231
- leaseId: Schema.optional(Schema.String),
1232
- }).pipe(
1233
- Schema.encodeKeys({
1234
- delaySeconds: "delay_seconds",
1235
- leaseId: "lease_id",
1236
- }),
1237
- ),
1238
- ),
1239
- ),
1240
- }).pipe(
1241
- T.Http({
1242
- method: "POST",
1243
- path: "/accounts/{account_id}/queues/{queueId}/messages/ack",
1244
- }),
1245
- ) as unknown as Schema.Schema<AckMessageRequest>;
617
+ acks: Schema.optional(Schema.Array(Schema.Struct({
618
+ leaseId: Schema.optional(Schema.String)
619
+ }).pipe(Schema.encodeKeys({ leaseId: "lease_id" })))),
620
+ retries: Schema.optional(Schema.Array(Schema.Struct({
621
+ delaySeconds: Schema.optional(Schema.Number),
622
+ leaseId: Schema.optional(Schema.String)
623
+ }).pipe(Schema.encodeKeys({ delaySeconds: "delay_seconds", leaseId: "lease_id" }))))
624
+ })
625
+ .pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages/ack" })) as unknown as Schema.Schema<AckMessageRequest>;
1246
626
 
1247
627
  export interface AckMessageResponse {
1248
628
  /** The number of messages that were succesfully acknowledged. */
@@ -1255,17 +635,14 @@ export interface AckMessageResponse {
1255
635
  export const AckMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1256
636
  ackCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1257
637
  retryCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1258
- warnings: Schema.optional(
1259
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1260
- ),
1261
- }).pipe(
1262
- T.ResponsePath("result"),
1263
- ) as unknown as Schema.Schema<AckMessageResponse>;
638
+ warnings: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null]))
639
+ }).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<AckMessageResponse>;
1264
640
 
1265
641
  export type AckMessageError =
1266
642
  | DefaultErrors
1267
643
  | InvalidRequestBody
1268
644
  | InvalidQueueId
645
+ | QueueNotFound
1269
646
  | InvalidRoute;
1270
647
 
1271
648
  export const ackMessage: API.OperationMethod<
@@ -1276,9 +653,10 @@ export const ackMessage: API.OperationMethod<
1276
653
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
1277
654
  input: AckMessageRequest,
1278
655
  output: AckMessageResponse,
1279
- errors: [InvalidRequestBody, InvalidQueueId, InvalidRoute],
656
+ errors: [InvalidRequestBody, InvalidQueueId, QueueNotFound, InvalidRoute],
1280
657
  }));
1281
658
 
659
+
1282
660
  // =============================================================================
1283
661
  // Purge
1284
662
  // =============================================================================
@@ -1294,255 +672,72 @@ export interface StartPurgeRequest {
1294
672
  export const StartPurgeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1295
673
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1296
674
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1297
- deleteMessagesPermanently: Schema.optional(Schema.Boolean),
1298
- }).pipe(
1299
- Schema.encodeKeys({
1300
- deleteMessagesPermanently: "delete_messages_permanently",
1301
- }),
1302
- T.Http({
1303
- method: "POST",
1304
- path: "/accounts/{account_id}/queues/{queueId}/purge",
1305
- }),
1306
- ) as unknown as Schema.Schema<StartPurgeRequest>;
675
+ deleteMessagesPermanently: Schema.optional(Schema.Boolean)
676
+ })
677
+ .pipe(Schema.encodeKeys({ deleteMessagesPermanently: "delete_messages_permanently" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/purge" })) as unknown as Schema.Schema<StartPurgeRequest>;
1307
678
 
1308
679
  export interface StartPurgeResponse {
1309
- consumers?:
1310
- | (
1311
- | {
1312
- consumerId?: string | null;
1313
- createdOn?: string | null;
1314
- queueId?: string | null;
1315
- script?: string | null;
1316
- settings?: {
1317
- batchSize?: number | null;
1318
- maxConcurrency?: number | null;
1319
- maxRetries?: number | null;
1320
- maxWaitTimeMs?: number | null;
1321
- retryDelay?: number | null;
1322
- } | null;
1323
- type?: "worker" | null;
1324
- }
1325
- | {
1326
- consumerId?: string | null;
1327
- createdOn?: string | null;
1328
- queueId?: string | null;
1329
- settings?: {
1330
- batchSize?: number | null;
1331
- maxRetries?: number | null;
1332
- retryDelay?: number | null;
1333
- visibilityTimeoutMs?: number | null;
1334
- } | null;
1335
- type?: "http_pull" | null;
1336
- }
1337
- )[]
1338
- | null;
680
+ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
1339
681
  consumersTotalCount?: number | null;
1340
682
  createdOn?: string | null;
1341
683
  modifiedOn?: string | null;
1342
- producers?:
1343
- | (
1344
- | { script?: string | null; type?: "worker" | null }
1345
- | { bucketName?: string | null; type?: "r2_bucket" | null }
1346
- )[]
1347
- | null;
684
+ producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
1348
685
  producersTotalCount?: number | null;
1349
686
  queueId?: string | null;
1350
687
  queueName?: string | null;
1351
- settings?: {
1352
- deliveryDelay?: number | null;
1353
- deliveryPaused?: boolean | null;
1354
- messageRetentionPeriod?: number | null;
1355
- } | null;
688
+ settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
1356
689
  }
1357
690
 
1358
691
  export const StartPurgeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1359
- consumers: Schema.optional(
1360
- Schema.Union([
1361
- Schema.Array(
1362
- Schema.Union([
1363
- Schema.Struct({
1364
- consumerId: Schema.optional(
1365
- Schema.Union([Schema.String, Schema.Null]),
1366
- ),
1367
- createdOn: Schema.optional(
1368
- Schema.Union([Schema.String, Schema.Null]),
1369
- ),
1370
- queueId: Schema.optional(
1371
- Schema.Union([Schema.String, Schema.Null]),
1372
- ),
1373
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1374
- settings: Schema.optional(
1375
- Schema.Union([
1376
- Schema.Struct({
1377
- batchSize: Schema.optional(
1378
- Schema.Union([Schema.Number, Schema.Null]),
1379
- ),
1380
- maxConcurrency: Schema.optional(
1381
- Schema.Union([Schema.Number, Schema.Null]),
1382
- ),
1383
- maxRetries: Schema.optional(
1384
- Schema.Union([Schema.Number, Schema.Null]),
1385
- ),
1386
- maxWaitTimeMs: Schema.optional(
1387
- Schema.Union([Schema.Number, Schema.Null]),
1388
- ),
1389
- retryDelay: Schema.optional(
1390
- Schema.Union([Schema.Number, Schema.Null]),
1391
- ),
1392
- }).pipe(
1393
- Schema.encodeKeys({
1394
- batchSize: "batch_size",
1395
- maxConcurrency: "max_concurrency",
1396
- maxRetries: "max_retries",
1397
- maxWaitTimeMs: "max_wait_time_ms",
1398
- retryDelay: "retry_delay",
1399
- }),
1400
- ),
1401
- Schema.Null,
1402
- ]),
1403
- ),
1404
- type: Schema.optional(
1405
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
1406
- ),
1407
- }).pipe(
1408
- Schema.encodeKeys({
1409
- consumerId: "consumer_id",
1410
- createdOn: "created_on",
1411
- queueId: "queue_id",
1412
- script: "script",
1413
- settings: "settings",
1414
- type: "type",
1415
- }),
1416
- ),
1417
- Schema.Struct({
1418
- consumerId: Schema.optional(
1419
- Schema.Union([Schema.String, Schema.Null]),
1420
- ),
1421
- createdOn: Schema.optional(
1422
- Schema.Union([Schema.String, Schema.Null]),
1423
- ),
1424
- queueId: Schema.optional(
1425
- Schema.Union([Schema.String, Schema.Null]),
1426
- ),
1427
- settings: Schema.optional(
1428
- Schema.Union([
1429
- Schema.Struct({
1430
- batchSize: Schema.optional(
1431
- Schema.Union([Schema.Number, Schema.Null]),
1432
- ),
1433
- maxRetries: Schema.optional(
1434
- Schema.Union([Schema.Number, Schema.Null]),
1435
- ),
1436
- retryDelay: Schema.optional(
1437
- Schema.Union([Schema.Number, Schema.Null]),
1438
- ),
1439
- visibilityTimeoutMs: Schema.optional(
1440
- Schema.Union([Schema.Number, Schema.Null]),
1441
- ),
1442
- }).pipe(
1443
- Schema.encodeKeys({
1444
- batchSize: "batch_size",
1445
- maxRetries: "max_retries",
1446
- retryDelay: "retry_delay",
1447
- visibilityTimeoutMs: "visibility_timeout_ms",
1448
- }),
1449
- ),
1450
- Schema.Null,
1451
- ]),
1452
- ),
1453
- type: Schema.optional(
1454
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
1455
- ),
1456
- }).pipe(
1457
- Schema.encodeKeys({
1458
- consumerId: "consumer_id",
1459
- createdOn: "created_on",
1460
- queueId: "queue_id",
1461
- settings: "settings",
1462
- type: "type",
1463
- }),
1464
- ),
1465
- ]),
1466
- ),
1467
- Schema.Null,
1468
- ]),
1469
- ),
1470
- consumersTotalCount: Schema.optional(
1471
- Schema.Union([Schema.Number, Schema.Null]),
1472
- ),
692
+ consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
693
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
694
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
695
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
696
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
697
+ settings: Schema.optional(Schema.Union([Schema.Struct({
698
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
699
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
700
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
701
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
702
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
703
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
704
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
705
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
706
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
707
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
708
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
709
+ settings: Schema.optional(Schema.Union([Schema.Struct({
710
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
711
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
712
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
713
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
714
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
715
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
716
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
717
+ consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1473
718
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1474
719
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1475
- producers: Schema.optional(
1476
- Schema.Union([
1477
- Schema.Array(
1478
- Schema.Union([
1479
- Schema.Struct({
1480
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1481
- type: Schema.optional(
1482
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
1483
- ),
1484
- }),
1485
- Schema.Struct({
1486
- bucketName: Schema.optional(
1487
- Schema.Union([Schema.String, Schema.Null]),
1488
- ),
1489
- type: Schema.optional(
1490
- Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1491
- ),
1492
- }).pipe(
1493
- Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1494
- ),
1495
- ]),
1496
- ),
1497
- Schema.Null,
1498
- ]),
1499
- ),
1500
- producersTotalCount: Schema.optional(
1501
- Schema.Union([Schema.Number, Schema.Null]),
1502
- ),
720
+ producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
721
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
722
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
723
+ }), Schema.Struct({
724
+ bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
725
+ type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
726
+ }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
727
+ producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1503
728
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1504
729
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1505
- settings: Schema.optional(
1506
- Schema.Union([
1507
- Schema.Struct({
1508
- deliveryDelay: Schema.optional(
1509
- Schema.Union([Schema.Number, Schema.Null]),
1510
- ),
1511
- deliveryPaused: Schema.optional(
1512
- Schema.Union([Schema.Boolean, Schema.Null]),
1513
- ),
1514
- messageRetentionPeriod: Schema.optional(
1515
- Schema.Union([Schema.Number, Schema.Null]),
1516
- ),
1517
- }).pipe(
1518
- Schema.encodeKeys({
1519
- deliveryDelay: "delivery_delay",
1520
- deliveryPaused: "delivery_paused",
1521
- messageRetentionPeriod: "message_retention_period",
1522
- }),
1523
- ),
1524
- Schema.Null,
1525
- ]),
1526
- ),
1527
- })
1528
- .pipe(
1529
- Schema.encodeKeys({
1530
- consumers: "consumers",
1531
- consumersTotalCount: "consumers_total_count",
1532
- createdOn: "created_on",
1533
- modifiedOn: "modified_on",
1534
- producers: "producers",
1535
- producersTotalCount: "producers_total_count",
1536
- queueId: "queue_id",
1537
- queueName: "queue_name",
1538
- settings: "settings",
1539
- }),
1540
- )
1541
- .pipe(
1542
- T.ResponsePath("result"),
1543
- ) as unknown as Schema.Schema<StartPurgeResponse>;
1544
-
1545
- export type StartPurgeError = DefaultErrors | InvalidQueueId | InvalidRoute;
730
+ settings: Schema.optional(Schema.Union([Schema.Struct({
731
+ deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
732
+ deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
733
+ messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
734
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
735
+ }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<StartPurgeResponse>;
736
+
737
+ export type StartPurgeError =
738
+ | DefaultErrors
739
+ | InvalidQueueId
740
+ | InvalidRoute;
1546
741
 
1547
742
  export const startPurge: API.OperationMethod<
1548
743
  StartPurgeRequest,
@@ -1563,13 +758,9 @@ export interface StatusPurgeRequest {
1563
758
 
1564
759
  export const StatusPurgeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1565
760
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1566
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
1567
- }).pipe(
1568
- T.Http({
1569
- method: "GET",
1570
- path: "/accounts/{account_id}/queues/{queueId}/purge",
1571
- }),
1572
- ) as unknown as Schema.Schema<StatusPurgeRequest>;
761
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
762
+ })
763
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}/purge" })) as unknown as Schema.Schema<StatusPurgeRequest>;
1573
764
 
1574
765
  export interface StatusPurgeResponse {
1575
766
  /** Indicates if the last purge operation completed successfully. */
@@ -1580,14 +771,13 @@ export interface StatusPurgeResponse {
1580
771
 
1581
772
  export const StatusPurgeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1582
773
  completed: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1583
- startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1584
- })
1585
- .pipe(Schema.encodeKeys({ completed: "completed", startedAt: "started_at" }))
1586
- .pipe(
1587
- T.ResponsePath("result"),
1588
- ) as unknown as Schema.Schema<StatusPurgeResponse>;
774
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
775
+ }).pipe(Schema.encodeKeys({ completed: "completed", startedAt: "started_at" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<StatusPurgeResponse>;
1589
776
 
1590
- export type StatusPurgeError = DefaultErrors | InvalidQueueId | InvalidRoute;
777
+ export type StatusPurgeError =
778
+ | DefaultErrors
779
+ | InvalidQueueId
780
+ | InvalidRoute;
1591
781
 
1592
782
  export const statusPurge: API.OperationMethod<
1593
783
  StatusPurgeRequest,
@@ -1600,6 +790,7 @@ export const statusPurge: API.OperationMethod<
1600
790
  errors: [InvalidQueueId, InvalidRoute],
1601
791
  }));
1602
792
 
793
+
1603
794
  // =============================================================================
1604
795
  // Queue
1605
796
  // =============================================================================
@@ -1612,247 +803,72 @@ export interface GetQueueRequest {
1612
803
 
1613
804
  export const GetQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1614
805
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1615
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
1616
- }).pipe(
1617
- T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}" }),
1618
- ) as unknown as Schema.Schema<GetQueueRequest>;
806
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
807
+ })
808
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<GetQueueRequest>;
1619
809
 
1620
810
  export interface GetQueueResponse {
1621
- consumers?:
1622
- | (
1623
- | {
1624
- consumerId?: string | null;
1625
- createdOn?: string | null;
1626
- queueId?: string | null;
1627
- script?: string | null;
1628
- settings?: {
1629
- batchSize?: number | null;
1630
- maxConcurrency?: number | null;
1631
- maxRetries?: number | null;
1632
- maxWaitTimeMs?: number | null;
1633
- retryDelay?: number | null;
1634
- } | null;
1635
- type?: "worker" | null;
1636
- }
1637
- | {
1638
- consumerId?: string | null;
1639
- createdOn?: string | null;
1640
- queueId?: string | null;
1641
- settings?: {
1642
- batchSize?: number | null;
1643
- maxRetries?: number | null;
1644
- retryDelay?: number | null;
1645
- visibilityTimeoutMs?: number | null;
1646
- } | null;
1647
- type?: "http_pull" | null;
1648
- }
1649
- )[]
1650
- | null;
811
+ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
1651
812
  consumersTotalCount?: number | null;
1652
813
  createdOn?: string | null;
1653
814
  modifiedOn?: string | null;
1654
- producers?:
1655
- | (
1656
- | { script?: string | null; type?: "worker" | null }
1657
- | { bucketName?: string | null; type?: "r2_bucket" | null }
1658
- )[]
1659
- | null;
815
+ producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
1660
816
  producersTotalCount?: number | null;
1661
817
  queueId?: string | null;
1662
818
  queueName?: string | null;
1663
- settings?: {
1664
- deliveryDelay?: number | null;
1665
- deliveryPaused?: boolean | null;
1666
- messageRetentionPeriod?: number | null;
1667
- } | null;
819
+ settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
1668
820
  }
1669
821
 
1670
822
  export const GetQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1671
- consumers: Schema.optional(
1672
- Schema.Union([
1673
- Schema.Array(
1674
- Schema.Union([
1675
- Schema.Struct({
1676
- consumerId: Schema.optional(
1677
- Schema.Union([Schema.String, Schema.Null]),
1678
- ),
1679
- createdOn: Schema.optional(
1680
- Schema.Union([Schema.String, Schema.Null]),
1681
- ),
1682
- queueId: Schema.optional(
1683
- Schema.Union([Schema.String, Schema.Null]),
1684
- ),
1685
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1686
- settings: Schema.optional(
1687
- Schema.Union([
1688
- Schema.Struct({
1689
- batchSize: Schema.optional(
1690
- Schema.Union([Schema.Number, Schema.Null]),
1691
- ),
1692
- maxConcurrency: Schema.optional(
1693
- Schema.Union([Schema.Number, Schema.Null]),
1694
- ),
1695
- maxRetries: Schema.optional(
1696
- Schema.Union([Schema.Number, Schema.Null]),
1697
- ),
1698
- maxWaitTimeMs: Schema.optional(
1699
- Schema.Union([Schema.Number, Schema.Null]),
1700
- ),
1701
- retryDelay: Schema.optional(
1702
- Schema.Union([Schema.Number, Schema.Null]),
1703
- ),
1704
- }).pipe(
1705
- Schema.encodeKeys({
1706
- batchSize: "batch_size",
1707
- maxConcurrency: "max_concurrency",
1708
- maxRetries: "max_retries",
1709
- maxWaitTimeMs: "max_wait_time_ms",
1710
- retryDelay: "retry_delay",
1711
- }),
1712
- ),
1713
- Schema.Null,
1714
- ]),
1715
- ),
1716
- type: Schema.optional(
1717
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
1718
- ),
1719
- }).pipe(
1720
- Schema.encodeKeys({
1721
- consumerId: "consumer_id",
1722
- createdOn: "created_on",
1723
- queueId: "queue_id",
1724
- script: "script",
1725
- settings: "settings",
1726
- type: "type",
1727
- }),
1728
- ),
1729
- Schema.Struct({
1730
- consumerId: Schema.optional(
1731
- Schema.Union([Schema.String, Schema.Null]),
1732
- ),
1733
- createdOn: Schema.optional(
1734
- Schema.Union([Schema.String, Schema.Null]),
1735
- ),
1736
- queueId: Schema.optional(
1737
- Schema.Union([Schema.String, Schema.Null]),
1738
- ),
1739
- settings: Schema.optional(
1740
- Schema.Union([
1741
- Schema.Struct({
1742
- batchSize: Schema.optional(
1743
- Schema.Union([Schema.Number, Schema.Null]),
1744
- ),
1745
- maxRetries: Schema.optional(
1746
- Schema.Union([Schema.Number, Schema.Null]),
1747
- ),
1748
- retryDelay: Schema.optional(
1749
- Schema.Union([Schema.Number, Schema.Null]),
1750
- ),
1751
- visibilityTimeoutMs: Schema.optional(
1752
- Schema.Union([Schema.Number, Schema.Null]),
1753
- ),
1754
- }).pipe(
1755
- Schema.encodeKeys({
1756
- batchSize: "batch_size",
1757
- maxRetries: "max_retries",
1758
- retryDelay: "retry_delay",
1759
- visibilityTimeoutMs: "visibility_timeout_ms",
1760
- }),
1761
- ),
1762
- Schema.Null,
1763
- ]),
1764
- ),
1765
- type: Schema.optional(
1766
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
1767
- ),
1768
- }).pipe(
1769
- Schema.encodeKeys({
1770
- consumerId: "consumer_id",
1771
- createdOn: "created_on",
1772
- queueId: "queue_id",
1773
- settings: "settings",
1774
- type: "type",
1775
- }),
1776
- ),
1777
- ]),
1778
- ),
1779
- Schema.Null,
1780
- ]),
1781
- ),
1782
- consumersTotalCount: Schema.optional(
1783
- Schema.Union([Schema.Number, Schema.Null]),
1784
- ),
823
+ consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
824
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
825
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
826
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
827
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
828
+ settings: Schema.optional(Schema.Union([Schema.Struct({
829
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
830
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
831
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
832
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
833
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
834
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
835
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
836
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
837
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
838
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
839
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
840
+ settings: Schema.optional(Schema.Union([Schema.Struct({
841
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
842
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
843
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
844
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
845
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
846
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
847
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
848
+ consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1785
849
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1786
850
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1787
- producers: Schema.optional(
1788
- Schema.Union([
1789
- Schema.Array(
1790
- Schema.Union([
1791
- Schema.Struct({
1792
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1793
- type: Schema.optional(
1794
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
1795
- ),
1796
- }),
1797
- Schema.Struct({
1798
- bucketName: Schema.optional(
1799
- Schema.Union([Schema.String, Schema.Null]),
1800
- ),
1801
- type: Schema.optional(
1802
- Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1803
- ),
1804
- }).pipe(
1805
- Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1806
- ),
1807
- ]),
1808
- ),
1809
- Schema.Null,
1810
- ]),
1811
- ),
1812
- producersTotalCount: Schema.optional(
1813
- Schema.Union([Schema.Number, Schema.Null]),
1814
- ),
851
+ producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
852
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
853
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
854
+ }), Schema.Struct({
855
+ bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
856
+ type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
857
+ }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
858
+ producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1815
859
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1816
860
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1817
- settings: Schema.optional(
1818
- Schema.Union([
1819
- Schema.Struct({
1820
- deliveryDelay: Schema.optional(
1821
- Schema.Union([Schema.Number, Schema.Null]),
1822
- ),
1823
- deliveryPaused: Schema.optional(
1824
- Schema.Union([Schema.Boolean, Schema.Null]),
1825
- ),
1826
- messageRetentionPeriod: Schema.optional(
1827
- Schema.Union([Schema.Number, Schema.Null]),
1828
- ),
1829
- }).pipe(
1830
- Schema.encodeKeys({
1831
- deliveryDelay: "delivery_delay",
1832
- deliveryPaused: "delivery_paused",
1833
- messageRetentionPeriod: "message_retention_period",
1834
- }),
1835
- ),
1836
- Schema.Null,
1837
- ]),
1838
- ),
1839
- })
1840
- .pipe(
1841
- Schema.encodeKeys({
1842
- consumers: "consumers",
1843
- consumersTotalCount: "consumers_total_count",
1844
- createdOn: "created_on",
1845
- modifiedOn: "modified_on",
1846
- producers: "producers",
1847
- producersTotalCount: "producers_total_count",
1848
- queueId: "queue_id",
1849
- queueName: "queue_name",
1850
- settings: "settings",
1851
- }),
1852
- )
1853
- .pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetQueueResponse>;
1854
-
1855
- export type GetQueueError = DefaultErrors | QueueNotFound | InvalidRoute;
861
+ settings: Schema.optional(Schema.Union([Schema.Struct({
862
+ deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
863
+ deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
864
+ messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
865
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
866
+ }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetQueueResponse>;
867
+
868
+ export type GetQueueError =
869
+ | DefaultErrors
870
+ | QueueNotFound
871
+ | InvalidRoute;
1856
872
 
1857
873
  export const getQueue: API.OperationMethod<
1858
874
  GetQueueRequest,
@@ -1871,255 +887,65 @@ export interface ListQueuesRequest {
1871
887
  }
1872
888
 
1873
889
  export const ListQueuesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1874
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
1875
- }).pipe(
1876
- T.Http({ method: "GET", path: "/accounts/{account_id}/queues" }),
1877
- ) as unknown as Schema.Schema<ListQueuesRequest>;
890
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
891
+ })
892
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues" })) as unknown as Schema.Schema<ListQueuesRequest>;
1878
893
 
1879
894
  export interface ListQueuesResponse {
1880
- result: {
1881
- consumers?:
1882
- | (
1883
- | {
1884
- consumerId?: string | null;
1885
- createdOn?: string | null;
1886
- queueId?: string | null;
1887
- script?: string | null;
1888
- settings?: {
1889
- batchSize?: number | null;
1890
- maxConcurrency?: number | null;
1891
- maxRetries?: number | null;
1892
- maxWaitTimeMs?: number | null;
1893
- retryDelay?: number | null;
1894
- } | null;
1895
- type?: "worker" | null;
1896
- }
1897
- | {
1898
- consumerId?: string | null;
1899
- createdOn?: string | null;
1900
- queueId?: string | null;
1901
- settings?: {
1902
- batchSize?: number | null;
1903
- maxRetries?: number | null;
1904
- retryDelay?: number | null;
1905
- visibilityTimeoutMs?: number | null;
1906
- } | null;
1907
- type?: "http_pull" | null;
1908
- }
1909
- )[]
1910
- | null;
1911
- consumersTotalCount?: number | null;
1912
- createdOn?: string | null;
1913
- modifiedOn?: string | null;
1914
- producers?:
1915
- | (
1916
- | { script?: string | null; type?: "worker" | null }
1917
- | { bucketName?: string | null; type?: "r2_bucket" | null }
1918
- )[]
1919
- | null;
1920
- producersTotalCount?: number | null;
1921
- queueId?: string | null;
1922
- queueName?: string | null;
1923
- settings?: {
1924
- deliveryDelay?: number | null;
1925
- deliveryPaused?: boolean | null;
1926
- messageRetentionPeriod?: number | null;
1927
- } | null;
1928
- }[];
895
+ result: ({ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null; consumersTotalCount?: number | null; createdOn?: string | null; modifiedOn?: string | null; producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null; producersTotalCount?: number | null; queueId?: string | null; queueName?: string | null; settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null })[];
1929
896
  }
1930
897
 
1931
898
  export const ListQueuesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1932
- result: Schema.Array(
1933
- Schema.Struct({
1934
- consumers: Schema.optional(
1935
- Schema.Union([
1936
- Schema.Array(
1937
- Schema.Union([
1938
- Schema.Struct({
1939
- consumerId: Schema.optional(
1940
- Schema.Union([Schema.String, Schema.Null]),
1941
- ),
1942
- createdOn: Schema.optional(
1943
- Schema.Union([Schema.String, Schema.Null]),
1944
- ),
1945
- queueId: Schema.optional(
1946
- Schema.Union([Schema.String, Schema.Null]),
1947
- ),
1948
- script: Schema.optional(
1949
- Schema.Union([Schema.String, Schema.Null]),
1950
- ),
1951
- settings: Schema.optional(
1952
- Schema.Union([
1953
- Schema.Struct({
1954
- batchSize: Schema.optional(
1955
- Schema.Union([Schema.Number, Schema.Null]),
1956
- ),
1957
- maxConcurrency: Schema.optional(
1958
- Schema.Union([Schema.Number, Schema.Null]),
1959
- ),
1960
- maxRetries: Schema.optional(
1961
- Schema.Union([Schema.Number, Schema.Null]),
1962
- ),
1963
- maxWaitTimeMs: Schema.optional(
1964
- Schema.Union([Schema.Number, Schema.Null]),
1965
- ),
1966
- retryDelay: Schema.optional(
1967
- Schema.Union([Schema.Number, Schema.Null]),
1968
- ),
1969
- }).pipe(
1970
- Schema.encodeKeys({
1971
- batchSize: "batch_size",
1972
- maxConcurrency: "max_concurrency",
1973
- maxRetries: "max_retries",
1974
- maxWaitTimeMs: "max_wait_time_ms",
1975
- retryDelay: "retry_delay",
1976
- }),
1977
- ),
1978
- Schema.Null,
1979
- ]),
1980
- ),
1981
- type: Schema.optional(
1982
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
1983
- ),
1984
- }).pipe(
1985
- Schema.encodeKeys({
1986
- consumerId: "consumer_id",
1987
- createdOn: "created_on",
1988
- queueId: "queue_id",
1989
- script: "script",
1990
- settings: "settings",
1991
- type: "type",
1992
- }),
1993
- ),
1994
- Schema.Struct({
1995
- consumerId: Schema.optional(
1996
- Schema.Union([Schema.String, Schema.Null]),
1997
- ),
1998
- createdOn: Schema.optional(
1999
- Schema.Union([Schema.String, Schema.Null]),
2000
- ),
2001
- queueId: Schema.optional(
2002
- Schema.Union([Schema.String, Schema.Null]),
2003
- ),
2004
- settings: Schema.optional(
2005
- Schema.Union([
2006
- Schema.Struct({
2007
- batchSize: Schema.optional(
2008
- Schema.Union([Schema.Number, Schema.Null]),
2009
- ),
2010
- maxRetries: Schema.optional(
2011
- Schema.Union([Schema.Number, Schema.Null]),
2012
- ),
2013
- retryDelay: Schema.optional(
2014
- Schema.Union([Schema.Number, Schema.Null]),
2015
- ),
2016
- visibilityTimeoutMs: Schema.optional(
2017
- Schema.Union([Schema.Number, Schema.Null]),
2018
- ),
2019
- }).pipe(
2020
- Schema.encodeKeys({
2021
- batchSize: "batch_size",
2022
- maxRetries: "max_retries",
2023
- retryDelay: "retry_delay",
2024
- visibilityTimeoutMs: "visibility_timeout_ms",
2025
- }),
2026
- ),
2027
- Schema.Null,
2028
- ]),
2029
- ),
2030
- type: Schema.optional(
2031
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2032
- ),
2033
- }).pipe(
2034
- Schema.encodeKeys({
2035
- consumerId: "consumer_id",
2036
- createdOn: "created_on",
2037
- queueId: "queue_id",
2038
- settings: "settings",
2039
- type: "type",
2040
- }),
2041
- ),
2042
- ]),
2043
- ),
2044
- Schema.Null,
2045
- ]),
2046
- ),
2047
- consumersTotalCount: Schema.optional(
2048
- Schema.Union([Schema.Number, Schema.Null]),
2049
- ),
2050
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2051
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2052
- producers: Schema.optional(
2053
- Schema.Union([
2054
- Schema.Array(
2055
- Schema.Union([
2056
- Schema.Struct({
2057
- script: Schema.optional(
2058
- Schema.Union([Schema.String, Schema.Null]),
2059
- ),
2060
- type: Schema.optional(
2061
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2062
- ),
2063
- }),
2064
- Schema.Struct({
2065
- bucketName: Schema.optional(
2066
- Schema.Union([Schema.String, Schema.Null]),
2067
- ),
2068
- type: Schema.optional(
2069
- Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2070
- ),
2071
- }).pipe(
2072
- Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2073
- ),
2074
- ]),
2075
- ),
2076
- Schema.Null,
2077
- ]),
2078
- ),
2079
- producersTotalCount: Schema.optional(
2080
- Schema.Union([Schema.Number, Schema.Null]),
2081
- ),
2082
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2083
- queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2084
- settings: Schema.optional(
2085
- Schema.Union([
2086
- Schema.Struct({
2087
- deliveryDelay: Schema.optional(
2088
- Schema.Union([Schema.Number, Schema.Null]),
2089
- ),
2090
- deliveryPaused: Schema.optional(
2091
- Schema.Union([Schema.Boolean, Schema.Null]),
2092
- ),
2093
- messageRetentionPeriod: Schema.optional(
2094
- Schema.Union([Schema.Number, Schema.Null]),
2095
- ),
2096
- }).pipe(
2097
- Schema.encodeKeys({
2098
- deliveryDelay: "delivery_delay",
2099
- deliveryPaused: "delivery_paused",
2100
- messageRetentionPeriod: "message_retention_period",
2101
- }),
2102
- ),
2103
- Schema.Null,
2104
- ]),
2105
- ),
2106
- }).pipe(
2107
- Schema.encodeKeys({
2108
- consumers: "consumers",
2109
- consumersTotalCount: "consumers_total_count",
2110
- createdOn: "created_on",
2111
- modifiedOn: "modified_on",
2112
- producers: "producers",
2113
- producersTotalCount: "producers_total_count",
2114
- queueId: "queue_id",
2115
- queueName: "queue_name",
2116
- settings: "settings",
2117
- }),
2118
- ),
2119
- ),
899
+ result: Schema.Array(Schema.Struct({
900
+ consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
901
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
902
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
903
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
904
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
905
+ settings: Schema.optional(Schema.Union([Schema.Struct({
906
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
907
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
908
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
909
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
910
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
911
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
912
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
913
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
914
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
915
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
916
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
917
+ settings: Schema.optional(Schema.Union([Schema.Struct({
918
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
919
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
920
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
921
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
922
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
923
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
924
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
925
+ consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
926
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
927
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
928
+ producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
929
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
930
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
931
+ }), Schema.Struct({
932
+ bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
933
+ type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
934
+ }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
935
+ producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
936
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
937
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
938
+ settings: Schema.optional(Schema.Union([Schema.Struct({
939
+ deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
940
+ deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
941
+ messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
942
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
943
+ }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })))
2120
944
  }) as unknown as Schema.Schema<ListQueuesResponse>;
2121
945
 
2122
- export type ListQueuesError = DefaultErrors | InvalidRoute;
946
+ export type ListQueuesError =
947
+ | DefaultErrors
948
+ | InvalidRoute;
2123
949
 
2124
950
  export const listQueues: API.PaginatedOperationMethod<
2125
951
  ListQueuesRequest,
@@ -2145,248 +971,67 @@ export interface CreateQueueRequest {
2145
971
 
2146
972
  export const CreateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2147
973
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
2148
- queueName: Schema.String,
2149
- }).pipe(
2150
- Schema.encodeKeys({ queueName: "queue_name" }),
2151
- T.Http({ method: "POST", path: "/accounts/{account_id}/queues" }),
2152
- ) as unknown as Schema.Schema<CreateQueueRequest>;
974
+ queueName: Schema.String
975
+ })
976
+ .pipe(Schema.encodeKeys({ queueName: "queue_name" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues" })) as unknown as Schema.Schema<CreateQueueRequest>;
2153
977
 
2154
978
  export interface CreateQueueResponse {
2155
- consumers?:
2156
- | (
2157
- | {
2158
- consumerId?: string | null;
2159
- createdOn?: string | null;
2160
- queueId?: string | null;
2161
- script?: string | null;
2162
- settings?: {
2163
- batchSize?: number | null;
2164
- maxConcurrency?: number | null;
2165
- maxRetries?: number | null;
2166
- maxWaitTimeMs?: number | null;
2167
- retryDelay?: number | null;
2168
- } | null;
2169
- type?: "worker" | null;
2170
- }
2171
- | {
2172
- consumerId?: string | null;
2173
- createdOn?: string | null;
2174
- queueId?: string | null;
2175
- settings?: {
2176
- batchSize?: number | null;
2177
- maxRetries?: number | null;
2178
- retryDelay?: number | null;
2179
- visibilityTimeoutMs?: number | null;
2180
- } | null;
2181
- type?: "http_pull" | null;
2182
- }
2183
- )[]
2184
- | null;
979
+ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
2185
980
  consumersTotalCount?: number | null;
2186
981
  createdOn?: string | null;
2187
982
  modifiedOn?: string | null;
2188
- producers?:
2189
- | (
2190
- | { script?: string | null; type?: "worker" | null }
2191
- | { bucketName?: string | null; type?: "r2_bucket" | null }
2192
- )[]
2193
- | null;
983
+ producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
2194
984
  producersTotalCount?: number | null;
2195
985
  queueId?: string | null;
2196
986
  queueName?: string | null;
2197
- settings?: {
2198
- deliveryDelay?: number | null;
2199
- deliveryPaused?: boolean | null;
2200
- messageRetentionPeriod?: number | null;
2201
- } | null;
987
+ settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
2202
988
  }
2203
989
 
2204
990
  export const CreateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2205
- consumers: Schema.optional(
2206
- Schema.Union([
2207
- Schema.Array(
2208
- Schema.Union([
2209
- Schema.Struct({
2210
- consumerId: Schema.optional(
2211
- Schema.Union([Schema.String, Schema.Null]),
2212
- ),
2213
- createdOn: Schema.optional(
2214
- Schema.Union([Schema.String, Schema.Null]),
2215
- ),
2216
- queueId: Schema.optional(
2217
- Schema.Union([Schema.String, Schema.Null]),
2218
- ),
2219
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2220
- settings: Schema.optional(
2221
- Schema.Union([
2222
- Schema.Struct({
2223
- batchSize: Schema.optional(
2224
- Schema.Union([Schema.Number, Schema.Null]),
2225
- ),
2226
- maxConcurrency: Schema.optional(
2227
- Schema.Union([Schema.Number, Schema.Null]),
2228
- ),
2229
- maxRetries: Schema.optional(
2230
- Schema.Union([Schema.Number, Schema.Null]),
2231
- ),
2232
- maxWaitTimeMs: Schema.optional(
2233
- Schema.Union([Schema.Number, Schema.Null]),
2234
- ),
2235
- retryDelay: Schema.optional(
2236
- Schema.Union([Schema.Number, Schema.Null]),
2237
- ),
2238
- }).pipe(
2239
- Schema.encodeKeys({
2240
- batchSize: "batch_size",
2241
- maxConcurrency: "max_concurrency",
2242
- maxRetries: "max_retries",
2243
- maxWaitTimeMs: "max_wait_time_ms",
2244
- retryDelay: "retry_delay",
2245
- }),
2246
- ),
2247
- Schema.Null,
2248
- ]),
2249
- ),
2250
- type: Schema.optional(
2251
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2252
- ),
2253
- }).pipe(
2254
- Schema.encodeKeys({
2255
- consumerId: "consumer_id",
2256
- createdOn: "created_on",
2257
- queueId: "queue_id",
2258
- script: "script",
2259
- settings: "settings",
2260
- type: "type",
2261
- }),
2262
- ),
2263
- Schema.Struct({
2264
- consumerId: Schema.optional(
2265
- Schema.Union([Schema.String, Schema.Null]),
2266
- ),
2267
- createdOn: Schema.optional(
2268
- Schema.Union([Schema.String, Schema.Null]),
2269
- ),
2270
- queueId: Schema.optional(
2271
- Schema.Union([Schema.String, Schema.Null]),
2272
- ),
2273
- settings: Schema.optional(
2274
- Schema.Union([
2275
- Schema.Struct({
2276
- batchSize: Schema.optional(
2277
- Schema.Union([Schema.Number, Schema.Null]),
2278
- ),
2279
- maxRetries: Schema.optional(
2280
- Schema.Union([Schema.Number, Schema.Null]),
2281
- ),
2282
- retryDelay: Schema.optional(
2283
- Schema.Union([Schema.Number, Schema.Null]),
2284
- ),
2285
- visibilityTimeoutMs: Schema.optional(
2286
- Schema.Union([Schema.Number, Schema.Null]),
2287
- ),
2288
- }).pipe(
2289
- Schema.encodeKeys({
2290
- batchSize: "batch_size",
2291
- maxRetries: "max_retries",
2292
- retryDelay: "retry_delay",
2293
- visibilityTimeoutMs: "visibility_timeout_ms",
2294
- }),
2295
- ),
2296
- Schema.Null,
2297
- ]),
2298
- ),
2299
- type: Schema.optional(
2300
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2301
- ),
2302
- }).pipe(
2303
- Schema.encodeKeys({
2304
- consumerId: "consumer_id",
2305
- createdOn: "created_on",
2306
- queueId: "queue_id",
2307
- settings: "settings",
2308
- type: "type",
2309
- }),
2310
- ),
2311
- ]),
2312
- ),
2313
- Schema.Null,
2314
- ]),
2315
- ),
2316
- consumersTotalCount: Schema.optional(
2317
- Schema.Union([Schema.Number, Schema.Null]),
2318
- ),
991
+ consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
992
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
993
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
994
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
995
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
996
+ settings: Schema.optional(Schema.Union([Schema.Struct({
997
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
998
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
999
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1000
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1001
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1002
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
1003
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1004
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
1005
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1006
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1007
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1008
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1009
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1010
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1011
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1012
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1013
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
1014
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
1015
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
1016
+ consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2319
1017
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2320
1018
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2321
- producers: Schema.optional(
2322
- Schema.Union([
2323
- Schema.Array(
2324
- Schema.Union([
2325
- Schema.Struct({
2326
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2327
- type: Schema.optional(
2328
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2329
- ),
2330
- }),
2331
- Schema.Struct({
2332
- bucketName: Schema.optional(
2333
- Schema.Union([Schema.String, Schema.Null]),
2334
- ),
2335
- type: Schema.optional(
2336
- Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2337
- ),
2338
- }).pipe(
2339
- Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2340
- ),
2341
- ]),
2342
- ),
2343
- Schema.Null,
2344
- ]),
2345
- ),
2346
- producersTotalCount: Schema.optional(
2347
- Schema.Union([Schema.Number, Schema.Null]),
2348
- ),
1019
+ producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1020
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1021
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1022
+ }), Schema.Struct({
1023
+ bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1024
+ type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
1025
+ }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
1026
+ producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2349
1027
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2350
1028
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2351
- settings: Schema.optional(
2352
- Schema.Union([
2353
- Schema.Struct({
2354
- deliveryDelay: Schema.optional(
2355
- Schema.Union([Schema.Number, Schema.Null]),
2356
- ),
2357
- deliveryPaused: Schema.optional(
2358
- Schema.Union([Schema.Boolean, Schema.Null]),
2359
- ),
2360
- messageRetentionPeriod: Schema.optional(
2361
- Schema.Union([Schema.Number, Schema.Null]),
2362
- ),
2363
- }).pipe(
2364
- Schema.encodeKeys({
2365
- deliveryDelay: "delivery_delay",
2366
- deliveryPaused: "delivery_paused",
2367
- messageRetentionPeriod: "message_retention_period",
2368
- }),
2369
- ),
2370
- Schema.Null,
2371
- ]),
2372
- ),
2373
- })
2374
- .pipe(
2375
- Schema.encodeKeys({
2376
- consumers: "consumers",
2377
- consumersTotalCount: "consumers_total_count",
2378
- createdOn: "created_on",
2379
- modifiedOn: "modified_on",
2380
- producers: "producers",
2381
- producersTotalCount: "producers_total_count",
2382
- queueId: "queue_id",
2383
- queueName: "queue_name",
2384
- settings: "settings",
2385
- }),
2386
- )
2387
- .pipe(
2388
- T.ResponsePath("result"),
2389
- ) as unknown as Schema.Schema<CreateQueueResponse>;
1029
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1030
+ deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1031
+ deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1032
+ messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1033
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
1034
+ }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<CreateQueueResponse>;
2390
1035
 
2391
1036
  export type CreateQueueError =
2392
1037
  | DefaultErrors
@@ -2412,271 +1057,78 @@ export interface UpdateQueueRequest {
2412
1057
  /** Body param: */
2413
1058
  queueName?: string;
2414
1059
  /** Body param: */
2415
- settings?: {
2416
- deliveryDelay?: number;
2417
- deliveryPaused?: boolean;
2418
- messageRetentionPeriod?: number;
2419
- };
1060
+ settings?: { deliveryDelay?: number; deliveryPaused?: boolean; messageRetentionPeriod?: number };
2420
1061
  }
2421
1062
 
2422
1063
  export const UpdateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2423
1064
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
2424
1065
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
2425
1066
  queueName: Schema.optional(Schema.String),
2426
- settings: Schema.optional(
2427
- Schema.Struct({
2428
- deliveryDelay: Schema.optional(Schema.Number),
2429
- deliveryPaused: Schema.optional(Schema.Boolean),
2430
- messageRetentionPeriod: Schema.optional(Schema.Number),
2431
- }).pipe(
2432
- Schema.encodeKeys({
2433
- deliveryDelay: "delivery_delay",
2434
- deliveryPaused: "delivery_paused",
2435
- messageRetentionPeriod: "message_retention_period",
2436
- }),
2437
- ),
2438
- ),
2439
- }).pipe(
2440
- Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }),
2441
- T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}" }),
2442
- ) as unknown as Schema.Schema<UpdateQueueRequest>;
1067
+ settings: Schema.optional(Schema.Struct({
1068
+ deliveryDelay: Schema.optional(Schema.Number),
1069
+ deliveryPaused: Schema.optional(Schema.Boolean),
1070
+ messageRetentionPeriod: Schema.optional(Schema.Number)
1071
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })))
1072
+ })
1073
+ .pipe(Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }), T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<UpdateQueueRequest>;
2443
1074
 
2444
1075
  export interface UpdateQueueResponse {
2445
- consumers?:
2446
- | (
2447
- | {
2448
- consumerId?: string | null;
2449
- createdOn?: string | null;
2450
- queueId?: string | null;
2451
- script?: string | null;
2452
- settings?: {
2453
- batchSize?: number | null;
2454
- maxConcurrency?: number | null;
2455
- maxRetries?: number | null;
2456
- maxWaitTimeMs?: number | null;
2457
- retryDelay?: number | null;
2458
- } | null;
2459
- type?: "worker" | null;
2460
- }
2461
- | {
2462
- consumerId?: string | null;
2463
- createdOn?: string | null;
2464
- queueId?: string | null;
2465
- settings?: {
2466
- batchSize?: number | null;
2467
- maxRetries?: number | null;
2468
- retryDelay?: number | null;
2469
- visibilityTimeoutMs?: number | null;
2470
- } | null;
2471
- type?: "http_pull" | null;
2472
- }
2473
- )[]
2474
- | null;
1076
+ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
2475
1077
  consumersTotalCount?: number | null;
2476
1078
  createdOn?: string | null;
2477
1079
  modifiedOn?: string | null;
2478
- producers?:
2479
- | (
2480
- | { script?: string | null; type?: "worker" | null }
2481
- | { bucketName?: string | null; type?: "r2_bucket" | null }
2482
- )[]
2483
- | null;
1080
+ producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
2484
1081
  producersTotalCount?: number | null;
2485
1082
  queueId?: string | null;
2486
1083
  queueName?: string | null;
2487
- settings?: {
2488
- deliveryDelay?: number | null;
2489
- deliveryPaused?: boolean | null;
2490
- messageRetentionPeriod?: number | null;
2491
- } | null;
1084
+ settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
2492
1085
  }
2493
1086
 
2494
1087
  export const UpdateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2495
- consumers: Schema.optional(
2496
- Schema.Union([
2497
- Schema.Array(
2498
- Schema.Union([
2499
- Schema.Struct({
2500
- consumerId: Schema.optional(
2501
- Schema.Union([Schema.String, Schema.Null]),
2502
- ),
2503
- createdOn: Schema.optional(
2504
- Schema.Union([Schema.String, Schema.Null]),
2505
- ),
2506
- queueId: Schema.optional(
2507
- Schema.Union([Schema.String, Schema.Null]),
2508
- ),
2509
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2510
- settings: Schema.optional(
2511
- Schema.Union([
2512
- Schema.Struct({
2513
- batchSize: Schema.optional(
2514
- Schema.Union([Schema.Number, Schema.Null]),
2515
- ),
2516
- maxConcurrency: Schema.optional(
2517
- Schema.Union([Schema.Number, Schema.Null]),
2518
- ),
2519
- maxRetries: Schema.optional(
2520
- Schema.Union([Schema.Number, Schema.Null]),
2521
- ),
2522
- maxWaitTimeMs: Schema.optional(
2523
- Schema.Union([Schema.Number, Schema.Null]),
2524
- ),
2525
- retryDelay: Schema.optional(
2526
- Schema.Union([Schema.Number, Schema.Null]),
2527
- ),
2528
- }).pipe(
2529
- Schema.encodeKeys({
2530
- batchSize: "batch_size",
2531
- maxConcurrency: "max_concurrency",
2532
- maxRetries: "max_retries",
2533
- maxWaitTimeMs: "max_wait_time_ms",
2534
- retryDelay: "retry_delay",
2535
- }),
2536
- ),
2537
- Schema.Null,
2538
- ]),
2539
- ),
2540
- type: Schema.optional(
2541
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2542
- ),
2543
- }).pipe(
2544
- Schema.encodeKeys({
2545
- consumerId: "consumer_id",
2546
- createdOn: "created_on",
2547
- queueId: "queue_id",
2548
- script: "script",
2549
- settings: "settings",
2550
- type: "type",
2551
- }),
2552
- ),
2553
- Schema.Struct({
2554
- consumerId: Schema.optional(
2555
- Schema.Union([Schema.String, Schema.Null]),
2556
- ),
2557
- createdOn: Schema.optional(
2558
- Schema.Union([Schema.String, Schema.Null]),
2559
- ),
2560
- queueId: Schema.optional(
2561
- Schema.Union([Schema.String, Schema.Null]),
2562
- ),
2563
- settings: Schema.optional(
2564
- Schema.Union([
2565
- Schema.Struct({
2566
- batchSize: Schema.optional(
2567
- Schema.Union([Schema.Number, Schema.Null]),
2568
- ),
2569
- maxRetries: Schema.optional(
2570
- Schema.Union([Schema.Number, Schema.Null]),
2571
- ),
2572
- retryDelay: Schema.optional(
2573
- Schema.Union([Schema.Number, Schema.Null]),
2574
- ),
2575
- visibilityTimeoutMs: Schema.optional(
2576
- Schema.Union([Schema.Number, Schema.Null]),
2577
- ),
2578
- }).pipe(
2579
- Schema.encodeKeys({
2580
- batchSize: "batch_size",
2581
- maxRetries: "max_retries",
2582
- retryDelay: "retry_delay",
2583
- visibilityTimeoutMs: "visibility_timeout_ms",
2584
- }),
2585
- ),
2586
- Schema.Null,
2587
- ]),
2588
- ),
2589
- type: Schema.optional(
2590
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2591
- ),
2592
- }).pipe(
2593
- Schema.encodeKeys({
2594
- consumerId: "consumer_id",
2595
- createdOn: "created_on",
2596
- queueId: "queue_id",
2597
- settings: "settings",
2598
- type: "type",
2599
- }),
2600
- ),
2601
- ]),
2602
- ),
2603
- Schema.Null,
2604
- ]),
2605
- ),
2606
- consumersTotalCount: Schema.optional(
2607
- Schema.Union([Schema.Number, Schema.Null]),
2608
- ),
1088
+ consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1089
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1090
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1091
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1092
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1093
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1094
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1095
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1096
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1097
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1098
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1099
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
1100
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1101
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
1102
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1103
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1104
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1105
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1106
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1107
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1108
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1109
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1110
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
1111
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
1112
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
1113
+ consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2609
1114
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2610
1115
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2611
- producers: Schema.optional(
2612
- Schema.Union([
2613
- Schema.Array(
2614
- Schema.Union([
2615
- Schema.Struct({
2616
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2617
- type: Schema.optional(
2618
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2619
- ),
2620
- }),
2621
- Schema.Struct({
2622
- bucketName: Schema.optional(
2623
- Schema.Union([Schema.String, Schema.Null]),
2624
- ),
2625
- type: Schema.optional(
2626
- Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2627
- ),
2628
- }).pipe(
2629
- Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2630
- ),
2631
- ]),
2632
- ),
2633
- Schema.Null,
2634
- ]),
2635
- ),
2636
- producersTotalCount: Schema.optional(
2637
- Schema.Union([Schema.Number, Schema.Null]),
2638
- ),
1116
+ producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1117
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1118
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1119
+ }), Schema.Struct({
1120
+ bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1121
+ type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
1122
+ }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
1123
+ producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2639
1124
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2640
1125
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2641
- settings: Schema.optional(
2642
- Schema.Union([
2643
- Schema.Struct({
2644
- deliveryDelay: Schema.optional(
2645
- Schema.Union([Schema.Number, Schema.Null]),
2646
- ),
2647
- deliveryPaused: Schema.optional(
2648
- Schema.Union([Schema.Boolean, Schema.Null]),
2649
- ),
2650
- messageRetentionPeriod: Schema.optional(
2651
- Schema.Union([Schema.Number, Schema.Null]),
2652
- ),
2653
- }).pipe(
2654
- Schema.encodeKeys({
2655
- deliveryDelay: "delivery_delay",
2656
- deliveryPaused: "delivery_paused",
2657
- messageRetentionPeriod: "message_retention_period",
2658
- }),
2659
- ),
2660
- Schema.Null,
2661
- ]),
2662
- ),
2663
- })
2664
- .pipe(
2665
- Schema.encodeKeys({
2666
- consumers: "consumers",
2667
- consumersTotalCount: "consumers_total_count",
2668
- createdOn: "created_on",
2669
- modifiedOn: "modified_on",
2670
- producers: "producers",
2671
- producersTotalCount: "producers_total_count",
2672
- queueId: "queue_id",
2673
- queueName: "queue_name",
2674
- settings: "settings",
2675
- }),
2676
- )
2677
- .pipe(
2678
- T.ResponsePath("result"),
2679
- ) as unknown as Schema.Schema<UpdateQueueResponse>;
1126
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1127
+ deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1128
+ deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1129
+ messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1130
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
1131
+ }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<UpdateQueueResponse>;
2680
1132
 
2681
1133
  export type UpdateQueueError =
2682
1134
  | DefaultErrors
@@ -2702,273 +1154,83 @@ export interface PatchQueueRequest {
2702
1154
  /** Body param: */
2703
1155
  queueName?: string;
2704
1156
  /** Body param: */
2705
- settings?: {
2706
- deliveryDelay?: number;
2707
- deliveryPaused?: boolean;
2708
- messageRetentionPeriod?: number;
2709
- };
1157
+ settings?: { deliveryDelay?: number; deliveryPaused?: boolean; messageRetentionPeriod?: number };
2710
1158
  }
2711
1159
 
2712
1160
  export const PatchQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2713
1161
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
2714
1162
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
2715
1163
  queueName: Schema.optional(Schema.String),
2716
- settings: Schema.optional(
2717
- Schema.Struct({
2718
- deliveryDelay: Schema.optional(Schema.Number),
2719
- deliveryPaused: Schema.optional(Schema.Boolean),
2720
- messageRetentionPeriod: Schema.optional(Schema.Number),
2721
- }).pipe(
2722
- Schema.encodeKeys({
2723
- deliveryDelay: "delivery_delay",
2724
- deliveryPaused: "delivery_paused",
2725
- messageRetentionPeriod: "message_retention_period",
2726
- }),
2727
- ),
2728
- ),
2729
- }).pipe(
2730
- Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }),
2731
- T.Http({ method: "PATCH", path: "/accounts/{account_id}/queues/{queueId}" }),
2732
- ) as unknown as Schema.Schema<PatchQueueRequest>;
1164
+ settings: Schema.optional(Schema.Struct({
1165
+ deliveryDelay: Schema.optional(Schema.Number),
1166
+ deliveryPaused: Schema.optional(Schema.Boolean),
1167
+ messageRetentionPeriod: Schema.optional(Schema.Number)
1168
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })))
1169
+ })
1170
+ .pipe(Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }), T.Http({ method: "PATCH", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<PatchQueueRequest>;
2733
1171
 
2734
1172
  export interface PatchQueueResponse {
2735
- consumers?:
2736
- | (
2737
- | {
2738
- consumerId?: string | null;
2739
- createdOn?: string | null;
2740
- queueId?: string | null;
2741
- script?: string | null;
2742
- settings?: {
2743
- batchSize?: number | null;
2744
- maxConcurrency?: number | null;
2745
- maxRetries?: number | null;
2746
- maxWaitTimeMs?: number | null;
2747
- retryDelay?: number | null;
2748
- } | null;
2749
- type?: "worker" | null;
2750
- }
2751
- | {
2752
- consumerId?: string | null;
2753
- createdOn?: string | null;
2754
- queueId?: string | null;
2755
- settings?: {
2756
- batchSize?: number | null;
2757
- maxRetries?: number | null;
2758
- retryDelay?: number | null;
2759
- visibilityTimeoutMs?: number | null;
2760
- } | null;
2761
- type?: "http_pull" | null;
2762
- }
2763
- )[]
2764
- | null;
1173
+ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
2765
1174
  consumersTotalCount?: number | null;
2766
1175
  createdOn?: string | null;
2767
1176
  modifiedOn?: string | null;
2768
- producers?:
2769
- | (
2770
- | { script?: string | null; type?: "worker" | null }
2771
- | { bucketName?: string | null; type?: "r2_bucket" | null }
2772
- )[]
2773
- | null;
1177
+ producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
2774
1178
  producersTotalCount?: number | null;
2775
1179
  queueId?: string | null;
2776
1180
  queueName?: string | null;
2777
- settings?: {
2778
- deliveryDelay?: number | null;
2779
- deliveryPaused?: boolean | null;
2780
- messageRetentionPeriod?: number | null;
2781
- } | null;
1181
+ settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
2782
1182
  }
2783
1183
 
2784
1184
  export const PatchQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2785
- consumers: Schema.optional(
2786
- Schema.Union([
2787
- Schema.Array(
2788
- Schema.Union([
2789
- Schema.Struct({
2790
- consumerId: Schema.optional(
2791
- Schema.Union([Schema.String, Schema.Null]),
2792
- ),
2793
- createdOn: Schema.optional(
2794
- Schema.Union([Schema.String, Schema.Null]),
2795
- ),
2796
- queueId: Schema.optional(
2797
- Schema.Union([Schema.String, Schema.Null]),
2798
- ),
2799
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2800
- settings: Schema.optional(
2801
- Schema.Union([
2802
- Schema.Struct({
2803
- batchSize: Schema.optional(
2804
- Schema.Union([Schema.Number, Schema.Null]),
2805
- ),
2806
- maxConcurrency: Schema.optional(
2807
- Schema.Union([Schema.Number, Schema.Null]),
2808
- ),
2809
- maxRetries: Schema.optional(
2810
- Schema.Union([Schema.Number, Schema.Null]),
2811
- ),
2812
- maxWaitTimeMs: Schema.optional(
2813
- Schema.Union([Schema.Number, Schema.Null]),
2814
- ),
2815
- retryDelay: Schema.optional(
2816
- Schema.Union([Schema.Number, Schema.Null]),
2817
- ),
2818
- }).pipe(
2819
- Schema.encodeKeys({
2820
- batchSize: "batch_size",
2821
- maxConcurrency: "max_concurrency",
2822
- maxRetries: "max_retries",
2823
- maxWaitTimeMs: "max_wait_time_ms",
2824
- retryDelay: "retry_delay",
2825
- }),
2826
- ),
2827
- Schema.Null,
2828
- ]),
2829
- ),
2830
- type: Schema.optional(
2831
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2832
- ),
2833
- }).pipe(
2834
- Schema.encodeKeys({
2835
- consumerId: "consumer_id",
2836
- createdOn: "created_on",
2837
- queueId: "queue_id",
2838
- script: "script",
2839
- settings: "settings",
2840
- type: "type",
2841
- }),
2842
- ),
2843
- Schema.Struct({
2844
- consumerId: Schema.optional(
2845
- Schema.Union([Schema.String, Schema.Null]),
2846
- ),
2847
- createdOn: Schema.optional(
2848
- Schema.Union([Schema.String, Schema.Null]),
2849
- ),
2850
- queueId: Schema.optional(
2851
- Schema.Union([Schema.String, Schema.Null]),
2852
- ),
2853
- settings: Schema.optional(
2854
- Schema.Union([
2855
- Schema.Struct({
2856
- batchSize: Schema.optional(
2857
- Schema.Union([Schema.Number, Schema.Null]),
2858
- ),
2859
- maxRetries: Schema.optional(
2860
- Schema.Union([Schema.Number, Schema.Null]),
2861
- ),
2862
- retryDelay: Schema.optional(
2863
- Schema.Union([Schema.Number, Schema.Null]),
2864
- ),
2865
- visibilityTimeoutMs: Schema.optional(
2866
- Schema.Union([Schema.Number, Schema.Null]),
2867
- ),
2868
- }).pipe(
2869
- Schema.encodeKeys({
2870
- batchSize: "batch_size",
2871
- maxRetries: "max_retries",
2872
- retryDelay: "retry_delay",
2873
- visibilityTimeoutMs: "visibility_timeout_ms",
2874
- }),
2875
- ),
2876
- Schema.Null,
2877
- ]),
2878
- ),
2879
- type: Schema.optional(
2880
- Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2881
- ),
2882
- }).pipe(
2883
- Schema.encodeKeys({
2884
- consumerId: "consumer_id",
2885
- createdOn: "created_on",
2886
- queueId: "queue_id",
2887
- settings: "settings",
2888
- type: "type",
2889
- }),
2890
- ),
2891
- ]),
2892
- ),
2893
- Schema.Null,
2894
- ]),
2895
- ),
2896
- consumersTotalCount: Schema.optional(
2897
- Schema.Union([Schema.Number, Schema.Null]),
2898
- ),
1185
+ consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1186
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1187
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1188
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1189
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1190
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1191
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1192
+ maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1193
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1194
+ maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1195
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1196
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
1197
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1198
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
1199
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1200
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1201
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1202
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1203
+ batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1204
+ maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1205
+ retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1206
+ visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1207
+ }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
1208
+ type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
1209
+ }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
1210
+ consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2899
1211
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2900
1212
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2901
- producers: Schema.optional(
2902
- Schema.Union([
2903
- Schema.Array(
2904
- Schema.Union([
2905
- Schema.Struct({
2906
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2907
- type: Schema.optional(
2908
- Schema.Union([Schema.Literal("worker"), Schema.Null]),
2909
- ),
2910
- }),
2911
- Schema.Struct({
2912
- bucketName: Schema.optional(
2913
- Schema.Union([Schema.String, Schema.Null]),
2914
- ),
2915
- type: Schema.optional(
2916
- Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2917
- ),
2918
- }).pipe(
2919
- Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2920
- ),
2921
- ]),
2922
- ),
2923
- Schema.Null,
2924
- ]),
2925
- ),
2926
- producersTotalCount: Schema.optional(
2927
- Schema.Union([Schema.Number, Schema.Null]),
2928
- ),
1213
+ producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1214
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1215
+ type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1216
+ }), Schema.Struct({
1217
+ bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1218
+ type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
1219
+ }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
1220
+ producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2929
1221
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2930
1222
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2931
- settings: Schema.optional(
2932
- Schema.Union([
2933
- Schema.Struct({
2934
- deliveryDelay: Schema.optional(
2935
- Schema.Union([Schema.Number, Schema.Null]),
2936
- ),
2937
- deliveryPaused: Schema.optional(
2938
- Schema.Union([Schema.Boolean, Schema.Null]),
2939
- ),
2940
- messageRetentionPeriod: Schema.optional(
2941
- Schema.Union([Schema.Number, Schema.Null]),
2942
- ),
2943
- }).pipe(
2944
- Schema.encodeKeys({
2945
- deliveryDelay: "delivery_delay",
2946
- deliveryPaused: "delivery_paused",
2947
- messageRetentionPeriod: "message_retention_period",
2948
- }),
2949
- ),
2950
- Schema.Null,
2951
- ]),
2952
- ),
2953
- })
2954
- .pipe(
2955
- Schema.encodeKeys({
2956
- consumers: "consumers",
2957
- consumersTotalCount: "consumers_total_count",
2958
- createdOn: "created_on",
2959
- modifiedOn: "modified_on",
2960
- producers: "producers",
2961
- producersTotalCount: "producers_total_count",
2962
- queueId: "queue_id",
2963
- queueName: "queue_name",
2964
- settings: "settings",
2965
- }),
2966
- )
2967
- .pipe(
2968
- T.ResponsePath("result"),
2969
- ) as unknown as Schema.Schema<PatchQueueResponse>;
2970
-
2971
- export type PatchQueueError = DefaultErrors | QueueNotFound | InvalidRoute;
1223
+ settings: Schema.optional(Schema.Union([Schema.Struct({
1224
+ deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1225
+ deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1226
+ messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1227
+ }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
1228
+ }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<PatchQueueResponse>;
1229
+
1230
+ export type PatchQueueError =
1231
+ | DefaultErrors
1232
+ | QueueNotFound
1233
+ | InvalidRoute;
2972
1234
 
2973
1235
  export const patchQueue: API.OperationMethod<
2974
1236
  PatchQueueRequest,
@@ -2989,64 +1251,34 @@ export interface DeleteQueueRequest {
2989
1251
 
2990
1252
  export const DeleteQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
2991
1253
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
2992
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
2993
- }).pipe(
2994
- T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}" }),
2995
- ) as unknown as Schema.Schema<DeleteQueueRequest>;
1254
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
1255
+ })
1256
+ .pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<DeleteQueueRequest>;
2996
1257
 
2997
1258
  export interface DeleteQueueResponse {
2998
- errors?:
2999
- | {
3000
- code: number;
3001
- message: string;
3002
- documentationUrl?: string | null;
3003
- source?: { pointer?: string | null } | null;
3004
- }[]
3005
- | null;
1259
+ errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
3006
1260
  messages?: string[] | null;
3007
1261
  /** Indicates if the API call was successful or not. */
3008
1262
  success?: true | null;
3009
1263
  }
3010
1264
 
3011
1265
  export const DeleteQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3012
- errors: Schema.optional(
3013
- Schema.Union([
3014
- Schema.Array(
3015
- Schema.Struct({
3016
- code: Schema.Number,
3017
- message: Schema.String,
3018
- documentationUrl: Schema.optional(
3019
- Schema.Union([Schema.String, Schema.Null]),
3020
- ),
3021
- source: Schema.optional(
3022
- Schema.Union([
3023
- Schema.Struct({
3024
- pointer: Schema.optional(
3025
- Schema.Union([Schema.String, Schema.Null]),
3026
- ),
3027
- }),
3028
- Schema.Null,
3029
- ]),
3030
- ),
3031
- }).pipe(
3032
- Schema.encodeKeys({
3033
- code: "code",
3034
- message: "message",
3035
- documentationUrl: "documentation_url",
3036
- source: "source",
3037
- }),
3038
- ),
3039
- ),
3040
- Schema.Null,
3041
- ]),
3042
- ),
3043
- messages: Schema.optional(
3044
- Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3045
- ),
3046
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
1266
+ errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
1267
+ code: Schema.Number,
1268
+ message: Schema.String,
1269
+ documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1270
+ source: Schema.optional(Schema.Union([Schema.Struct({
1271
+ pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1272
+ }), Schema.Null]))
1273
+ }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
1274
+ messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1275
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
3047
1276
  }) as unknown as Schema.Schema<DeleteQueueResponse>;
3048
1277
 
3049
- export type DeleteQueueError = DefaultErrors | QueueNotFound | InvalidRoute;
1278
+ export type DeleteQueueError =
1279
+ | DefaultErrors
1280
+ | QueueNotFound
1281
+ | InvalidRoute;
3050
1282
 
3051
1283
  export const deleteQueue: API.OperationMethod<
3052
1284
  DeleteQueueRequest,
@@ -3059,6 +1291,7 @@ export const deleteQueue: API.OperationMethod<
3059
1291
  errors: [QueueNotFound, InvalidRoute],
3060
1292
  }));
3061
1293
 
1294
+
3062
1295
  // =============================================================================
3063
1296
  // Subscription
3064
1297
  // =============================================================================
@@ -3069,17 +1302,11 @@ export interface GetSubscriptionRequest {
3069
1302
  accountId: string;
3070
1303
  }
3071
1304
 
3072
- export const GetSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
3073
- {
3074
- subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
3075
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
3076
- },
3077
- ).pipe(
3078
- T.Http({
3079
- method: "GET",
3080
- path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
3081
- }),
3082
- ) as unknown as Schema.Schema<GetSubscriptionRequest>;
1305
+ export const GetSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1306
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1307
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
1308
+ })
1309
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}" })) as unknown as Schema.Schema<GetSubscriptionRequest>;
3083
1310
 
3084
1311
  export interface GetSubscriptionResponse {
3085
1312
  /** Unique identifier for the subscription */
@@ -3097,96 +1324,45 @@ export interface GetSubscriptionResponse {
3097
1324
  /** Name of the subscription */
3098
1325
  name: string;
3099
1326
  /** Source configuration for the subscription */
3100
- source:
3101
- | { type?: "images" | null }
3102
- | { type?: "kv" | null }
3103
- | { type?: "r2" | null }
3104
- | { type?: "superSlurper" | null }
3105
- | { type?: "vectorize" | null }
3106
- | { modelName?: string | null; type?: "workersAi.model" | null }
3107
- | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3108
- | { type?: "workflows.workflow" | null; workflowName?: string | null };
1327
+ source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3109
1328
  }
3110
1329
 
3111
- export const GetSubscriptionResponse =
3112
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3113
- id: Schema.String,
3114
- createdAt: Schema.String,
3115
- destination: Schema.Struct({
3116
- queueId: Schema.String,
3117
- type: Schema.Literal("queues.queue"),
3118
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3119
- enabled: Schema.Boolean,
3120
- events: Schema.Array(Schema.String),
3121
- modifiedAt: Schema.String,
3122
- name: Schema.String,
3123
- source: Schema.Union([
3124
- Schema.Struct({
3125
- type: Schema.optional(
3126
- Schema.Union([Schema.Literal("images"), Schema.Null]),
3127
- ),
3128
- }),
3129
- Schema.Struct({
3130
- type: Schema.optional(
3131
- Schema.Union([Schema.Literal("kv"), Schema.Null]),
3132
- ),
3133
- }),
3134
- Schema.Struct({
3135
- type: Schema.optional(
3136
- Schema.Union([Schema.Literal("r2"), Schema.Null]),
3137
- ),
3138
- }),
3139
- Schema.Struct({
3140
- type: Schema.optional(
3141
- Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3142
- ),
3143
- }),
3144
- Schema.Struct({
3145
- type: Schema.optional(
3146
- Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3147
- ),
3148
- }),
3149
- Schema.Struct({
3150
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3151
- type: Schema.optional(
3152
- Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3153
- ),
3154
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3155
- Schema.Struct({
3156
- type: Schema.optional(
3157
- Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3158
- ),
3159
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3160
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3161
- Schema.Struct({
3162
- type: Schema.optional(
3163
- Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3164
- ),
3165
- workflowName: Schema.optional(
3166
- Schema.Union([Schema.String, Schema.Null]),
3167
- ),
3168
- }).pipe(
3169
- Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3170
- ),
3171
- ]),
3172
- })
3173
- .pipe(
3174
- Schema.encodeKeys({
3175
- id: "id",
3176
- createdAt: "created_at",
3177
- destination: "destination",
3178
- enabled: "enabled",
3179
- events: "events",
3180
- modifiedAt: "modified_at",
3181
- name: "name",
3182
- source: "source",
3183
- }),
3184
- )
3185
- .pipe(
3186
- T.ResponsePath("result"),
3187
- ) as unknown as Schema.Schema<GetSubscriptionResponse>;
3188
-
3189
- export type GetSubscriptionError = DefaultErrors | UnrecognizedEventType;
1330
+ export const GetSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1331
+ id: Schema.String,
1332
+ createdAt: Schema.String,
1333
+ destination: Schema.Struct({
1334
+ queueId: Schema.String,
1335
+ type: Schema.Literal("queues.queue")
1336
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1337
+ enabled: Schema.Boolean,
1338
+ events: Schema.Array(Schema.String),
1339
+ modifiedAt: Schema.String,
1340
+ name: Schema.String,
1341
+ source: Schema.Union([Schema.Struct({
1342
+ type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1343
+ }), Schema.Struct({
1344
+ type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1345
+ }), Schema.Struct({
1346
+ type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1347
+ }), Schema.Struct({
1348
+ type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1349
+ }), Schema.Struct({
1350
+ type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1351
+ }), Schema.Struct({
1352
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1353
+ type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1354
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1355
+ type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1356
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1357
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1358
+ type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1359
+ workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1360
+ }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1361
+ }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetSubscriptionResponse>;
1362
+
1363
+ export type GetSubscriptionError =
1364
+ | DefaultErrors
1365
+ | UnrecognizedEventType;
3190
1366
 
3191
1367
  export const getSubscription: API.OperationMethod<
3192
1368
  GetSubscriptionRequest,
@@ -3208,152 +1384,61 @@ export interface ListSubscriptionsRequest {
3208
1384
  order?: "created_at" | "name" | "enabled" | "source";
3209
1385
  }
3210
1386
 
3211
- export const ListSubscriptionsRequest =
3212
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3213
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
3214
- direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
3215
- T.HttpQuery("direction"),
3216
- ),
3217
- order: Schema.optional(
3218
- Schema.Literals(["created_at", "name", "enabled", "source"]),
3219
- ).pipe(T.HttpQuery("order")),
3220
- }).pipe(
3221
- T.Http({
3222
- method: "GET",
3223
- path: "/accounts/{account_id}/event_subscriptions/subscriptions",
3224
- }),
3225
- ) as unknown as Schema.Schema<ListSubscriptionsRequest>;
1387
+ export const ListSubscriptionsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1388
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1389
+ direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
1390
+ order: Schema.optional(Schema.Literals(["created_at", "name", "enabled", "source"])).pipe(T.HttpQuery("order"))
1391
+ })
1392
+ .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/event_subscriptions/subscriptions" })) as unknown as Schema.Schema<ListSubscriptionsRequest>;
3226
1393
 
3227
1394
  export interface ListSubscriptionsResponse {
3228
- result: {
3229
- id: string;
3230
- createdAt: string;
3231
- destination: { queueId: string; type: "queues.queue" };
3232
- enabled: boolean;
3233
- events: string[];
3234
- modifiedAt: string;
3235
- name: string;
3236
- source:
3237
- | { type?: "images" | null }
3238
- | { type?: "kv" | null }
3239
- | { type?: "r2" | null }
3240
- | { type?: "superSlurper" | null }
3241
- | { type?: "vectorize" | null }
3242
- | { modelName?: string | null; type?: "workersAi.model" | null }
3243
- | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3244
- | { type?: "workflows.workflow" | null; workflowName?: string | null };
3245
- }[];
3246
- resultInfo: {
3247
- count?: number | null;
3248
- page?: number | null;
3249
- perPage?: number | null;
3250
- totalCount?: number | null;
3251
- };
1395
+ result: ({ id: string; createdAt: string; destination: { queueId: string; type: "queues.queue" }; enabled: boolean; events: string[]; modifiedAt: string; name: string; source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null } })[];
1396
+ resultInfo: { count?: number | null; page?: number | null; perPage?: number | null; totalCount?: number | null };
3252
1397
  }
3253
1398
 
3254
- export const ListSubscriptionsResponse =
3255
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3256
- result: Schema.Array(
3257
- Schema.Struct({
3258
- id: Schema.String,
3259
- createdAt: Schema.String,
3260
- destination: Schema.Struct({
3261
- queueId: Schema.String,
3262
- type: Schema.Literal("queues.queue"),
3263
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3264
- enabled: Schema.Boolean,
3265
- events: Schema.Array(Schema.String),
3266
- modifiedAt: Schema.String,
3267
- name: Schema.String,
3268
- source: Schema.Union([
3269
- Schema.Struct({
3270
- type: Schema.optional(
3271
- Schema.Union([Schema.Literal("images"), Schema.Null]),
3272
- ),
3273
- }),
3274
- Schema.Struct({
3275
- type: Schema.optional(
3276
- Schema.Union([Schema.Literal("kv"), Schema.Null]),
3277
- ),
3278
- }),
3279
- Schema.Struct({
3280
- type: Schema.optional(
3281
- Schema.Union([Schema.Literal("r2"), Schema.Null]),
3282
- ),
3283
- }),
3284
- Schema.Struct({
3285
- type: Schema.optional(
3286
- Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3287
- ),
3288
- }),
3289
- Schema.Struct({
3290
- type: Schema.optional(
3291
- Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3292
- ),
3293
- }),
3294
- Schema.Struct({
3295
- modelName: Schema.optional(
3296
- Schema.Union([Schema.String, Schema.Null]),
3297
- ),
3298
- type: Schema.optional(
3299
- Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3300
- ),
3301
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3302
- Schema.Struct({
3303
- type: Schema.optional(
3304
- Schema.Union([
3305
- Schema.Literal("workersBuilds.worker"),
3306
- Schema.Null,
3307
- ]),
3308
- ),
3309
- workerName: Schema.optional(
3310
- Schema.Union([Schema.String, Schema.Null]),
3311
- ),
3312
- }).pipe(
3313
- Schema.encodeKeys({ type: "type", workerName: "worker_name" }),
3314
- ),
3315
- Schema.Struct({
3316
- type: Schema.optional(
3317
- Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3318
- ),
3319
- workflowName: Schema.optional(
3320
- Schema.Union([Schema.String, Schema.Null]),
3321
- ),
3322
- }).pipe(
3323
- Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3324
- ),
3325
- ]),
3326
- }).pipe(
3327
- Schema.encodeKeys({
3328
- id: "id",
3329
- createdAt: "created_at",
3330
- destination: "destination",
3331
- enabled: "enabled",
3332
- events: "events",
3333
- modifiedAt: "modified_at",
3334
- name: "name",
3335
- source: "source",
3336
- }),
3337
- ),
3338
- ),
3339
- resultInfo: Schema.Struct({
3340
- count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3341
- page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3342
- perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3343
- totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3344
- }).pipe(
3345
- Schema.encodeKeys({
3346
- count: "count",
3347
- page: "page",
3348
- perPage: "per_page",
3349
- totalCount: "total_count",
3350
- }),
3351
- ),
3352
- }).pipe(
3353
- Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
3354
- ) as unknown as Schema.Schema<ListSubscriptionsResponse>;
3355
-
3356
- export type ListSubscriptionsError = DefaultErrors;
1399
+ export const ListSubscriptionsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1400
+ result: Schema.Array(Schema.Struct({
1401
+ id: Schema.String,
1402
+ createdAt: Schema.String,
1403
+ destination: Schema.Struct({
1404
+ queueId: Schema.String,
1405
+ type: Schema.Literal("queues.queue")
1406
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1407
+ enabled: Schema.Boolean,
1408
+ events: Schema.Array(Schema.String),
1409
+ modifiedAt: Schema.String,
1410
+ name: Schema.String,
1411
+ source: Schema.Union([Schema.Struct({
1412
+ type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1413
+ }), Schema.Struct({
1414
+ type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1415
+ }), Schema.Struct({
1416
+ type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1417
+ }), Schema.Struct({
1418
+ type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1419
+ }), Schema.Struct({
1420
+ type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1421
+ }), Schema.Struct({
1422
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1423
+ type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1424
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1425
+ type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1426
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1427
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1428
+ type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1429
+ workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1430
+ }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1431
+ }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" }))),
1432
+ resultInfo: Schema.Struct({
1433
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1434
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1435
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1436
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1437
+ }).pipe(Schema.encodeKeys({ count: "count", page: "page", perPage: "per_page", totalCount: "total_count" }))
1438
+ }).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" })) as unknown as Schema.Schema<ListSubscriptionsResponse>;
1439
+
1440
+ export type ListSubscriptionsError =
1441
+ | DefaultErrors;
3357
1442
 
3358
1443
  export const listSubscriptions: API.PaginatedOperationMethod<
3359
1444
  ListSubscriptionsRequest,
@@ -3385,68 +1470,40 @@ export interface CreateSubscriptionRequest {
3385
1470
  /** Body param: Name of the subscription */
3386
1471
  name?: string;
3387
1472
  /** Body param: Source configuration for the subscription */
3388
- source?:
3389
- | { type?: "images" }
3390
- | { type?: "kv" }
3391
- | { type?: "r2" }
3392
- | { type?: "superSlurper" }
3393
- | { type?: "vectorize" }
3394
- | { modelName?: string; type?: "workersAi.model" }
3395
- | { type?: "workersBuilds.worker"; workerName?: string }
3396
- | { type?: "workflows.workflow"; workflowName?: string };
1473
+ source?: { type?: "images" } | { type?: "kv" } | { type?: "r2" } | { type?: "superSlurper" } | { type?: "vectorize" } | { modelName?: string; type?: "workersAi.model" } | { type?: "workersBuilds.worker"; workerName?: string } | { type?: "workflows.workflow"; workflowName?: string };
3397
1474
  }
3398
1475
 
3399
- export const CreateSubscriptionRequest =
3400
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3401
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
3402
- destination: Schema.optional(
3403
- Schema.Struct({
3404
- queueId: Schema.String,
3405
- type: Schema.Literal("queues.queue"),
3406
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3407
- ),
3408
- enabled: Schema.optional(Schema.Boolean),
3409
- events: Schema.optional(Schema.Array(Schema.String)),
3410
- name: Schema.optional(Schema.String),
3411
- source: Schema.optional(
3412
- Schema.Union([
3413
- Schema.Struct({
3414
- type: Schema.optional(Schema.Literal("images")),
3415
- }),
3416
- Schema.Struct({
3417
- type: Schema.optional(Schema.Literal("kv")),
3418
- }),
3419
- Schema.Struct({
3420
- type: Schema.optional(Schema.Literal("r2")),
3421
- }),
3422
- Schema.Struct({
3423
- type: Schema.optional(Schema.Literal("superSlurper")),
3424
- }),
3425
- Schema.Struct({
3426
- type: Schema.optional(Schema.Literal("vectorize")),
3427
- }),
3428
- Schema.Struct({
3429
- modelName: Schema.optional(Schema.String),
3430
- type: Schema.optional(Schema.Literal("workersAi.model")),
3431
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3432
- Schema.Struct({
3433
- type: Schema.optional(Schema.Literal("workersBuilds.worker")),
3434
- workerName: Schema.optional(Schema.String),
3435
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3436
- Schema.Struct({
3437
- type: Schema.optional(Schema.Literal("workflows.workflow")),
3438
- workflowName: Schema.optional(Schema.String),
3439
- }).pipe(
3440
- Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3441
- ),
3442
- ]),
3443
- ),
3444
- }).pipe(
3445
- T.Http({
3446
- method: "POST",
3447
- path: "/accounts/{account_id}/event_subscriptions/subscriptions",
3448
- }),
3449
- ) as unknown as Schema.Schema<CreateSubscriptionRequest>;
1476
+ export const CreateSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1477
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1478
+ destination: Schema.optional(Schema.Struct({
1479
+ queueId: Schema.String,
1480
+ type: Schema.Literal("queues.queue")
1481
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" }))),
1482
+ enabled: Schema.optional(Schema.Boolean),
1483
+ events: Schema.optional(Schema.Array(Schema.String)),
1484
+ name: Schema.optional(Schema.String),
1485
+ source: Schema.optional(Schema.Union([Schema.Struct({
1486
+ type: Schema.optional(Schema.Literal("images"))
1487
+ }), Schema.Struct({
1488
+ type: Schema.optional(Schema.Literal("kv"))
1489
+ }), Schema.Struct({
1490
+ type: Schema.optional(Schema.Literal("r2"))
1491
+ }), Schema.Struct({
1492
+ type: Schema.optional(Schema.Literal("superSlurper"))
1493
+ }), Schema.Struct({
1494
+ type: Schema.optional(Schema.Literal("vectorize"))
1495
+ }), Schema.Struct({
1496
+ modelName: Schema.optional(Schema.String),
1497
+ type: Schema.optional(Schema.Literal("workersAi.model"))
1498
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1499
+ type: Schema.optional(Schema.Literal("workersBuilds.worker")),
1500
+ workerName: Schema.optional(Schema.String)
1501
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1502
+ type: Schema.optional(Schema.Literal("workflows.workflow")),
1503
+ workflowName: Schema.optional(Schema.String)
1504
+ }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))]))
1505
+ })
1506
+ .pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/event_subscriptions/subscriptions" })) as unknown as Schema.Schema<CreateSubscriptionRequest>;
3450
1507
 
3451
1508
  export interface CreateSubscriptionResponse {
3452
1509
  /** Unique identifier for the subscription */
@@ -3464,96 +1521,45 @@ export interface CreateSubscriptionResponse {
3464
1521
  /** Name of the subscription */
3465
1522
  name: string;
3466
1523
  /** Source configuration for the subscription */
3467
- source:
3468
- | { type?: "images" | null }
3469
- | { type?: "kv" | null }
3470
- | { type?: "r2" | null }
3471
- | { type?: "superSlurper" | null }
3472
- | { type?: "vectorize" | null }
3473
- | { modelName?: string | null; type?: "workersAi.model" | null }
3474
- | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3475
- | { type?: "workflows.workflow" | null; workflowName?: string | null };
1524
+ source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3476
1525
  }
3477
1526
 
3478
- export const CreateSubscriptionResponse =
3479
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3480
- id: Schema.String,
3481
- createdAt: Schema.String,
3482
- destination: Schema.Struct({
3483
- queueId: Schema.String,
3484
- type: Schema.Literal("queues.queue"),
3485
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3486
- enabled: Schema.Boolean,
3487
- events: Schema.Array(Schema.String),
3488
- modifiedAt: Schema.String,
3489
- name: Schema.String,
3490
- source: Schema.Union([
3491
- Schema.Struct({
3492
- type: Schema.optional(
3493
- Schema.Union([Schema.Literal("images"), Schema.Null]),
3494
- ),
3495
- }),
3496
- Schema.Struct({
3497
- type: Schema.optional(
3498
- Schema.Union([Schema.Literal("kv"), Schema.Null]),
3499
- ),
3500
- }),
3501
- Schema.Struct({
3502
- type: Schema.optional(
3503
- Schema.Union([Schema.Literal("r2"), Schema.Null]),
3504
- ),
3505
- }),
3506
- Schema.Struct({
3507
- type: Schema.optional(
3508
- Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3509
- ),
3510
- }),
3511
- Schema.Struct({
3512
- type: Schema.optional(
3513
- Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3514
- ),
3515
- }),
3516
- Schema.Struct({
3517
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3518
- type: Schema.optional(
3519
- Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3520
- ),
3521
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3522
- Schema.Struct({
3523
- type: Schema.optional(
3524
- Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3525
- ),
3526
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3527
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3528
- Schema.Struct({
3529
- type: Schema.optional(
3530
- Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3531
- ),
3532
- workflowName: Schema.optional(
3533
- Schema.Union([Schema.String, Schema.Null]),
3534
- ),
3535
- }).pipe(
3536
- Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3537
- ),
3538
- ]),
3539
- })
3540
- .pipe(
3541
- Schema.encodeKeys({
3542
- id: "id",
3543
- createdAt: "created_at",
3544
- destination: "destination",
3545
- enabled: "enabled",
3546
- events: "events",
3547
- modifiedAt: "modified_at",
3548
- name: "name",
3549
- source: "source",
3550
- }),
3551
- )
3552
- .pipe(
3553
- T.ResponsePath("result"),
3554
- ) as unknown as Schema.Schema<CreateSubscriptionResponse>;
3555
-
3556
- export type CreateSubscriptionError = DefaultErrors | UnrecognizedEventType;
1527
+ export const CreateSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1528
+ id: Schema.String,
1529
+ createdAt: Schema.String,
1530
+ destination: Schema.Struct({
1531
+ queueId: Schema.String,
1532
+ type: Schema.Literal("queues.queue")
1533
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1534
+ enabled: Schema.Boolean,
1535
+ events: Schema.Array(Schema.String),
1536
+ modifiedAt: Schema.String,
1537
+ name: Schema.String,
1538
+ source: Schema.Union([Schema.Struct({
1539
+ type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1540
+ }), Schema.Struct({
1541
+ type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1542
+ }), Schema.Struct({
1543
+ type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1544
+ }), Schema.Struct({
1545
+ type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1546
+ }), Schema.Struct({
1547
+ type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1548
+ }), Schema.Struct({
1549
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1550
+ type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1551
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1552
+ type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1553
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1554
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1555
+ type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1556
+ workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1557
+ }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1558
+ }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<CreateSubscriptionResponse>;
1559
+
1560
+ export type CreateSubscriptionError =
1561
+ | DefaultErrors
1562
+ | UnrecognizedEventType;
3557
1563
 
3558
1564
  export const createSubscription: API.OperationMethod<
3559
1565
  CreateSubscriptionRequest,
@@ -3580,25 +1586,18 @@ export interface PatchSubscriptionRequest {
3580
1586
  name?: string;
3581
1587
  }
3582
1588
 
3583
- export const PatchSubscriptionRequest =
3584
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3585
- subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
3586
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
3587
- destination: Schema.optional(
3588
- Schema.Struct({
3589
- queueId: Schema.String,
3590
- type: Schema.Literal("queues.queue"),
3591
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3592
- ),
3593
- enabled: Schema.optional(Schema.Boolean),
3594
- events: Schema.optional(Schema.Array(Schema.String)),
3595
- name: Schema.optional(Schema.String),
3596
- }).pipe(
3597
- T.Http({
3598
- method: "PATCH",
3599
- path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
3600
- }),
3601
- ) as unknown as Schema.Schema<PatchSubscriptionRequest>;
1589
+ export const PatchSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1590
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1591
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1592
+ destination: Schema.optional(Schema.Struct({
1593
+ queueId: Schema.String,
1594
+ type: Schema.Literal("queues.queue")
1595
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" }))),
1596
+ enabled: Schema.optional(Schema.Boolean),
1597
+ events: Schema.optional(Schema.Array(Schema.String)),
1598
+ name: Schema.optional(Schema.String)
1599
+ })
1600
+ .pipe(T.Http({ method: "PATCH", path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}" })) as unknown as Schema.Schema<PatchSubscriptionRequest>;
3602
1601
 
3603
1602
  export interface PatchSubscriptionResponse {
3604
1603
  /** Unique identifier for the subscription */
@@ -3616,96 +1615,45 @@ export interface PatchSubscriptionResponse {
3616
1615
  /** Name of the subscription */
3617
1616
  name: string;
3618
1617
  /** Source configuration for the subscription */
3619
- source:
3620
- | { type?: "images" | null }
3621
- | { type?: "kv" | null }
3622
- | { type?: "r2" | null }
3623
- | { type?: "superSlurper" | null }
3624
- | { type?: "vectorize" | null }
3625
- | { modelName?: string | null; type?: "workersAi.model" | null }
3626
- | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3627
- | { type?: "workflows.workflow" | null; workflowName?: string | null };
1618
+ source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3628
1619
  }
3629
1620
 
3630
- export const PatchSubscriptionResponse =
3631
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3632
- id: Schema.String,
3633
- createdAt: Schema.String,
3634
- destination: Schema.Struct({
3635
- queueId: Schema.String,
3636
- type: Schema.Literal("queues.queue"),
3637
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3638
- enabled: Schema.Boolean,
3639
- events: Schema.Array(Schema.String),
3640
- modifiedAt: Schema.String,
3641
- name: Schema.String,
3642
- source: Schema.Union([
3643
- Schema.Struct({
3644
- type: Schema.optional(
3645
- Schema.Union([Schema.Literal("images"), Schema.Null]),
3646
- ),
3647
- }),
3648
- Schema.Struct({
3649
- type: Schema.optional(
3650
- Schema.Union([Schema.Literal("kv"), Schema.Null]),
3651
- ),
3652
- }),
3653
- Schema.Struct({
3654
- type: Schema.optional(
3655
- Schema.Union([Schema.Literal("r2"), Schema.Null]),
3656
- ),
3657
- }),
3658
- Schema.Struct({
3659
- type: Schema.optional(
3660
- Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3661
- ),
3662
- }),
3663
- Schema.Struct({
3664
- type: Schema.optional(
3665
- Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3666
- ),
3667
- }),
3668
- Schema.Struct({
3669
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3670
- type: Schema.optional(
3671
- Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3672
- ),
3673
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3674
- Schema.Struct({
3675
- type: Schema.optional(
3676
- Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3677
- ),
3678
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3679
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3680
- Schema.Struct({
3681
- type: Schema.optional(
3682
- Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3683
- ),
3684
- workflowName: Schema.optional(
3685
- Schema.Union([Schema.String, Schema.Null]),
3686
- ),
3687
- }).pipe(
3688
- Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3689
- ),
3690
- ]),
3691
- })
3692
- .pipe(
3693
- Schema.encodeKeys({
3694
- id: "id",
3695
- createdAt: "created_at",
3696
- destination: "destination",
3697
- enabled: "enabled",
3698
- events: "events",
3699
- modifiedAt: "modified_at",
3700
- name: "name",
3701
- source: "source",
3702
- }),
3703
- )
3704
- .pipe(
3705
- T.ResponsePath("result"),
3706
- ) as unknown as Schema.Schema<PatchSubscriptionResponse>;
3707
-
3708
- export type PatchSubscriptionError = DefaultErrors | UnrecognizedEventType;
1621
+ export const PatchSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1622
+ id: Schema.String,
1623
+ createdAt: Schema.String,
1624
+ destination: Schema.Struct({
1625
+ queueId: Schema.String,
1626
+ type: Schema.Literal("queues.queue")
1627
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1628
+ enabled: Schema.Boolean,
1629
+ events: Schema.Array(Schema.String),
1630
+ modifiedAt: Schema.String,
1631
+ name: Schema.String,
1632
+ source: Schema.Union([Schema.Struct({
1633
+ type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1634
+ }), Schema.Struct({
1635
+ type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1636
+ }), Schema.Struct({
1637
+ type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1638
+ }), Schema.Struct({
1639
+ type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1640
+ }), Schema.Struct({
1641
+ type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1642
+ }), Schema.Struct({
1643
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1644
+ type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1645
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1646
+ type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1647
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1648
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1649
+ type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1650
+ workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1651
+ }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1652
+ }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<PatchSubscriptionResponse>;
1653
+
1654
+ export type PatchSubscriptionError =
1655
+ | DefaultErrors
1656
+ | UnrecognizedEventType;
3709
1657
 
3710
1658
  export const patchSubscription: API.OperationMethod<
3711
1659
  PatchSubscriptionRequest,
@@ -3724,16 +1672,11 @@ export interface DeleteSubscriptionRequest {
3724
1672
  accountId: string;
3725
1673
  }
3726
1674
 
3727
- export const DeleteSubscriptionRequest =
3728
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3729
- subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
3730
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
3731
- }).pipe(
3732
- T.Http({
3733
- method: "DELETE",
3734
- path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
3735
- }),
3736
- ) as unknown as Schema.Schema<DeleteSubscriptionRequest>;
1675
+ export const DeleteSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1676
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1677
+ accountId: Schema.String.pipe(T.HttpPath("account_id"))
1678
+ })
1679
+ .pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}" })) as unknown as Schema.Schema<DeleteSubscriptionRequest>;
3737
1680
 
3738
1681
  export interface DeleteSubscriptionResponse {
3739
1682
  /** Unique identifier for the subscription */
@@ -3751,96 +1694,45 @@ export interface DeleteSubscriptionResponse {
3751
1694
  /** Name of the subscription */
3752
1695
  name: string;
3753
1696
  /** Source configuration for the subscription */
3754
- source:
3755
- | { type?: "images" | null }
3756
- | { type?: "kv" | null }
3757
- | { type?: "r2" | null }
3758
- | { type?: "superSlurper" | null }
3759
- | { type?: "vectorize" | null }
3760
- | { modelName?: string | null; type?: "workersAi.model" | null }
3761
- | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3762
- | { type?: "workflows.workflow" | null; workflowName?: string | null };
1697
+ source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3763
1698
  }
3764
1699
 
3765
- export const DeleteSubscriptionResponse =
3766
- /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3767
- id: Schema.String,
3768
- createdAt: Schema.String,
3769
- destination: Schema.Struct({
3770
- queueId: Schema.String,
3771
- type: Schema.Literal("queues.queue"),
3772
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3773
- enabled: Schema.Boolean,
3774
- events: Schema.Array(Schema.String),
3775
- modifiedAt: Schema.String,
3776
- name: Schema.String,
3777
- source: Schema.Union([
3778
- Schema.Struct({
3779
- type: Schema.optional(
3780
- Schema.Union([Schema.Literal("images"), Schema.Null]),
3781
- ),
3782
- }),
3783
- Schema.Struct({
3784
- type: Schema.optional(
3785
- Schema.Union([Schema.Literal("kv"), Schema.Null]),
3786
- ),
3787
- }),
3788
- Schema.Struct({
3789
- type: Schema.optional(
3790
- Schema.Union([Schema.Literal("r2"), Schema.Null]),
3791
- ),
3792
- }),
3793
- Schema.Struct({
3794
- type: Schema.optional(
3795
- Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3796
- ),
3797
- }),
3798
- Schema.Struct({
3799
- type: Schema.optional(
3800
- Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3801
- ),
3802
- }),
3803
- Schema.Struct({
3804
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3805
- type: Schema.optional(
3806
- Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3807
- ),
3808
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3809
- Schema.Struct({
3810
- type: Schema.optional(
3811
- Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3812
- ),
3813
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3814
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3815
- Schema.Struct({
3816
- type: Schema.optional(
3817
- Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3818
- ),
3819
- workflowName: Schema.optional(
3820
- Schema.Union([Schema.String, Schema.Null]),
3821
- ),
3822
- }).pipe(
3823
- Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3824
- ),
3825
- ]),
3826
- })
3827
- .pipe(
3828
- Schema.encodeKeys({
3829
- id: "id",
3830
- createdAt: "created_at",
3831
- destination: "destination",
3832
- enabled: "enabled",
3833
- events: "events",
3834
- modifiedAt: "modified_at",
3835
- name: "name",
3836
- source: "source",
3837
- }),
3838
- )
3839
- .pipe(
3840
- T.ResponsePath("result"),
3841
- ) as unknown as Schema.Schema<DeleteSubscriptionResponse>;
3842
-
3843
- export type DeleteSubscriptionError = DefaultErrors | UnrecognizedEventType;
1700
+ export const DeleteSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1701
+ id: Schema.String,
1702
+ createdAt: Schema.String,
1703
+ destination: Schema.Struct({
1704
+ queueId: Schema.String,
1705
+ type: Schema.Literal("queues.queue")
1706
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1707
+ enabled: Schema.Boolean,
1708
+ events: Schema.Array(Schema.String),
1709
+ modifiedAt: Schema.String,
1710
+ name: Schema.String,
1711
+ source: Schema.Union([Schema.Struct({
1712
+ type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1713
+ }), Schema.Struct({
1714
+ type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1715
+ }), Schema.Struct({
1716
+ type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1717
+ }), Schema.Struct({
1718
+ type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1719
+ }), Schema.Struct({
1720
+ type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1721
+ }), Schema.Struct({
1722
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1723
+ type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1724
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1725
+ type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1726
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1727
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1728
+ type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1729
+ workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1730
+ }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1731
+ }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<DeleteSubscriptionResponse>;
1732
+
1733
+ export type DeleteSubscriptionError =
1734
+ | DefaultErrors
1735
+ | UnrecognizedEventType;
3844
1736
 
3845
1737
  export const deleteSubscription: API.OperationMethod<
3846
1738
  DeleteSubscriptionRequest,