retell-sdk 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example.js +34 -2
- 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 +3 -3
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +60 -26
- 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.map +1 -1
- package/models/operations/createagent.js +16 -6
- 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.map +1 -1
- package/models/operations/updateagent.js +18 -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 +121 -87
- 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 +459 -387
- 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 +165 -129
- 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 +226 -173
- package/src/models/operations/updatephoneagent.ts +160 -132
- package/src/sdk/liveClient.ts +11 -7
- 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
|
-
|
|
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 CreatePhoneCallResponse500ResponseBody extends Error {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
* Too Many Requests
|
|
64
68
|
*/
|
|
65
69
|
export class CreatePhoneCallResponse429ResponseBody extends Error {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
|
|
285
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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
|
-
|
|
341
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
397
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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
|
-
|
|
453
|
-
|
|
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
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
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
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
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
|
-
|
|
509
|
-
|
|
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
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
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
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
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
|
-
|
|
561
|
-
|
|
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
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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
|
}
|