Skip to content

Commit 4ab01b7

Browse files
author
childish-sambino
authored
fix: correct the enum names (#921)
Reverts back to v3 naming. Also removes enum types for resource properties which were not needed. Matches v3.
1 parent 63de418 commit 4ab01b7

File tree

79 files changed

+536
-1069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+536
-1069
lines changed

src/rest/api/v2010/account/address/dependentPhoneNumber.ts

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -266,41 +266,6 @@ export function DependentPhoneNumberListInstance(
266266

267267
return instance;
268268
}
269-
export type DependentPhoneNumberVoiceMethod =
270-
| "HEAD"
271-
| "GET"
272-
| "POST"
273-
| "PATCH"
274-
| "PUT"
275-
| "DELETE";
276-
export type DependentPhoneNumberVoiceFallbackMethod =
277-
| "HEAD"
278-
| "GET"
279-
| "POST"
280-
| "PATCH"
281-
| "PUT"
282-
| "DELETE";
283-
export type DependentPhoneNumberSmsFallbackMethod =
284-
| "HEAD"
285-
| "GET"
286-
| "POST"
287-
| "PATCH"
288-
| "PUT"
289-
| "DELETE";
290-
export type DependentPhoneNumberSmsMethod =
291-
| "HEAD"
292-
| "GET"
293-
| "POST"
294-
| "PATCH"
295-
| "PUT"
296-
| "DELETE";
297-
export type DependentPhoneNumberStatusCallbackMethod =
298-
| "HEAD"
299-
| "GET"
300-
| "POST"
301-
| "PATCH"
302-
| "PUT"
303-
| "DELETE";
304269

305270
interface DependentPhoneNumberPayload extends TwilioResponsePayload {
306271
dependent_phone_numbers: DependentPhoneNumberResource[];
@@ -312,20 +277,20 @@ interface DependentPhoneNumberResource {
312277
friendly_name: string;
313278
phone_number: string;
314279
voice_url: string;
315-
voice_method: DependentPhoneNumberVoiceMethod;
316-
voice_fallback_method: DependentPhoneNumberVoiceFallbackMethod;
280+
voice_method: string;
281+
voice_fallback_method: string;
317282
voice_fallback_url: string;
318283
voice_caller_id_lookup: boolean;
319284
date_created: Date;
320285
date_updated: Date;
321-
sms_fallback_method: DependentPhoneNumberSmsFallbackMethod;
286+
sms_fallback_method: string;
322287
sms_fallback_url: string;
323-
sms_method: DependentPhoneNumberSmsMethod;
288+
sms_method: string;
324289
sms_url: string;
325290
address_requirements: DependentPhoneNumberAddressRequirement;
326291
capabilities: any;
327292
status_callback: string;
328-
status_callback_method: DependentPhoneNumberStatusCallbackMethod;
293+
status_callback_method: string;
329294
api_version: string;
330295
sms_application_sid: string;
331296
voice_application_sid: string;
@@ -393,11 +358,11 @@ export class DependentPhoneNumberInstance {
393358
/**
394359
* The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
395360
*/
396-
voiceMethod: DependentPhoneNumberVoiceMethod;
361+
voiceMethod: string;
397362
/**
398363
* The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
399364
*/
400-
voiceFallbackMethod: DependentPhoneNumberVoiceFallbackMethod;
365+
voiceFallbackMethod: string;
401366
/**
402367
* The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`.
403368
*/
@@ -417,15 +382,15 @@ export class DependentPhoneNumberInstance {
417382
/**
418383
* The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`.
419384
*/
420-
smsFallbackMethod: DependentPhoneNumberSmsFallbackMethod;
385+
smsFallbackMethod: string;
421386
/**
422387
* The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`.
423388
*/
424389
smsFallbackUrl: string;
425390
/**
426391
* The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`.
427392
*/
428-
smsMethod: DependentPhoneNumberSmsMethod;
393+
smsMethod: string;
429394
/**
430395
* The URL we call when the phone number receives an incoming SMS message.
431396
*/
@@ -442,7 +407,7 @@ export class DependentPhoneNumberInstance {
442407
/**
443408
* The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`.
444409
*/
445-
statusCallbackMethod: DependentPhoneNumberStatusCallbackMethod;
410+
statusCallbackMethod: string;
446411
/**
447412
* The API version used to start a new TwiML session.
448413
*/

src/rest/api/v2010/account/application.ts

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -349,42 +349,6 @@ export class ApplicationContextImpl implements ApplicationContext {
349349
}
350350
}
351351

352-
export type ApplicationSmsFallbackMethod =
353-
| "HEAD"
354-
| "GET"
355-
| "POST"
356-
| "PATCH"
357-
| "PUT"
358-
| "DELETE";
359-
export type ApplicationSmsMethod =
360-
| "HEAD"
361-
| "GET"
362-
| "POST"
363-
| "PATCH"
364-
| "PUT"
365-
| "DELETE";
366-
export type ApplicationStatusCallbackMethod =
367-
| "HEAD"
368-
| "GET"
369-
| "POST"
370-
| "PATCH"
371-
| "PUT"
372-
| "DELETE";
373-
export type ApplicationVoiceFallbackMethod =
374-
| "HEAD"
375-
| "GET"
376-
| "POST"
377-
| "PATCH"
378-
| "PUT"
379-
| "DELETE";
380-
export type ApplicationVoiceMethod =
381-
| "HEAD"
382-
| "GET"
383-
| "POST"
384-
| "PATCH"
385-
| "PUT"
386-
| "DELETE";
387-
388352
interface ApplicationPayload extends TwilioResponsePayload {
389353
applications: ApplicationResource[];
390354
}
@@ -397,18 +361,18 @@ interface ApplicationResource {
397361
friendly_name: string;
398362
message_status_callback: string;
399363
sid: string;
400-
sms_fallback_method: ApplicationSmsFallbackMethod;
364+
sms_fallback_method: string;
401365
sms_fallback_url: string;
402-
sms_method: ApplicationSmsMethod;
366+
sms_method: string;
403367
sms_status_callback: string;
404368
sms_url: string;
405369
status_callback: string;
406-
status_callback_method: ApplicationStatusCallbackMethod;
370+
status_callback_method: string;
407371
uri: string;
408372
voice_caller_id_lookup: boolean;
409-
voice_fallback_method: ApplicationVoiceFallbackMethod;
373+
voice_fallback_method: string;
410374
voice_fallback_url: string;
411-
voice_method: ApplicationVoiceMethod;
375+
voice_method: string;
412376
voice_url: string;
413377
public_application_connect_enabled: boolean;
414378
}
@@ -480,15 +444,15 @@ export class ApplicationInstance {
480444
/**
481445
* The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`.
482446
*/
483-
smsFallbackMethod: ApplicationSmsFallbackMethod;
447+
smsFallbackMethod: string;
484448
/**
485449
* The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`.
486450
*/
487451
smsFallbackUrl: string;
488452
/**
489453
* The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`.
490454
*/
491-
smsMethod: ApplicationSmsMethod;
455+
smsMethod: string;
492456
/**
493457
* The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.
494458
*/
@@ -504,7 +468,7 @@ export class ApplicationInstance {
504468
/**
505469
* The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`.
506470
*/
507-
statusCallbackMethod: ApplicationStatusCallbackMethod;
471+
statusCallbackMethod: string;
508472
/**
509473
* The URI of the resource, relative to `https://api.twilio.com`.
510474
*/
@@ -516,15 +480,15 @@ export class ApplicationInstance {
516480
/**
517481
* The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
518482
*/
519-
voiceFallbackMethod: ApplicationVoiceFallbackMethod;
483+
voiceFallbackMethod: string;
520484
/**
521485
* The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`.
522486
*/
523487
voiceFallbackUrl: string;
524488
/**
525489
* The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
526490
*/
527-
voiceMethod: ApplicationVoiceMethod;
491+
voiceMethod: string;
528492
/**
529493
* The URL we call when the phone number assigned to this application receives a call.
530494
*/

src/rest/api/v2010/account/call/feedback.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const deserialize = require("../../../../../base/deserialize");
1818
const serialize = require("../../../../../base/serialize");
1919
import { isValidPathParam } from "../../../../../base/utility";
2020

21-
export type CallFeedbackIssues =
21+
export type FeedbackIssues =
2222
| "audio-latency"
2323
| "digits-not-captured"
2424
| "dropped-call"
@@ -35,7 +35,7 @@ export interface FeedbackContextUpdateOptions {
3535
/** The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. */
3636
qualityScore?: number;
3737
/** One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. */
38-
issue?: Array<CallFeedbackIssues>;
38+
issue?: Array<FeedbackIssues>;
3939
}
4040

4141
export interface FeedbackContext {
@@ -147,10 +147,7 @@ export class FeedbackContextImpl implements FeedbackContext {
147147
if (params["qualityScore"] !== undefined)
148148
data["QualityScore"] = params["qualityScore"];
149149
if (params["issue"] !== undefined)
150-
data["Issue"] = serialize.map(
151-
params["issue"],
152-
(e: CallFeedbackIssues) => e
153-
);
150+
data["Issue"] = serialize.map(params["issue"], (e: FeedbackIssues) => e);
154151

155152
const headers: any = {};
156153
headers["Content-Type"] = "application/x-www-form-urlencoded";
@@ -201,7 +198,7 @@ interface FeedbackResource {
201198
account_sid: string;
202199
date_created: Date;
203200
date_updated: Date;
204-
issues: Array<CallFeedbackIssues>;
201+
issues: Array<FeedbackIssues>;
205202
quality_score: number;
206203
sid: string;
207204
}
@@ -241,7 +238,7 @@ export class FeedbackInstance {
241238
/**
242239
* A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.
243240
*/
244-
issues: Array<CallFeedbackIssues>;
241+
issues: Array<FeedbackIssues>;
245242
/**
246243
* `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call.
247244
*/

src/rest/api/v2010/account/call/feedbackSummary.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const deserialize = require("../../../../../base/deserialize");
1818
const serialize = require("../../../../../base/serialize");
1919
import { isValidPathParam } from "../../../../../base/utility";
2020

21-
export type CallFeedbackSummaryStatus =
21+
export type FeedbackSummaryStatus =
2222
| "queued"
2323
| "in-progress"
2424
| "completed"
@@ -166,7 +166,7 @@ interface FeedbackSummaryResource {
166166
quality_score_standard_deviation: number;
167167
sid: string;
168168
start_date: Date;
169-
status: CallFeedbackSummaryStatus;
169+
status: FeedbackSummaryStatus;
170170
}
171171

172172
export class FeedbackSummaryInstance {
@@ -250,7 +250,7 @@ export class FeedbackSummaryInstance {
250250
* The first date for which feedback entries are included in this feedback summary, formatted as `YYYY-MM-DD` and specified in UTC.
251251
*/
252252
startDate: Date;
253-
status: CallFeedbackSummaryStatus;
253+
status: FeedbackSummaryStatus;
254254

255255
private get _proxy(): FeedbackSummaryContext {
256256
this._context =

src/rest/api/v2010/account/call/notification.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,6 @@ export class NotificationContextImpl implements NotificationContext {
173173
}
174174
}
175175

176-
export type NotificationRequestMethod =
177-
| "HEAD"
178-
| "GET"
179-
| "POST"
180-
| "PATCH"
181-
| "PUT"
182-
| "DELETE";
183-
184176
interface NotificationPayload extends TwilioResponsePayload {
185177
notifications: NotificationResource[];
186178
}
@@ -196,7 +188,7 @@ interface NotificationResource {
196188
message_date: Date;
197189
message_text: string;
198190
more_info: string;
199-
request_method: NotificationRequestMethod;
191+
request_method: string;
200192
request_url: string;
201193
request_variables: string;
202194
response_body: string;
@@ -280,7 +272,7 @@ export class NotificationInstance {
280272
/**
281273
* The HTTP method used to generate the notification. If the notification was generated during a phone call, this is the HTTP Method used to request the resource on your server. If the notification was generated by your use of our REST API, this is the HTTP method used to call the resource on our servers.
282274
*/
283-
requestMethod: NotificationRequestMethod;
275+
requestMethod: string;
284276
/**
285277
* The URL of the resource that generated the notification. If the notification was generated during a phone call, this is the URL of the resource on your server that caused the notification. If the notification was generated by your use of our REST API, this is the URL of the resource you called.
286278
*/

src/rest/api/v2010/account/call/payment.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ const deserialize = require("../../../../../base/deserialize");
1818
const serialize = require("../../../../../base/serialize");
1919
import { isValidPathParam } from "../../../../../base/utility";
2020

21-
export type PaymentsBankAccountType =
21+
export type PaymentBankAccountType =
2222
| "consumer-checking"
2323
| "consumer-savings"
2424
| "commercial-checking";
2525

26-
export type PaymentsCapture =
26+
export type PaymentCapture =
2727
| "payment-card-number"
2828
| "expiration-date"
2929
| "security-code"
3030
| "postal-code"
3131
| "bank-routing-number"
3232
| "bank-account-number";
3333

34-
export type PaymentsPaymentMethod = "credit-card" | "ach-debit";
34+
export type PaymentPaymentMethod = "credit-card" | "ach-debit";
3535

36-
export type PaymentsStatus = "complete" | "cancel";
36+
export type PaymentStatus = "complete" | "cancel";
3737

38-
export type PaymentsTokenType = "one-time" | "reusable";
38+
export type PaymentTokenType = "one-time" | "reusable";
3939

4040
/**
4141
* Options to pass to update a PaymentInstance
@@ -46,9 +46,9 @@ export interface PaymentContextUpdateOptions {
4646
/** Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. */
4747
statusCallback: string;
4848
/** */
49-
capture?: PaymentsCapture;
49+
capture?: PaymentCapture;
5050
/** */
51-
status?: PaymentsStatus;
51+
status?: PaymentStatus;
5252
}
5353

5454
/**
@@ -60,7 +60,7 @@ export interface PaymentListInstanceCreateOptions {
6060
/** Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) */
6161
statusCallback: string;
6262
/** */
63-
bankAccountType?: PaymentsBankAccountType;
63+
bankAccountType?: PaymentBankAccountType;
6464
/** A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. */
6565
chargeAmount?: number;
6666
/** The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. */
@@ -76,15 +76,15 @@ export interface PaymentListInstanceCreateOptions {
7676
/** This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. */
7777
paymentConnector?: string;
7878
/** */
79-
paymentMethod?: PaymentsPaymentMethod;
79+
paymentMethod?: PaymentPaymentMethod;
8080
/** Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. */
8181
postalCode?: boolean;
8282
/** Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. */
8383
securityCode?: boolean;
8484
/** The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. */
8585
timeout?: number;
8686
/** */
87-
tokenType?: PaymentsTokenType;
87+
tokenType?: PaymentTokenType;
8888
/** Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` */
8989
validCardTypes?: string;
9090
}

0 commit comments

Comments
 (0)