Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct the enum names #921

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 10 additions & 45 deletions src/rest/api/v2010/account/address/dependentPhoneNumber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,41 +266,6 @@ export function DependentPhoneNumberListInstance(

return instance;
}
export type DependentPhoneNumberVoiceMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type DependentPhoneNumberVoiceFallbackMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type DependentPhoneNumberSmsFallbackMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type DependentPhoneNumberSmsMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type DependentPhoneNumberStatusCallbackMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";

interface DependentPhoneNumberPayload extends TwilioResponsePayload {
dependent_phone_numbers: DependentPhoneNumberResource[];
Expand All @@ -312,20 +277,20 @@ interface DependentPhoneNumberResource {
friendly_name: string;
phone_number: string;
voice_url: string;
voice_method: DependentPhoneNumberVoiceMethod;
voice_fallback_method: DependentPhoneNumberVoiceFallbackMethod;
voice_method: string;
voice_fallback_method: string;
voice_fallback_url: string;
voice_caller_id_lookup: boolean;
date_created: Date;
date_updated: Date;
sms_fallback_method: DependentPhoneNumberSmsFallbackMethod;
sms_fallback_method: string;
sms_fallback_url: string;
sms_method: DependentPhoneNumberSmsMethod;
sms_method: string;
sms_url: string;
address_requirements: DependentPhoneNumberAddressRequirement;
capabilities: any;
status_callback: string;
status_callback_method: DependentPhoneNumberStatusCallbackMethod;
status_callback_method: string;
api_version: string;
sms_application_sid: string;
voice_application_sid: string;
Expand Down Expand Up @@ -393,11 +358,11 @@ export class DependentPhoneNumberInstance {
/**
* The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
*/
voiceMethod: DependentPhoneNumberVoiceMethod;
voiceMethod: string;
/**
* The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
*/
voiceFallbackMethod: DependentPhoneNumberVoiceFallbackMethod;
voiceFallbackMethod: string;
/**
* The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`.
*/
Expand All @@ -417,15 +382,15 @@ export class DependentPhoneNumberInstance {
/**
* The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`.
*/
smsFallbackMethod: DependentPhoneNumberSmsFallbackMethod;
smsFallbackMethod: string;
/**
* The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`.
*/
smsFallbackUrl: string;
/**
* The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`.
*/
smsMethod: DependentPhoneNumberSmsMethod;
smsMethod: string;
/**
* The URL we call when the phone number receives an incoming SMS message.
*/
Expand All @@ -442,7 +407,7 @@ export class DependentPhoneNumberInstance {
/**
* The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`.
*/
statusCallbackMethod: DependentPhoneNumberStatusCallbackMethod;
statusCallbackMethod: string;
/**
* The API version used to start a new TwiML session.
*/
Expand Down
56 changes: 10 additions & 46 deletions src/rest/api/v2010/account/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,42 +349,6 @@ export class ApplicationContextImpl implements ApplicationContext {
}
}

export type ApplicationSmsFallbackMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type ApplicationSmsMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type ApplicationStatusCallbackMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type ApplicationVoiceFallbackMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";
export type ApplicationVoiceMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";

interface ApplicationPayload extends TwilioResponsePayload {
applications: ApplicationResource[];
}
Expand All @@ -397,18 +361,18 @@ interface ApplicationResource {
friendly_name: string;
message_status_callback: string;
sid: string;
sms_fallback_method: ApplicationSmsFallbackMethod;
sms_fallback_method: string;
sms_fallback_url: string;
sms_method: ApplicationSmsMethod;
sms_method: string;
sms_status_callback: string;
sms_url: string;
status_callback: string;
status_callback_method: ApplicationStatusCallbackMethod;
status_callback_method: string;
uri: string;
voice_caller_id_lookup: boolean;
voice_fallback_method: ApplicationVoiceFallbackMethod;
voice_fallback_method: string;
voice_fallback_url: string;
voice_method: ApplicationVoiceMethod;
voice_method: string;
voice_url: string;
public_application_connect_enabled: boolean;
}
Expand Down Expand Up @@ -480,15 +444,15 @@ export class ApplicationInstance {
/**
* The HTTP method we use to call `sms_fallback_url`. Can be: `GET` or `POST`.
*/
smsFallbackMethod: ApplicationSmsFallbackMethod;
smsFallbackMethod: string;
/**
* The URL that we call when an error occurs while retrieving or executing the TwiML from `sms_url`.
*/
smsFallbackUrl: string;
/**
* The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`.
*/
smsMethod: ApplicationSmsMethod;
smsMethod: string;
/**
* The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.
*/
Expand All @@ -504,7 +468,7 @@ export class ApplicationInstance {
/**
* The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`.
*/
statusCallbackMethod: ApplicationStatusCallbackMethod;
statusCallbackMethod: string;
/**
* The URI of the resource, relative to `https://api.twilio.com`.
*/
Expand All @@ -516,15 +480,15 @@ export class ApplicationInstance {
/**
* The HTTP method we use to call `voice_fallback_url`. Can be: `GET` or `POST`.
*/
voiceFallbackMethod: ApplicationVoiceFallbackMethod;
voiceFallbackMethod: string;
/**
* The URL that we call when an error occurs retrieving or executing the TwiML requested by `url`.
*/
voiceFallbackUrl: string;
/**
* The HTTP method we use to call `voice_url`. Can be: `GET` or `POST`.
*/
voiceMethod: ApplicationVoiceMethod;
voiceMethod: string;
/**
* The URL we call when the phone number assigned to this application receives a call.
*/
Expand Down
13 changes: 5 additions & 8 deletions src/rest/api/v2010/account/call/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const deserialize = require("../../../../../base/deserialize");
const serialize = require("../../../../../base/serialize");
import { isValidPathParam } from "../../../../../base/utility";

export type CallFeedbackIssues =
export type FeedbackIssues =
| "audio-latency"
| "digits-not-captured"
| "dropped-call"
Expand All @@ -35,7 +35,7 @@ export interface FeedbackContextUpdateOptions {
/** The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. */
qualityScore?: number;
/** 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`. */
issue?: Array<CallFeedbackIssues>;
issue?: Array<FeedbackIssues>;
}

export interface FeedbackContext {
Expand Down Expand Up @@ -147,10 +147,7 @@ export class FeedbackContextImpl implements FeedbackContext {
if (params["qualityScore"] !== undefined)
data["QualityScore"] = params["qualityScore"];
if (params["issue"] !== undefined)
data["Issue"] = serialize.map(
params["issue"],
(e: CallFeedbackIssues) => e
);
data["Issue"] = serialize.map(params["issue"], (e: FeedbackIssues) => e);

const headers: any = {};
headers["Content-Type"] = "application/x-www-form-urlencoded";
Expand Down Expand Up @@ -201,7 +198,7 @@ interface FeedbackResource {
account_sid: string;
date_created: Date;
date_updated: Date;
issues: Array<CallFeedbackIssues>;
issues: Array<FeedbackIssues>;
quality_score: number;
sid: string;
}
Expand Down Expand Up @@ -241,7 +238,7 @@ export class FeedbackInstance {
/**
* 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`.
*/
issues: Array<CallFeedbackIssues>;
issues: Array<FeedbackIssues>;
/**
* `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/rest/api/v2010/account/call/feedbackSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const deserialize = require("../../../../../base/deserialize");
const serialize = require("../../../../../base/serialize");
import { isValidPathParam } from "../../../../../base/utility";

export type CallFeedbackSummaryStatus =
export type FeedbackSummaryStatus =
| "queued"
| "in-progress"
| "completed"
Expand Down Expand Up @@ -166,7 +166,7 @@ interface FeedbackSummaryResource {
quality_score_standard_deviation: number;
sid: string;
start_date: Date;
status: CallFeedbackSummaryStatus;
status: FeedbackSummaryStatus;
}

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

private get _proxy(): FeedbackSummaryContext {
this._context =
Expand Down
12 changes: 2 additions & 10 deletions src/rest/api/v2010/account/call/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,6 @@ export class NotificationContextImpl implements NotificationContext {
}
}

export type NotificationRequestMethod =
| "HEAD"
| "GET"
| "POST"
| "PATCH"
| "PUT"
| "DELETE";

interface NotificationPayload extends TwilioResponsePayload {
notifications: NotificationResource[];
}
Expand All @@ -196,7 +188,7 @@ interface NotificationResource {
message_date: Date;
message_text: string;
more_info: string;
request_method: NotificationRequestMethod;
request_method: string;
request_url: string;
request_variables: string;
response_body: string;
Expand Down Expand Up @@ -280,7 +272,7 @@ export class NotificationInstance {
/**
* 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.
*/
requestMethod: NotificationRequestMethod;
requestMethod: string;
/**
* 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.
*/
Expand Down
20 changes: 10 additions & 10 deletions src/rest/api/v2010/account/call/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ const deserialize = require("../../../../../base/deserialize");
const serialize = require("../../../../../base/serialize");
import { isValidPathParam } from "../../../../../base/utility";

export type PaymentsBankAccountType =
export type PaymentBankAccountType =
| "consumer-checking"
| "consumer-savings"
| "commercial-checking";

export type PaymentsCapture =
export type PaymentCapture =
| "payment-card-number"
| "expiration-date"
| "security-code"
| "postal-code"
| "bank-routing-number"
| "bank-account-number";

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

export type PaymentsStatus = "complete" | "cancel";
export type PaymentStatus = "complete" | "cancel";

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

/**
* Options to pass to update a PaymentInstance
Expand All @@ -46,9 +46,9 @@ export interface PaymentContextUpdateOptions {
/** 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. */
statusCallback: string;
/** */
capture?: PaymentsCapture;
capture?: PaymentCapture;
/** */
status?: PaymentsStatus;
status?: PaymentStatus;
}

/**
Expand All @@ -60,7 +60,7 @@ export interface PaymentListInstanceCreateOptions {
/** 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) */
statusCallback: string;
/** */
bankAccountType?: PaymentsBankAccountType;
bankAccountType?: PaymentBankAccountType;
/** 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. */
chargeAmount?: number;
/** 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. */
Expand All @@ -76,15 +76,15 @@ export interface PaymentListInstanceCreateOptions {
/** 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`. */
paymentConnector?: string;
/** */
paymentMethod?: PaymentsPaymentMethod;
paymentMethod?: PaymentPaymentMethod;
/** 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`. */
postalCode?: boolean;
/** 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`. */
securityCode?: boolean;
/** 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`. */
timeout?: number;
/** */
tokenType?: PaymentsTokenType;
tokenType?: PaymentTokenType;
/** Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` */
validCardTypes?: string;
}
Expand Down
Loading