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,376 +8,432 @@ import { z } from "zod";
8
8
  * Internal Server Error
9
9
  */
10
10
  export type GetAgentResponse500ResponseBodyData = {
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 GetAgentResponse500ResponseBody 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$: GetAgentResponse500ResponseBodyData;
30
-
31
- constructor(err: GetAgentResponse500ResponseBodyData, 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 = "GetAgentResponse500ResponseBody";
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$: GetAgentResponse500ResponseBodyData;
30
+
31
+ constructor(
32
+ err: GetAgentResponse500ResponseBodyData,
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 = "GetAgentResponse500ResponseBody";
52
+ }
49
53
  }
50
54
 
51
55
  /**
52
56
  * Unprocessable Content
53
57
  */
54
58
  export type GetAgentResponse422ResponseBodyData = {
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 GetAgentResponse422ResponseBody 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$: GetAgentResponse422ResponseBodyData;
74
-
75
- constructor(err: GetAgentResponse422ResponseBodyData, 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 = "GetAgentResponse422ResponseBody";
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$: GetAgentResponse422ResponseBodyData;
78
+
79
+ constructor(
80
+ err: GetAgentResponse422ResponseBodyData,
81
+ options?: ErrorOptions,
82
+ ) {
83
+ super("", options);
84
+ this.data$ = err;
85
+
86
+ if (err.rawResponse != null) {
87
+ this.rawResponse = err.rawResponse;
88
+ }
89
+ if (err.errorMessage != null) {
90
+ this.errorMessage = err.errorMessage;
92
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 = "GetAgentResponse422ResponseBody";
100
+ }
93
101
  }
94
102
 
95
103
  /**
96
104
  * Unauthorized
97
105
  */
98
106
  export type GetAgentResponseResponseBodyData = {
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 GetAgentResponseResponseBody 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$: GetAgentResponseResponseBodyData;
118
-
119
- constructor(err: GetAgentResponseResponseBodyData, 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 = "GetAgentResponseResponseBody";
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$: GetAgentResponseResponseBodyData;
126
+
127
+ constructor(err: GetAgentResponseResponseBodyData, options?: ErrorOptions) {
128
+ super("", options);
129
+ this.data$ = err;
130
+
131
+ if (err.rawResponse != null) {
132
+ this.rawResponse = err.rawResponse;
136
133
  }
134
+ if (err.errorMessage != null) {
135
+ this.errorMessage = err.errorMessage;
136
+ }
137
+
138
+ const msg =
139
+ "message" in err && typeof err.message === "string" ? err.message : "";
140
+ const { rawResponse, ...data } = err;
141
+ const content = JSON.stringify(data);
142
+ this.message = [msg, content].filter(Boolean).join("\n");
143
+
144
+ this.name = "GetAgentResponseResponseBody";
145
+ }
137
146
  }
138
147
 
139
148
  /**
140
149
  * Bad Request
141
150
  */
142
151
  export type GetAgentResponseBodyData = {
143
- /**
144
- * Raw HTTP response; suitable for custom response parsing
145
- */
146
- rawResponse?: Response | undefined;
147
- errorMessage?: string | undefined;
152
+ /**
153
+ * Raw HTTP response; suitable for custom response parsing
154
+ */
155
+ rawResponse?: Response | undefined;
156
+ errorMessage?: string | undefined;
148
157
  };
149
158
 
150
159
  /**
151
160
  * Bad Request
152
161
  */
153
162
  export class GetAgentResponseBody 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$: GetAgentResponseBodyData;
162
-
163
- constructor(err: GetAgentResponseBodyData, 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 = "GetAgentResponseBody";
163
+ /**
164
+ * Raw HTTP response; suitable for custom response parsing
165
+ */
166
+ rawResponse?: Response | undefined;
167
+ errorMessage?: string | undefined;
168
+
169
+ /** The original data that was passed to this error instance. */
170
+ data$: GetAgentResponseBodyData;
171
+
172
+ constructor(err: GetAgentResponseBodyData, options?: ErrorOptions) {
173
+ super("", options);
174
+ this.data$ = err;
175
+
176
+ if (err.rawResponse != null) {
177
+ this.rawResponse = err.rawResponse;
178
+ }
179
+ if (err.errorMessage != null) {
180
+ this.errorMessage = err.errorMessage;
180
181
  }
182
+
183
+ const msg =
184
+ "message" in err && typeof err.message === "string" ? err.message : "";
185
+ const { rawResponse, ...data } = err;
186
+ const content = JSON.stringify(data);
187
+ this.message = [msg, content].filter(Boolean).join("\n");
188
+
189
+ this.name = "GetAgentResponseBody";
190
+ }
181
191
  }
182
192
 
183
193
  /** @internal */
184
194
  export namespace GetAgentResponse500ResponseBody$ {
185
- export type Inbound = {
186
- RawResponse?: Response | undefined;
187
- error_message?: string | undefined;
188
- };
189
-
190
- export const inboundSchema: z.ZodType<GetAgentResponse500ResponseBody, z.ZodTypeDef, Inbound> =
191
- z
192
- .object({
193
- RawResponse: z.instanceof(Response).optional(),
194
- error_message: z.string().optional(),
195
+ export type Inbound = {
196
+ RawResponse?: Response | undefined;
197
+ error_message?: string | undefined;
198
+ };
199
+
200
+ export const inboundSchema: z.ZodType<
201
+ GetAgentResponse500ResponseBody,
202
+ z.ZodTypeDef,
203
+ Inbound
204
+ > = z
205
+ .object({
206
+ RawResponse: z.instanceof(Response).optional(),
207
+ error_message: z.string().optional(),
208
+ })
209
+ .transform((v) => {
210
+ return new GetAgentResponse500ResponseBody({
211
+ ...(v.RawResponse === undefined
212
+ ? null
213
+ : { rawResponse: v.RawResponse }),
214
+ ...(v.error_message === undefined
215
+ ? null
216
+ : { errorMessage: v.error_message }),
217
+ });
218
+ });
219
+ export type Outbound = {
220
+ RawResponse?: never | undefined;
221
+ error_message?: string | undefined;
222
+ };
223
+
224
+ export const outboundSchema: z.ZodType<
225
+ Outbound,
226
+ z.ZodTypeDef,
227
+ GetAgentResponse500ResponseBody
228
+ > = z
229
+ .instanceof(GetAgentResponse500ResponseBody)
230
+ .transform((v) => v.data$)
231
+ .pipe(
232
+ z
233
+ .object({
234
+ rawResponse: z
235
+ .instanceof(Response)
236
+ .transform(() => {
237
+ throw new Error("Response cannot be serialized");
195
238
  })
196
- .transform((v) => {
197
- return new GetAgentResponse500ResponseBody({
198
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
199
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
200
- });
201
- });
202
- export type Outbound = {
203
- RawResponse?: never | undefined;
204
- error_message?: string | undefined;
205
- };
206
-
207
- export const outboundSchema: z.ZodType<
208
- Outbound,
209
- z.ZodTypeDef,
210
- GetAgentResponse500ResponseBody
211
- > = z
212
- .instanceof(GetAgentResponse500ResponseBody)
213
- .transform((v) => v.data$)
214
- .pipe(
215
- z
216
- .object({
217
- rawResponse: z
218
- .instanceof(Response)
219
- .transform(() => {
220
- throw new Error("Response cannot be serialized");
221
- })
222
- .optional(),
223
- errorMessage: z.string().optional(),
224
- })
225
- .transform((v) => {
226
- return {
227
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
228
- ...(v.errorMessage === undefined
229
- ? null
230
- : { error_message: v.errorMessage }),
231
- };
232
- })
233
- );
239
+ .optional(),
240
+ errorMessage: z.string().optional(),
241
+ })
242
+ .transform((v) => {
243
+ return {
244
+ ...(v.rawResponse === undefined
245
+ ? null
246
+ : { RawResponse: v.rawResponse }),
247
+ ...(v.errorMessage === undefined
248
+ ? null
249
+ : { error_message: v.errorMessage }),
250
+ };
251
+ }),
252
+ );
234
253
  }
235
254
 
236
255
  /** @internal */
237
256
  export namespace GetAgentResponse422ResponseBody$ {
238
- export type Inbound = {
239
- RawResponse?: Response | undefined;
240
- error_message?: string | undefined;
241
- };
242
-
243
- export const inboundSchema: z.ZodType<GetAgentResponse422ResponseBody, z.ZodTypeDef, Inbound> =
244
- z
245
- .object({
246
- RawResponse: z.instanceof(Response).optional(),
247
- error_message: z.string().optional(),
257
+ export type Inbound = {
258
+ RawResponse?: Response | undefined;
259
+ error_message?: string | undefined;
260
+ };
261
+
262
+ export const inboundSchema: z.ZodType<
263
+ GetAgentResponse422ResponseBody,
264
+ z.ZodTypeDef,
265
+ Inbound
266
+ > = z
267
+ .object({
268
+ RawResponse: z.instanceof(Response).optional(),
269
+ error_message: z.string().optional(),
270
+ })
271
+ .transform((v) => {
272
+ return new GetAgentResponse422ResponseBody({
273
+ ...(v.RawResponse === undefined
274
+ ? null
275
+ : { rawResponse: v.RawResponse }),
276
+ ...(v.error_message === undefined
277
+ ? null
278
+ : { errorMessage: v.error_message }),
279
+ });
280
+ });
281
+ export type Outbound = {
282
+ RawResponse?: never | undefined;
283
+ error_message?: string | undefined;
284
+ };
285
+
286
+ export const outboundSchema: z.ZodType<
287
+ Outbound,
288
+ z.ZodTypeDef,
289
+ GetAgentResponse422ResponseBody
290
+ > = z
291
+ .instanceof(GetAgentResponse422ResponseBody)
292
+ .transform((v) => v.data$)
293
+ .pipe(
294
+ z
295
+ .object({
296
+ rawResponse: z
297
+ .instanceof(Response)
298
+ .transform(() => {
299
+ throw new Error("Response cannot be serialized");
248
300
  })
249
- .transform((v) => {
250
- return new GetAgentResponse422ResponseBody({
251
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
252
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
253
- });
254
- });
255
- export type Outbound = {
256
- RawResponse?: never | undefined;
257
- error_message?: string | undefined;
258
- };
259
-
260
- export const outboundSchema: z.ZodType<
261
- Outbound,
262
- z.ZodTypeDef,
263
- GetAgentResponse422ResponseBody
264
- > = z
265
- .instanceof(GetAgentResponse422ResponseBody)
266
- .transform((v) => v.data$)
267
- .pipe(
268
- z
269
- .object({
270
- rawResponse: z
271
- .instanceof(Response)
272
- .transform(() => {
273
- throw new Error("Response cannot be serialized");
274
- })
275
- .optional(),
276
- errorMessage: z.string().optional(),
277
- })
278
- .transform((v) => {
279
- return {
280
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
281
- ...(v.errorMessage === undefined
282
- ? null
283
- : { error_message: v.errorMessage }),
284
- };
285
- })
286
- );
301
+ .optional(),
302
+ errorMessage: z.string().optional(),
303
+ })
304
+ .transform((v) => {
305
+ return {
306
+ ...(v.rawResponse === undefined
307
+ ? null
308
+ : { RawResponse: v.rawResponse }),
309
+ ...(v.errorMessage === undefined
310
+ ? null
311
+ : { error_message: v.errorMessage }),
312
+ };
313
+ }),
314
+ );
287
315
  }
288
316
 
289
317
  /** @internal */
290
318
  export namespace GetAgentResponseResponseBody$ {
291
- export type Inbound = {
292
- RawResponse?: Response | undefined;
293
- error_message?: string | undefined;
294
- };
295
-
296
- export const inboundSchema: z.ZodType<GetAgentResponseResponseBody, z.ZodTypeDef, Inbound> = z
319
+ export type Inbound = {
320
+ RawResponse?: Response | undefined;
321
+ error_message?: string | undefined;
322
+ };
323
+
324
+ export const inboundSchema: z.ZodType<
325
+ GetAgentResponseResponseBody,
326
+ z.ZodTypeDef,
327
+ Inbound
328
+ > = z
329
+ .object({
330
+ RawResponse: z.instanceof(Response).optional(),
331
+ error_message: z.string().optional(),
332
+ })
333
+ .transform((v) => {
334
+ return new GetAgentResponseResponseBody({
335
+ ...(v.RawResponse === undefined
336
+ ? null
337
+ : { rawResponse: v.RawResponse }),
338
+ ...(v.error_message === undefined
339
+ ? null
340
+ : { errorMessage: v.error_message }),
341
+ });
342
+ });
343
+ export type Outbound = {
344
+ RawResponse?: never | undefined;
345
+ error_message?: string | undefined;
346
+ };
347
+
348
+ export const outboundSchema: z.ZodType<
349
+ Outbound,
350
+ z.ZodTypeDef,
351
+ GetAgentResponseResponseBody
352
+ > = z
353
+ .instanceof(GetAgentResponseResponseBody)
354
+ .transform((v) => v.data$)
355
+ .pipe(
356
+ z
297
357
  .object({
298
- RawResponse: z.instanceof(Response).optional(),
299
- error_message: z.string().optional(),
358
+ rawResponse: z
359
+ .instanceof(Response)
360
+ .transform(() => {
361
+ throw new Error("Response cannot be serialized");
362
+ })
363
+ .optional(),
364
+ errorMessage: z.string().optional(),
300
365
  })
301
366
  .transform((v) => {
302
- return new GetAgentResponseResponseBody({
303
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
304
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
305
- });
306
- });
307
- export type Outbound = {
308
- RawResponse?: never | undefined;
309
- error_message?: string | undefined;
310
- };
311
-
312
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetAgentResponseResponseBody> = z
313
- .instanceof(GetAgentResponseResponseBody)
314
- .transform((v) => v.data$)
315
- .pipe(
316
- z
317
- .object({
318
- rawResponse: z
319
- .instanceof(Response)
320
- .transform(() => {
321
- throw new Error("Response cannot be serialized");
322
- })
323
- .optional(),
324
- errorMessage: z.string().optional(),
325
- })
326
- .transform((v) => {
327
- return {
328
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
329
- ...(v.errorMessage === undefined
330
- ? null
331
- : { error_message: v.errorMessage }),
332
- };
333
- })
334
- );
367
+ return {
368
+ ...(v.rawResponse === undefined
369
+ ? null
370
+ : { RawResponse: v.rawResponse }),
371
+ ...(v.errorMessage === undefined
372
+ ? null
373
+ : { error_message: v.errorMessage }),
374
+ };
375
+ }),
376
+ );
335
377
  }
336
378
 
337
379
  /** @internal */
338
380
  export namespace GetAgentResponseBody$ {
339
- export type Inbound = {
340
- RawResponse?: Response | undefined;
341
- error_message?: string | undefined;
342
- };
343
-
344
- export const inboundSchema: z.ZodType<GetAgentResponseBody, z.ZodTypeDef, Inbound> = z
381
+ export type Inbound = {
382
+ RawResponse?: Response | undefined;
383
+ error_message?: string | undefined;
384
+ };
385
+
386
+ export const inboundSchema: z.ZodType<
387
+ GetAgentResponseBody,
388
+ z.ZodTypeDef,
389
+ Inbound
390
+ > = z
391
+ .object({
392
+ RawResponse: z.instanceof(Response).optional(),
393
+ error_message: z.string().optional(),
394
+ })
395
+ .transform((v) => {
396
+ return new GetAgentResponseBody({
397
+ ...(v.RawResponse === undefined
398
+ ? null
399
+ : { rawResponse: v.RawResponse }),
400
+ ...(v.error_message === undefined
401
+ ? null
402
+ : { errorMessage: v.error_message }),
403
+ });
404
+ });
405
+ export type Outbound = {
406
+ RawResponse?: never | undefined;
407
+ error_message?: string | undefined;
408
+ };
409
+
410
+ export const outboundSchema: z.ZodType<
411
+ Outbound,
412
+ z.ZodTypeDef,
413
+ GetAgentResponseBody
414
+ > = z
415
+ .instanceof(GetAgentResponseBody)
416
+ .transform((v) => v.data$)
417
+ .pipe(
418
+ z
345
419
  .object({
346
- RawResponse: z.instanceof(Response).optional(),
347
- error_message: z.string().optional(),
420
+ rawResponse: z
421
+ .instanceof(Response)
422
+ .transform(() => {
423
+ throw new Error("Response cannot be serialized");
424
+ })
425
+ .optional(),
426
+ errorMessage: z.string().optional(),
348
427
  })
349
428
  .transform((v) => {
350
- return new GetAgentResponseBody({
351
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
352
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
353
- });
354
- });
355
- export type Outbound = {
356
- RawResponse?: never | undefined;
357
- error_message?: string | undefined;
358
- };
359
-
360
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetAgentResponseBody> = z
361
- .instanceof(GetAgentResponseBody)
362
- .transform((v) => v.data$)
363
- .pipe(
364
- z
365
- .object({
366
- rawResponse: z
367
- .instanceof(Response)
368
- .transform(() => {
369
- throw new Error("Response cannot be serialized");
370
- })
371
- .optional(),
372
- errorMessage: z.string().optional(),
373
- })
374
- .transform((v) => {
375
- return {
376
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
377
- ...(v.errorMessage === undefined
378
- ? null
379
- : { error_message: v.errorMessage }),
380
- };
381
- })
382
- );
429
+ return {
430
+ ...(v.rawResponse === undefined
431
+ ? null
432
+ : { RawResponse: v.rawResponse }),
433
+ ...(v.errorMessage === undefined
434
+ ? null
435
+ : { error_message: v.errorMessage }),
436
+ };
437
+ }),
438
+ );
383
439
  }