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.
- package/example.js +61 -7
- package/example.js.map +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +5 -1
- package/lib/security.js.map +1 -1
- package/models/components/agent.d.ts +62 -0
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +95 -15
- package/models/components/agent.js.map +1 -1
- package/models/components/agentpromptparams.d.ts.map +1 -1
- package/models/components/agentpromptparams.js.map +1 -1
- package/models/components/calldetail.d.ts.map +1 -1
- package/models/components/calldetail.js +18 -6
- package/models/components/calldetail.js.map +1 -1
- package/models/components/callphonenumber.d.ts.map +1 -1
- package/models/components/callphonenumber.js.map +1 -1
- package/models/components/phonenumber.d.ts.map +1 -1
- package/models/components/phonenumber.js.map +1 -1
- package/models/components/security.d.ts.map +1 -1
- package/models/errors/createagent.d.ts.map +1 -1
- package/models/errors/createagent.js +36 -12
- package/models/errors/createagent.js.map +1 -1
- package/models/errors/createphonecall.d.ts.map +1 -1
- package/models/errors/createphonecall.js +54 -18
- package/models/errors/createphonecall.js.map +1 -1
- package/models/errors/createphonenumber.d.ts.map +1 -1
- package/models/errors/createphonenumber.js +42 -14
- package/models/errors/createphonenumber.js.map +1 -1
- package/models/errors/deleteagent.d.ts.map +1 -1
- package/models/errors/deleteagent.js +36 -12
- package/models/errors/deleteagent.js.map +1 -1
- package/models/errors/deletephonenumber.d.ts.map +1 -1
- package/models/errors/deletephonenumber.js +33 -11
- package/models/errors/deletephonenumber.js.map +1 -1
- package/models/errors/getagent.d.ts.map +1 -1
- package/models/errors/getagent.js +36 -12
- package/models/errors/getagent.js.map +1 -1
- package/models/errors/getcall.d.ts.map +1 -1
- package/models/errors/getcall.js +30 -10
- package/models/errors/getcall.js.map +1 -1
- package/models/errors/getphonenumber.d.ts.map +1 -1
- package/models/errors/getphonenumber.js +36 -12
- package/models/errors/getphonenumber.js.map +1 -1
- package/models/errors/listagents.d.ts.map +1 -1
- package/models/errors/listagents.js +15 -5
- package/models/errors/listagents.js.map +1 -1
- package/models/errors/listcalls.d.ts.map +1 -1
- package/models/errors/listcalls.js +24 -8
- package/models/errors/listcalls.js.map +1 -1
- package/models/errors/listphonenumbers.d.ts.map +1 -1
- package/models/errors/listphonenumbers.js +27 -9
- package/models/errors/listphonenumbers.js.map +1 -1
- package/models/errors/updateagent.d.ts.map +1 -1
- package/models/errors/updateagent.js +36 -12
- package/models/errors/updateagent.js.map +1 -1
- package/models/errors/updatephoneagent.d.ts.map +1 -1
- package/models/errors/updatephoneagent.js +36 -12
- package/models/errors/updatephoneagent.js.map +1 -1
- package/models/operations/createagent.d.ts +7 -0
- package/models/operations/createagent.d.ts.map +1 -1
- package/models/operations/createagent.js +18 -4
- package/models/operations/createagent.js.map +1 -1
- package/models/operations/createphonecall.d.ts.map +1 -1
- package/models/operations/createphonecall.js +18 -6
- package/models/operations/createphonecall.js.map +1 -1
- package/models/operations/createphonenumber.d.ts.map +1 -1
- package/models/operations/createphonenumber.js +6 -2
- package/models/operations/createphonenumber.js.map +1 -1
- package/models/operations/createwebcall.d.ts.map +1 -1
- package/models/operations/deleteagent.d.ts.map +1 -1
- package/models/operations/deleteagent.js.map +1 -1
- package/models/operations/deletephonenumber.d.ts.map +1 -1
- package/models/operations/deletephonenumber.js.map +1 -1
- package/models/operations/getagent.d.ts.map +1 -1
- package/models/operations/getagent.js.map +1 -1
- package/models/operations/getcall.d.ts.map +1 -1
- package/models/operations/getcall.js.map +1 -1
- package/models/operations/getphonenumber.d.ts.map +1 -1
- package/models/operations/getphonenumber.js +6 -2
- package/models/operations/getphonenumber.js.map +1 -1
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listcalls.d.ts.map +1 -1
- package/models/operations/listcalls.js +6 -2
- package/models/operations/listcalls.js.map +1 -1
- package/models/operations/listphonenumbers.d.ts.map +1 -1
- package/models/operations/listphonenumbers.js +6 -2
- package/models/operations/listphonenumbers.js.map +1 -1
- package/models/operations/updateagent.d.ts +7 -0
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +22 -4
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatephoneagent.d.ts.map +1 -1
- package/models/operations/updatephoneagent.js +6 -2
- package/models/operations/updatephoneagent.js.map +1 -1
- package/package.json +1 -1
- package/sdk/liveClient.d.ts.map +1 -1
- package/sdk/liveClient.js +7 -2
- package/sdk/liveClient.js.map +1 -1
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +22 -5
- package/sdk/sdk.js.map +1 -1
- package/src/example.ts +122 -65
- package/src/lib/config.ts +32 -32
- package/src/lib/sdks.ts +91 -82
- package/src/lib/security.ts +133 -118
- package/src/models/components/agent.ts +482 -303
- package/src/models/components/agentpromptparams.ts +46 -38
- package/src/models/components/calldetail.ts +137 -125
- package/src/models/components/callphonenumber.ts +46 -38
- package/src/models/components/phonenumber.ts +69 -68
- package/src/models/components/security.ts +1 -1
- package/src/models/errors/createagent.ts +359 -311
- package/src/models/errors/createphonecall.ts +537 -472
- package/src/models/errors/createphonenumber.ts +447 -395
- package/src/models/errors/deleteagent.ts +359 -311
- package/src/models/errors/deletephonenumber.ts +357 -315
- package/src/models/errors/getagent.ts +358 -302
- package/src/models/errors/getcall.ts +348 -294
- package/src/models/errors/getphonenumber.ts +357 -312
- package/src/models/errors/listagents.ts +174 -147
- package/src/models/errors/listcalls.ts +251 -211
- package/src/models/errors/listphonenumbers.ts +252 -217
- package/src/models/errors/updateagent.ts +359 -311
- package/src/models/errors/updatephoneagent.ts +357 -312
- package/src/models/operations/createagent.ts +166 -119
- package/src/models/operations/createphonecall.ts +283 -238
- package/src/models/operations/createphonenumber.ts +118 -98
- package/src/models/operations/createwebcall.ts +13 -13
- package/src/models/operations/deleteagent.ts +94 -78
- package/src/models/operations/deletephonenumber.ts +94 -78
- package/src/models/operations/getagent.ts +104 -88
- package/src/models/operations/getcall.ts +101 -88
- package/src/models/operations/getphonenumber.ts +108 -88
- package/src/models/operations/listagents.ts +68 -60
- package/src/models/operations/listcalls.ts +238 -213
- package/src/models/operations/listphonenumbers.ts +72 -60
- package/src/models/operations/updateagent.ts +227 -163
- package/src/models/operations/updatephoneagent.ts +160 -132
- package/src/sdk/liveClient.ts +11 -7
- package/src/sdk/sdk.ts +1313 -1160
|
@@ -8,282 +8,322 @@ import { z } from "zod";
|
|
|
8
8
|
* Internal Server Error
|
|
9
9
|
*/
|
|
10
10
|
export type ListCallsResponse500ResponseBodyData = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 ListCallsResponse500ResponseBody extends Error {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
24
|
+
*/
|
|
25
|
+
rawResponse?: Response | undefined;
|
|
26
|
+
errorMessage?: string | undefined;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/** The original data that was passed to this error instance. */
|
|
29
|
+
data$: ListCallsResponse500ResponseBodyData;
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
constructor(
|
|
32
|
+
err: ListCallsResponse500ResponseBodyData,
|
|
33
|
+
options?: ErrorOptions,
|
|
34
|
+
) {
|
|
35
|
+
super("", options);
|
|
36
|
+
this.data$ = err;
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
if (err.rawResponse != null) {
|
|
39
|
+
this.rawResponse = err.rawResponse;
|
|
40
|
+
}
|
|
41
|
+
if (err.errorMessage != null) {
|
|
42
|
+
this.errorMessage = err.errorMessage;
|
|
43
|
+
}
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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");
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
this.name = "ListCallsResponse500ResponseBody";
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
/**
|
|
52
56
|
* Unauthorized
|
|
53
57
|
*/
|
|
54
58
|
export type ListCallsResponseResponseBodyData = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
* Unauthorized
|
|
64
68
|
*/
|
|
65
69
|
export class ListCallsResponseResponseBody extends Error {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
72
|
+
*/
|
|
73
|
+
rawResponse?: Response | undefined;
|
|
74
|
+
errorMessage?: string | undefined;
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
/** The original data that was passed to this error instance. */
|
|
77
|
+
data$: ListCallsResponseResponseBodyData;
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
constructor(err: ListCallsResponseResponseBodyData, options?: ErrorOptions) {
|
|
80
|
+
super("", options);
|
|
81
|
+
this.data$ = err;
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
if (err.rawResponse != null) {
|
|
84
|
+
this.rawResponse = err.rawResponse;
|
|
85
|
+
}
|
|
86
|
+
if (err.errorMessage != null) {
|
|
87
|
+
this.errorMessage = err.errorMessage;
|
|
88
|
+
}
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
const msg =
|
|
91
|
+
"message" in err && typeof err.message === "string" ? err.message : "";
|
|
92
|
+
const { rawResponse, ...data } = err;
|
|
93
|
+
const content = JSON.stringify(data);
|
|
94
|
+
this.message = [msg, content].filter(Boolean).join("\n");
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
this.name = "ListCallsResponseResponseBody";
|
|
97
|
+
}
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
/**
|
|
96
101
|
* Bad Request
|
|
97
102
|
*/
|
|
98
103
|
export type ListCallsResponseBodyData = {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
106
|
+
*/
|
|
107
|
+
rawResponse?: Response | undefined;
|
|
108
|
+
errorMessage?: string | undefined;
|
|
104
109
|
};
|
|
105
110
|
|
|
106
111
|
/**
|
|
107
112
|
* Bad Request
|
|
108
113
|
*/
|
|
109
114
|
export class ListCallsResponseBody extends Error {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Raw HTTP response; suitable for custom response parsing
|
|
117
|
+
*/
|
|
118
|
+
rawResponse?: Response | undefined;
|
|
119
|
+
errorMessage?: string | undefined;
|
|
115
120
|
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
/** The original data that was passed to this error instance. */
|
|
122
|
+
data$: ListCallsResponseBodyData;
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
constructor(err: ListCallsResponseBodyData, options?: ErrorOptions) {
|
|
125
|
+
super("", options);
|
|
126
|
+
this.data$ = err;
|
|
122
127
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
if (err.rawResponse != null) {
|
|
129
|
+
this.rawResponse = err.rawResponse;
|
|
130
|
+
}
|
|
131
|
+
if (err.errorMessage != null) {
|
|
132
|
+
this.errorMessage = err.errorMessage;
|
|
133
|
+
}
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
const msg =
|
|
136
|
+
"message" in err && typeof err.message === "string" ? err.message : "";
|
|
137
|
+
const { rawResponse, ...data } = err;
|
|
138
|
+
const content = JSON.stringify(data);
|
|
139
|
+
this.message = [msg, content].filter(Boolean).join("\n");
|
|
134
140
|
|
|
135
|
-
|
|
136
|
-
|
|
141
|
+
this.name = "ListCallsResponseBody";
|
|
142
|
+
}
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
/** @internal */
|
|
140
146
|
export namespace ListCallsResponse500ResponseBody$ {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
export type Inbound = {
|
|
148
|
+
RawResponse?: Response | undefined;
|
|
149
|
+
error_message?: string | undefined;
|
|
150
|
+
};
|
|
145
151
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
error_message
|
|
161
|
-
|
|
152
|
+
export const inboundSchema: z.ZodType<
|
|
153
|
+
ListCallsResponse500ResponseBody,
|
|
154
|
+
z.ZodTypeDef,
|
|
155
|
+
Inbound
|
|
156
|
+
> = z
|
|
157
|
+
.object({
|
|
158
|
+
RawResponse: z.instanceof(Response).optional(),
|
|
159
|
+
error_message: z.string().optional(),
|
|
160
|
+
})
|
|
161
|
+
.transform((v) => {
|
|
162
|
+
return new ListCallsResponse500ResponseBody({
|
|
163
|
+
...(v.RawResponse === undefined
|
|
164
|
+
? null
|
|
165
|
+
: { rawResponse: v.RawResponse }),
|
|
166
|
+
...(v.error_message === undefined
|
|
167
|
+
? null
|
|
168
|
+
: { errorMessage: v.error_message }),
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
export type Outbound = {
|
|
172
|
+
RawResponse?: never | undefined;
|
|
173
|
+
error_message?: string | undefined;
|
|
174
|
+
};
|
|
162
175
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
176
|
+
export const outboundSchema: z.ZodType<
|
|
177
|
+
Outbound,
|
|
178
|
+
z.ZodTypeDef,
|
|
179
|
+
ListCallsResponse500ResponseBody
|
|
180
|
+
> = z
|
|
181
|
+
.instanceof(ListCallsResponse500ResponseBody)
|
|
182
|
+
.transform((v) => v.data$)
|
|
183
|
+
.pipe(
|
|
184
|
+
z
|
|
185
|
+
.object({
|
|
186
|
+
rawResponse: z
|
|
187
|
+
.instanceof(Response)
|
|
188
|
+
.transform(() => {
|
|
189
|
+
throw new Error("Response cannot be serialized");
|
|
190
|
+
})
|
|
191
|
+
.optional(),
|
|
192
|
+
errorMessage: z.string().optional(),
|
|
193
|
+
})
|
|
194
|
+
.transform((v) => {
|
|
195
|
+
return {
|
|
196
|
+
...(v.rawResponse === undefined
|
|
197
|
+
? null
|
|
198
|
+
: { RawResponse: v.rawResponse }),
|
|
199
|
+
...(v.errorMessage === undefined
|
|
200
|
+
? null
|
|
201
|
+
: { error_message: v.errorMessage }),
|
|
202
|
+
};
|
|
203
|
+
}),
|
|
204
|
+
);
|
|
190
205
|
}
|
|
191
206
|
|
|
192
207
|
/** @internal */
|
|
193
208
|
export namespace ListCallsResponseResponseBody$ {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
209
|
+
export type Inbound = {
|
|
210
|
+
RawResponse?: Response | undefined;
|
|
211
|
+
error_message?: string | undefined;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export const inboundSchema: z.ZodType<
|
|
215
|
+
ListCallsResponseResponseBody,
|
|
216
|
+
z.ZodTypeDef,
|
|
217
|
+
Inbound
|
|
218
|
+
> = z
|
|
219
|
+
.object({
|
|
220
|
+
RawResponse: z.instanceof(Response).optional(),
|
|
221
|
+
error_message: z.string().optional(),
|
|
222
|
+
})
|
|
223
|
+
.transform((v) => {
|
|
224
|
+
return new ListCallsResponseResponseBody({
|
|
225
|
+
...(v.RawResponse === undefined
|
|
226
|
+
? null
|
|
227
|
+
: { rawResponse: v.RawResponse }),
|
|
228
|
+
...(v.error_message === undefined
|
|
229
|
+
? null
|
|
230
|
+
: { errorMessage: v.error_message }),
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
export type Outbound = {
|
|
234
|
+
RawResponse?: never | undefined;
|
|
235
|
+
error_message?: string | undefined;
|
|
236
|
+
};
|
|
198
237
|
|
|
199
|
-
|
|
238
|
+
export const outboundSchema: z.ZodType<
|
|
239
|
+
Outbound,
|
|
240
|
+
z.ZodTypeDef,
|
|
241
|
+
ListCallsResponseResponseBody
|
|
242
|
+
> = z
|
|
243
|
+
.instanceof(ListCallsResponseResponseBody)
|
|
244
|
+
.transform((v) => v.data$)
|
|
245
|
+
.pipe(
|
|
246
|
+
z
|
|
200
247
|
.object({
|
|
201
|
-
|
|
202
|
-
|
|
248
|
+
rawResponse: z
|
|
249
|
+
.instanceof(Response)
|
|
250
|
+
.transform(() => {
|
|
251
|
+
throw new Error("Response cannot be serialized");
|
|
252
|
+
})
|
|
253
|
+
.optional(),
|
|
254
|
+
errorMessage: z.string().optional(),
|
|
203
255
|
})
|
|
204
256
|
.transform((v) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, ListCallsResponseResponseBody> =
|
|
216
|
-
z
|
|
217
|
-
.instanceof(ListCallsResponseResponseBody)
|
|
218
|
-
.transform((v) => v.data$)
|
|
219
|
-
.pipe(
|
|
220
|
-
z
|
|
221
|
-
.object({
|
|
222
|
-
rawResponse: z
|
|
223
|
-
.instanceof(Response)
|
|
224
|
-
.transform(() => {
|
|
225
|
-
throw new Error("Response cannot be serialized");
|
|
226
|
-
})
|
|
227
|
-
.optional(),
|
|
228
|
-
errorMessage: z.string().optional(),
|
|
229
|
-
})
|
|
230
|
-
.transform((v) => {
|
|
231
|
-
return {
|
|
232
|
-
...(v.rawResponse === undefined
|
|
233
|
-
? null
|
|
234
|
-
: { RawResponse: v.rawResponse }),
|
|
235
|
-
...(v.errorMessage === undefined
|
|
236
|
-
? null
|
|
237
|
-
: { error_message: v.errorMessage }),
|
|
238
|
-
};
|
|
239
|
-
})
|
|
240
|
-
);
|
|
257
|
+
return {
|
|
258
|
+
...(v.rawResponse === undefined
|
|
259
|
+
? null
|
|
260
|
+
: { RawResponse: v.rawResponse }),
|
|
261
|
+
...(v.errorMessage === undefined
|
|
262
|
+
? null
|
|
263
|
+
: { error_message: v.errorMessage }),
|
|
264
|
+
};
|
|
265
|
+
}),
|
|
266
|
+
);
|
|
241
267
|
}
|
|
242
268
|
|
|
243
269
|
/** @internal */
|
|
244
270
|
export namespace ListCallsResponseBody$ {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
271
|
+
export type Inbound = {
|
|
272
|
+
RawResponse?: Response | undefined;
|
|
273
|
+
error_message?: string | undefined;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export const inboundSchema: z.ZodType<
|
|
277
|
+
ListCallsResponseBody,
|
|
278
|
+
z.ZodTypeDef,
|
|
279
|
+
Inbound
|
|
280
|
+
> = z
|
|
281
|
+
.object({
|
|
282
|
+
RawResponse: z.instanceof(Response).optional(),
|
|
283
|
+
error_message: z.string().optional(),
|
|
284
|
+
})
|
|
285
|
+
.transform((v) => {
|
|
286
|
+
return new ListCallsResponseBody({
|
|
287
|
+
...(v.RawResponse === undefined
|
|
288
|
+
? null
|
|
289
|
+
: { rawResponse: v.RawResponse }),
|
|
290
|
+
...(v.error_message === undefined
|
|
291
|
+
? null
|
|
292
|
+
: { errorMessage: v.error_message }),
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
export type Outbound = {
|
|
296
|
+
RawResponse?: never | undefined;
|
|
297
|
+
error_message?: string | undefined;
|
|
298
|
+
};
|
|
249
299
|
|
|
250
|
-
|
|
300
|
+
export const outboundSchema: z.ZodType<
|
|
301
|
+
Outbound,
|
|
302
|
+
z.ZodTypeDef,
|
|
303
|
+
ListCallsResponseBody
|
|
304
|
+
> = z
|
|
305
|
+
.instanceof(ListCallsResponseBody)
|
|
306
|
+
.transform((v) => v.data$)
|
|
307
|
+
.pipe(
|
|
308
|
+
z
|
|
251
309
|
.object({
|
|
252
|
-
|
|
253
|
-
|
|
310
|
+
rawResponse: z
|
|
311
|
+
.instanceof(Response)
|
|
312
|
+
.transform(() => {
|
|
313
|
+
throw new Error("Response cannot be serialized");
|
|
314
|
+
})
|
|
315
|
+
.optional(),
|
|
316
|
+
errorMessage: z.string().optional(),
|
|
254
317
|
})
|
|
255
318
|
.transform((v) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, ListCallsResponseBody> = z
|
|
267
|
-
.instanceof(ListCallsResponseBody)
|
|
268
|
-
.transform((v) => v.data$)
|
|
269
|
-
.pipe(
|
|
270
|
-
z
|
|
271
|
-
.object({
|
|
272
|
-
rawResponse: z
|
|
273
|
-
.instanceof(Response)
|
|
274
|
-
.transform(() => {
|
|
275
|
-
throw new Error("Response cannot be serialized");
|
|
276
|
-
})
|
|
277
|
-
.optional(),
|
|
278
|
-
errorMessage: z.string().optional(),
|
|
279
|
-
})
|
|
280
|
-
.transform((v) => {
|
|
281
|
-
return {
|
|
282
|
-
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
|
283
|
-
...(v.errorMessage === undefined
|
|
284
|
-
? null
|
|
285
|
-
: { error_message: v.errorMessage }),
|
|
286
|
-
};
|
|
287
|
-
})
|
|
288
|
-
);
|
|
319
|
+
return {
|
|
320
|
+
...(v.rawResponse === undefined
|
|
321
|
+
? null
|
|
322
|
+
: { RawResponse: v.rawResponse }),
|
|
323
|
+
...(v.errorMessage === undefined
|
|
324
|
+
? null
|
|
325
|
+
: { error_message: v.errorMessage }),
|
|
326
|
+
};
|
|
327
|
+
}),
|
|
328
|
+
);
|
|
289
329
|
}
|