retell-sdk 2.2.2 → 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 (145) hide show
  1. package/example.js +61 -7
  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 +62 -0
  11. package/models/components/agent.d.ts.map +1 -1
  12. package/models/components/agent.js +95 -15
  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 +7 -0
  64. package/models/operations/createagent.d.ts.map +1 -1
  65. package/models/operations/createagent.js +18 -4
  66. package/models/operations/createagent.js.map +1 -1
  67. package/models/operations/createphonecall.d.ts.map +1 -1
  68. package/models/operations/createphonecall.js +18 -6
  69. package/models/operations/createphonecall.js.map +1 -1
  70. package/models/operations/createphonenumber.d.ts.map +1 -1
  71. package/models/operations/createphonenumber.js +6 -2
  72. package/models/operations/createphonenumber.js.map +1 -1
  73. package/models/operations/createwebcall.d.ts.map +1 -1
  74. package/models/operations/deleteagent.d.ts.map +1 -1
  75. package/models/operations/deleteagent.js.map +1 -1
  76. package/models/operations/deletephonenumber.d.ts.map +1 -1
  77. package/models/operations/deletephonenumber.js.map +1 -1
  78. package/models/operations/getagent.d.ts.map +1 -1
  79. package/models/operations/getagent.js.map +1 -1
  80. package/models/operations/getcall.d.ts.map +1 -1
  81. package/models/operations/getcall.js.map +1 -1
  82. package/models/operations/getphonenumber.d.ts.map +1 -1
  83. package/models/operations/getphonenumber.js +6 -2
  84. package/models/operations/getphonenumber.js.map +1 -1
  85. package/models/operations/listagents.d.ts.map +1 -1
  86. package/models/operations/listagents.js.map +1 -1
  87. package/models/operations/listcalls.d.ts.map +1 -1
  88. package/models/operations/listcalls.js +6 -2
  89. package/models/operations/listcalls.js.map +1 -1
  90. package/models/operations/listphonenumbers.d.ts.map +1 -1
  91. package/models/operations/listphonenumbers.js +6 -2
  92. package/models/operations/listphonenumbers.js.map +1 -1
  93. package/models/operations/updateagent.d.ts +7 -0
  94. package/models/operations/updateagent.d.ts.map +1 -1
  95. package/models/operations/updateagent.js +22 -4
  96. package/models/operations/updateagent.js.map +1 -1
  97. package/models/operations/updatephoneagent.d.ts.map +1 -1
  98. package/models/operations/updatephoneagent.js +6 -2
  99. package/models/operations/updatephoneagent.js.map +1 -1
  100. package/package.json +1 -1
  101. package/sdk/liveClient.d.ts.map +1 -1
  102. package/sdk/liveClient.js +7 -2
  103. package/sdk/liveClient.js.map +1 -1
  104. package/sdk/sdk.d.ts.map +1 -1
  105. package/sdk/sdk.js +22 -5
  106. package/sdk/sdk.js.map +1 -1
  107. package/src/example.ts +122 -65
  108. package/src/lib/config.ts +32 -32
  109. package/src/lib/sdks.ts +91 -82
  110. package/src/lib/security.ts +133 -118
  111. package/src/models/components/agent.ts +482 -303
  112. package/src/models/components/agentpromptparams.ts +46 -38
  113. package/src/models/components/calldetail.ts +137 -125
  114. package/src/models/components/callphonenumber.ts +46 -38
  115. package/src/models/components/phonenumber.ts +69 -68
  116. package/src/models/components/security.ts +1 -1
  117. package/src/models/errors/createagent.ts +359 -311
  118. package/src/models/errors/createphonecall.ts +537 -472
  119. package/src/models/errors/createphonenumber.ts +447 -395
  120. package/src/models/errors/deleteagent.ts +359 -311
  121. package/src/models/errors/deletephonenumber.ts +357 -315
  122. package/src/models/errors/getagent.ts +358 -302
  123. package/src/models/errors/getcall.ts +348 -294
  124. package/src/models/errors/getphonenumber.ts +357 -312
  125. package/src/models/errors/listagents.ts +174 -147
  126. package/src/models/errors/listcalls.ts +251 -211
  127. package/src/models/errors/listphonenumbers.ts +252 -217
  128. package/src/models/errors/updateagent.ts +359 -311
  129. package/src/models/errors/updatephoneagent.ts +357 -312
  130. package/src/models/operations/createagent.ts +166 -119
  131. package/src/models/operations/createphonecall.ts +283 -238
  132. package/src/models/operations/createphonenumber.ts +118 -98
  133. package/src/models/operations/createwebcall.ts +13 -13
  134. package/src/models/operations/deleteagent.ts +94 -78
  135. package/src/models/operations/deletephonenumber.ts +94 -78
  136. package/src/models/operations/getagent.ts +104 -88
  137. package/src/models/operations/getcall.ts +101 -88
  138. package/src/models/operations/getphonenumber.ts +108 -88
  139. package/src/models/operations/listagents.ts +68 -60
  140. package/src/models/operations/listcalls.ts +238 -213
  141. package/src/models/operations/listphonenumbers.ts +72 -60
  142. package/src/models/operations/updateagent.ts +227 -163
  143. package/src/models/operations/updatephoneagent.ts +160 -132
  144. package/src/sdk/liveClient.ts +11 -7
  145. package/src/sdk/sdk.ts +1313 -1160
@@ -8,590 +8,655 @@ import { z } from "zod";
8
8
  * Internal Server Error
9
9
  */
10
10
  export type CreatePhoneCallResponse500ResponseBodyData = {
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 CreatePhoneCallResponse500ResponseBody 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$: CreatePhoneCallResponse500ResponseBodyData;
30
-
31
- constructor(err: CreatePhoneCallResponse500ResponseBodyData, 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 = "CreatePhoneCallResponse500ResponseBody";
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$: CreatePhoneCallResponse500ResponseBodyData;
30
+
31
+ constructor(
32
+ err: CreatePhoneCallResponse500ResponseBodyData,
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 = "CreatePhoneCallResponse500ResponseBody";
52
+ }
49
53
  }
50
54
 
51
55
  /**
52
56
  * Too Many Requests
53
57
  */
54
58
  export type CreatePhoneCallResponse429ResponseBodyData = {
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
  * Too Many Requests
64
68
  */
65
69
  export class CreatePhoneCallResponse429ResponseBody 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$: CreatePhoneCallResponse429ResponseBodyData;
74
-
75
- constructor(err: CreatePhoneCallResponse429ResponseBodyData, 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 = "CreatePhoneCallResponse429ResponseBody";
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$: CreatePhoneCallResponse429ResponseBodyData;
78
+
79
+ constructor(
80
+ err: CreatePhoneCallResponse429ResponseBodyData,
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 = "CreatePhoneCallResponse429ResponseBody";
100
+ }
93
101
  }
94
102
 
95
103
  /**
96
104
  * Unprocessable Content
97
105
  */
98
106
  export type CreatePhoneCallResponse422ResponseBodyData = {
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
  * Unprocessable Content
108
116
  */
109
117
  export class CreatePhoneCallResponse422ResponseBody 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$: CreatePhoneCallResponse422ResponseBodyData;
118
-
119
- constructor(err: CreatePhoneCallResponse422ResponseBodyData, 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 = "CreatePhoneCallResponse422ResponseBody";
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$: CreatePhoneCallResponse422ResponseBodyData;
126
+
127
+ constructor(
128
+ err: CreatePhoneCallResponse422ResponseBodyData,
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 = "CreatePhoneCallResponse422ResponseBody";
148
+ }
137
149
  }
138
150
 
139
151
  /**
140
152
  * Payment Required
141
153
  */
142
154
  export type CreatePhoneCallResponse402ResponseBodyData = {
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
  * Payment Required
152
164
  */
153
165
  export class CreatePhoneCallResponse402ResponseBody 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$: CreatePhoneCallResponse402ResponseBodyData;
162
-
163
- constructor(err: CreatePhoneCallResponse402ResponseBodyData, 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 = "CreatePhoneCallResponse402ResponseBody";
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$: CreatePhoneCallResponse402ResponseBodyData;
174
+
175
+ constructor(
176
+ err: CreatePhoneCallResponse402ResponseBodyData,
177
+ options?: ErrorOptions,
178
+ ) {
179
+ super("", options);
180
+ this.data$ = err;
181
+
182
+ if (err.rawResponse != null) {
183
+ this.rawResponse = err.rawResponse;
180
184
  }
185
+ if (err.errorMessage != null) {
186
+ this.errorMessage = err.errorMessage;
187
+ }
188
+
189
+ const msg =
190
+ "message" in err && typeof err.message === "string" ? err.message : "";
191
+ const { rawResponse, ...data } = err;
192
+ const content = JSON.stringify(data);
193
+ this.message = [msg, content].filter(Boolean).join("\n");
194
+
195
+ this.name = "CreatePhoneCallResponse402ResponseBody";
196
+ }
181
197
  }
182
198
 
183
199
  /**
184
200
  * Unauthorized
185
201
  */
186
202
  export type CreatePhoneCallResponseResponseBodyData = {
187
- /**
188
- * Raw HTTP response; suitable for custom response parsing
189
- */
190
- rawResponse?: Response | undefined;
191
- errorMessage?: string | undefined;
203
+ /**
204
+ * Raw HTTP response; suitable for custom response parsing
205
+ */
206
+ rawResponse?: Response | undefined;
207
+ errorMessage?: string | undefined;
192
208
  };
193
209
 
194
210
  /**
195
211
  * Unauthorized
196
212
  */
197
213
  export class CreatePhoneCallResponseResponseBody extends Error {
198
- /**
199
- * Raw HTTP response; suitable for custom response parsing
200
- */
201
- rawResponse?: Response | undefined;
202
- errorMessage?: string | undefined;
203
-
204
- /** The original data that was passed to this error instance. */
205
- data$: CreatePhoneCallResponseResponseBodyData;
206
-
207
- constructor(err: CreatePhoneCallResponseResponseBodyData, options?: ErrorOptions) {
208
- super("", options);
209
- this.data$ = err;
210
-
211
- if (err.rawResponse != null) {
212
- this.rawResponse = err.rawResponse;
213
- }
214
- if (err.errorMessage != null) {
215
- this.errorMessage = err.errorMessage;
216
- }
217
-
218
- const msg = "message" in err && typeof err.message === "string" ? err.message : "";
219
- const { rawResponse, ...data } = err;
220
- const content = JSON.stringify(data);
221
- this.message = [msg, content].filter(Boolean).join("\n");
222
-
223
- this.name = "CreatePhoneCallResponseResponseBody";
214
+ /**
215
+ * Raw HTTP response; suitable for custom response parsing
216
+ */
217
+ rawResponse?: Response | undefined;
218
+ errorMessage?: string | undefined;
219
+
220
+ /** The original data that was passed to this error instance. */
221
+ data$: CreatePhoneCallResponseResponseBodyData;
222
+
223
+ constructor(
224
+ err: CreatePhoneCallResponseResponseBodyData,
225
+ options?: ErrorOptions,
226
+ ) {
227
+ super("", options);
228
+ this.data$ = err;
229
+
230
+ if (err.rawResponse != null) {
231
+ this.rawResponse = err.rawResponse;
232
+ }
233
+ if (err.errorMessage != null) {
234
+ this.errorMessage = err.errorMessage;
224
235
  }
236
+
237
+ const msg =
238
+ "message" in err && typeof err.message === "string" ? err.message : "";
239
+ const { rawResponse, ...data } = err;
240
+ const content = JSON.stringify(data);
241
+ this.message = [msg, content].filter(Boolean).join("\n");
242
+
243
+ this.name = "CreatePhoneCallResponseResponseBody";
244
+ }
225
245
  }
226
246
 
227
247
  /**
228
248
  * Bad Request
229
249
  */
230
250
  export type CreatePhoneCallResponseBodyData = {
231
- /**
232
- * Raw HTTP response; suitable for custom response parsing
233
- */
234
- rawResponse?: Response | undefined;
235
- errorMessage?: string | undefined;
251
+ /**
252
+ * Raw HTTP response; suitable for custom response parsing
253
+ */
254
+ rawResponse?: Response | undefined;
255
+ errorMessage?: string | undefined;
236
256
  };
237
257
 
238
258
  /**
239
259
  * Bad Request
240
260
  */
241
261
  export class CreatePhoneCallResponseBody extends Error {
242
- /**
243
- * Raw HTTP response; suitable for custom response parsing
244
- */
245
- rawResponse?: Response | undefined;
246
- errorMessage?: string | undefined;
247
-
248
- /** The original data that was passed to this error instance. */
249
- data$: CreatePhoneCallResponseBodyData;
250
-
251
- constructor(err: CreatePhoneCallResponseBodyData, options?: ErrorOptions) {
252
- super("", options);
253
- this.data$ = err;
254
-
255
- if (err.rawResponse != null) {
256
- this.rawResponse = err.rawResponse;
257
- }
258
- if (err.errorMessage != null) {
259
- this.errorMessage = err.errorMessage;
260
- }
261
-
262
- const msg = "message" in err && typeof err.message === "string" ? err.message : "";
263
- const { rawResponse, ...data } = err;
264
- const content = JSON.stringify(data);
265
- this.message = [msg, content].filter(Boolean).join("\n");
266
-
267
- this.name = "CreatePhoneCallResponseBody";
262
+ /**
263
+ * Raw HTTP response; suitable for custom response parsing
264
+ */
265
+ rawResponse?: Response | undefined;
266
+ errorMessage?: string | undefined;
267
+
268
+ /** The original data that was passed to this error instance. */
269
+ data$: CreatePhoneCallResponseBodyData;
270
+
271
+ constructor(err: CreatePhoneCallResponseBodyData, options?: ErrorOptions) {
272
+ super("", options);
273
+ this.data$ = err;
274
+
275
+ if (err.rawResponse != null) {
276
+ this.rawResponse = err.rawResponse;
277
+ }
278
+ if (err.errorMessage != null) {
279
+ this.errorMessage = err.errorMessage;
268
280
  }
281
+
282
+ const msg =
283
+ "message" in err && typeof err.message === "string" ? err.message : "";
284
+ const { rawResponse, ...data } = err;
285
+ const content = JSON.stringify(data);
286
+ this.message = [msg, content].filter(Boolean).join("\n");
287
+
288
+ this.name = "CreatePhoneCallResponseBody";
289
+ }
269
290
  }
270
291
 
271
292
  /** @internal */
272
293
  export namespace CreatePhoneCallResponse500ResponseBody$ {
273
- export type Inbound = {
274
- RawResponse?: Response | undefined;
275
- error_message?: string | undefined;
276
- };
277
-
278
- export const inboundSchema: z.ZodType<
279
- CreatePhoneCallResponse500ResponseBody,
280
- z.ZodTypeDef,
281
- Inbound
282
- > = z
294
+ export type Inbound = {
295
+ RawResponse?: Response | undefined;
296
+ error_message?: string | undefined;
297
+ };
298
+
299
+ export const inboundSchema: z.ZodType<
300
+ CreatePhoneCallResponse500ResponseBody,
301
+ z.ZodTypeDef,
302
+ Inbound
303
+ > = z
304
+ .object({
305
+ RawResponse: z.instanceof(Response).optional(),
306
+ error_message: z.string().optional(),
307
+ })
308
+ .transform((v) => {
309
+ return new CreatePhoneCallResponse500ResponseBody({
310
+ ...(v.RawResponse === undefined
311
+ ? null
312
+ : { rawResponse: v.RawResponse }),
313
+ ...(v.error_message === undefined
314
+ ? null
315
+ : { errorMessage: v.error_message }),
316
+ });
317
+ });
318
+ export type Outbound = {
319
+ RawResponse?: never | undefined;
320
+ error_message?: string | undefined;
321
+ };
322
+
323
+ export const outboundSchema: z.ZodType<
324
+ Outbound,
325
+ z.ZodTypeDef,
326
+ CreatePhoneCallResponse500ResponseBody
327
+ > = z
328
+ .instanceof(CreatePhoneCallResponse500ResponseBody)
329
+ .transform((v) => v.data$)
330
+ .pipe(
331
+ z
283
332
  .object({
284
- RawResponse: z.instanceof(Response).optional(),
285
- error_message: z.string().optional(),
333
+ rawResponse: z
334
+ .instanceof(Response)
335
+ .transform(() => {
336
+ throw new Error("Response cannot be serialized");
337
+ })
338
+ .optional(),
339
+ errorMessage: z.string().optional(),
286
340
  })
287
341
  .transform((v) => {
288
- return new CreatePhoneCallResponse500ResponseBody({
289
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
290
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
291
- });
292
- });
293
- export type Outbound = {
294
- RawResponse?: never | undefined;
295
- error_message?: string | undefined;
296
- };
297
-
298
- export const outboundSchema: z.ZodType<
299
- Outbound,
300
- z.ZodTypeDef,
301
- CreatePhoneCallResponse500ResponseBody
302
- > = z
303
- .instanceof(CreatePhoneCallResponse500ResponseBody)
304
- .transform((v) => v.data$)
305
- .pipe(
306
- z
307
- .object({
308
- rawResponse: z
309
- .instanceof(Response)
310
- .transform(() => {
311
- throw new Error("Response cannot be serialized");
312
- })
313
- .optional(),
314
- errorMessage: z.string().optional(),
315
- })
316
- .transform((v) => {
317
- return {
318
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
319
- ...(v.errorMessage === undefined
320
- ? null
321
- : { error_message: v.errorMessage }),
322
- };
323
- })
324
- );
342
+ return {
343
+ ...(v.rawResponse === undefined
344
+ ? null
345
+ : { RawResponse: v.rawResponse }),
346
+ ...(v.errorMessage === undefined
347
+ ? null
348
+ : { error_message: v.errorMessage }),
349
+ };
350
+ }),
351
+ );
325
352
  }
326
353
 
327
354
  /** @internal */
328
355
  export namespace CreatePhoneCallResponse429ResponseBody$ {
329
- export type Inbound = {
330
- RawResponse?: Response | undefined;
331
- error_message?: string | undefined;
332
- };
333
-
334
- export const inboundSchema: z.ZodType<
335
- CreatePhoneCallResponse429ResponseBody,
336
- z.ZodTypeDef,
337
- Inbound
338
- > = z
356
+ export type Inbound = {
357
+ RawResponse?: Response | undefined;
358
+ error_message?: string | undefined;
359
+ };
360
+
361
+ export const inboundSchema: z.ZodType<
362
+ CreatePhoneCallResponse429ResponseBody,
363
+ z.ZodTypeDef,
364
+ Inbound
365
+ > = z
366
+ .object({
367
+ RawResponse: z.instanceof(Response).optional(),
368
+ error_message: z.string().optional(),
369
+ })
370
+ .transform((v) => {
371
+ return new CreatePhoneCallResponse429ResponseBody({
372
+ ...(v.RawResponse === undefined
373
+ ? null
374
+ : { rawResponse: v.RawResponse }),
375
+ ...(v.error_message === undefined
376
+ ? null
377
+ : { errorMessage: v.error_message }),
378
+ });
379
+ });
380
+ export type Outbound = {
381
+ RawResponse?: never | undefined;
382
+ error_message?: string | undefined;
383
+ };
384
+
385
+ export const outboundSchema: z.ZodType<
386
+ Outbound,
387
+ z.ZodTypeDef,
388
+ CreatePhoneCallResponse429ResponseBody
389
+ > = z
390
+ .instanceof(CreatePhoneCallResponse429ResponseBody)
391
+ .transform((v) => v.data$)
392
+ .pipe(
393
+ z
339
394
  .object({
340
- RawResponse: z.instanceof(Response).optional(),
341
- error_message: z.string().optional(),
395
+ rawResponse: z
396
+ .instanceof(Response)
397
+ .transform(() => {
398
+ throw new Error("Response cannot be serialized");
399
+ })
400
+ .optional(),
401
+ errorMessage: z.string().optional(),
342
402
  })
343
403
  .transform((v) => {
344
- return new CreatePhoneCallResponse429ResponseBody({
345
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
346
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
347
- });
348
- });
349
- export type Outbound = {
350
- RawResponse?: never | undefined;
351
- error_message?: string | undefined;
352
- };
353
-
354
- export const outboundSchema: z.ZodType<
355
- Outbound,
356
- z.ZodTypeDef,
357
- CreatePhoneCallResponse429ResponseBody
358
- > = z
359
- .instanceof(CreatePhoneCallResponse429ResponseBody)
360
- .transform((v) => v.data$)
361
- .pipe(
362
- z
363
- .object({
364
- rawResponse: z
365
- .instanceof(Response)
366
- .transform(() => {
367
- throw new Error("Response cannot be serialized");
368
- })
369
- .optional(),
370
- errorMessage: z.string().optional(),
371
- })
372
- .transform((v) => {
373
- return {
374
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
375
- ...(v.errorMessage === undefined
376
- ? null
377
- : { error_message: v.errorMessage }),
378
- };
379
- })
380
- );
404
+ return {
405
+ ...(v.rawResponse === undefined
406
+ ? null
407
+ : { RawResponse: v.rawResponse }),
408
+ ...(v.errorMessage === undefined
409
+ ? null
410
+ : { error_message: v.errorMessage }),
411
+ };
412
+ }),
413
+ );
381
414
  }
382
415
 
383
416
  /** @internal */
384
417
  export namespace CreatePhoneCallResponse422ResponseBody$ {
385
- export type Inbound = {
386
- RawResponse?: Response | undefined;
387
- error_message?: string | undefined;
388
- };
389
-
390
- export const inboundSchema: z.ZodType<
391
- CreatePhoneCallResponse422ResponseBody,
392
- z.ZodTypeDef,
393
- Inbound
394
- > = z
418
+ export type Inbound = {
419
+ RawResponse?: Response | undefined;
420
+ error_message?: string | undefined;
421
+ };
422
+
423
+ export const inboundSchema: z.ZodType<
424
+ CreatePhoneCallResponse422ResponseBody,
425
+ z.ZodTypeDef,
426
+ Inbound
427
+ > = z
428
+ .object({
429
+ RawResponse: z.instanceof(Response).optional(),
430
+ error_message: z.string().optional(),
431
+ })
432
+ .transform((v) => {
433
+ return new CreatePhoneCallResponse422ResponseBody({
434
+ ...(v.RawResponse === undefined
435
+ ? null
436
+ : { rawResponse: v.RawResponse }),
437
+ ...(v.error_message === undefined
438
+ ? null
439
+ : { errorMessage: v.error_message }),
440
+ });
441
+ });
442
+ export type Outbound = {
443
+ RawResponse?: never | undefined;
444
+ error_message?: string | undefined;
445
+ };
446
+
447
+ export const outboundSchema: z.ZodType<
448
+ Outbound,
449
+ z.ZodTypeDef,
450
+ CreatePhoneCallResponse422ResponseBody
451
+ > = z
452
+ .instanceof(CreatePhoneCallResponse422ResponseBody)
453
+ .transform((v) => v.data$)
454
+ .pipe(
455
+ z
395
456
  .object({
396
- RawResponse: z.instanceof(Response).optional(),
397
- error_message: z.string().optional(),
457
+ rawResponse: z
458
+ .instanceof(Response)
459
+ .transform(() => {
460
+ throw new Error("Response cannot be serialized");
461
+ })
462
+ .optional(),
463
+ errorMessage: z.string().optional(),
398
464
  })
399
465
  .transform((v) => {
400
- return new CreatePhoneCallResponse422ResponseBody({
401
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
402
- ...(v.error_message === undefined ? null : { 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
- CreatePhoneCallResponse422ResponseBody
414
- > = z
415
- .instanceof(CreatePhoneCallResponse422ResponseBody)
416
- .transform((v) => v.data$)
417
- .pipe(
418
- z
419
- .object({
420
- rawResponse: z
421
- .instanceof(Response)
422
- .transform(() => {
423
- throw new Error("Response cannot be serialized");
424
- })
425
- .optional(),
426
- errorMessage: z.string().optional(),
427
- })
428
- .transform((v) => {
429
- return {
430
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
431
- ...(v.errorMessage === undefined
432
- ? null
433
- : { error_message: v.errorMessage }),
434
- };
435
- })
436
- );
466
+ return {
467
+ ...(v.rawResponse === undefined
468
+ ? null
469
+ : { RawResponse: v.rawResponse }),
470
+ ...(v.errorMessage === undefined
471
+ ? null
472
+ : { error_message: v.errorMessage }),
473
+ };
474
+ }),
475
+ );
437
476
  }
438
477
 
439
478
  /** @internal */
440
479
  export namespace CreatePhoneCallResponse402ResponseBody$ {
441
- export type Inbound = {
442
- RawResponse?: Response | undefined;
443
- error_message?: string | undefined;
444
- };
445
-
446
- export const inboundSchema: z.ZodType<
447
- CreatePhoneCallResponse402ResponseBody,
448
- z.ZodTypeDef,
449
- Inbound
450
- > = z
480
+ export type Inbound = {
481
+ RawResponse?: Response | undefined;
482
+ error_message?: string | undefined;
483
+ };
484
+
485
+ export const inboundSchema: z.ZodType<
486
+ CreatePhoneCallResponse402ResponseBody,
487
+ z.ZodTypeDef,
488
+ Inbound
489
+ > = z
490
+ .object({
491
+ RawResponse: z.instanceof(Response).optional(),
492
+ error_message: z.string().optional(),
493
+ })
494
+ .transform((v) => {
495
+ return new CreatePhoneCallResponse402ResponseBody({
496
+ ...(v.RawResponse === undefined
497
+ ? null
498
+ : { rawResponse: v.RawResponse }),
499
+ ...(v.error_message === undefined
500
+ ? null
501
+ : { errorMessage: v.error_message }),
502
+ });
503
+ });
504
+ export type Outbound = {
505
+ RawResponse?: never | undefined;
506
+ error_message?: string | undefined;
507
+ };
508
+
509
+ export const outboundSchema: z.ZodType<
510
+ Outbound,
511
+ z.ZodTypeDef,
512
+ CreatePhoneCallResponse402ResponseBody
513
+ > = z
514
+ .instanceof(CreatePhoneCallResponse402ResponseBody)
515
+ .transform((v) => v.data$)
516
+ .pipe(
517
+ z
451
518
  .object({
452
- RawResponse: z.instanceof(Response).optional(),
453
- error_message: z.string().optional(),
519
+ rawResponse: z
520
+ .instanceof(Response)
521
+ .transform(() => {
522
+ throw new Error("Response cannot be serialized");
523
+ })
524
+ .optional(),
525
+ errorMessage: z.string().optional(),
454
526
  })
455
527
  .transform((v) => {
456
- return new CreatePhoneCallResponse402ResponseBody({
457
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
458
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
459
- });
460
- });
461
- export type Outbound = {
462
- RawResponse?: never | undefined;
463
- error_message?: string | undefined;
464
- };
465
-
466
- export const outboundSchema: z.ZodType<
467
- Outbound,
468
- z.ZodTypeDef,
469
- CreatePhoneCallResponse402ResponseBody
470
- > = z
471
- .instanceof(CreatePhoneCallResponse402ResponseBody)
472
- .transform((v) => v.data$)
473
- .pipe(
474
- z
475
- .object({
476
- rawResponse: z
477
- .instanceof(Response)
478
- .transform(() => {
479
- throw new Error("Response cannot be serialized");
480
- })
481
- .optional(),
482
- errorMessage: z.string().optional(),
483
- })
484
- .transform((v) => {
485
- return {
486
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
487
- ...(v.errorMessage === undefined
488
- ? null
489
- : { error_message: v.errorMessage }),
490
- };
491
- })
492
- );
528
+ return {
529
+ ...(v.rawResponse === undefined
530
+ ? null
531
+ : { RawResponse: v.rawResponse }),
532
+ ...(v.errorMessage === undefined
533
+ ? null
534
+ : { error_message: v.errorMessage }),
535
+ };
536
+ }),
537
+ );
493
538
  }
494
539
 
495
540
  /** @internal */
496
541
  export namespace CreatePhoneCallResponseResponseBody$ {
497
- export type Inbound = {
498
- RawResponse?: Response | undefined;
499
- error_message?: string | undefined;
500
- };
501
-
502
- export const inboundSchema: z.ZodType<
503
- CreatePhoneCallResponseResponseBody,
504
- z.ZodTypeDef,
505
- Inbound
506
- > = z
542
+ export type Inbound = {
543
+ RawResponse?: Response | undefined;
544
+ error_message?: string | undefined;
545
+ };
546
+
547
+ export const inboundSchema: z.ZodType<
548
+ CreatePhoneCallResponseResponseBody,
549
+ z.ZodTypeDef,
550
+ Inbound
551
+ > = z
552
+ .object({
553
+ RawResponse: z.instanceof(Response).optional(),
554
+ error_message: z.string().optional(),
555
+ })
556
+ .transform((v) => {
557
+ return new CreatePhoneCallResponseResponseBody({
558
+ ...(v.RawResponse === undefined
559
+ ? null
560
+ : { rawResponse: v.RawResponse }),
561
+ ...(v.error_message === undefined
562
+ ? null
563
+ : { errorMessage: v.error_message }),
564
+ });
565
+ });
566
+ export type Outbound = {
567
+ RawResponse?: never | undefined;
568
+ error_message?: string | undefined;
569
+ };
570
+
571
+ export const outboundSchema: z.ZodType<
572
+ Outbound,
573
+ z.ZodTypeDef,
574
+ CreatePhoneCallResponseResponseBody
575
+ > = z
576
+ .instanceof(CreatePhoneCallResponseResponseBody)
577
+ .transform((v) => v.data$)
578
+ .pipe(
579
+ z
507
580
  .object({
508
- RawResponse: z.instanceof(Response).optional(),
509
- error_message: z.string().optional(),
581
+ rawResponse: z
582
+ .instanceof(Response)
583
+ .transform(() => {
584
+ throw new Error("Response cannot be serialized");
585
+ })
586
+ .optional(),
587
+ errorMessage: z.string().optional(),
510
588
  })
511
589
  .transform((v) => {
512
- return new CreatePhoneCallResponseResponseBody({
513
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
514
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
515
- });
516
- });
517
- export type Outbound = {
518
- RawResponse?: never | undefined;
519
- error_message?: string | undefined;
520
- };
521
-
522
- export const outboundSchema: z.ZodType<
523
- Outbound,
524
- z.ZodTypeDef,
525
- CreatePhoneCallResponseResponseBody
526
- > = z
527
- .instanceof(CreatePhoneCallResponseResponseBody)
528
- .transform((v) => v.data$)
529
- .pipe(
530
- z
531
- .object({
532
- rawResponse: z
533
- .instanceof(Response)
534
- .transform(() => {
535
- throw new Error("Response cannot be serialized");
536
- })
537
- .optional(),
538
- errorMessage: z.string().optional(),
539
- })
540
- .transform((v) => {
541
- return {
542
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
543
- ...(v.errorMessage === undefined
544
- ? null
545
- : { error_message: v.errorMessage }),
546
- };
547
- })
548
- );
590
+ return {
591
+ ...(v.rawResponse === undefined
592
+ ? null
593
+ : { RawResponse: v.rawResponse }),
594
+ ...(v.errorMessage === undefined
595
+ ? null
596
+ : { error_message: v.errorMessage }),
597
+ };
598
+ }),
599
+ );
549
600
  }
550
601
 
551
602
  /** @internal */
552
603
  export namespace CreatePhoneCallResponseBody$ {
553
- export type Inbound = {
554
- RawResponse?: Response | undefined;
555
- error_message?: string | undefined;
556
- };
557
-
558
- export const inboundSchema: z.ZodType<CreatePhoneCallResponseBody, z.ZodTypeDef, Inbound> = z
604
+ export type Inbound = {
605
+ RawResponse?: Response | undefined;
606
+ error_message?: string | undefined;
607
+ };
608
+
609
+ export const inboundSchema: z.ZodType<
610
+ CreatePhoneCallResponseBody,
611
+ z.ZodTypeDef,
612
+ Inbound
613
+ > = z
614
+ .object({
615
+ RawResponse: z.instanceof(Response).optional(),
616
+ error_message: z.string().optional(),
617
+ })
618
+ .transform((v) => {
619
+ return new CreatePhoneCallResponseBody({
620
+ ...(v.RawResponse === undefined
621
+ ? null
622
+ : { rawResponse: v.RawResponse }),
623
+ ...(v.error_message === undefined
624
+ ? null
625
+ : { errorMessage: v.error_message }),
626
+ });
627
+ });
628
+ export type Outbound = {
629
+ RawResponse?: never | undefined;
630
+ error_message?: string | undefined;
631
+ };
632
+
633
+ export const outboundSchema: z.ZodType<
634
+ Outbound,
635
+ z.ZodTypeDef,
636
+ CreatePhoneCallResponseBody
637
+ > = z
638
+ .instanceof(CreatePhoneCallResponseBody)
639
+ .transform((v) => v.data$)
640
+ .pipe(
641
+ z
559
642
  .object({
560
- RawResponse: z.instanceof(Response).optional(),
561
- error_message: z.string().optional(),
643
+ rawResponse: z
644
+ .instanceof(Response)
645
+ .transform(() => {
646
+ throw new Error("Response cannot be serialized");
647
+ })
648
+ .optional(),
649
+ errorMessage: z.string().optional(),
562
650
  })
563
651
  .transform((v) => {
564
- return new CreatePhoneCallResponseBody({
565
- ...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
566
- ...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
567
- });
568
- });
569
- export type Outbound = {
570
- RawResponse?: never | undefined;
571
- error_message?: string | undefined;
572
- };
573
-
574
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallResponseBody> = z
575
- .instanceof(CreatePhoneCallResponseBody)
576
- .transform((v) => v.data$)
577
- .pipe(
578
- z
579
- .object({
580
- rawResponse: z
581
- .instanceof(Response)
582
- .transform(() => {
583
- throw new Error("Response cannot be serialized");
584
- })
585
- .optional(),
586
- errorMessage: z.string().optional(),
587
- })
588
- .transform((v) => {
589
- return {
590
- ...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
591
- ...(v.errorMessage === undefined
592
- ? null
593
- : { error_message: v.errorMessage }),
594
- };
595
- })
596
- );
652
+ return {
653
+ ...(v.rawResponse === undefined
654
+ ? null
655
+ : { RawResponse: v.rawResponse }),
656
+ ...(v.errorMessage === undefined
657
+ ? null
658
+ : { error_message: v.errorMessage }),
659
+ };
660
+ }),
661
+ );
597
662
  }