retell-sdk 2.2.3 → 2.2.4

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 (143) hide show
  1. package/example.js +34 -2
  2. package/example.js.map +1 -1
  3. package/lib/config.d.ts.map +1 -1
  4. package/lib/config.js.map +1 -1
  5. package/lib/sdks.d.ts.map +1 -1
  6. package/lib/sdks.js.map +1 -1
  7. package/lib/security.d.ts.map +1 -1
  8. package/lib/security.js +5 -1
  9. package/lib/security.js.map +1 -1
  10. package/models/components/agent.d.ts +3 -3
  11. package/models/components/agent.d.ts.map +1 -1
  12. package/models/components/agent.js +60 -26
  13. package/models/components/agent.js.map +1 -1
  14. package/models/components/agentpromptparams.d.ts.map +1 -1
  15. package/models/components/agentpromptparams.js.map +1 -1
  16. package/models/components/calldetail.d.ts.map +1 -1
  17. package/models/components/calldetail.js +18 -6
  18. package/models/components/calldetail.js.map +1 -1
  19. package/models/components/callphonenumber.d.ts.map +1 -1
  20. package/models/components/callphonenumber.js.map +1 -1
  21. package/models/components/phonenumber.d.ts.map +1 -1
  22. package/models/components/phonenumber.js.map +1 -1
  23. package/models/components/security.d.ts.map +1 -1
  24. package/models/errors/createagent.d.ts.map +1 -1
  25. package/models/errors/createagent.js +36 -12
  26. package/models/errors/createagent.js.map +1 -1
  27. package/models/errors/createphonecall.d.ts.map +1 -1
  28. package/models/errors/createphonecall.js +54 -18
  29. package/models/errors/createphonecall.js.map +1 -1
  30. package/models/errors/createphonenumber.d.ts.map +1 -1
  31. package/models/errors/createphonenumber.js +42 -14
  32. package/models/errors/createphonenumber.js.map +1 -1
  33. package/models/errors/deleteagent.d.ts.map +1 -1
  34. package/models/errors/deleteagent.js +36 -12
  35. package/models/errors/deleteagent.js.map +1 -1
  36. package/models/errors/deletephonenumber.d.ts.map +1 -1
  37. package/models/errors/deletephonenumber.js +33 -11
  38. package/models/errors/deletephonenumber.js.map +1 -1
  39. package/models/errors/getagent.d.ts.map +1 -1
  40. package/models/errors/getagent.js +36 -12
  41. package/models/errors/getagent.js.map +1 -1
  42. package/models/errors/getcall.d.ts.map +1 -1
  43. package/models/errors/getcall.js +30 -10
  44. package/models/errors/getcall.js.map +1 -1
  45. package/models/errors/getphonenumber.d.ts.map +1 -1
  46. package/models/errors/getphonenumber.js +36 -12
  47. package/models/errors/getphonenumber.js.map +1 -1
  48. package/models/errors/listagents.d.ts.map +1 -1
  49. package/models/errors/listagents.js +15 -5
  50. package/models/errors/listagents.js.map +1 -1
  51. package/models/errors/listcalls.d.ts.map +1 -1
  52. package/models/errors/listcalls.js +24 -8
  53. package/models/errors/listcalls.js.map +1 -1
  54. package/models/errors/listphonenumbers.d.ts.map +1 -1
  55. package/models/errors/listphonenumbers.js +27 -9
  56. package/models/errors/listphonenumbers.js.map +1 -1
  57. package/models/errors/updateagent.d.ts.map +1 -1
  58. package/models/errors/updateagent.js +36 -12
  59. package/models/errors/updateagent.js.map +1 -1
  60. package/models/errors/updatephoneagent.d.ts.map +1 -1
  61. package/models/errors/updatephoneagent.js +36 -12
  62. package/models/errors/updatephoneagent.js.map +1 -1
  63. package/models/operations/createagent.d.ts.map +1 -1
  64. package/models/operations/createagent.js +16 -6
  65. package/models/operations/createagent.js.map +1 -1
  66. package/models/operations/createphonecall.d.ts.map +1 -1
  67. package/models/operations/createphonecall.js +18 -6
  68. package/models/operations/createphonecall.js.map +1 -1
  69. package/models/operations/createphonenumber.d.ts.map +1 -1
  70. package/models/operations/createphonenumber.js +6 -2
  71. package/models/operations/createphonenumber.js.map +1 -1
  72. package/models/operations/createwebcall.d.ts.map +1 -1
  73. package/models/operations/deleteagent.d.ts.map +1 -1
  74. package/models/operations/deleteagent.js.map +1 -1
  75. package/models/operations/deletephonenumber.d.ts.map +1 -1
  76. package/models/operations/deletephonenumber.js.map +1 -1
  77. package/models/operations/getagent.d.ts.map +1 -1
  78. package/models/operations/getagent.js.map +1 -1
  79. package/models/operations/getcall.d.ts.map +1 -1
  80. package/models/operations/getcall.js.map +1 -1
  81. package/models/operations/getphonenumber.d.ts.map +1 -1
  82. package/models/operations/getphonenumber.js +6 -2
  83. package/models/operations/getphonenumber.js.map +1 -1
  84. package/models/operations/listagents.d.ts.map +1 -1
  85. package/models/operations/listagents.js.map +1 -1
  86. package/models/operations/listcalls.d.ts.map +1 -1
  87. package/models/operations/listcalls.js +6 -2
  88. package/models/operations/listcalls.js.map +1 -1
  89. package/models/operations/listphonenumbers.d.ts.map +1 -1
  90. package/models/operations/listphonenumbers.js +6 -2
  91. package/models/operations/listphonenumbers.js.map +1 -1
  92. package/models/operations/updateagent.d.ts.map +1 -1
  93. package/models/operations/updateagent.js +18 -4
  94. package/models/operations/updateagent.js.map +1 -1
  95. package/models/operations/updatephoneagent.d.ts.map +1 -1
  96. package/models/operations/updatephoneagent.js +6 -2
  97. package/models/operations/updatephoneagent.js.map +1 -1
  98. package/package.json +1 -1
  99. package/sdk/liveClient.d.ts.map +1 -1
  100. package/sdk/liveClient.js +7 -2
  101. package/sdk/liveClient.js.map +1 -1
  102. package/sdk/sdk.d.ts.map +1 -1
  103. package/sdk/sdk.js +22 -5
  104. package/sdk/sdk.js.map +1 -1
  105. package/src/example.ts +121 -87
  106. package/src/lib/config.ts +32 -32
  107. package/src/lib/sdks.ts +91 -82
  108. package/src/lib/security.ts +133 -118
  109. package/src/models/components/agent.ts +459 -387
  110. package/src/models/components/agentpromptparams.ts +46 -38
  111. package/src/models/components/calldetail.ts +137 -125
  112. package/src/models/components/callphonenumber.ts +46 -38
  113. package/src/models/components/phonenumber.ts +69 -68
  114. package/src/models/components/security.ts +1 -1
  115. package/src/models/errors/createagent.ts +359 -311
  116. package/src/models/errors/createphonecall.ts +537 -472
  117. package/src/models/errors/createphonenumber.ts +447 -395
  118. package/src/models/errors/deleteagent.ts +359 -311
  119. package/src/models/errors/deletephonenumber.ts +357 -315
  120. package/src/models/errors/getagent.ts +358 -302
  121. package/src/models/errors/getcall.ts +348 -294
  122. package/src/models/errors/getphonenumber.ts +357 -312
  123. package/src/models/errors/listagents.ts +174 -147
  124. package/src/models/errors/listcalls.ts +251 -211
  125. package/src/models/errors/listphonenumbers.ts +252 -217
  126. package/src/models/errors/updateagent.ts +359 -311
  127. package/src/models/errors/updatephoneagent.ts +357 -312
  128. package/src/models/operations/createagent.ts +165 -129
  129. package/src/models/operations/createphonecall.ts +283 -238
  130. package/src/models/operations/createphonenumber.ts +118 -98
  131. package/src/models/operations/createwebcall.ts +13 -13
  132. package/src/models/operations/deleteagent.ts +94 -78
  133. package/src/models/operations/deletephonenumber.ts +94 -78
  134. package/src/models/operations/getagent.ts +104 -88
  135. package/src/models/operations/getcall.ts +101 -88
  136. package/src/models/operations/getphonenumber.ts +108 -88
  137. package/src/models/operations/listagents.ts +68 -60
  138. package/src/models/operations/listcalls.ts +238 -213
  139. package/src/models/operations/listphonenumbers.ts +72 -60
  140. package/src/models/operations/updateagent.ts +226 -173
  141. package/src/models/operations/updatephoneagent.ts +160 -132
  142. package/src/sdk/liveClient.ts +11 -7
  143. package/src/sdk/sdk.ts +1313 -1160
@@ -8,387 +8,435 @@ import { z } from "zod";
8
8
  * Internal Server Error
9
9
  */
10
10
  export type CreateAgentResponse500ResponseBodyData = {
11
- /**
12
- * Raw HTTP response; suitable for custom response parsing
13
- */
14
- rawResponse?: Response | undefined;
15
- errorMessage?: string | undefined;
11
+ /**
12
+ * Raw HTTP response; suitable for custom response parsing
13
+ */
14
+ rawResponse?: Response | undefined;
15
+ errorMessage?: string | undefined;
16
16
  };
17
17
 
18
18
  /**
19
19
  * Internal Server Error
20
20
  */
21
21
  export class CreateAgentResponse500ResponseBody extends Error {
22
- /**
23
- * Raw HTTP response; suitable for custom response parsing
24
- */
25
- rawResponse?: Response | undefined;
26
- errorMessage?: string | undefined;
27
-
28
- /** The original data that was passed to this error instance. */
29
- data$: CreateAgentResponse500ResponseBodyData;
30
-
31
- constructor(err: CreateAgentResponse500ResponseBodyData, options?: ErrorOptions) {
32
- super("", options);
33
- this.data$ = err;
34
-
35
- if (err.rawResponse != null) {
36
- this.rawResponse = err.rawResponse;
37
- }
38
- if (err.errorMessage != null) {
39
- this.errorMessage = err.errorMessage;
40
- }
41
-
42
- const msg = "message" in err && typeof err.message === "string" ? err.message : "";
43
- const { rawResponse, ...data } = err;
44
- const content = JSON.stringify(data);
45
- this.message = [msg, content].filter(Boolean).join("\n");
46
-
47
- this.name = "CreateAgentResponse500ResponseBody";
22
+ /**
23
+ * Raw HTTP response; suitable for custom response parsing
24
+ */
25
+ rawResponse?: Response | undefined;
26
+ errorMessage?: string | undefined;
27
+
28
+ /** The original data that was passed to this error instance. */
29
+ data$: CreateAgentResponse500ResponseBodyData;
30
+
31
+ constructor(
32
+ err: CreateAgentResponse500ResponseBodyData,
33
+ options?: ErrorOptions,
34
+ ) {
35
+ super("", options);
36
+ this.data$ = err;
37
+
38
+ if (err.rawResponse != null) {
39
+ this.rawResponse = err.rawResponse;
48
40
  }
41
+ if (err.errorMessage != null) {
42
+ this.errorMessage = err.errorMessage;
43
+ }
44
+
45
+ const msg =
46
+ "message" in err && typeof err.message === "string" ? err.message : "";
47
+ const { rawResponse, ...data } = err;
48
+ const content = JSON.stringify(data);
49
+ this.message = [msg, content].filter(Boolean).join("\n");
50
+
51
+ this.name = "CreateAgentResponse500ResponseBody";
52
+ }
49
53
  }
50
54
 
51
55
  /**
52
56
  * Unprocessable Content
53
57
  */
54
58
  export type CreateAgentResponse422ResponseBodyData = {
55
- /**
56
- * Raw HTTP response; suitable for custom response parsing
57
- */
58
- rawResponse?: Response | undefined;
59
- errorMessage?: string | undefined;
59
+ /**
60
+ * Raw HTTP response; suitable for custom response parsing
61
+ */
62
+ rawResponse?: Response | undefined;
63
+ errorMessage?: string | undefined;
60
64
  };
61
65
 
62
66
  /**
63
67
  * Unprocessable Content
64
68
  */
65
69
  export class CreateAgentResponse422ResponseBody extends Error {
66
- /**
67
- * Raw HTTP response; suitable for custom response parsing
68
- */
69
- rawResponse?: Response | undefined;
70
- errorMessage?: string | undefined;
71
-
72
- /** The original data that was passed to this error instance. */
73
- data$: CreateAgentResponse422ResponseBodyData;
74
-
75
- constructor(err: CreateAgentResponse422ResponseBodyData, options?: ErrorOptions) {
76
- super("", options);
77
- this.data$ = err;
78
-
79
- if (err.rawResponse != null) {
80
- this.rawResponse = err.rawResponse;
81
- }
82
- if (err.errorMessage != null) {
83
- this.errorMessage = err.errorMessage;
84
- }
85
-
86
- const msg = "message" in err && typeof err.message === "string" ? err.message : "";
87
- const { rawResponse, ...data } = err;
88
- const content = JSON.stringify(data);
89
- this.message = [msg, content].filter(Boolean).join("\n");
90
-
91
- this.name = "CreateAgentResponse422ResponseBody";
70
+ /**
71
+ * Raw HTTP response; suitable for custom response parsing
72
+ */
73
+ rawResponse?: Response | undefined;
74
+ errorMessage?: string | undefined;
75
+
76
+ /** The original data that was passed to this error instance. */
77
+ data$: CreateAgentResponse422ResponseBodyData;
78
+
79
+ constructor(
80
+ err: CreateAgentResponse422ResponseBodyData,
81
+ options?: ErrorOptions,
82
+ ) {
83
+ super("", options);
84
+ this.data$ = err;
85
+
86
+ if (err.rawResponse != null) {
87
+ this.rawResponse = err.rawResponse;
92
88
  }
89
+ if (err.errorMessage != null) {
90
+ this.errorMessage = err.errorMessage;
91
+ }
92
+
93
+ const msg =
94
+ "message" in err && typeof err.message === "string" ? err.message : "";
95
+ const { rawResponse, ...data } = err;
96
+ const content = JSON.stringify(data);
97
+ this.message = [msg, content].filter(Boolean).join("\n");
98
+
99
+ this.name = "CreateAgentResponse422ResponseBody";
100
+ }
93
101
  }
94
102
 
95
103
  /**
96
104
  * Unauthorized
97
105
  */
98
106
  export type CreateAgentResponseResponseBodyData = {
99
- /**
100
- * Raw HTTP response; suitable for custom response parsing
101
- */
102
- rawResponse?: Response | undefined;
103
- errorMessage?: string | undefined;
107
+ /**
108
+ * Raw HTTP response; suitable for custom response parsing
109
+ */
110
+ rawResponse?: Response | undefined;
111
+ errorMessage?: string | undefined;
104
112
  };
105
113
 
106
114
  /**
107
115
  * Unauthorized
108
116
  */
109
117
  export class CreateAgentResponseResponseBody extends Error {
110
- /**
111
- * Raw HTTP response; suitable for custom response parsing
112
- */
113
- rawResponse?: Response | undefined;
114
- errorMessage?: string | undefined;
115
-
116
- /** The original data that was passed to this error instance. */
117
- data$: CreateAgentResponseResponseBodyData;
118
-
119
- constructor(err: CreateAgentResponseResponseBodyData, options?: ErrorOptions) {
120
- super("", options);
121
- this.data$ = err;
122
-
123
- if (err.rawResponse != null) {
124
- this.rawResponse = err.rawResponse;
125
- }
126
- if (err.errorMessage != null) {
127
- this.errorMessage = err.errorMessage;
128
- }
129
-
130
- const msg = "message" in err && typeof err.message === "string" ? err.message : "";
131
- const { rawResponse, ...data } = err;
132
- const content = JSON.stringify(data);
133
- this.message = [msg, content].filter(Boolean).join("\n");
134
-
135
- this.name = "CreateAgentResponseResponseBody";
118
+ /**
119
+ * Raw HTTP response; suitable for custom response parsing
120
+ */
121
+ rawResponse?: Response | undefined;
122
+ errorMessage?: string | undefined;
123
+
124
+ /** The original data that was passed to this error instance. */
125
+ data$: CreateAgentResponseResponseBodyData;
126
+
127
+ constructor(
128
+ err: CreateAgentResponseResponseBodyData,
129
+ options?: ErrorOptions,
130
+ ) {
131
+ super("", options);
132
+ this.data$ = err;
133
+
134
+ if (err.rawResponse != null) {
135
+ this.rawResponse = err.rawResponse;
136
136
  }
137
+ if (err.errorMessage != null) {
138
+ this.errorMessage = err.errorMessage;
139
+ }
140
+
141
+ const msg =
142
+ "message" in err && typeof err.message === "string" ? err.message : "";
143
+ const { rawResponse, ...data } = err;
144
+ const content = JSON.stringify(data);
145
+ this.message = [msg, content].filter(Boolean).join("\n");
146
+
147
+ this.name = "CreateAgentResponseResponseBody";
148
+ }
137
149
  }
138
150
 
139
151
  /**
140
152
  * Bad Request
141
153
  */
142
154
  export type CreateAgentResponseBodyData = {
143
- /**
144
- * Raw HTTP response; suitable for custom response parsing
145
- */
146
- rawResponse?: Response | undefined;
147
- errorMessage?: string | undefined;
155
+ /**
156
+ * Raw HTTP response; suitable for custom response parsing
157
+ */
158
+ rawResponse?: Response | undefined;
159
+ errorMessage?: string | undefined;
148
160
  };
149
161
 
150
162
  /**
151
163
  * Bad Request
152
164
  */
153
165
  export class CreateAgentResponseBody extends Error {
154
- /**
155
- * Raw HTTP response; suitable for custom response parsing
156
- */
157
- rawResponse?: Response | undefined;
158
- errorMessage?: string | undefined;
159
-
160
- /** The original data that was passed to this error instance. */
161
- data$: CreateAgentResponseBodyData;
162
-
163
- constructor(err: CreateAgentResponseBodyData, options?: ErrorOptions) {
164
- super("", options);
165
- this.data$ = err;
166
-
167
- if (err.rawResponse != null) {
168
- this.rawResponse = err.rawResponse;
169
- }
170
- if (err.errorMessage != null) {
171
- this.errorMessage = err.errorMessage;
172
- }
173
-
174
- const msg = "message" in err && typeof err.message === "string" ? err.message : "";
175
- const { rawResponse, ...data } = err;
176
- const content = JSON.stringify(data);
177
- this.message = [msg, content].filter(Boolean).join("\n");
178
-
179
- this.name = "CreateAgentResponseBody";
166
+ /**
167
+ * Raw HTTP response; suitable for custom response parsing
168
+ */
169
+ rawResponse?: Response | undefined;
170
+ errorMessage?: string | undefined;
171
+
172
+ /** The original data that was passed to this error instance. */
173
+ data$: CreateAgentResponseBodyData;
174
+
175
+ constructor(err: CreateAgentResponseBodyData, options?: ErrorOptions) {
176
+ super("", options);
177
+ this.data$ = err;
178
+
179
+ if (err.rawResponse != null) {
180
+ this.rawResponse = err.rawResponse;
181
+ }
182
+ if (err.errorMessage != null) {
183
+ this.errorMessage = err.errorMessage;
180
184
  }
185
+
186
+ const msg =
187
+ "message" in err && typeof err.message === "string" ? err.message : "";
188
+ const { rawResponse, ...data } = err;
189
+ const content = JSON.stringify(data);
190
+ this.message = [msg, content].filter(Boolean).join("\n");
191
+
192
+ this.name = "CreateAgentResponseBody";
193
+ }
181
194
  }
182
195
 
183
196
  /** @internal */
184
197
  export namespace CreateAgentResponse500ResponseBody$ {
185
- export type Inbound = {
186
- RawResponse?: Response | undefined;
187
- error_message?: string | undefined;
188
- };
189
-
190
- export const inboundSchema: z.ZodType<
191
- CreateAgentResponse500ResponseBody,
192
- z.ZodTypeDef,
193
- Inbound
194
- > = z
198
+ export type Inbound = {
199
+ RawResponse?: Response | undefined;
200
+ error_message?: string | undefined;
201
+ };
202
+
203
+ export const inboundSchema: z.ZodType<
204
+ CreateAgentResponse500ResponseBody,
205
+ z.ZodTypeDef,
206
+ Inbound
207
+ > = z
208
+ .object({
209
+ RawResponse: z.instanceof(Response).optional(),
210
+ error_message: z.string().optional(),
211
+ })
212
+ .transform((v) => {
213
+ return new CreateAgentResponse500ResponseBody({
214
+ ...(v.RawResponse === undefined
215
+ ? null
216
+ : { rawResponse: v.RawResponse }),
217
+ ...(v.error_message === undefined
218
+ ? null
219
+ : { errorMessage: v.error_message }),
220
+ });
221
+ });
222
+ export type Outbound = {
223
+ RawResponse?: never | undefined;
224
+ error_message?: string | undefined;
225
+ };
226
+
227
+ export const outboundSchema: z.ZodType<
228
+ Outbound,
229
+ z.ZodTypeDef,
230
+ CreateAgentResponse500ResponseBody
231
+ > = z
232
+ .instanceof(CreateAgentResponse500ResponseBody)
233
+ .transform((v) => v.data$)
234
+ .pipe(
235
+ z
195
236
  .object({
196
- RawResponse: z.instanceof(Response).optional(),
197
- error_message: z.string().optional(),
237
+ rawResponse: z
238
+ .instanceof(Response)
239
+ .transform(() => {
240
+ throw new Error("Response cannot be serialized");
241
+ })
242
+ .optional(),
243
+ errorMessage: z.string().optional(),
198
244
  })
199
245
  .transform((v) => {
200
- return new CreateAgentResponse500ResponseBody({
201
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
202
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
203
- });
204
- });
205
- export type Outbound = {
206
- RawResponse?: never | undefined;
207
- error_message?: string | undefined;
208
- };
209
-
210
- export const outboundSchema: z.ZodType<
211
- Outbound,
212
- z.ZodTypeDef,
213
- CreateAgentResponse500ResponseBody
214
- > = z
215
- .instanceof(CreateAgentResponse500ResponseBody)
216
- .transform((v) => v.data$)
217
- .pipe(
218
- z
219
- .object({
220
- rawResponse: z
221
- .instanceof(Response)
222
- .transform(() => {
223
- throw new Error("Response cannot be serialized");
224
- })
225
- .optional(),
226
- errorMessage: z.string().optional(),
227
- })
228
- .transform((v) => {
229
- return {
230
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
231
- ...(v.errorMessage === undefined
232
- ? null
233
- : { error_message: v.errorMessage }),
234
- };
235
- })
236
- );
246
+ return {
247
+ ...(v.rawResponse === undefined
248
+ ? null
249
+ : { RawResponse: v.rawResponse }),
250
+ ...(v.errorMessage === undefined
251
+ ? null
252
+ : { error_message: v.errorMessage }),
253
+ };
254
+ }),
255
+ );
237
256
  }
238
257
 
239
258
  /** @internal */
240
259
  export namespace CreateAgentResponse422ResponseBody$ {
241
- export type Inbound = {
242
- RawResponse?: Response | undefined;
243
- error_message?: string | undefined;
244
- };
245
-
246
- export const inboundSchema: z.ZodType<
247
- CreateAgentResponse422ResponseBody,
248
- z.ZodTypeDef,
249
- Inbound
250
- > = z
260
+ export type Inbound = {
261
+ RawResponse?: Response | undefined;
262
+ error_message?: string | undefined;
263
+ };
264
+
265
+ export const inboundSchema: z.ZodType<
266
+ CreateAgentResponse422ResponseBody,
267
+ z.ZodTypeDef,
268
+ Inbound
269
+ > = z
270
+ .object({
271
+ RawResponse: z.instanceof(Response).optional(),
272
+ error_message: z.string().optional(),
273
+ })
274
+ .transform((v) => {
275
+ return new CreateAgentResponse422ResponseBody({
276
+ ...(v.RawResponse === undefined
277
+ ? null
278
+ : { rawResponse: v.RawResponse }),
279
+ ...(v.error_message === undefined
280
+ ? null
281
+ : { errorMessage: v.error_message }),
282
+ });
283
+ });
284
+ export type Outbound = {
285
+ RawResponse?: never | undefined;
286
+ error_message?: string | undefined;
287
+ };
288
+
289
+ export const outboundSchema: z.ZodType<
290
+ Outbound,
291
+ z.ZodTypeDef,
292
+ CreateAgentResponse422ResponseBody
293
+ > = z
294
+ .instanceof(CreateAgentResponse422ResponseBody)
295
+ .transform((v) => v.data$)
296
+ .pipe(
297
+ z
251
298
  .object({
252
- RawResponse: z.instanceof(Response).optional(),
253
- error_message: z.string().optional(),
299
+ rawResponse: z
300
+ .instanceof(Response)
301
+ .transform(() => {
302
+ throw new Error("Response cannot be serialized");
303
+ })
304
+ .optional(),
305
+ errorMessage: z.string().optional(),
254
306
  })
255
307
  .transform((v) => {
256
- return new CreateAgentResponse422ResponseBody({
257
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
258
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
259
- });
260
- });
261
- export type Outbound = {
262
- RawResponse?: never | undefined;
263
- error_message?: string | undefined;
264
- };
265
-
266
- export const outboundSchema: z.ZodType<
267
- Outbound,
268
- z.ZodTypeDef,
269
- CreateAgentResponse422ResponseBody
270
- > = z
271
- .instanceof(CreateAgentResponse422ResponseBody)
272
- .transform((v) => v.data$)
273
- .pipe(
274
- z
275
- .object({
276
- rawResponse: z
277
- .instanceof(Response)
278
- .transform(() => {
279
- throw new Error("Response cannot be serialized");
280
- })
281
- .optional(),
282
- errorMessage: z.string().optional(),
283
- })
284
- .transform((v) => {
285
- return {
286
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
287
- ...(v.errorMessage === undefined
288
- ? null
289
- : { error_message: v.errorMessage }),
290
- };
291
- })
292
- );
308
+ return {
309
+ ...(v.rawResponse === undefined
310
+ ? null
311
+ : { RawResponse: v.rawResponse }),
312
+ ...(v.errorMessage === undefined
313
+ ? null
314
+ : { error_message: v.errorMessage }),
315
+ };
316
+ }),
317
+ );
293
318
  }
294
319
 
295
320
  /** @internal */
296
321
  export namespace CreateAgentResponseResponseBody$ {
297
- export type Inbound = {
298
- RawResponse?: Response | undefined;
299
- error_message?: string | undefined;
300
- };
301
-
302
- export const inboundSchema: z.ZodType<CreateAgentResponseResponseBody, z.ZodTypeDef, Inbound> =
303
- z
304
- .object({
305
- RawResponse: z.instanceof(Response).optional(),
306
- error_message: z.string().optional(),
322
+ export type Inbound = {
323
+ RawResponse?: Response | undefined;
324
+ error_message?: string | undefined;
325
+ };
326
+
327
+ export const inboundSchema: z.ZodType<
328
+ CreateAgentResponseResponseBody,
329
+ z.ZodTypeDef,
330
+ Inbound
331
+ > = z
332
+ .object({
333
+ RawResponse: z.instanceof(Response).optional(),
334
+ error_message: z.string().optional(),
335
+ })
336
+ .transform((v) => {
337
+ return new CreateAgentResponseResponseBody({
338
+ ...(v.RawResponse === undefined
339
+ ? null
340
+ : { rawResponse: v.RawResponse }),
341
+ ...(v.error_message === undefined
342
+ ? null
343
+ : { errorMessage: v.error_message }),
344
+ });
345
+ });
346
+ export type Outbound = {
347
+ RawResponse?: never | undefined;
348
+ error_message?: string | undefined;
349
+ };
350
+
351
+ export const outboundSchema: z.ZodType<
352
+ Outbound,
353
+ z.ZodTypeDef,
354
+ CreateAgentResponseResponseBody
355
+ > = z
356
+ .instanceof(CreateAgentResponseResponseBody)
357
+ .transform((v) => v.data$)
358
+ .pipe(
359
+ z
360
+ .object({
361
+ rawResponse: z
362
+ .instanceof(Response)
363
+ .transform(() => {
364
+ throw new Error("Response cannot be serialized");
307
365
  })
308
- .transform((v) => {
309
- return new CreateAgentResponseResponseBody({
310
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
311
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
312
- });
313
- });
314
- export type Outbound = {
315
- RawResponse?: never | undefined;
316
- error_message?: string | undefined;
317
- };
318
-
319
- export const outboundSchema: z.ZodType<
320
- Outbound,
321
- z.ZodTypeDef,
322
- CreateAgentResponseResponseBody
323
- > = z
324
- .instanceof(CreateAgentResponseResponseBody)
325
- .transform((v) => v.data$)
326
- .pipe(
327
- z
328
- .object({
329
- rawResponse: z
330
- .instanceof(Response)
331
- .transform(() => {
332
- throw new Error("Response cannot be serialized");
333
- })
334
- .optional(),
335
- errorMessage: z.string().optional(),
336
- })
337
- .transform((v) => {
338
- return {
339
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
340
- ...(v.errorMessage === undefined
341
- ? null
342
- : { error_message: v.errorMessage }),
343
- };
344
- })
345
- );
366
+ .optional(),
367
+ errorMessage: z.string().optional(),
368
+ })
369
+ .transform((v) => {
370
+ return {
371
+ ...(v.rawResponse === undefined
372
+ ? null
373
+ : { RawResponse: v.rawResponse }),
374
+ ...(v.errorMessage === undefined
375
+ ? null
376
+ : { error_message: v.errorMessage }),
377
+ };
378
+ }),
379
+ );
346
380
  }
347
381
 
348
382
  /** @internal */
349
383
  export namespace CreateAgentResponseBody$ {
350
- export type Inbound = {
351
- RawResponse?: Response | undefined;
352
- error_message?: string | undefined;
353
- };
354
-
355
- export const inboundSchema: z.ZodType<CreateAgentResponseBody, z.ZodTypeDef, Inbound> = z
384
+ export type Inbound = {
385
+ RawResponse?: Response | undefined;
386
+ error_message?: string | undefined;
387
+ };
388
+
389
+ export const inboundSchema: z.ZodType<
390
+ CreateAgentResponseBody,
391
+ z.ZodTypeDef,
392
+ Inbound
393
+ > = z
394
+ .object({
395
+ RawResponse: z.instanceof(Response).optional(),
396
+ error_message: z.string().optional(),
397
+ })
398
+ .transform((v) => {
399
+ return new CreateAgentResponseBody({
400
+ ...(v.RawResponse === undefined
401
+ ? null
402
+ : { rawResponse: v.RawResponse }),
403
+ ...(v.error_message === undefined
404
+ ? null
405
+ : { errorMessage: v.error_message }),
406
+ });
407
+ });
408
+ export type Outbound = {
409
+ RawResponse?: never | undefined;
410
+ error_message?: string | undefined;
411
+ };
412
+
413
+ export const outboundSchema: z.ZodType<
414
+ Outbound,
415
+ z.ZodTypeDef,
416
+ CreateAgentResponseBody
417
+ > = z
418
+ .instanceof(CreateAgentResponseBody)
419
+ .transform((v) => v.data$)
420
+ .pipe(
421
+ z
356
422
  .object({
357
- RawResponse: z.instanceof(Response).optional(),
358
- error_message: z.string().optional(),
423
+ rawResponse: z
424
+ .instanceof(Response)
425
+ .transform(() => {
426
+ throw new Error("Response cannot be serialized");
427
+ })
428
+ .optional(),
429
+ errorMessage: z.string().optional(),
359
430
  })
360
431
  .transform((v) => {
361
- return new CreateAgentResponseBody({
362
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
363
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
364
- });
365
- });
366
- export type Outbound = {
367
- RawResponse?: never | undefined;
368
- error_message?: string | undefined;
369
- };
370
-
371
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreateAgentResponseBody> = z
372
- .instanceof(CreateAgentResponseBody)
373
- .transform((v) => v.data$)
374
- .pipe(
375
- z
376
- .object({
377
- rawResponse: z
378
- .instanceof(Response)
379
- .transform(() => {
380
- throw new Error("Response cannot be serialized");
381
- })
382
- .optional(),
383
- errorMessage: z.string().optional(),
384
- })
385
- .transform((v) => {
386
- return {
387
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
388
- ...(v.errorMessage === undefined
389
- ? null
390
- : { error_message: v.errorMessage }),
391
- };
392
- })
393
- );
432
+ return {
433
+ ...(v.rawResponse === undefined
434
+ ? null
435
+ : { RawResponse: v.rawResponse }),
436
+ ...(v.errorMessage === undefined
437
+ ? null
438
+ : { error_message: v.errorMessage }),
439
+ };
440
+ }),
441
+ );
394
442
  }