@vercel/sdk 1.3.0 → 1.3.1

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 (94) hide show
  1. package/README.md +6 -0
  2. package/docs/sdks/accessgroups/README.md +40 -4
  3. package/docs/sdks/deployments/README.md +22 -0
  4. package/docs/sdks/marketplace/README.md +54 -22
  5. package/docs/sdks/projects/README.md +179 -0
  6. package/docs/sdks/security/README.md +84 -0
  7. package/docs/sdks/teams/README.md +8 -0
  8. package/esm/__tests__/projects.test.js +31 -0
  9. package/esm/__tests__/projects.test.js.map +1 -1
  10. package/esm/__tests__/security.test.js +33 -0
  11. package/esm/__tests__/security.test.js.map +1 -1
  12. package/esm/funcs/projectsAcceptProjectTransferRequest.d.ts +18 -0
  13. package/esm/funcs/projectsAcceptProjectTransferRequest.d.ts.map +1 -0
  14. package/esm/funcs/projectsAcceptProjectTransferRequest.js +88 -0
  15. package/esm/funcs/projectsAcceptProjectTransferRequest.js.map +1 -0
  16. package/esm/funcs/projectsCreateProjectTransferRequest.d.ts +17 -0
  17. package/esm/funcs/projectsCreateProjectTransferRequest.d.ts.map +1 -0
  18. package/esm/funcs/projectsCreateProjectTransferRequest.js +86 -0
  19. package/esm/funcs/projectsCreateProjectTransferRequest.js.map +1 -0
  20. package/esm/funcs/securityGetActiveAttackStatus.d.ts +18 -0
  21. package/esm/funcs/securityGetActiveAttackStatus.d.ts.map +1 -0
  22. package/esm/funcs/securityGetActiveAttackStatus.js +82 -0
  23. package/esm/funcs/securityGetActiveAttackStatus.js.map +1 -0
  24. package/esm/lib/config.d.ts +3 -3
  25. package/esm/lib/config.js +3 -3
  26. package/esm/lib/schemas.d.ts +1 -1
  27. package/esm/lib/schemas.d.ts.map +1 -1
  28. package/esm/lib/schemas.js +4 -1
  29. package/esm/lib/schemas.js.map +1 -1
  30. package/esm/models/acceptprojecttransferrequestop.d.ts +127 -0
  31. package/esm/models/acceptprojecttransferrequestop.d.ts.map +1 -0
  32. package/esm/models/acceptprojecttransferrequestop.js +123 -0
  33. package/esm/models/acceptprojecttransferrequestop.js.map +1 -0
  34. package/esm/models/addprojectdomainop.d.ts +5 -0
  35. package/esm/models/addprojectdomainop.d.ts.map +1 -1
  36. package/esm/models/addprojectdomainop.js +2 -0
  37. package/esm/models/addprojectdomainop.js.map +1 -1
  38. package/esm/models/authuser.d.ts +9 -0
  39. package/esm/models/authuser.d.ts.map +1 -1
  40. package/esm/models/authuser.js +3 -0
  41. package/esm/models/authuser.js.map +1 -1
  42. package/esm/models/createprojectop.d.ts +4 -2
  43. package/esm/models/createprojectop.d.ts.map +1 -1
  44. package/esm/models/createprojectop.js +4 -2
  45. package/esm/models/createprojectop.js.map +1 -1
  46. package/esm/models/createprojecttransferrequestop.d.ts +66 -0
  47. package/esm/models/createprojecttransferrequestop.d.ts.map +1 -0
  48. package/esm/models/createprojecttransferrequestop.js +56 -0
  49. package/esm/models/createprojecttransferrequestop.js.map +1 -0
  50. package/esm/models/getactiveattackstatusop.d.ts +242 -0
  51. package/esm/models/getactiveattackstatusop.d.ts.map +1 -0
  52. package/esm/models/getactiveattackstatusop.js +248 -0
  53. package/esm/models/getactiveattackstatusop.js.map +1 -0
  54. package/esm/models/getprojectsop.d.ts +4 -2
  55. package/esm/models/getprojectsop.d.ts.map +1 -1
  56. package/esm/models/getprojectsop.js +4 -2
  57. package/esm/models/getprojectsop.js.map +1 -1
  58. package/esm/models/updateprojectdatacacheop.d.ts +4 -2
  59. package/esm/models/updateprojectdatacacheop.d.ts.map +1 -1
  60. package/esm/models/updateprojectdatacacheop.js +4 -2
  61. package/esm/models/updateprojectdatacacheop.js.map +1 -1
  62. package/esm/models/updateprojectop.d.ts +4 -2
  63. package/esm/models/updateprojectop.d.ts.map +1 -1
  64. package/esm/models/updateprojectop.js +4 -2
  65. package/esm/models/updateprojectop.js.map +1 -1
  66. package/esm/sdk/projects.d.ts +16 -0
  67. package/esm/sdk/projects.d.ts.map +1 -1
  68. package/esm/sdk/projects.js +20 -0
  69. package/esm/sdk/projects.js.map +1 -1
  70. package/esm/sdk/security.d.ts +8 -0
  71. package/esm/sdk/security.d.ts.map +1 -1
  72. package/esm/sdk/security.js +10 -0
  73. package/esm/sdk/security.js.map +1 -1
  74. package/jsr.json +1 -1
  75. package/package.json +1 -1
  76. package/src/__tests__/projects.test.ts +35 -0
  77. package/src/__tests__/security.test.ts +35 -0
  78. package/src/funcs/projectsAcceptProjectTransferRequest.ts +169 -0
  79. package/src/funcs/projectsCreateProjectTransferRequest.ts +161 -0
  80. package/src/funcs/securityGetActiveAttackStatus.ts +162 -0
  81. package/src/lib/config.ts +3 -3
  82. package/src/lib/schemas.ts +5 -0
  83. package/src/models/acceptprojecttransferrequestop.ts +307 -0
  84. package/src/models/addprojectdomainop.ts +7 -0
  85. package/src/models/authuser.ts +3 -0
  86. package/src/models/createprojectop.ts +8 -4
  87. package/src/models/createprojecttransferrequestop.ts +152 -0
  88. package/src/models/getactiveattackstatusop.ts +543 -0
  89. package/src/models/getprojectsop.ts +8 -4
  90. package/src/models/updateprojectdatacacheop.ts +8 -4
  91. package/src/models/updateprojectop.ts +8 -4
  92. package/src/sdk/projects.ts +44 -0
  93. package/src/sdk/security.ts +22 -0
  94. package/vercel-spec.json +425 -0
@@ -0,0 +1,152 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./sdkvalidationerror.js";
9
+
10
+ export type CreateProjectTransferRequestRequest = {
11
+ /**
12
+ * The ID or name of the project to transfer.
13
+ */
14
+ idOrName: string;
15
+ /**
16
+ * The Team identifier to perform the request on behalf of.
17
+ */
18
+ teamId?: string | undefined;
19
+ /**
20
+ * The Team slug to perform the request on behalf of.
21
+ */
22
+ slug?: string | undefined;
23
+ };
24
+
25
+ /**
26
+ * The project transfer request has been initiated successfully.
27
+ */
28
+ export type CreateProjectTransferRequestResponseBody = {};
29
+
30
+ /** @internal */
31
+ export const CreateProjectTransferRequestRequest$inboundSchema: z.ZodType<
32
+ CreateProjectTransferRequestRequest,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ idOrName: z.string(),
37
+ teamId: z.string().optional(),
38
+ slug: z.string().optional(),
39
+ });
40
+
41
+ /** @internal */
42
+ export type CreateProjectTransferRequestRequest$Outbound = {
43
+ idOrName: string;
44
+ teamId?: string | undefined;
45
+ slug?: string | undefined;
46
+ };
47
+
48
+ /** @internal */
49
+ export const CreateProjectTransferRequestRequest$outboundSchema: z.ZodType<
50
+ CreateProjectTransferRequestRequest$Outbound,
51
+ z.ZodTypeDef,
52
+ CreateProjectTransferRequestRequest
53
+ > = z.object({
54
+ idOrName: z.string(),
55
+ teamId: z.string().optional(),
56
+ slug: z.string().optional(),
57
+ });
58
+
59
+ /**
60
+ * @internal
61
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
62
+ */
63
+ export namespace CreateProjectTransferRequestRequest$ {
64
+ /** @deprecated use `CreateProjectTransferRequestRequest$inboundSchema` instead. */
65
+ export const inboundSchema =
66
+ CreateProjectTransferRequestRequest$inboundSchema;
67
+ /** @deprecated use `CreateProjectTransferRequestRequest$outboundSchema` instead. */
68
+ export const outboundSchema =
69
+ CreateProjectTransferRequestRequest$outboundSchema;
70
+ /** @deprecated use `CreateProjectTransferRequestRequest$Outbound` instead. */
71
+ export type Outbound = CreateProjectTransferRequestRequest$Outbound;
72
+ }
73
+
74
+ export function createProjectTransferRequestRequestToJSON(
75
+ createProjectTransferRequestRequest: CreateProjectTransferRequestRequest,
76
+ ): string {
77
+ return JSON.stringify(
78
+ CreateProjectTransferRequestRequest$outboundSchema.parse(
79
+ createProjectTransferRequestRequest,
80
+ ),
81
+ );
82
+ }
83
+
84
+ export function createProjectTransferRequestRequestFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<CreateProjectTransferRequestRequest, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) =>
90
+ CreateProjectTransferRequestRequest$inboundSchema.parse(JSON.parse(x)),
91
+ `Failed to parse 'CreateProjectTransferRequestRequest' from JSON`,
92
+ );
93
+ }
94
+
95
+ /** @internal */
96
+ export const CreateProjectTransferRequestResponseBody$inboundSchema: z.ZodType<
97
+ CreateProjectTransferRequestResponseBody,
98
+ z.ZodTypeDef,
99
+ unknown
100
+ > = z.object({});
101
+
102
+ /** @internal */
103
+ export type CreateProjectTransferRequestResponseBody$Outbound = {};
104
+
105
+ /** @internal */
106
+ export const CreateProjectTransferRequestResponseBody$outboundSchema: z.ZodType<
107
+ CreateProjectTransferRequestResponseBody$Outbound,
108
+ z.ZodTypeDef,
109
+ CreateProjectTransferRequestResponseBody
110
+ > = z.object({});
111
+
112
+ /**
113
+ * @internal
114
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
115
+ */
116
+ export namespace CreateProjectTransferRequestResponseBody$ {
117
+ /** @deprecated use `CreateProjectTransferRequestResponseBody$inboundSchema` instead. */
118
+ export const inboundSchema =
119
+ CreateProjectTransferRequestResponseBody$inboundSchema;
120
+ /** @deprecated use `CreateProjectTransferRequestResponseBody$outboundSchema` instead. */
121
+ export const outboundSchema =
122
+ CreateProjectTransferRequestResponseBody$outboundSchema;
123
+ /** @deprecated use `CreateProjectTransferRequestResponseBody$Outbound` instead. */
124
+ export type Outbound = CreateProjectTransferRequestResponseBody$Outbound;
125
+ }
126
+
127
+ export function createProjectTransferRequestResponseBodyToJSON(
128
+ createProjectTransferRequestResponseBody:
129
+ CreateProjectTransferRequestResponseBody,
130
+ ): string {
131
+ return JSON.stringify(
132
+ CreateProjectTransferRequestResponseBody$outboundSchema.parse(
133
+ createProjectTransferRequestResponseBody,
134
+ ),
135
+ );
136
+ }
137
+
138
+ export function createProjectTransferRequestResponseBodyFromJSON(
139
+ jsonString: string,
140
+ ): SafeParseResult<
141
+ CreateProjectTransferRequestResponseBody,
142
+ SDKValidationError
143
+ > {
144
+ return safeParse(
145
+ jsonString,
146
+ (x) =>
147
+ CreateProjectTransferRequestResponseBody$inboundSchema.parse(
148
+ JSON.parse(x),
149
+ ),
150
+ `Failed to parse 'CreateProjectTransferRequestResponseBody' from JSON`,
151
+ );
152
+ }
@@ -0,0 +1,543 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../lib/primitives.js";
7
+ import { safeParse } from "../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../types/fp.js";
9
+ import { SDKValidationError } from "./sdkvalidationerror.js";
10
+
11
+ export type GetActiveAttackStatusRequest = {
12
+ projectId: string;
13
+ /**
14
+ * The Team identifier to perform the request on behalf of.
15
+ */
16
+ teamId?: string | undefined;
17
+ /**
18
+ * The Team slug to perform the request on behalf of.
19
+ */
20
+ slug?: string | undefined;
21
+ };
22
+
23
+ export type AnomalyAlerts = {
24
+ atMinute: string;
25
+ zscore: number;
26
+ totalRequestsMinute: number;
27
+ avgRequests: number;
28
+ stddevRequests: number;
29
+ };
30
+
31
+ export type DdosAlerts = {
32
+ atMinute: string;
33
+ totalReqs: number;
34
+ };
35
+
36
+ export type AffectedHostMap = {
37
+ anomalyAlerts?: { [k: string]: AnomalyAlerts } | undefined;
38
+ ddosAlerts?: { [k: string]: DdosAlerts } | undefined;
39
+ };
40
+
41
+ export type Anomalies = {
42
+ ownerId: string;
43
+ projectId: string;
44
+ startTime: number;
45
+ endTime: number | null;
46
+ atMinute: number;
47
+ state?: string | undefined;
48
+ affectedHostMap: { [k: string]: AffectedHostMap };
49
+ };
50
+
51
+ export type GetActiveAttackStatusResponseBody2 = {
52
+ anomalies: Array<Anomalies>;
53
+ };
54
+
55
+ export type GetActiveAttackStatusResponseBody1 = {};
56
+
57
+ export type GetActiveAttackStatusResponseBody =
58
+ | GetActiveAttackStatusResponseBody1
59
+ | GetActiveAttackStatusResponseBody2;
60
+
61
+ /** @internal */
62
+ export const GetActiveAttackStatusRequest$inboundSchema: z.ZodType<
63
+ GetActiveAttackStatusRequest,
64
+ z.ZodTypeDef,
65
+ unknown
66
+ > = z.object({
67
+ projectId: z.string(),
68
+ teamId: z.string().optional(),
69
+ slug: z.string().optional(),
70
+ });
71
+
72
+ /** @internal */
73
+ export type GetActiveAttackStatusRequest$Outbound = {
74
+ projectId: string;
75
+ teamId?: string | undefined;
76
+ slug?: string | undefined;
77
+ };
78
+
79
+ /** @internal */
80
+ export const GetActiveAttackStatusRequest$outboundSchema: z.ZodType<
81
+ GetActiveAttackStatusRequest$Outbound,
82
+ z.ZodTypeDef,
83
+ GetActiveAttackStatusRequest
84
+ > = z.object({
85
+ projectId: z.string(),
86
+ teamId: z.string().optional(),
87
+ slug: z.string().optional(),
88
+ });
89
+
90
+ /**
91
+ * @internal
92
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
93
+ */
94
+ export namespace GetActiveAttackStatusRequest$ {
95
+ /** @deprecated use `GetActiveAttackStatusRequest$inboundSchema` instead. */
96
+ export const inboundSchema = GetActiveAttackStatusRequest$inboundSchema;
97
+ /** @deprecated use `GetActiveAttackStatusRequest$outboundSchema` instead. */
98
+ export const outboundSchema = GetActiveAttackStatusRequest$outboundSchema;
99
+ /** @deprecated use `GetActiveAttackStatusRequest$Outbound` instead. */
100
+ export type Outbound = GetActiveAttackStatusRequest$Outbound;
101
+ }
102
+
103
+ export function getActiveAttackStatusRequestToJSON(
104
+ getActiveAttackStatusRequest: GetActiveAttackStatusRequest,
105
+ ): string {
106
+ return JSON.stringify(
107
+ GetActiveAttackStatusRequest$outboundSchema.parse(
108
+ getActiveAttackStatusRequest,
109
+ ),
110
+ );
111
+ }
112
+
113
+ export function getActiveAttackStatusRequestFromJSON(
114
+ jsonString: string,
115
+ ): SafeParseResult<GetActiveAttackStatusRequest, SDKValidationError> {
116
+ return safeParse(
117
+ jsonString,
118
+ (x) => GetActiveAttackStatusRequest$inboundSchema.parse(JSON.parse(x)),
119
+ `Failed to parse 'GetActiveAttackStatusRequest' from JSON`,
120
+ );
121
+ }
122
+
123
+ /** @internal */
124
+ export const AnomalyAlerts$inboundSchema: z.ZodType<
125
+ AnomalyAlerts,
126
+ z.ZodTypeDef,
127
+ unknown
128
+ > = z.object({
129
+ at_minute: z.string(),
130
+ zscore: z.number(),
131
+ total_requests_minute: z.number(),
132
+ avg_requests: z.number(),
133
+ stddev_requests: z.number(),
134
+ }).transform((v) => {
135
+ return remap$(v, {
136
+ "at_minute": "atMinute",
137
+ "total_requests_minute": "totalRequestsMinute",
138
+ "avg_requests": "avgRequests",
139
+ "stddev_requests": "stddevRequests",
140
+ });
141
+ });
142
+
143
+ /** @internal */
144
+ export type AnomalyAlerts$Outbound = {
145
+ at_minute: string;
146
+ zscore: number;
147
+ total_requests_minute: number;
148
+ avg_requests: number;
149
+ stddev_requests: number;
150
+ };
151
+
152
+ /** @internal */
153
+ export const AnomalyAlerts$outboundSchema: z.ZodType<
154
+ AnomalyAlerts$Outbound,
155
+ z.ZodTypeDef,
156
+ AnomalyAlerts
157
+ > = z.object({
158
+ atMinute: z.string(),
159
+ zscore: z.number(),
160
+ totalRequestsMinute: z.number(),
161
+ avgRequests: z.number(),
162
+ stddevRequests: z.number(),
163
+ }).transform((v) => {
164
+ return remap$(v, {
165
+ atMinute: "at_minute",
166
+ totalRequestsMinute: "total_requests_minute",
167
+ avgRequests: "avg_requests",
168
+ stddevRequests: "stddev_requests",
169
+ });
170
+ });
171
+
172
+ /**
173
+ * @internal
174
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
175
+ */
176
+ export namespace AnomalyAlerts$ {
177
+ /** @deprecated use `AnomalyAlerts$inboundSchema` instead. */
178
+ export const inboundSchema = AnomalyAlerts$inboundSchema;
179
+ /** @deprecated use `AnomalyAlerts$outboundSchema` instead. */
180
+ export const outboundSchema = AnomalyAlerts$outboundSchema;
181
+ /** @deprecated use `AnomalyAlerts$Outbound` instead. */
182
+ export type Outbound = AnomalyAlerts$Outbound;
183
+ }
184
+
185
+ export function anomalyAlertsToJSON(anomalyAlerts: AnomalyAlerts): string {
186
+ return JSON.stringify(AnomalyAlerts$outboundSchema.parse(anomalyAlerts));
187
+ }
188
+
189
+ export function anomalyAlertsFromJSON(
190
+ jsonString: string,
191
+ ): SafeParseResult<AnomalyAlerts, SDKValidationError> {
192
+ return safeParse(
193
+ jsonString,
194
+ (x) => AnomalyAlerts$inboundSchema.parse(JSON.parse(x)),
195
+ `Failed to parse 'AnomalyAlerts' from JSON`,
196
+ );
197
+ }
198
+
199
+ /** @internal */
200
+ export const DdosAlerts$inboundSchema: z.ZodType<
201
+ DdosAlerts,
202
+ z.ZodTypeDef,
203
+ unknown
204
+ > = z.object({
205
+ atMinute: z.string(),
206
+ totalReqs: z.number(),
207
+ });
208
+
209
+ /** @internal */
210
+ export type DdosAlerts$Outbound = {
211
+ atMinute: string;
212
+ totalReqs: number;
213
+ };
214
+
215
+ /** @internal */
216
+ export const DdosAlerts$outboundSchema: z.ZodType<
217
+ DdosAlerts$Outbound,
218
+ z.ZodTypeDef,
219
+ DdosAlerts
220
+ > = z.object({
221
+ atMinute: z.string(),
222
+ totalReqs: z.number(),
223
+ });
224
+
225
+ /**
226
+ * @internal
227
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
228
+ */
229
+ export namespace DdosAlerts$ {
230
+ /** @deprecated use `DdosAlerts$inboundSchema` instead. */
231
+ export const inboundSchema = DdosAlerts$inboundSchema;
232
+ /** @deprecated use `DdosAlerts$outboundSchema` instead. */
233
+ export const outboundSchema = DdosAlerts$outboundSchema;
234
+ /** @deprecated use `DdosAlerts$Outbound` instead. */
235
+ export type Outbound = DdosAlerts$Outbound;
236
+ }
237
+
238
+ export function ddosAlertsToJSON(ddosAlerts: DdosAlerts): string {
239
+ return JSON.stringify(DdosAlerts$outboundSchema.parse(ddosAlerts));
240
+ }
241
+
242
+ export function ddosAlertsFromJSON(
243
+ jsonString: string,
244
+ ): SafeParseResult<DdosAlerts, SDKValidationError> {
245
+ return safeParse(
246
+ jsonString,
247
+ (x) => DdosAlerts$inboundSchema.parse(JSON.parse(x)),
248
+ `Failed to parse 'DdosAlerts' from JSON`,
249
+ );
250
+ }
251
+
252
+ /** @internal */
253
+ export const AffectedHostMap$inboundSchema: z.ZodType<
254
+ AffectedHostMap,
255
+ z.ZodTypeDef,
256
+ unknown
257
+ > = z.object({
258
+ anomalyAlerts: z.record(z.lazy(() => AnomalyAlerts$inboundSchema)).optional(),
259
+ ddosAlerts: z.record(z.lazy(() => DdosAlerts$inboundSchema)).optional(),
260
+ });
261
+
262
+ /** @internal */
263
+ export type AffectedHostMap$Outbound = {
264
+ anomalyAlerts?: { [k: string]: AnomalyAlerts$Outbound } | undefined;
265
+ ddosAlerts?: { [k: string]: DdosAlerts$Outbound } | undefined;
266
+ };
267
+
268
+ /** @internal */
269
+ export const AffectedHostMap$outboundSchema: z.ZodType<
270
+ AffectedHostMap$Outbound,
271
+ z.ZodTypeDef,
272
+ AffectedHostMap
273
+ > = z.object({
274
+ anomalyAlerts: z.record(z.lazy(() => AnomalyAlerts$outboundSchema))
275
+ .optional(),
276
+ ddosAlerts: z.record(z.lazy(() => DdosAlerts$outboundSchema)).optional(),
277
+ });
278
+
279
+ /**
280
+ * @internal
281
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
282
+ */
283
+ export namespace AffectedHostMap$ {
284
+ /** @deprecated use `AffectedHostMap$inboundSchema` instead. */
285
+ export const inboundSchema = AffectedHostMap$inboundSchema;
286
+ /** @deprecated use `AffectedHostMap$outboundSchema` instead. */
287
+ export const outboundSchema = AffectedHostMap$outboundSchema;
288
+ /** @deprecated use `AffectedHostMap$Outbound` instead. */
289
+ export type Outbound = AffectedHostMap$Outbound;
290
+ }
291
+
292
+ export function affectedHostMapToJSON(
293
+ affectedHostMap: AffectedHostMap,
294
+ ): string {
295
+ return JSON.stringify(AffectedHostMap$outboundSchema.parse(affectedHostMap));
296
+ }
297
+
298
+ export function affectedHostMapFromJSON(
299
+ jsonString: string,
300
+ ): SafeParseResult<AffectedHostMap, SDKValidationError> {
301
+ return safeParse(
302
+ jsonString,
303
+ (x) => AffectedHostMap$inboundSchema.parse(JSON.parse(x)),
304
+ `Failed to parse 'AffectedHostMap' from JSON`,
305
+ );
306
+ }
307
+
308
+ /** @internal */
309
+ export const Anomalies$inboundSchema: z.ZodType<
310
+ Anomalies,
311
+ z.ZodTypeDef,
312
+ unknown
313
+ > = z.object({
314
+ ownerId: z.string(),
315
+ projectId: z.string(),
316
+ startTime: z.number(),
317
+ endTime: z.nullable(z.number()),
318
+ atMinute: z.number(),
319
+ state: z.string().optional(),
320
+ affectedHostMap: z.record(z.lazy(() => AffectedHostMap$inboundSchema)),
321
+ });
322
+
323
+ /** @internal */
324
+ export type Anomalies$Outbound = {
325
+ ownerId: string;
326
+ projectId: string;
327
+ startTime: number;
328
+ endTime: number | null;
329
+ atMinute: number;
330
+ state?: string | undefined;
331
+ affectedHostMap: { [k: string]: AffectedHostMap$Outbound };
332
+ };
333
+
334
+ /** @internal */
335
+ export const Anomalies$outboundSchema: z.ZodType<
336
+ Anomalies$Outbound,
337
+ z.ZodTypeDef,
338
+ Anomalies
339
+ > = z.object({
340
+ ownerId: z.string(),
341
+ projectId: z.string(),
342
+ startTime: z.number(),
343
+ endTime: z.nullable(z.number()),
344
+ atMinute: z.number(),
345
+ state: z.string().optional(),
346
+ affectedHostMap: z.record(z.lazy(() => AffectedHostMap$outboundSchema)),
347
+ });
348
+
349
+ /**
350
+ * @internal
351
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
352
+ */
353
+ export namespace Anomalies$ {
354
+ /** @deprecated use `Anomalies$inboundSchema` instead. */
355
+ export const inboundSchema = Anomalies$inboundSchema;
356
+ /** @deprecated use `Anomalies$outboundSchema` instead. */
357
+ export const outboundSchema = Anomalies$outboundSchema;
358
+ /** @deprecated use `Anomalies$Outbound` instead. */
359
+ export type Outbound = Anomalies$Outbound;
360
+ }
361
+
362
+ export function anomaliesToJSON(anomalies: Anomalies): string {
363
+ return JSON.stringify(Anomalies$outboundSchema.parse(anomalies));
364
+ }
365
+
366
+ export function anomaliesFromJSON(
367
+ jsonString: string,
368
+ ): SafeParseResult<Anomalies, SDKValidationError> {
369
+ return safeParse(
370
+ jsonString,
371
+ (x) => Anomalies$inboundSchema.parse(JSON.parse(x)),
372
+ `Failed to parse 'Anomalies' from JSON`,
373
+ );
374
+ }
375
+
376
+ /** @internal */
377
+ export const GetActiveAttackStatusResponseBody2$inboundSchema: z.ZodType<
378
+ GetActiveAttackStatusResponseBody2,
379
+ z.ZodTypeDef,
380
+ unknown
381
+ > = z.object({
382
+ anomalies: z.array(z.lazy(() => Anomalies$inboundSchema)),
383
+ });
384
+
385
+ /** @internal */
386
+ export type GetActiveAttackStatusResponseBody2$Outbound = {
387
+ anomalies: Array<Anomalies$Outbound>;
388
+ };
389
+
390
+ /** @internal */
391
+ export const GetActiveAttackStatusResponseBody2$outboundSchema: z.ZodType<
392
+ GetActiveAttackStatusResponseBody2$Outbound,
393
+ z.ZodTypeDef,
394
+ GetActiveAttackStatusResponseBody2
395
+ > = z.object({
396
+ anomalies: z.array(z.lazy(() => Anomalies$outboundSchema)),
397
+ });
398
+
399
+ /**
400
+ * @internal
401
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
402
+ */
403
+ export namespace GetActiveAttackStatusResponseBody2$ {
404
+ /** @deprecated use `GetActiveAttackStatusResponseBody2$inboundSchema` instead. */
405
+ export const inboundSchema = GetActiveAttackStatusResponseBody2$inboundSchema;
406
+ /** @deprecated use `GetActiveAttackStatusResponseBody2$outboundSchema` instead. */
407
+ export const outboundSchema =
408
+ GetActiveAttackStatusResponseBody2$outboundSchema;
409
+ /** @deprecated use `GetActiveAttackStatusResponseBody2$Outbound` instead. */
410
+ export type Outbound = GetActiveAttackStatusResponseBody2$Outbound;
411
+ }
412
+
413
+ export function getActiveAttackStatusResponseBody2ToJSON(
414
+ getActiveAttackStatusResponseBody2: GetActiveAttackStatusResponseBody2,
415
+ ): string {
416
+ return JSON.stringify(
417
+ GetActiveAttackStatusResponseBody2$outboundSchema.parse(
418
+ getActiveAttackStatusResponseBody2,
419
+ ),
420
+ );
421
+ }
422
+
423
+ export function getActiveAttackStatusResponseBody2FromJSON(
424
+ jsonString: string,
425
+ ): SafeParseResult<GetActiveAttackStatusResponseBody2, SDKValidationError> {
426
+ return safeParse(
427
+ jsonString,
428
+ (x) =>
429
+ GetActiveAttackStatusResponseBody2$inboundSchema.parse(JSON.parse(x)),
430
+ `Failed to parse 'GetActiveAttackStatusResponseBody2' from JSON`,
431
+ );
432
+ }
433
+
434
+ /** @internal */
435
+ export const GetActiveAttackStatusResponseBody1$inboundSchema: z.ZodType<
436
+ GetActiveAttackStatusResponseBody1,
437
+ z.ZodTypeDef,
438
+ unknown
439
+ > = z.object({});
440
+
441
+ /** @internal */
442
+ export type GetActiveAttackStatusResponseBody1$Outbound = {};
443
+
444
+ /** @internal */
445
+ export const GetActiveAttackStatusResponseBody1$outboundSchema: z.ZodType<
446
+ GetActiveAttackStatusResponseBody1$Outbound,
447
+ z.ZodTypeDef,
448
+ GetActiveAttackStatusResponseBody1
449
+ > = z.object({});
450
+
451
+ /**
452
+ * @internal
453
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
454
+ */
455
+ export namespace GetActiveAttackStatusResponseBody1$ {
456
+ /** @deprecated use `GetActiveAttackStatusResponseBody1$inboundSchema` instead. */
457
+ export const inboundSchema = GetActiveAttackStatusResponseBody1$inboundSchema;
458
+ /** @deprecated use `GetActiveAttackStatusResponseBody1$outboundSchema` instead. */
459
+ export const outboundSchema =
460
+ GetActiveAttackStatusResponseBody1$outboundSchema;
461
+ /** @deprecated use `GetActiveAttackStatusResponseBody1$Outbound` instead. */
462
+ export type Outbound = GetActiveAttackStatusResponseBody1$Outbound;
463
+ }
464
+
465
+ export function getActiveAttackStatusResponseBody1ToJSON(
466
+ getActiveAttackStatusResponseBody1: GetActiveAttackStatusResponseBody1,
467
+ ): string {
468
+ return JSON.stringify(
469
+ GetActiveAttackStatusResponseBody1$outboundSchema.parse(
470
+ getActiveAttackStatusResponseBody1,
471
+ ),
472
+ );
473
+ }
474
+
475
+ export function getActiveAttackStatusResponseBody1FromJSON(
476
+ jsonString: string,
477
+ ): SafeParseResult<GetActiveAttackStatusResponseBody1, SDKValidationError> {
478
+ return safeParse(
479
+ jsonString,
480
+ (x) =>
481
+ GetActiveAttackStatusResponseBody1$inboundSchema.parse(JSON.parse(x)),
482
+ `Failed to parse 'GetActiveAttackStatusResponseBody1' from JSON`,
483
+ );
484
+ }
485
+
486
+ /** @internal */
487
+ export const GetActiveAttackStatusResponseBody$inboundSchema: z.ZodType<
488
+ GetActiveAttackStatusResponseBody,
489
+ z.ZodTypeDef,
490
+ unknown
491
+ > = z.union([
492
+ z.lazy(() => GetActiveAttackStatusResponseBody1$inboundSchema),
493
+ z.lazy(() => GetActiveAttackStatusResponseBody2$inboundSchema),
494
+ ]);
495
+
496
+ /** @internal */
497
+ export type GetActiveAttackStatusResponseBody$Outbound =
498
+ | GetActiveAttackStatusResponseBody1$Outbound
499
+ | GetActiveAttackStatusResponseBody2$Outbound;
500
+
501
+ /** @internal */
502
+ export const GetActiveAttackStatusResponseBody$outboundSchema: z.ZodType<
503
+ GetActiveAttackStatusResponseBody$Outbound,
504
+ z.ZodTypeDef,
505
+ GetActiveAttackStatusResponseBody
506
+ > = z.union([
507
+ z.lazy(() => GetActiveAttackStatusResponseBody1$outboundSchema),
508
+ z.lazy(() => GetActiveAttackStatusResponseBody2$outboundSchema),
509
+ ]);
510
+
511
+ /**
512
+ * @internal
513
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
514
+ */
515
+ export namespace GetActiveAttackStatusResponseBody$ {
516
+ /** @deprecated use `GetActiveAttackStatusResponseBody$inboundSchema` instead. */
517
+ export const inboundSchema = GetActiveAttackStatusResponseBody$inboundSchema;
518
+ /** @deprecated use `GetActiveAttackStatusResponseBody$outboundSchema` instead. */
519
+ export const outboundSchema =
520
+ GetActiveAttackStatusResponseBody$outboundSchema;
521
+ /** @deprecated use `GetActiveAttackStatusResponseBody$Outbound` instead. */
522
+ export type Outbound = GetActiveAttackStatusResponseBody$Outbound;
523
+ }
524
+
525
+ export function getActiveAttackStatusResponseBodyToJSON(
526
+ getActiveAttackStatusResponseBody: GetActiveAttackStatusResponseBody,
527
+ ): string {
528
+ return JSON.stringify(
529
+ GetActiveAttackStatusResponseBody$outboundSchema.parse(
530
+ getActiveAttackStatusResponseBody,
531
+ ),
532
+ );
533
+ }
534
+
535
+ export function getActiveAttackStatusResponseBodyFromJSON(
536
+ jsonString: string,
537
+ ): SafeParseResult<GetActiveAttackStatusResponseBody, SDKValidationError> {
538
+ return safeParse(
539
+ jsonString,
540
+ (x) => GetActiveAttackStatusResponseBody$inboundSchema.parse(JSON.parse(x)),
541
+ `Failed to parse 'GetActiveAttackStatusResponseBody' from JSON`,
542
+ );
543
+ }