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,390 +8,435 @@ import { z } from "zod";
8
8
  * Internal Server Error
9
9
  */
10
10
  export type GetPhoneNumberResponse500ResponseBodyData = {
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 GetPhoneNumberResponse500ResponseBody 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$: GetPhoneNumberResponse500ResponseBodyData;
30
-
31
- constructor(err: GetPhoneNumberResponse500ResponseBodyData, 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 = "GetPhoneNumberResponse500ResponseBody";
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$: GetPhoneNumberResponse500ResponseBodyData;
30
+
31
+ constructor(
32
+ err: GetPhoneNumberResponse500ResponseBodyData,
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 = "GetPhoneNumberResponse500ResponseBody";
52
+ }
49
53
  }
50
54
 
51
55
  /**
52
56
  * Unprocessable Content
53
57
  */
54
58
  export type GetPhoneNumberResponse422ResponseBodyData = {
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 GetPhoneNumberResponse422ResponseBody 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$: GetPhoneNumberResponse422ResponseBodyData;
74
-
75
- constructor(err: GetPhoneNumberResponse422ResponseBodyData, 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 = "GetPhoneNumberResponse422ResponseBody";
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$: GetPhoneNumberResponse422ResponseBodyData;
78
+
79
+ constructor(
80
+ err: GetPhoneNumberResponse422ResponseBodyData,
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 = "GetPhoneNumberResponse422ResponseBody";
100
+ }
93
101
  }
94
102
 
95
103
  /**
96
104
  * Unauthorized
97
105
  */
98
106
  export type GetPhoneNumberResponseResponseBodyData = {
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 GetPhoneNumberResponseResponseBody 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$: GetPhoneNumberResponseResponseBodyData;
118
-
119
- constructor(err: GetPhoneNumberResponseResponseBodyData, 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 = "GetPhoneNumberResponseResponseBody";
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$: GetPhoneNumberResponseResponseBodyData;
126
+
127
+ constructor(
128
+ err: GetPhoneNumberResponseResponseBodyData,
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 = "GetPhoneNumberResponseResponseBody";
148
+ }
137
149
  }
138
150
 
139
151
  /**
140
152
  * Bad Request
141
153
  */
142
154
  export type GetPhoneNumberResponseBodyData = {
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 GetPhoneNumberResponseBody 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$: GetPhoneNumberResponseBodyData;
162
-
163
- constructor(err: GetPhoneNumberResponseBodyData, 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 = "GetPhoneNumberResponseBody";
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$: GetPhoneNumberResponseBodyData;
174
+
175
+ constructor(err: GetPhoneNumberResponseBodyData, options?: ErrorOptions) {
176
+ super("", options);
177
+ this.data$ = err;
178
+
179
+ if (err.rawResponse != null) {
180
+ this.rawResponse = err.rawResponse;
180
181
  }
182
+ if (err.errorMessage != null) {
183
+ this.errorMessage = err.errorMessage;
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 = "GetPhoneNumberResponseBody";
193
+ }
181
194
  }
182
195
 
183
196
  /** @internal */
184
197
  export namespace GetPhoneNumberResponse500ResponseBody$ {
185
- export type Inbound = {
186
- RawResponse?: Response | undefined;
187
- error_message?: string | undefined;
188
- };
189
-
190
- export const inboundSchema: z.ZodType<
191
- GetPhoneNumberResponse500ResponseBody,
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
+ GetPhoneNumberResponse500ResponseBody,
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 GetPhoneNumberResponse500ResponseBody({
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
+ GetPhoneNumberResponse500ResponseBody
231
+ > = z
232
+ .instanceof(GetPhoneNumberResponse500ResponseBody)
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 GetPhoneNumberResponse500ResponseBody({
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
- GetPhoneNumberResponse500ResponseBody
214
- > = z
215
- .instanceof(GetPhoneNumberResponse500ResponseBody)
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 GetPhoneNumberResponse422ResponseBody$ {
241
- export type Inbound = {
242
- RawResponse?: Response | undefined;
243
- error_message?: string | undefined;
244
- };
245
-
246
- export const inboundSchema: z.ZodType<
247
- GetPhoneNumberResponse422ResponseBody,
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
+ GetPhoneNumberResponse422ResponseBody,
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 GetPhoneNumberResponse422ResponseBody({
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
+ GetPhoneNumberResponse422ResponseBody
293
+ > = z
294
+ .instanceof(GetPhoneNumberResponse422ResponseBody)
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 GetPhoneNumberResponse422ResponseBody({
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
- GetPhoneNumberResponse422ResponseBody
270
- > = z
271
- .instanceof(GetPhoneNumberResponse422ResponseBody)
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 GetPhoneNumberResponseResponseBody$ {
297
- export type Inbound = {
298
- RawResponse?: Response | undefined;
299
- error_message?: string | undefined;
300
- };
301
-
302
- export const inboundSchema: z.ZodType<
303
- GetPhoneNumberResponseResponseBody,
304
- z.ZodTypeDef,
305
- Inbound
306
- > = z
322
+ export type Inbound = {
323
+ RawResponse?: Response | undefined;
324
+ error_message?: string | undefined;
325
+ };
326
+
327
+ export const inboundSchema: z.ZodType<
328
+ GetPhoneNumberResponseResponseBody,
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 GetPhoneNumberResponseResponseBody({
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
+ GetPhoneNumberResponseResponseBody
355
+ > = z
356
+ .instanceof(GetPhoneNumberResponseResponseBody)
357
+ .transform((v) => v.data$)
358
+ .pipe(
359
+ z
307
360
  .object({
308
- RawResponse: z.instanceof(Response).optional(),
309
- error_message: z.string().optional(),
361
+ rawResponse: z
362
+ .instanceof(Response)
363
+ .transform(() => {
364
+ throw new Error("Response cannot be serialized");
365
+ })
366
+ .optional(),
367
+ errorMessage: z.string().optional(),
310
368
  })
311
369
  .transform((v) => {
312
- return new GetPhoneNumberResponseResponseBody({
313
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
314
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
315
- });
316
- });
317
- export type Outbound = {
318
- RawResponse?: never | undefined;
319
- error_message?: string | undefined;
320
- };
321
-
322
- export const outboundSchema: z.ZodType<
323
- Outbound,
324
- z.ZodTypeDef,
325
- GetPhoneNumberResponseResponseBody
326
- > = z
327
- .instanceof(GetPhoneNumberResponseResponseBody)
328
- .transform((v) => v.data$)
329
- .pipe(
330
- z
331
- .object({
332
- rawResponse: z
333
- .instanceof(Response)
334
- .transform(() => {
335
- throw new Error("Response cannot be serialized");
336
- })
337
- .optional(),
338
- errorMessage: z.string().optional(),
339
- })
340
- .transform((v) => {
341
- return {
342
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
343
- ...(v.errorMessage === undefined
344
- ? null
345
- : { error_message: v.errorMessage }),
346
- };
347
- })
348
- );
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
+ );
349
380
  }
350
381
 
351
382
  /** @internal */
352
383
  export namespace GetPhoneNumberResponseBody$ {
353
- export type Inbound = {
354
- RawResponse?: Response | undefined;
355
- error_message?: string | undefined;
356
- };
357
-
358
- export const inboundSchema: z.ZodType<GetPhoneNumberResponseBody, 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
+ GetPhoneNumberResponseBody,
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 GetPhoneNumberResponseBody({
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
+ GetPhoneNumberResponseBody
417
+ > = z
418
+ .instanceof(GetPhoneNumberResponseBody)
419
+ .transform((v) => v.data$)
420
+ .pipe(
421
+ z
359
422
  .object({
360
- RawResponse: z.instanceof(Response).optional(),
361
- 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(),
362
430
  })
363
431
  .transform((v) => {
364
- return new GetPhoneNumberResponseBody({
365
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
366
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
367
- });
368
- });
369
- export type Outbound = {
370
- RawResponse?: never | undefined;
371
- error_message?: string | undefined;
372
- };
373
-
374
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, GetPhoneNumberResponseBody> = z
375
- .instanceof(GetPhoneNumberResponseBody)
376
- .transform((v) => v.data$)
377
- .pipe(
378
- z
379
- .object({
380
- rawResponse: z
381
- .instanceof(Response)
382
- .transform(() => {
383
- throw new Error("Response cannot be serialized");
384
- })
385
- .optional(),
386
- errorMessage: z.string().optional(),
387
- })
388
- .transform((v) => {
389
- return {
390
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
391
- ...(v.errorMessage === undefined
392
- ? null
393
- : { error_message: v.errorMessage }),
394
- };
395
- })
396
- );
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
+ );
397
442
  }