retell-sdk 2.2.2 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/example.js +61 -7
  2. package/example.js.map +1 -1
  3. package/lib/config.d.ts.map +1 -1
  4. package/lib/config.js.map +1 -1
  5. package/lib/sdks.d.ts.map +1 -1
  6. package/lib/sdks.js.map +1 -1
  7. package/lib/security.d.ts.map +1 -1
  8. package/lib/security.js +5 -1
  9. package/lib/security.js.map +1 -1
  10. package/models/components/agent.d.ts +62 -0
  11. package/models/components/agent.d.ts.map +1 -1
  12. package/models/components/agent.js +95 -15
  13. package/models/components/agent.js.map +1 -1
  14. package/models/components/agentpromptparams.d.ts.map +1 -1
  15. package/models/components/agentpromptparams.js.map +1 -1
  16. package/models/components/calldetail.d.ts.map +1 -1
  17. package/models/components/calldetail.js +18 -6
  18. package/models/components/calldetail.js.map +1 -1
  19. package/models/components/callphonenumber.d.ts.map +1 -1
  20. package/models/components/callphonenumber.js.map +1 -1
  21. package/models/components/phonenumber.d.ts.map +1 -1
  22. package/models/components/phonenumber.js.map +1 -1
  23. package/models/components/security.d.ts.map +1 -1
  24. package/models/errors/createagent.d.ts.map +1 -1
  25. package/models/errors/createagent.js +36 -12
  26. package/models/errors/createagent.js.map +1 -1
  27. package/models/errors/createphonecall.d.ts.map +1 -1
  28. package/models/errors/createphonecall.js +54 -18
  29. package/models/errors/createphonecall.js.map +1 -1
  30. package/models/errors/createphonenumber.d.ts.map +1 -1
  31. package/models/errors/createphonenumber.js +42 -14
  32. package/models/errors/createphonenumber.js.map +1 -1
  33. package/models/errors/deleteagent.d.ts.map +1 -1
  34. package/models/errors/deleteagent.js +36 -12
  35. package/models/errors/deleteagent.js.map +1 -1
  36. package/models/errors/deletephonenumber.d.ts.map +1 -1
  37. package/models/errors/deletephonenumber.js +33 -11
  38. package/models/errors/deletephonenumber.js.map +1 -1
  39. package/models/errors/getagent.d.ts.map +1 -1
  40. package/models/errors/getagent.js +36 -12
  41. package/models/errors/getagent.js.map +1 -1
  42. package/models/errors/getcall.d.ts.map +1 -1
  43. package/models/errors/getcall.js +30 -10
  44. package/models/errors/getcall.js.map +1 -1
  45. package/models/errors/getphonenumber.d.ts.map +1 -1
  46. package/models/errors/getphonenumber.js +36 -12
  47. package/models/errors/getphonenumber.js.map +1 -1
  48. package/models/errors/listagents.d.ts.map +1 -1
  49. package/models/errors/listagents.js +15 -5
  50. package/models/errors/listagents.js.map +1 -1
  51. package/models/errors/listcalls.d.ts.map +1 -1
  52. package/models/errors/listcalls.js +24 -8
  53. package/models/errors/listcalls.js.map +1 -1
  54. package/models/errors/listphonenumbers.d.ts.map +1 -1
  55. package/models/errors/listphonenumbers.js +27 -9
  56. package/models/errors/listphonenumbers.js.map +1 -1
  57. package/models/errors/updateagent.d.ts.map +1 -1
  58. package/models/errors/updateagent.js +36 -12
  59. package/models/errors/updateagent.js.map +1 -1
  60. package/models/errors/updatephoneagent.d.ts.map +1 -1
  61. package/models/errors/updatephoneagent.js +36 -12
  62. package/models/errors/updatephoneagent.js.map +1 -1
  63. package/models/operations/createagent.d.ts +7 -0
  64. package/models/operations/createagent.d.ts.map +1 -1
  65. package/models/operations/createagent.js +18 -4
  66. package/models/operations/createagent.js.map +1 -1
  67. package/models/operations/createphonecall.d.ts.map +1 -1
  68. package/models/operations/createphonecall.js +18 -6
  69. package/models/operations/createphonecall.js.map +1 -1
  70. package/models/operations/createphonenumber.d.ts.map +1 -1
  71. package/models/operations/createphonenumber.js +6 -2
  72. package/models/operations/createphonenumber.js.map +1 -1
  73. package/models/operations/createwebcall.d.ts.map +1 -1
  74. package/models/operations/deleteagent.d.ts.map +1 -1
  75. package/models/operations/deleteagent.js.map +1 -1
  76. package/models/operations/deletephonenumber.d.ts.map +1 -1
  77. package/models/operations/deletephonenumber.js.map +1 -1
  78. package/models/operations/getagent.d.ts.map +1 -1
  79. package/models/operations/getagent.js.map +1 -1
  80. package/models/operations/getcall.d.ts.map +1 -1
  81. package/models/operations/getcall.js.map +1 -1
  82. package/models/operations/getphonenumber.d.ts.map +1 -1
  83. package/models/operations/getphonenumber.js +6 -2
  84. package/models/operations/getphonenumber.js.map +1 -1
  85. package/models/operations/listagents.d.ts.map +1 -1
  86. package/models/operations/listagents.js.map +1 -1
  87. package/models/operations/listcalls.d.ts.map +1 -1
  88. package/models/operations/listcalls.js +6 -2
  89. package/models/operations/listcalls.js.map +1 -1
  90. package/models/operations/listphonenumbers.d.ts.map +1 -1
  91. package/models/operations/listphonenumbers.js +6 -2
  92. package/models/operations/listphonenumbers.js.map +1 -1
  93. package/models/operations/updateagent.d.ts +7 -0
  94. package/models/operations/updateagent.d.ts.map +1 -1
  95. package/models/operations/updateagent.js +22 -4
  96. package/models/operations/updateagent.js.map +1 -1
  97. package/models/operations/updatephoneagent.d.ts.map +1 -1
  98. package/models/operations/updatephoneagent.js +6 -2
  99. package/models/operations/updatephoneagent.js.map +1 -1
  100. package/package.json +1 -1
  101. package/sdk/liveClient.d.ts.map +1 -1
  102. package/sdk/liveClient.js +7 -2
  103. package/sdk/liveClient.js.map +1 -1
  104. package/sdk/sdk.d.ts.map +1 -1
  105. package/sdk/sdk.js +22 -5
  106. package/sdk/sdk.js.map +1 -1
  107. package/src/example.ts +122 -65
  108. package/src/lib/config.ts +32 -32
  109. package/src/lib/sdks.ts +91 -82
  110. package/src/lib/security.ts +133 -118
  111. package/src/models/components/agent.ts +482 -303
  112. package/src/models/components/agentpromptparams.ts +46 -38
  113. package/src/models/components/calldetail.ts +137 -125
  114. package/src/models/components/callphonenumber.ts +46 -38
  115. package/src/models/components/phonenumber.ts +69 -68
  116. package/src/models/components/security.ts +1 -1
  117. package/src/models/errors/createagent.ts +359 -311
  118. package/src/models/errors/createphonecall.ts +537 -472
  119. package/src/models/errors/createphonenumber.ts +447 -395
  120. package/src/models/errors/deleteagent.ts +359 -311
  121. package/src/models/errors/deletephonenumber.ts +357 -315
  122. package/src/models/errors/getagent.ts +358 -302
  123. package/src/models/errors/getcall.ts +348 -294
  124. package/src/models/errors/getphonenumber.ts +357 -312
  125. package/src/models/errors/listagents.ts +174 -147
  126. package/src/models/errors/listcalls.ts +251 -211
  127. package/src/models/errors/listphonenumbers.ts +252 -217
  128. package/src/models/errors/updateagent.ts +359 -311
  129. package/src/models/errors/updatephoneagent.ts +357 -312
  130. package/src/models/operations/createagent.ts +166 -119
  131. package/src/models/operations/createphonecall.ts +283 -238
  132. package/src/models/operations/createphonenumber.ts +118 -98
  133. package/src/models/operations/createwebcall.ts +13 -13
  134. package/src/models/operations/deleteagent.ts +94 -78
  135. package/src/models/operations/deletephonenumber.ts +94 -78
  136. package/src/models/operations/getagent.ts +104 -88
  137. package/src/models/operations/getcall.ts +101 -88
  138. package/src/models/operations/getphonenumber.ts +108 -88
  139. package/src/models/operations/listagents.ts +68 -60
  140. package/src/models/operations/listcalls.ts +238 -213
  141. package/src/models/operations/listphonenumbers.ts +72 -60
  142. package/src/models/operations/updateagent.ts +227 -163
  143. package/src/models/operations/updatephoneagent.ts +160 -132
  144. package/src/sdk/liveClient.ts +11 -7
  145. package/src/sdk/sdk.ts +1313 -1160
@@ -9,174 +9,191 @@ import { z } from "zod";
9
9
  * Phone number associated with the call.
10
10
  */
11
11
  export type PhoneNumber = {
12
- /**
13
- * Phone number you purchased in E.164 format. It would have an agent id associated with it.
14
- */
15
- from: string;
16
- /**
17
- * Callee phone number in E.164 format.
18
- */
19
- to: string;
12
+ /**
13
+ * Phone number you purchased in E.164 format. It would have an agent id associated with it.
14
+ */
15
+ from: string;
16
+ /**
17
+ * Callee phone number in E.164 format.
18
+ */
19
+ to: string;
20
20
  };
21
21
 
22
22
  export type CreatePhoneCallRequestBody = {
23
- /**
24
- * Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect.
25
- */
26
- agentPromptParams?: Array<components.AgentPromptParams> | undefined;
27
- /**
28
- * Phone number associated with the call.
29
- */
30
- phoneNumber: PhoneNumber;
23
+ /**
24
+ * Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect.
25
+ */
26
+ agentPromptParams?: Array<components.AgentPromptParams> | undefined;
27
+ /**
28
+ * Phone number associated with the call.
29
+ */
30
+ phoneNumber: PhoneNumber;
31
31
  };
32
32
 
33
33
  /**
34
34
  * Status of call.
35
35
  */
36
36
  export enum CallStatus {
37
- Ongoing = "ongoing",
38
- Ended = "ended",
39
- Error = "error",
37
+ Ongoing = "ongoing",
38
+ Ended = "ended",
39
+ Error = "error",
40
40
  }
41
41
 
42
42
  /**
43
43
  * Web call or phone call.
44
44
  */
45
45
  export enum CreatePhoneCallCallType {
46
- InboundPhoneCall = "inbound_phone_call",
47
- OutboundPhoneCall = "outbound_phone_call",
48
- WebCall = "web_call",
46
+ InboundPhoneCall = "inbound_phone_call",
47
+ OutboundPhoneCall = "outbound_phone_call",
48
+ WebCall = "web_call",
49
49
  }
50
50
 
51
51
  /**
52
52
  * Successfully retrieved an agent.
53
53
  */
54
54
  export type CreatePhoneCallResponseBody = {
55
- /**
56
- * Corresponding agent id of this call.
57
- */
58
- agentId: string;
59
- /**
60
- * Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect. Learn more about [Agent Prompt Parameters](/features/agent-prompt-parameter).
61
- */
62
- agentPromptParams?: Array<components.AgentPromptParams> | undefined;
63
- /**
64
- * Unique id of the call.
65
- */
66
- callId: string;
67
- /**
68
- * Status of call.
69
- */
70
- callStatus: CallStatus;
71
- /**
72
- * Web call or phone call.
73
- */
74
- callType: CreatePhoneCallCallType;
75
- /**
76
- * Phone number associated with the call.
77
- */
78
- phoneNumber: components.CallPhoneNumber;
79
- /**
80
- * Begin timestamp (milliseconds since epoch) of the call.
81
- */
82
- startTimestamp: number;
55
+ /**
56
+ * Corresponding agent id of this call.
57
+ */
58
+ agentId: string;
59
+ /**
60
+ * Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect. Learn more about [Agent Prompt Parameters](/features/agent-prompt-parameter).
61
+ */
62
+ agentPromptParams?: Array<components.AgentPromptParams> | undefined;
63
+ /**
64
+ * Unique id of the call.
65
+ */
66
+ callId: string;
67
+ /**
68
+ * Status of call.
69
+ */
70
+ callStatus: CallStatus;
71
+ /**
72
+ * Web call or phone call.
73
+ */
74
+ callType: CreatePhoneCallCallType;
75
+ /**
76
+ * Phone number associated with the call.
77
+ */
78
+ phoneNumber: components.CallPhoneNumber;
79
+ /**
80
+ * Begin timestamp (milliseconds since epoch) of the call.
81
+ */
82
+ startTimestamp: number;
83
83
  };
84
84
 
85
85
  export type CreatePhoneCallResponse = {
86
- /**
87
- * HTTP response content type for this operation
88
- */
89
- contentType: string;
90
- /**
91
- * HTTP response status code for this operation
92
- */
93
- statusCode: number;
94
- /**
95
- * Raw HTTP response; suitable for custom response parsing
96
- */
97
- rawResponse: Response;
98
- /**
99
- * Successfully retrieved an agent.
100
- */
101
- object?: CreatePhoneCallResponseBody | undefined;
86
+ /**
87
+ * HTTP response content type for this operation
88
+ */
89
+ contentType: string;
90
+ /**
91
+ * HTTP response status code for this operation
92
+ */
93
+ statusCode: number;
94
+ /**
95
+ * Raw HTTP response; suitable for custom response parsing
96
+ */
97
+ rawResponse: Response;
98
+ /**
99
+ * Successfully retrieved an agent.
100
+ */
101
+ object?: CreatePhoneCallResponseBody | undefined;
102
102
  };
103
103
 
104
104
  /** @internal */
105
105
  export namespace PhoneNumber$ {
106
- export type Inbound = {
107
- from: string;
108
- to: string;
109
- };
106
+ export type Inbound = {
107
+ from: string;
108
+ to: string;
109
+ };
110
110
 
111
- export const inboundSchema: z.ZodType<PhoneNumber, z.ZodTypeDef, Inbound> = z
112
- .object({
113
- from: z.string(),
114
- to: z.string(),
115
- })
116
- .transform((v) => {
117
- return {
118
- from: v.from,
119
- to: v.to,
120
- };
121
- });
111
+ export const inboundSchema: z.ZodType<PhoneNumber, z.ZodTypeDef, Inbound> = z
112
+ .object({
113
+ from: z.string(),
114
+ to: z.string(),
115
+ })
116
+ .transform((v) => {
117
+ return {
118
+ from: v.from,
119
+ to: v.to,
120
+ };
121
+ });
122
122
 
123
- export type Outbound = {
124
- from: string;
125
- to: string;
126
- };
123
+ export type Outbound = {
124
+ from: string;
125
+ to: string;
126
+ };
127
127
 
128
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PhoneNumber> = z
129
- .object({
130
- from: z.string(),
131
- to: z.string(),
132
- })
133
- .transform((v) => {
134
- return {
135
- from: v.from,
136
- to: v.to,
137
- };
138
- });
128
+ export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PhoneNumber> =
129
+ z
130
+ .object({
131
+ from: z.string(),
132
+ to: z.string(),
133
+ })
134
+ .transform((v) => {
135
+ return {
136
+ from: v.from,
137
+ to: v.to,
138
+ };
139
+ });
139
140
  }
140
141
 
141
142
  /** @internal */
142
143
  export namespace CreatePhoneCallRequestBody$ {
143
- export type Inbound = {
144
- agent_prompt_params?: Array<components.AgentPromptParams$.Inbound> | undefined;
145
- phone_number: PhoneNumber$.Inbound;
146
- };
144
+ export type Inbound = {
145
+ agent_prompt_params?:
146
+ | Array<components.AgentPromptParams$.Inbound>
147
+ | undefined;
148
+ phone_number: PhoneNumber$.Inbound;
149
+ };
147
150
 
148
- export const inboundSchema: z.ZodType<CreatePhoneCallRequestBody, z.ZodTypeDef, Inbound> = z
149
- .object({
150
- agent_prompt_params: z.array(components.AgentPromptParams$.inboundSchema).optional(),
151
- phone_number: z.lazy(() => PhoneNumber$.inboundSchema),
152
- })
153
- .transform((v) => {
154
- return {
155
- ...(v.agent_prompt_params === undefined
156
- ? null
157
- : { agentPromptParams: v.agent_prompt_params }),
158
- phoneNumber: v.phone_number,
159
- };
160
- });
151
+ export const inboundSchema: z.ZodType<
152
+ CreatePhoneCallRequestBody,
153
+ z.ZodTypeDef,
154
+ Inbound
155
+ > = z
156
+ .object({
157
+ agent_prompt_params: z
158
+ .array(components.AgentPromptParams$.inboundSchema)
159
+ .optional(),
160
+ phone_number: z.lazy(() => PhoneNumber$.inboundSchema),
161
+ })
162
+ .transform((v) => {
163
+ return {
164
+ ...(v.agent_prompt_params === undefined
165
+ ? null
166
+ : { agentPromptParams: v.agent_prompt_params }),
167
+ phoneNumber: v.phone_number,
168
+ };
169
+ });
161
170
 
162
- export type Outbound = {
163
- agent_prompt_params?: Array<components.AgentPromptParams$.Outbound> | undefined;
164
- phone_number: PhoneNumber$.Outbound;
165
- };
171
+ export type Outbound = {
172
+ agent_prompt_params?:
173
+ | Array<components.AgentPromptParams$.Outbound>
174
+ | undefined;
175
+ phone_number: PhoneNumber$.Outbound;
176
+ };
166
177
 
167
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallRequestBody> = z
168
- .object({
169
- agentPromptParams: z.array(components.AgentPromptParams$.outboundSchema).optional(),
170
- phoneNumber: z.lazy(() => PhoneNumber$.outboundSchema),
171
- })
172
- .transform((v) => {
173
- return {
174
- ...(v.agentPromptParams === undefined
175
- ? null
176
- : { agent_prompt_params: v.agentPromptParams }),
177
- phone_number: v.phoneNumber,
178
- };
179
- });
178
+ export const outboundSchema: z.ZodType<
179
+ Outbound,
180
+ z.ZodTypeDef,
181
+ CreatePhoneCallRequestBody
182
+ > = z
183
+ .object({
184
+ agentPromptParams: z
185
+ .array(components.AgentPromptParams$.outboundSchema)
186
+ .optional(),
187
+ phoneNumber: z.lazy(() => PhoneNumber$.outboundSchema),
188
+ })
189
+ .transform((v) => {
190
+ return {
191
+ ...(v.agentPromptParams === undefined
192
+ ? null
193
+ : { agent_prompt_params: v.agentPromptParams }),
194
+ phone_number: v.phoneNumber,
195
+ };
196
+ });
180
197
  }
181
198
 
182
199
  /** @internal */
@@ -187,122 +204,150 @@ export const CreatePhoneCallCallType$ = z.nativeEnum(CreatePhoneCallCallType);
187
204
 
188
205
  /** @internal */
189
206
  export namespace CreatePhoneCallResponseBody$ {
190
- export type Inbound = {
191
- agent_id: string;
192
- agent_prompt_params?: Array<components.AgentPromptParams$.Inbound> | undefined;
193
- call_id: string;
194
- call_status: CallStatus;
195
- call_type: CreatePhoneCallCallType;
196
- phone_number: components.CallPhoneNumber$.Inbound;
197
- start_timestamp: number;
198
- };
207
+ export type Inbound = {
208
+ agent_id: string;
209
+ agent_prompt_params?:
210
+ | Array<components.AgentPromptParams$.Inbound>
211
+ | undefined;
212
+ call_id: string;
213
+ call_status: CallStatus;
214
+ call_type: CreatePhoneCallCallType;
215
+ phone_number: components.CallPhoneNumber$.Inbound;
216
+ start_timestamp: number;
217
+ };
199
218
 
200
- export const inboundSchema: z.ZodType<CreatePhoneCallResponseBody, z.ZodTypeDef, Inbound> = z
201
- .object({
202
- agent_id: z.string(),
203
- agent_prompt_params: z.array(components.AgentPromptParams$.inboundSchema).optional(),
204
- call_id: z.string(),
205
- call_status: CallStatus$,
206
- call_type: CreatePhoneCallCallType$,
207
- phone_number: components.CallPhoneNumber$.inboundSchema,
208
- start_timestamp: z.number().int(),
209
- })
210
- .transform((v) => {
211
- return {
212
- agentId: v.agent_id,
213
- ...(v.agent_prompt_params === undefined
214
- ? null
215
- : { agentPromptParams: v.agent_prompt_params }),
216
- callId: v.call_id,
217
- callStatus: v.call_status,
218
- callType: v.call_type,
219
- phoneNumber: v.phone_number,
220
- startTimestamp: v.start_timestamp,
221
- };
222
- });
219
+ export const inboundSchema: z.ZodType<
220
+ CreatePhoneCallResponseBody,
221
+ z.ZodTypeDef,
222
+ Inbound
223
+ > = z
224
+ .object({
225
+ agent_id: z.string(),
226
+ agent_prompt_params: z
227
+ .array(components.AgentPromptParams$.inboundSchema)
228
+ .optional(),
229
+ call_id: z.string(),
230
+ call_status: CallStatus$,
231
+ call_type: CreatePhoneCallCallType$,
232
+ phone_number: components.CallPhoneNumber$.inboundSchema,
233
+ start_timestamp: z.number().int(),
234
+ })
235
+ .transform((v) => {
236
+ return {
237
+ agentId: v.agent_id,
238
+ ...(v.agent_prompt_params === undefined
239
+ ? null
240
+ : { agentPromptParams: v.agent_prompt_params }),
241
+ callId: v.call_id,
242
+ callStatus: v.call_status,
243
+ callType: v.call_type,
244
+ phoneNumber: v.phone_number,
245
+ startTimestamp: v.start_timestamp,
246
+ };
247
+ });
223
248
 
224
- export type Outbound = {
225
- agent_id: string;
226
- agent_prompt_params?: Array<components.AgentPromptParams$.Outbound> | undefined;
227
- call_id: string;
228
- call_status: CallStatus;
229
- call_type: CreatePhoneCallCallType;
230
- phone_number: components.CallPhoneNumber$.Outbound;
231
- start_timestamp: number;
232
- };
249
+ export type Outbound = {
250
+ agent_id: string;
251
+ agent_prompt_params?:
252
+ | Array<components.AgentPromptParams$.Outbound>
253
+ | undefined;
254
+ call_id: string;
255
+ call_status: CallStatus;
256
+ call_type: CreatePhoneCallCallType;
257
+ phone_number: components.CallPhoneNumber$.Outbound;
258
+ start_timestamp: number;
259
+ };
233
260
 
234
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallResponseBody> = z
235
- .object({
236
- agentId: z.string(),
237
- agentPromptParams: z.array(components.AgentPromptParams$.outboundSchema).optional(),
238
- callId: z.string(),
239
- callStatus: CallStatus$,
240
- callType: CreatePhoneCallCallType$,
241
- phoneNumber: components.CallPhoneNumber$.outboundSchema,
242
- startTimestamp: z.number().int(),
243
- })
244
- .transform((v) => {
245
- return {
246
- agent_id: v.agentId,
247
- ...(v.agentPromptParams === undefined
248
- ? null
249
- : { agent_prompt_params: v.agentPromptParams }),
250
- call_id: v.callId,
251
- call_status: v.callStatus,
252
- call_type: v.callType,
253
- phone_number: v.phoneNumber,
254
- start_timestamp: v.startTimestamp,
255
- };
256
- });
261
+ export const outboundSchema: z.ZodType<
262
+ Outbound,
263
+ z.ZodTypeDef,
264
+ CreatePhoneCallResponseBody
265
+ > = z
266
+ .object({
267
+ agentId: z.string(),
268
+ agentPromptParams: z
269
+ .array(components.AgentPromptParams$.outboundSchema)
270
+ .optional(),
271
+ callId: z.string(),
272
+ callStatus: CallStatus$,
273
+ callType: CreatePhoneCallCallType$,
274
+ phoneNumber: components.CallPhoneNumber$.outboundSchema,
275
+ startTimestamp: z.number().int(),
276
+ })
277
+ .transform((v) => {
278
+ return {
279
+ agent_id: v.agentId,
280
+ ...(v.agentPromptParams === undefined
281
+ ? null
282
+ : { agent_prompt_params: v.agentPromptParams }),
283
+ call_id: v.callId,
284
+ call_status: v.callStatus,
285
+ call_type: v.callType,
286
+ phone_number: v.phoneNumber,
287
+ start_timestamp: v.startTimestamp,
288
+ };
289
+ });
257
290
  }
258
291
 
259
292
  /** @internal */
260
293
  export namespace CreatePhoneCallResponse$ {
261
- export type Inbound = {
262
- ContentType: string;
263
- StatusCode: number;
264
- RawResponse: Response;
265
- callDetail?: CreatePhoneCallResponseBody$.Inbound | undefined;
266
- };
294
+ export type Inbound = {
295
+ ContentType: string;
296
+ StatusCode: number;
297
+ RawResponse: Response;
298
+ callDetail?: CreatePhoneCallResponseBody$.Inbound | undefined;
299
+ };
267
300
 
268
- export const inboundSchema: z.ZodType<CreatePhoneCallResponse, z.ZodTypeDef, Inbound> = z
269
- .object({
270
- ContentType: z.string(),
271
- StatusCode: z.number().int(),
272
- RawResponse: z.instanceof(Response),
273
- callDetail: z.lazy(() => CreatePhoneCallResponseBody$.inboundSchema).optional(),
274
- })
275
- .transform((v) => {
276
- return {
277
- contentType: v.ContentType,
278
- statusCode: v.StatusCode,
279
- rawResponse: v.RawResponse,
280
- ...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
281
- };
282
- });
301
+ export const inboundSchema: z.ZodType<
302
+ CreatePhoneCallResponse,
303
+ z.ZodTypeDef,
304
+ Inbound
305
+ > = z
306
+ .object({
307
+ ContentType: z.string(),
308
+ StatusCode: z.number().int(),
309
+ RawResponse: z.instanceof(Response),
310
+ callDetail: z
311
+ .lazy(() => CreatePhoneCallResponseBody$.inboundSchema)
312
+ .optional(),
313
+ })
314
+ .transform((v) => {
315
+ return {
316
+ contentType: v.ContentType,
317
+ statusCode: v.StatusCode,
318
+ rawResponse: v.RawResponse,
319
+ ...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
320
+ };
321
+ });
283
322
 
284
- export type Outbound = {
285
- ContentType: string;
286
- StatusCode: number;
287
- RawResponse: never;
288
- callDetail?: CreatePhoneCallResponseBody$.Outbound | undefined;
289
- };
323
+ export type Outbound = {
324
+ ContentType: string;
325
+ StatusCode: number;
326
+ RawResponse: never;
327
+ callDetail?: CreatePhoneCallResponseBody$.Outbound | undefined;
328
+ };
290
329
 
291
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallResponse> = z
292
- .object({
293
- contentType: z.string(),
294
- statusCode: z.number().int(),
295
- rawResponse: z.instanceof(Response).transform(() => {
296
- throw new Error("Response cannot be serialized");
297
- }),
298
- callDetail: z.lazy(() => CreatePhoneCallResponseBody$.outboundSchema).optional(),
299
- })
300
- .transform((v) => {
301
- return {
302
- ContentType: v.contentType,
303
- StatusCode: v.statusCode,
304
- RawResponse: v.rawResponse,
305
- ...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
306
- };
307
- });
330
+ export const outboundSchema: z.ZodType<
331
+ Outbound,
332
+ z.ZodTypeDef,
333
+ CreatePhoneCallResponse
334
+ > = z
335
+ .object({
336
+ contentType: z.string(),
337
+ statusCode: z.number().int(),
338
+ rawResponse: z.instanceof(Response).transform(() => {
339
+ throw new Error("Response cannot be serialized");
340
+ }),
341
+ callDetail: z
342
+ .lazy(() => CreatePhoneCallResponseBody$.outboundSchema)
343
+ .optional(),
344
+ })
345
+ .transform((v) => {
346
+ return {
347
+ ContentType: v.contentType,
348
+ StatusCode: v.statusCode,
349
+ RawResponse: v.rawResponse,
350
+ ...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
351
+ };
352
+ });
308
353
  }