retell-sdk 2.2.3 → 2.2.6

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