@solarwinds/squadcast-sdk-typescript 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/FUNCTIONS.md +5 -8
  2. package/README.md +138 -36
  3. package/dist/commonjs/funcs/authAuthGetAccessToken.d.ts +20 -0
  4. package/dist/commonjs/funcs/authAuthGetAccessToken.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/authAuthGetAccessToken.js +134 -0
  6. package/dist/commonjs/funcs/authAuthGetAccessToken.js.map +1 -0
  7. package/dist/commonjs/funcs/escalationPoliciesUpdate.js +4 -1
  8. package/dist/commonjs/funcs/escalationPoliciesUpdate.js.map +1 -1
  9. package/dist/commonjs/funcs/workflowsUpdateAction.d.ts +1 -2
  10. package/dist/commonjs/funcs/workflowsUpdateAction.d.ts.map +1 -1
  11. package/dist/commonjs/funcs/workflowsUpdateAction.js +1 -2
  12. package/dist/commonjs/funcs/workflowsUpdateAction.js.map +1 -1
  13. package/dist/commonjs/lib/config.d.ts +4 -4
  14. package/dist/commonjs/lib/config.d.ts.map +1 -1
  15. package/dist/commonjs/lib/config.js +8 -4
  16. package/dist/commonjs/lib/config.js.map +1 -1
  17. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  18. package/dist/commonjs/lib/matchers.js +0 -1
  19. package/dist/commonjs/lib/matchers.js.map +1 -1
  20. package/dist/commonjs/lib/security.d.ts.map +1 -1
  21. package/dist/commonjs/lib/security.js +1 -2
  22. package/dist/commonjs/lib/security.js.map +1 -1
  23. package/dist/commonjs/models/errors/authgetaccesstoken.d.ts +352 -0
  24. package/dist/commonjs/models/errors/authgetaccesstoken.d.ts.map +1 -0
  25. package/dist/commonjs/models/errors/authgetaccesstoken.js +424 -0
  26. package/dist/commonjs/models/errors/authgetaccesstoken.js.map +1 -0
  27. package/dist/commonjs/models/errors/index.d.ts +1 -1
  28. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  29. package/dist/commonjs/models/errors/index.js +1 -1
  30. package/dist/commonjs/models/errors/index.js.map +1 -1
  31. package/dist/commonjs/models/index.d.ts +1 -0
  32. package/dist/commonjs/models/index.d.ts.map +1 -1
  33. package/dist/commonjs/models/index.js +1 -0
  34. package/dist/commonjs/models/index.js.map +1 -1
  35. package/dist/commonjs/models/operations/authgetaccesstoken.d.ts +31 -0
  36. package/dist/commonjs/models/operations/authgetaccesstoken.d.ts.map +1 -0
  37. package/dist/commonjs/models/operations/authgetaccesstoken.js +74 -0
  38. package/dist/commonjs/models/operations/authgetaccesstoken.js.map +1 -0
  39. package/dist/commonjs/models/operations/index.d.ts +1 -0
  40. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  41. package/dist/commonjs/models/operations/index.js +1 -0
  42. package/dist/commonjs/models/operations/index.js.map +1 -1
  43. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.d.ts +29 -0
  44. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.d.ts.map +1 -1
  45. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.js +49 -1
  46. package/dist/commonjs/models/operations/workflowsupdateworkflowaction.js.map +1 -1
  47. package/dist/commonjs/models/security.d.ts +2 -2
  48. package/dist/commonjs/models/security.d.ts.map +1 -1
  49. package/dist/commonjs/models/security.js +1 -1
  50. package/dist/commonjs/models/security.js.map +1 -1
  51. package/dist/commonjs/models/v3authaccesstokendata.d.ts +32 -0
  52. package/dist/commonjs/models/v3authaccesstokendata.d.ts.map +1 -0
  53. package/dist/commonjs/models/v3authaccesstokendata.js +62 -0
  54. package/dist/commonjs/models/v3authaccesstokendata.js.map +1 -0
  55. package/dist/commonjs/sdk/auth.d.ts +14 -0
  56. package/dist/commonjs/sdk/auth.d.ts.map +1 -0
  57. package/dist/commonjs/sdk/auth.js +24 -0
  58. package/dist/commonjs/sdk/auth.js.map +1 -0
  59. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  60. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  61. package/dist/commonjs/sdk/sdk.js +4 -0
  62. package/dist/commonjs/sdk/sdk.js.map +1 -1
  63. package/dist/commonjs/sdk/workflows.d.ts +1 -1
  64. package/dist/commonjs/sdk/workflows.d.ts.map +1 -1
  65. package/dist/esm/funcs/authAuthGetAccessToken.d.ts +20 -0
  66. package/dist/esm/funcs/authAuthGetAccessToken.d.ts.map +1 -0
  67. package/dist/esm/funcs/authAuthGetAccessToken.js +98 -0
  68. package/dist/esm/funcs/authAuthGetAccessToken.js.map +1 -0
  69. package/dist/esm/funcs/escalationPoliciesUpdate.js +4 -1
  70. package/dist/esm/funcs/escalationPoliciesUpdate.js.map +1 -1
  71. package/dist/esm/funcs/workflowsUpdateAction.d.ts +1 -2
  72. package/dist/esm/funcs/workflowsUpdateAction.d.ts.map +1 -1
  73. package/dist/esm/funcs/workflowsUpdateAction.js +1 -2
  74. package/dist/esm/funcs/workflowsUpdateAction.js.map +1 -1
  75. package/dist/esm/lib/config.d.ts +4 -4
  76. package/dist/esm/lib/config.d.ts.map +1 -1
  77. package/dist/esm/lib/config.js +8 -4
  78. package/dist/esm/lib/config.js.map +1 -1
  79. package/dist/esm/lib/matchers.d.ts.map +1 -1
  80. package/dist/esm/lib/matchers.js +0 -1
  81. package/dist/esm/lib/matchers.js.map +1 -1
  82. package/dist/esm/lib/security.d.ts.map +1 -1
  83. package/dist/esm/lib/security.js +1 -2
  84. package/dist/esm/lib/security.js.map +1 -1
  85. package/dist/esm/models/errors/authgetaccesstoken.d.ts +352 -0
  86. package/dist/esm/models/errors/authgetaccesstoken.d.ts.map +1 -0
  87. package/dist/esm/models/errors/authgetaccesstoken.js +374 -0
  88. package/dist/esm/models/errors/authgetaccesstoken.js.map +1 -0
  89. package/dist/esm/models/errors/index.d.ts +1 -1
  90. package/dist/esm/models/errors/index.d.ts.map +1 -1
  91. package/dist/esm/models/errors/index.js +1 -1
  92. package/dist/esm/models/errors/index.js.map +1 -1
  93. package/dist/esm/models/index.d.ts +1 -0
  94. package/dist/esm/models/index.d.ts.map +1 -1
  95. package/dist/esm/models/index.js +1 -0
  96. package/dist/esm/models/index.js.map +1 -1
  97. package/dist/esm/models/operations/authgetaccesstoken.d.ts +31 -0
  98. package/dist/esm/models/operations/authgetaccesstoken.d.ts.map +1 -0
  99. package/dist/esm/models/operations/authgetaccesstoken.js +36 -0
  100. package/dist/esm/models/operations/authgetaccesstoken.js.map +1 -0
  101. package/dist/esm/models/operations/index.d.ts +1 -0
  102. package/dist/esm/models/operations/index.d.ts.map +1 -1
  103. package/dist/esm/models/operations/index.js +1 -0
  104. package/dist/esm/models/operations/index.js.map +1 -1
  105. package/dist/esm/models/operations/workflowsupdateworkflowaction.d.ts +29 -0
  106. package/dist/esm/models/operations/workflowsupdateworkflowaction.d.ts.map +1 -1
  107. package/dist/esm/models/operations/workflowsupdateworkflowaction.js +45 -0
  108. package/dist/esm/models/operations/workflowsupdateworkflowaction.js.map +1 -1
  109. package/dist/esm/models/security.d.ts +2 -2
  110. package/dist/esm/models/security.d.ts.map +1 -1
  111. package/dist/esm/models/security.js +1 -1
  112. package/dist/esm/models/security.js.map +1 -1
  113. package/dist/esm/models/v3authaccesstokendata.d.ts +32 -0
  114. package/dist/esm/models/v3authaccesstokendata.d.ts.map +1 -0
  115. package/dist/esm/models/v3authaccesstokendata.js +25 -0
  116. package/dist/esm/models/v3authaccesstokendata.js.map +1 -0
  117. package/dist/esm/sdk/auth.d.ts +14 -0
  118. package/dist/esm/sdk/auth.d.ts.map +1 -0
  119. package/dist/esm/sdk/auth.js +20 -0
  120. package/dist/esm/sdk/auth.js.map +1 -0
  121. package/dist/esm/sdk/sdk.d.ts +3 -0
  122. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  123. package/dist/esm/sdk/sdk.js +4 -0
  124. package/dist/esm/sdk/sdk.js.map +1 -1
  125. package/dist/esm/sdk/workflows.d.ts +1 -1
  126. package/dist/esm/sdk/workflows.d.ts.map +1 -1
  127. package/examples/authAuthGetAccessToken.example.ts +26 -0
  128. package/jsr.json +1 -1
  129. package/package.json +5 -5
  130. package/src/funcs/authAuthGetAccessToken.ts +229 -0
  131. package/src/funcs/escalationPoliciesUpdate.ts +7 -1
  132. package/src/funcs/workflowsUpdateAction.ts +4 -5
  133. package/src/lib/config.ts +8 -4
  134. package/src/lib/matchers.ts +3 -2
  135. package/src/lib/security.ts +1 -2
  136. package/src/models/errors/authgetaccesstoken.ts +751 -0
  137. package/src/models/errors/index.ts +1 -1
  138. package/src/models/index.ts +1 -0
  139. package/src/models/operations/authgetaccesstoken.ts +83 -0
  140. package/src/models/operations/index.ts +1 -0
  141. package/src/models/operations/workflowsupdateworkflowaction.ts +122 -0
  142. package/src/models/security.ts +3 -3
  143. package/src/models/v3authaccesstokendata.ts +65 -0
  144. package/src/sdk/auth.ts +29 -0
  145. package/src/sdk/sdk.ts +6 -0
  146. package/src/sdk/workflows.ts +1 -1
  147. package/examples/package-lock.json +0 -611
  148. package/examples/package.json +0 -18
  149. package/tsconfig.json +0 -40
@@ -0,0 +1,751 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as models from "../index.js";
9
+ import { SDKValidationError } from "./sdkvalidationerror.js";
10
+ import { SquadcastSDKError } from "./squadcastsdkerror.js";
11
+
12
+ /**
13
+ * Server error
14
+ */
15
+ export type GatewayTimeoutErrorData = {
16
+ /**
17
+ * Represents a single response containing data of type T.
18
+ */
19
+ meta: models.CommonV3ErrorMeta;
20
+ };
21
+
22
+ /**
23
+ * Server error
24
+ */
25
+ export class GatewayTimeoutError extends SquadcastSDKError {
26
+ /**
27
+ * Represents a single response containing data of type T.
28
+ */
29
+ meta: models.CommonV3ErrorMeta;
30
+
31
+ /** The original data that was passed to this error instance. */
32
+ data$: GatewayTimeoutErrorData;
33
+
34
+ constructor(
35
+ err: GatewayTimeoutErrorData,
36
+ httpMeta: { response: Response; request: Request; body: string },
37
+ ) {
38
+ const message = "message" in err && typeof err.message === "string"
39
+ ? err.message
40
+ : `API error occurred: ${JSON.stringify(err)}`;
41
+ super(message, httpMeta);
42
+ this.data$ = err;
43
+ this.meta = err.meta;
44
+
45
+ this.name = "GatewayTimeoutError";
46
+ }
47
+ }
48
+
49
+ /**
50
+ * Service unavailable.
51
+ */
52
+ export type ServiceUnavailableErrorData = {
53
+ /**
54
+ * Represents a single response containing data of type T.
55
+ */
56
+ meta: models.CommonV3ErrorMeta;
57
+ };
58
+
59
+ /**
60
+ * Service unavailable.
61
+ */
62
+ export class ServiceUnavailableError extends SquadcastSDKError {
63
+ /**
64
+ * Represents a single response containing data of type T.
65
+ */
66
+ meta: models.CommonV3ErrorMeta;
67
+
68
+ /** The original data that was passed to this error instance. */
69
+ data$: ServiceUnavailableErrorData;
70
+
71
+ constructor(
72
+ err: ServiceUnavailableErrorData,
73
+ httpMeta: { response: Response; request: Request; body: string },
74
+ ) {
75
+ const message = "message" in err && typeof err.message === "string"
76
+ ? err.message
77
+ : `API error occurred: ${JSON.stringify(err)}`;
78
+ super(message, httpMeta);
79
+ this.data$ = err;
80
+ this.meta = err.meta;
81
+
82
+ this.name = "ServiceUnavailableError";
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Server error
88
+ */
89
+ export type BadGatewayErrorData = {
90
+ /**
91
+ * Represents a single response containing data of type T.
92
+ */
93
+ meta: models.CommonV3ErrorMeta;
94
+ };
95
+
96
+ /**
97
+ * Server error
98
+ */
99
+ export class BadGatewayError extends SquadcastSDKError {
100
+ /**
101
+ * Represents a single response containing data of type T.
102
+ */
103
+ meta: models.CommonV3ErrorMeta;
104
+
105
+ /** The original data that was passed to this error instance. */
106
+ data$: BadGatewayErrorData;
107
+
108
+ constructor(
109
+ err: BadGatewayErrorData,
110
+ httpMeta: { response: Response; request: Request; body: string },
111
+ ) {
112
+ const message = "message" in err && typeof err.message === "string"
113
+ ? err.message
114
+ : `API error occurred: ${JSON.stringify(err)}`;
115
+ super(message, httpMeta);
116
+ this.data$ = err;
117
+ this.meta = err.meta;
118
+
119
+ this.name = "BadGatewayError";
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Server error
125
+ */
126
+ export type InternalServerErrorData = {
127
+ /**
128
+ * Represents a single response containing data of type T.
129
+ */
130
+ meta: models.CommonV3ErrorMeta;
131
+ };
132
+
133
+ /**
134
+ * Server error
135
+ */
136
+ export class InternalServerError extends SquadcastSDKError {
137
+ /**
138
+ * Represents a single response containing data of type T.
139
+ */
140
+ meta: models.CommonV3ErrorMeta;
141
+
142
+ /** The original data that was passed to this error instance. */
143
+ data$: InternalServerErrorData;
144
+
145
+ constructor(
146
+ err: InternalServerErrorData,
147
+ httpMeta: { response: Response; request: Request; body: string },
148
+ ) {
149
+ const message = "message" in err && typeof err.message === "string"
150
+ ? err.message
151
+ : `API error occurred: ${JSON.stringify(err)}`;
152
+ super(message, httpMeta);
153
+ this.data$ = err;
154
+ this.meta = err.meta;
155
+
156
+ this.name = "InternalServerError";
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Client error
162
+ */
163
+ export type UnprocessableEntityErrorData = {
164
+ /**
165
+ * Represents a single response containing data of type T.
166
+ */
167
+ meta: models.CommonV3ErrorMeta;
168
+ };
169
+
170
+ /**
171
+ * Client error
172
+ */
173
+ export class UnprocessableEntityError extends SquadcastSDKError {
174
+ /**
175
+ * Represents a single response containing data of type T.
176
+ */
177
+ meta: models.CommonV3ErrorMeta;
178
+
179
+ /** The original data that was passed to this error instance. */
180
+ data$: UnprocessableEntityErrorData;
181
+
182
+ constructor(
183
+ err: UnprocessableEntityErrorData,
184
+ httpMeta: { response: Response; request: Request; body: string },
185
+ ) {
186
+ const message = "message" in err && typeof err.message === "string"
187
+ ? err.message
188
+ : `API error occurred: ${JSON.stringify(err)}`;
189
+ super(message, httpMeta);
190
+ this.data$ = err;
191
+ this.meta = err.meta;
192
+
193
+ this.name = "UnprocessableEntityError";
194
+ }
195
+ }
196
+
197
+ /**
198
+ * The request conflicts with the current state of the server.
199
+ */
200
+ export type ConflictErrorData = {
201
+ /**
202
+ * Represents a single response containing data of type T.
203
+ */
204
+ meta: models.CommonV3ErrorMeta;
205
+ };
206
+
207
+ /**
208
+ * The request conflicts with the current state of the server.
209
+ */
210
+ export class ConflictError extends SquadcastSDKError {
211
+ /**
212
+ * Represents a single response containing data of type T.
213
+ */
214
+ meta: models.CommonV3ErrorMeta;
215
+
216
+ /** The original data that was passed to this error instance. */
217
+ data$: ConflictErrorData;
218
+
219
+ constructor(
220
+ err: ConflictErrorData,
221
+ httpMeta: { response: Response; request: Request; body: string },
222
+ ) {
223
+ const message = "message" in err && typeof err.message === "string"
224
+ ? err.message
225
+ : `API error occurred: ${JSON.stringify(err)}`;
226
+ super(message, httpMeta);
227
+ this.data$ = err;
228
+ this.meta = err.meta;
229
+
230
+ this.name = "ConflictError";
231
+ }
232
+ }
233
+
234
+ /**
235
+ * The server cannot find the requested resource.
236
+ */
237
+ export type NotFoundErrorData = {
238
+ /**
239
+ * Represents a single response containing data of type T.
240
+ */
241
+ meta: models.CommonV3ErrorMeta;
242
+ };
243
+
244
+ /**
245
+ * The server cannot find the requested resource.
246
+ */
247
+ export class NotFoundError extends SquadcastSDKError {
248
+ /**
249
+ * Represents a single response containing data of type T.
250
+ */
251
+ meta: models.CommonV3ErrorMeta;
252
+
253
+ /** The original data that was passed to this error instance. */
254
+ data$: NotFoundErrorData;
255
+
256
+ constructor(
257
+ err: NotFoundErrorData,
258
+ httpMeta: { response: Response; request: Request; body: string },
259
+ ) {
260
+ const message = "message" in err && typeof err.message === "string"
261
+ ? err.message
262
+ : `API error occurred: ${JSON.stringify(err)}`;
263
+ super(message, httpMeta);
264
+ this.data$ = err;
265
+ this.meta = err.meta;
266
+
267
+ this.name = "NotFoundError";
268
+ }
269
+ }
270
+
271
+ /**
272
+ * Access is forbidden.
273
+ */
274
+ export type ForbiddenErrorData = {
275
+ /**
276
+ * Represents a single response containing data of type T.
277
+ */
278
+ meta: models.CommonV3ErrorMeta;
279
+ };
280
+
281
+ /**
282
+ * Access is forbidden.
283
+ */
284
+ export class ForbiddenError extends SquadcastSDKError {
285
+ /**
286
+ * Represents a single response containing data of type T.
287
+ */
288
+ meta: models.CommonV3ErrorMeta;
289
+
290
+ /** The original data that was passed to this error instance. */
291
+ data$: ForbiddenErrorData;
292
+
293
+ constructor(
294
+ err: ForbiddenErrorData,
295
+ httpMeta: { response: Response; request: Request; body: string },
296
+ ) {
297
+ const message = "message" in err && typeof err.message === "string"
298
+ ? err.message
299
+ : `API error occurred: ${JSON.stringify(err)}`;
300
+ super(message, httpMeta);
301
+ this.data$ = err;
302
+ this.meta = err.meta;
303
+
304
+ this.name = "ForbiddenError";
305
+ }
306
+ }
307
+
308
+ /**
309
+ * Client error
310
+ */
311
+ export type PaymentRequiredErrorData = {
312
+ /**
313
+ * Represents a single response containing data of type T.
314
+ */
315
+ meta: models.CommonV3ErrorMeta;
316
+ };
317
+
318
+ /**
319
+ * Client error
320
+ */
321
+ export class PaymentRequiredError extends SquadcastSDKError {
322
+ /**
323
+ * Represents a single response containing data of type T.
324
+ */
325
+ meta: models.CommonV3ErrorMeta;
326
+
327
+ /** The original data that was passed to this error instance. */
328
+ data$: PaymentRequiredErrorData;
329
+
330
+ constructor(
331
+ err: PaymentRequiredErrorData,
332
+ httpMeta: { response: Response; request: Request; body: string },
333
+ ) {
334
+ const message = "message" in err && typeof err.message === "string"
335
+ ? err.message
336
+ : `API error occurred: ${JSON.stringify(err)}`;
337
+ super(message, httpMeta);
338
+ this.data$ = err;
339
+ this.meta = err.meta;
340
+
341
+ this.name = "PaymentRequiredError";
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Access is unauthorized.
347
+ */
348
+ export type UnauthorizedErrorData = {
349
+ /**
350
+ * Represents a single response containing data of type T.
351
+ */
352
+ meta: models.CommonV3ErrorMeta;
353
+ };
354
+
355
+ /**
356
+ * Access is unauthorized.
357
+ */
358
+ export class UnauthorizedError extends SquadcastSDKError {
359
+ /**
360
+ * Represents a single response containing data of type T.
361
+ */
362
+ meta: models.CommonV3ErrorMeta;
363
+
364
+ /** The original data that was passed to this error instance. */
365
+ data$: UnauthorizedErrorData;
366
+
367
+ constructor(
368
+ err: UnauthorizedErrorData,
369
+ httpMeta: { response: Response; request: Request; body: string },
370
+ ) {
371
+ const message = "message" in err && typeof err.message === "string"
372
+ ? err.message
373
+ : `API error occurred: ${JSON.stringify(err)}`;
374
+ super(message, httpMeta);
375
+ this.data$ = err;
376
+ this.meta = err.meta;
377
+
378
+ this.name = "UnauthorizedError";
379
+ }
380
+ }
381
+
382
+ /**
383
+ * The server could not understand the request due to invalid syntax.
384
+ */
385
+ export type BadRequestErrorData = {
386
+ /**
387
+ * Represents a single response containing data of type T.
388
+ */
389
+ meta: models.CommonV3ErrorMeta;
390
+ };
391
+
392
+ /**
393
+ * The server could not understand the request due to invalid syntax.
394
+ */
395
+ export class BadRequestError extends SquadcastSDKError {
396
+ /**
397
+ * Represents a single response containing data of type T.
398
+ */
399
+ meta: models.CommonV3ErrorMeta;
400
+
401
+ /** The original data that was passed to this error instance. */
402
+ data$: BadRequestErrorData;
403
+
404
+ constructor(
405
+ err: BadRequestErrorData,
406
+ httpMeta: { response: Response; request: Request; body: string },
407
+ ) {
408
+ const message = "message" in err && typeof err.message === "string"
409
+ ? err.message
410
+ : `API error occurred: ${JSON.stringify(err)}`;
411
+ super(message, httpMeta);
412
+ this.data$ = err;
413
+ this.meta = err.meta;
414
+
415
+ this.name = "BadRequestError";
416
+ }
417
+ }
418
+
419
+ export type ResponseBodyError2Data = {
420
+ /**
421
+ * Represents a single response containing data of type T.
422
+ */
423
+ meta: models.CommonV3ErrorMeta;
424
+ };
425
+
426
+ export class ResponseBodyError2 extends SquadcastSDKError {
427
+ /**
428
+ * Represents a single response containing data of type T.
429
+ */
430
+ meta: models.CommonV3ErrorMeta;
431
+
432
+ /** The original data that was passed to this error instance. */
433
+ data$: ResponseBodyError2Data;
434
+
435
+ constructor(
436
+ err: ResponseBodyError2Data,
437
+ httpMeta: { response: Response; request: Request; body: string },
438
+ ) {
439
+ const message = "message" in err && typeof err.message === "string"
440
+ ? err.message
441
+ : `API error occurred: ${JSON.stringify(err)}`;
442
+ super(message, httpMeta);
443
+ this.data$ = err;
444
+ this.meta = err.meta;
445
+
446
+ this.name = "ResponseBodyError2";
447
+ }
448
+ }
449
+
450
+ export type ResponseBodyError1Data = {
451
+ /**
452
+ * Represents the metadata for a CircleCI error response.
453
+ */
454
+ meta: models.V3IncidentsIncidentActionsCircleCIErrorMeta;
455
+ };
456
+
457
+ export class ResponseBodyError1 extends SquadcastSDKError {
458
+ /**
459
+ * Represents the metadata for a CircleCI error response.
460
+ */
461
+ meta: models.V3IncidentsIncidentActionsCircleCIErrorMeta;
462
+
463
+ /** The original data that was passed to this error instance. */
464
+ data$: ResponseBodyError1Data;
465
+
466
+ constructor(
467
+ err: ResponseBodyError1Data,
468
+ httpMeta: { response: Response; request: Request; body: string },
469
+ ) {
470
+ const message = "message" in err && typeof err.message === "string"
471
+ ? err.message
472
+ : `API error occurred: ${JSON.stringify(err)}`;
473
+ super(message, httpMeta);
474
+ this.data$ = err;
475
+ this.meta = err.meta;
476
+
477
+ this.name = "ResponseBodyError1";
478
+ }
479
+ }
480
+
481
+ /**
482
+ * Represents a CircleCI error response for a 400 status code.
483
+ */
484
+ export type BadRequest = ResponseBodyError1 | ResponseBodyError2;
485
+
486
+ /** @internal */
487
+ export const GatewayTimeoutError$inboundSchema: z.ZodType<
488
+ GatewayTimeoutError,
489
+ z.ZodTypeDef,
490
+ unknown
491
+ > = z.object({
492
+ meta: models.CommonV3ErrorMeta$inboundSchema,
493
+ request$: z.instanceof(Request),
494
+ response$: z.instanceof(Response),
495
+ body$: z.string(),
496
+ })
497
+ .transform((v) => {
498
+ return new GatewayTimeoutError(v, {
499
+ request: v.request$,
500
+ response: v.response$,
501
+ body: v.body$,
502
+ });
503
+ });
504
+
505
+ /** @internal */
506
+ export const ServiceUnavailableError$inboundSchema: z.ZodType<
507
+ ServiceUnavailableError,
508
+ z.ZodTypeDef,
509
+ unknown
510
+ > = z.object({
511
+ meta: models.CommonV3ErrorMeta$inboundSchema,
512
+ request$: z.instanceof(Request),
513
+ response$: z.instanceof(Response),
514
+ body$: z.string(),
515
+ })
516
+ .transform((v) => {
517
+ return new ServiceUnavailableError(v, {
518
+ request: v.request$,
519
+ response: v.response$,
520
+ body: v.body$,
521
+ });
522
+ });
523
+
524
+ /** @internal */
525
+ export const BadGatewayError$inboundSchema: z.ZodType<
526
+ BadGatewayError,
527
+ z.ZodTypeDef,
528
+ unknown
529
+ > = z.object({
530
+ meta: models.CommonV3ErrorMeta$inboundSchema,
531
+ request$: z.instanceof(Request),
532
+ response$: z.instanceof(Response),
533
+ body$: z.string(),
534
+ })
535
+ .transform((v) => {
536
+ return new BadGatewayError(v, {
537
+ request: v.request$,
538
+ response: v.response$,
539
+ body: v.body$,
540
+ });
541
+ });
542
+
543
+ /** @internal */
544
+ export const InternalServerError$inboundSchema: z.ZodType<
545
+ InternalServerError,
546
+ z.ZodTypeDef,
547
+ unknown
548
+ > = z.object({
549
+ meta: models.CommonV3ErrorMeta$inboundSchema,
550
+ request$: z.instanceof(Request),
551
+ response$: z.instanceof(Response),
552
+ body$: z.string(),
553
+ })
554
+ .transform((v) => {
555
+ return new InternalServerError(v, {
556
+ request: v.request$,
557
+ response: v.response$,
558
+ body: v.body$,
559
+ });
560
+ });
561
+
562
+ /** @internal */
563
+ export const UnprocessableEntityError$inboundSchema: z.ZodType<
564
+ UnprocessableEntityError,
565
+ z.ZodTypeDef,
566
+ unknown
567
+ > = z.object({
568
+ meta: models.CommonV3ErrorMeta$inboundSchema,
569
+ request$: z.instanceof(Request),
570
+ response$: z.instanceof(Response),
571
+ body$: z.string(),
572
+ })
573
+ .transform((v) => {
574
+ return new UnprocessableEntityError(v, {
575
+ request: v.request$,
576
+ response: v.response$,
577
+ body: v.body$,
578
+ });
579
+ });
580
+
581
+ /** @internal */
582
+ export const ConflictError$inboundSchema: z.ZodType<
583
+ ConflictError,
584
+ z.ZodTypeDef,
585
+ unknown
586
+ > = z.object({
587
+ meta: models.CommonV3ErrorMeta$inboundSchema,
588
+ request$: z.instanceof(Request),
589
+ response$: z.instanceof(Response),
590
+ body$: z.string(),
591
+ })
592
+ .transform((v) => {
593
+ return new ConflictError(v, {
594
+ request: v.request$,
595
+ response: v.response$,
596
+ body: v.body$,
597
+ });
598
+ });
599
+
600
+ /** @internal */
601
+ export const NotFoundError$inboundSchema: z.ZodType<
602
+ NotFoundError,
603
+ z.ZodTypeDef,
604
+ unknown
605
+ > = z.object({
606
+ meta: models.CommonV3ErrorMeta$inboundSchema,
607
+ request$: z.instanceof(Request),
608
+ response$: z.instanceof(Response),
609
+ body$: z.string(),
610
+ })
611
+ .transform((v) => {
612
+ return new NotFoundError(v, {
613
+ request: v.request$,
614
+ response: v.response$,
615
+ body: v.body$,
616
+ });
617
+ });
618
+
619
+ /** @internal */
620
+ export const ForbiddenError$inboundSchema: z.ZodType<
621
+ ForbiddenError,
622
+ z.ZodTypeDef,
623
+ unknown
624
+ > = z.object({
625
+ meta: models.CommonV3ErrorMeta$inboundSchema,
626
+ request$: z.instanceof(Request),
627
+ response$: z.instanceof(Response),
628
+ body$: z.string(),
629
+ })
630
+ .transform((v) => {
631
+ return new ForbiddenError(v, {
632
+ request: v.request$,
633
+ response: v.response$,
634
+ body: v.body$,
635
+ });
636
+ });
637
+
638
+ /** @internal */
639
+ export const PaymentRequiredError$inboundSchema: z.ZodType<
640
+ PaymentRequiredError,
641
+ z.ZodTypeDef,
642
+ unknown
643
+ > = z.object({
644
+ meta: models.CommonV3ErrorMeta$inboundSchema,
645
+ request$: z.instanceof(Request),
646
+ response$: z.instanceof(Response),
647
+ body$: z.string(),
648
+ })
649
+ .transform((v) => {
650
+ return new PaymentRequiredError(v, {
651
+ request: v.request$,
652
+ response: v.response$,
653
+ body: v.body$,
654
+ });
655
+ });
656
+
657
+ /** @internal */
658
+ export const UnauthorizedError$inboundSchema: z.ZodType<
659
+ UnauthorizedError,
660
+ z.ZodTypeDef,
661
+ unknown
662
+ > = z.object({
663
+ meta: models.CommonV3ErrorMeta$inboundSchema,
664
+ request$: z.instanceof(Request),
665
+ response$: z.instanceof(Response),
666
+ body$: z.string(),
667
+ })
668
+ .transform((v) => {
669
+ return new UnauthorizedError(v, {
670
+ request: v.request$,
671
+ response: v.response$,
672
+ body: v.body$,
673
+ });
674
+ });
675
+
676
+ /** @internal */
677
+ export const BadRequestError$inboundSchema: z.ZodType<
678
+ BadRequestError,
679
+ z.ZodTypeDef,
680
+ unknown
681
+ > = z.object({
682
+ meta: models.CommonV3ErrorMeta$inboundSchema,
683
+ request$: z.instanceof(Request),
684
+ response$: z.instanceof(Response),
685
+ body$: z.string(),
686
+ })
687
+ .transform((v) => {
688
+ return new BadRequestError(v, {
689
+ request: v.request$,
690
+ response: v.response$,
691
+ body: v.body$,
692
+ });
693
+ });
694
+
695
+ /** @internal */
696
+ export const ResponseBodyError2$inboundSchema: z.ZodType<
697
+ ResponseBodyError2,
698
+ z.ZodTypeDef,
699
+ unknown
700
+ > = z.object({
701
+ meta: models.CommonV3ErrorMeta$inboundSchema,
702
+ request$: z.instanceof(Request),
703
+ response$: z.instanceof(Response),
704
+ body$: z.string(),
705
+ })
706
+ .transform((v) => {
707
+ return new ResponseBodyError2(v, {
708
+ request: v.request$,
709
+ response: v.response$,
710
+ body: v.body$,
711
+ });
712
+ });
713
+
714
+ /** @internal */
715
+ export const ResponseBodyError1$inboundSchema: z.ZodType<
716
+ ResponseBodyError1,
717
+ z.ZodTypeDef,
718
+ unknown
719
+ > = z.object({
720
+ meta: models.V3IncidentsIncidentActionsCircleCIErrorMeta$inboundSchema,
721
+ request$: z.instanceof(Request),
722
+ response$: z.instanceof(Response),
723
+ body$: z.string(),
724
+ })
725
+ .transform((v) => {
726
+ return new ResponseBodyError1(v, {
727
+ request: v.request$,
728
+ response: v.response$,
729
+ body: v.body$,
730
+ });
731
+ });
732
+
733
+ /** @internal */
734
+ export const BadRequest$inboundSchema: z.ZodType<
735
+ BadRequest,
736
+ z.ZodTypeDef,
737
+ unknown
738
+ > = z.union([
739
+ z.lazy(() => ResponseBodyError1$inboundSchema),
740
+ z.lazy(() => ResponseBodyError2$inboundSchema),
741
+ ]);
742
+
743
+ export function badRequestFromJSON(
744
+ jsonString: string,
745
+ ): SafeParseResult<BadRequest, SDKValidationError> {
746
+ return safeParse(
747
+ jsonString,
748
+ (x) => BadRequest$inboundSchema.parse(JSON.parse(x)),
749
+ `Failed to parse 'BadRequest' from JSON`,
750
+ );
751
+ }