diff --git a/CHANGES.md b/CHANGES.md index 5b2f38632..9d96f614b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ twilio-node changelog ===================== +[2025-01-13] Version 5.4.2 +-------------------------- +**Messaging** +- Adds validity period Default value in service resource documentation + + [2025-01-09] Version 5.4.1 -------------------------- **Numbers** diff --git a/src/rest/api/v2010/account/call/transcription.ts b/src/rest/api/v2010/account/call/transcription.ts index 0ae47ae19..dba55357d 100644 --- a/src/rest/api/v2010/account/call/transcription.ts +++ b/src/rest/api/v2010/account/call/transcription.ts @@ -65,7 +65,7 @@ export interface TranscriptionListInstanceCreateOptions { hints?: string; /** The provider will add punctuation to recognition result */ enableAutomaticPunctuation?: boolean; - /** The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. */ + /** The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . */ intelligenceService?: string; } diff --git a/src/rest/conversations/v1/configuration/webhook.ts b/src/rest/conversations/v1/configuration/webhook.ts index c87737cc9..b3b295e8d 100644 --- a/src/rest/conversations/v1/configuration/webhook.ts +++ b/src/rest/conversations/v1/configuration/webhook.ts @@ -28,7 +28,7 @@ export type WebhookTarget = "webhook" | "flex"; export interface WebhookContextUpdateOptions { /** The HTTP method to be used when sending a webhook request. */ method?: string; - /** The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` */ + /** The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` */ filters?: Array; /** The absolute url the pre-event webhook request should be sent to. */ preWebhookUrl?: string; @@ -212,7 +212,7 @@ export class WebhookInstance { accountSid: string; method: WebhookMethod; /** - * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` */ filters: Array; /** diff --git a/src/rest/iam/V1.ts b/src/rest/iam/V1.ts index 30b75755c..28484249f 100644 --- a/src/rest/iam/V1.ts +++ b/src/rest/iam/V1.ts @@ -16,7 +16,7 @@ import IamBase from "../IamBase"; import Version from "../../base/Version"; import { ApiKeyListInstance } from "./v1/apiKey"; import { GetApiKeysListInstance } from "./v1/getApiKeys"; -import { NewApiKeyListInstance } from "./v1/newApiKey"; +import { KeyListInstance } from "./v1/key"; export default class V1 extends Version { /** @@ -32,8 +32,8 @@ export default class V1 extends Version { protected _apiKey?: ApiKeyListInstance; /** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */ protected _getApiKeys?: GetApiKeysListInstance; - /** newApiKey - { Twilio.Iam.V1.NewApiKeyListInstance } resource */ - protected _newApiKey?: NewApiKeyListInstance; + /** keys - { Twilio.Iam.V1.KeyListInstance } resource */ + protected _keys?: KeyListInstance; /** Getter for apiKey resource */ get apiKey(): ApiKeyListInstance { @@ -47,9 +47,9 @@ export default class V1 extends Version { return this._getApiKeys; } - /** Getter for newApiKey resource */ - get newApiKey(): NewApiKeyListInstance { - this._newApiKey = this._newApiKey || NewApiKeyListInstance(this); - return this._newApiKey; + /** Getter for keys resource */ + get keys(): KeyListInstance { + this._keys = this._keys || KeyListInstance(this); + return this._keys; } } diff --git a/src/rest/iam/v1/newApiKey.ts b/src/rest/iam/v1/key.ts similarity index 82% rename from src/rest/iam/v1/newApiKey.ts rename to src/rest/iam/v1/key.ts index ab2a5f6e8..36a8f4faa 100644 --- a/src/rest/iam/v1/newApiKey.ts +++ b/src/rest/iam/v1/key.ts @@ -18,41 +18,41 @@ const deserialize = require("../../../base/deserialize"); const serialize = require("../../../base/serialize"); import { isValidPathParam } from "../../../base/utility"; -export type NewApiKeyKeytype = "restricted"; +export type KeyKeytype = "restricted"; /** - * Options to pass to create a NewApiKeyInstance + * Options to pass to create a KeyInstance */ -export interface NewApiKeyListInstanceCreateOptions { +export interface KeyListInstanceCreateOptions { /** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */ accountSid: string; /** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ friendlyName?: string; /** */ - keyType?: NewApiKeyKeytype; + keyType?: KeyKeytype; /** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */ policy?: any; } -export interface NewApiKeySolution {} +export interface KeySolution {} -export interface NewApiKeyListInstance { +export interface KeyListInstance { _version: V1; - _solution: NewApiKeySolution; + _solution: KeySolution; _uri: string; /** - * Create a NewApiKeyInstance + * Create a KeyInstance * * @param params - Parameter for request * @param callback - Callback to handle processed record * - * @returns Resolves to processed NewApiKeyInstance + * @returns Resolves to processed KeyInstance */ create( - params: NewApiKeyListInstanceCreateOptions, - callback?: (error: Error | null, item?: NewApiKeyInstance) => any - ): Promise; + params: KeyListInstanceCreateOptions, + callback?: (error: Error | null, item?: KeyInstance) => any + ): Promise; /** * Provide a user-friendly representation @@ -61,17 +61,17 @@ export interface NewApiKeyListInstance { [inspect.custom](_depth: any, options: InspectOptions): any; } -export function NewApiKeyListInstance(version: V1): NewApiKeyListInstance { - const instance = {} as NewApiKeyListInstance; +export function KeyListInstance(version: V1): KeyListInstance { + const instance = {} as KeyListInstance; instance._version = version; instance._solution = {}; instance._uri = `/Keys`; instance.create = function create( - params: NewApiKeyListInstanceCreateOptions, - callback?: (error: Error | null, items: NewApiKeyInstance) => any - ): Promise { + params: KeyListInstanceCreateOptions, + callback?: (error: Error | null, items: KeyInstance) => any + ): Promise { if (params === null || params === undefined) { throw new Error('Required parameter "params" missing.'); } @@ -102,7 +102,7 @@ export function NewApiKeyListInstance(version: V1): NewApiKeyListInstance { }); operationPromise = operationPromise.then( - (payload) => new NewApiKeyInstance(operationVersion, payload) + (payload) => new KeyInstance(operationVersion, payload) ); operationPromise = instance._version.setPromiseCallback( @@ -126,9 +126,9 @@ export function NewApiKeyListInstance(version: V1): NewApiKeyListInstance { return instance; } -interface NewApiKeyPayload extends NewApiKeyResource {} +interface KeyPayload extends KeyResource {} -interface NewApiKeyResource { +interface KeyResource { sid: string; friendly_name: string; date_created: Date; @@ -137,8 +137,8 @@ interface NewApiKeyResource { policy: any; } -export class NewApiKeyInstance { - constructor(protected _version: V1, payload: NewApiKeyResource) { +export class KeyInstance { + constructor(protected _version: V1, payload: KeyResource) { this.sid = payload.sid; this.friendlyName = payload.friendly_name; this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); diff --git a/src/rest/marketplace/V1.ts b/src/rest/marketplace/V1.ts index c22d31863..8a5552f3c 100644 --- a/src/rest/marketplace/V1.ts +++ b/src/rest/marketplace/V1.ts @@ -16,6 +16,7 @@ import MarketplaceBase from "../MarketplaceBase"; import Version from "../../base/Version"; import { AvailableAddOnListInstance } from "./v1/availableAddOn"; import { InstalledAddOnListInstance } from "./v1/installedAddOn"; +import { ModuleDataListInstance } from "./v1/moduleData"; import { ModuleDataManagementListInstance } from "./v1/moduleDataManagement"; import { ReferralConversionListInstance } from "./v1/referralConversion"; @@ -33,6 +34,8 @@ export default class V1 extends Version { protected _availableAddOns?: AvailableAddOnListInstance; /** installedAddOns - { Twilio.Marketplace.V1.InstalledAddOnListInstance } resource */ protected _installedAddOns?: InstalledAddOnListInstance; + /** moduleData - { Twilio.Marketplace.V1.ModuleDataListInstance } resource */ + protected _moduleData?: ModuleDataListInstance; /** moduleDataManagement - { Twilio.Marketplace.V1.ModuleDataManagementListInstance } resource */ protected _moduleDataManagement?: ModuleDataManagementListInstance; /** referralConversion - { Twilio.Marketplace.V1.ReferralConversionListInstance } resource */ @@ -52,6 +55,12 @@ export default class V1 extends Version { return this._installedAddOns; } + /** Getter for moduleData resource */ + get moduleData(): ModuleDataListInstance { + this._moduleData = this._moduleData || ModuleDataListInstance(this); + return this._moduleData; + } + /** Getter for moduleDataManagement resource */ get moduleDataManagement(): ModuleDataManagementListInstance { this._moduleDataManagement = diff --git a/src/rest/marketplace/v1/availableAddOn.ts b/src/rest/marketplace/v1/availableAddOn.ts index 240f8486a..f6eebe296 100644 --- a/src/rest/marketplace/v1/availableAddOn.ts +++ b/src/rest/marketplace/v1/availableAddOn.ts @@ -160,7 +160,7 @@ interface AvailableAddOnResource { friendly_name: string; description: string; pricing_type: string; - configuration_schema: any; + configuration_schema: Record; url: string; links: Record; } @@ -204,7 +204,7 @@ export class AvailableAddOnInstance { /** * The JSON object with the configuration that must be provided when installing a given Add-on. */ - configurationSchema: any; + configurationSchema: Record; /** * The absolute URL of the resource. */ diff --git a/src/rest/marketplace/v1/installedAddOn.ts b/src/rest/marketplace/v1/installedAddOn.ts index f41048caf..63e9738be 100644 --- a/src/rest/marketplace/v1/installedAddOn.ts +++ b/src/rest/marketplace/v1/installedAddOn.ts @@ -296,7 +296,7 @@ interface InstalledAddOnResource { account_sid: string; friendly_name: string; description: string; - configuration: any; + configuration: Record; unique_name: string; date_created: Date; date_updated: Date; @@ -346,7 +346,7 @@ export class InstalledAddOnInstance { /** * The JSON object that represents the current configuration of installed Add-on. */ - configuration: any; + configuration: Record; /** * An application-defined string that uniquely identifies the resource. */ diff --git a/src/rest/marketplace/v1/moduleData.ts b/src/rest/marketplace/v1/moduleData.ts new file mode 100644 index 000000000..60cb8d7e1 --- /dev/null +++ b/src/rest/marketplace/v1/moduleData.ts @@ -0,0 +1,260 @@ +/* + * This code was generated by + * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + * + * Twilio - Marketplace + * This is the public Twilio REST API. + * + * NOTE: This class is auto generated by OpenAPI Generator. + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { inspect, InspectOptions } from "util"; +import V1 from "../V1"; +const deserialize = require("../../../base/deserialize"); +const serialize = require("../../../base/serialize"); +import { isValidPathParam } from "../../../base/utility"; + +/** + * Options to pass to create a ModuleDataInstance + */ +export interface ModuleDataListInstanceCreateOptions { + /** A JSON object containing essential attributes that define a Listing. */ + moduleInfo?: string; + /** A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. */ + configuration?: string; +} + +export interface ModuleDataSolution {} + +export interface ModuleDataListInstance { + _version: V1; + _solution: ModuleDataSolution; + _uri: string; + + /** + * Create a ModuleDataInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ModuleDataInstance + */ + create( + callback?: (error: Error | null, item?: ModuleDataInstance) => any + ): Promise; + /** + * Create a ModuleDataInstance + * + * @param params - Parameter for request + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ModuleDataInstance + */ + create( + params: ModuleDataListInstanceCreateOptions, + callback?: (error: Error | null, item?: ModuleDataInstance) => any + ): Promise; + + /** + * Fetch a ModuleDataInstance + * + * @param callback - Callback to handle processed record + * + * @returns Resolves to processed ModuleDataInstance + */ + fetch( + callback?: (error: Error | null, item?: ModuleDataInstance) => any + ): Promise; + + /** + * Provide a user-friendly representation + */ + toJSON(): any; + [inspect.custom](_depth: any, options: InspectOptions): any; +} + +export function ModuleDataListInstance(version: V1): ModuleDataListInstance { + const instance = {} as ModuleDataListInstance; + + instance._version = version; + instance._solution = {}; + instance._uri = `/Listings`; + + instance.create = function create( + params?: + | ModuleDataListInstanceCreateOptions + | ((error: Error | null, items: ModuleDataInstance) => any), + callback?: (error: Error | null, items: ModuleDataInstance) => any + ): Promise { + if (params instanceof Function) { + callback = params; + params = {}; + } else { + params = params || {}; + } + + let data: any = {}; + + if (params["moduleInfo"] !== undefined) + data["ModuleInfo"] = params["moduleInfo"]; + if (params["configuration"] !== undefined) + data["Configuration"] = params["configuration"]; + + const headers: any = {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; + headers["Accept"] = "application/json"; + + let operationVersion = version, + operationPromise = operationVersion.create({ + uri: instance._uri, + method: "post", + data, + headers, + }); + + operationPromise = operationPromise.then( + (payload) => new ModuleDataInstance(operationVersion, payload) + ); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + }; + + instance.fetch = function fetch( + callback?: (error: Error | null, items: ModuleDataInstance) => any + ): Promise { + const headers: any = {}; + headers["Accept"] = "application/json"; + + let operationVersion = version, + operationPromise = operationVersion.fetch({ + uri: instance._uri, + method: "get", + headers, + }); + + operationPromise = operationPromise.then( + (payload) => new ModuleDataInstance(operationVersion, payload) + ); + + operationPromise = instance._version.setPromiseCallback( + operationPromise, + callback + ); + return operationPromise; + }; + + instance.toJSON = function toJSON() { + return instance._solution; + }; + + instance[inspect.custom] = function inspectImpl( + _depth: any, + options: InspectOptions + ) { + return inspect(instance.toJSON(), options); + }; + + return instance; +} + +interface ModuleDataPayload extends ModuleDataResource {} + +interface ModuleDataResource { + url: string; + sid: string; + description: Record; + support: Record; + policies: Record; + module_info: Record; + documentation: Record; + configuration: Record; + pricing: Record; + listings: Array>; +} + +export class ModuleDataInstance { + constructor(protected _version: V1, payload: ModuleDataResource) { + this.url = payload.url; + this.sid = payload.sid; + this.description = payload.description; + this.support = payload.support; + this.policies = payload.policies; + this.moduleInfo = payload.module_info; + this.documentation = payload.documentation; + this.configuration = payload.configuration; + this.pricing = payload.pricing; + this.listings = payload.listings; + } + + /** + * URL to query the subresource. + */ + url: string; + /** + * ModuleSid that identifies this Listing. + */ + sid: string; + /** + * A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers + */ + description: Record; + /** + * A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description. + */ + support: Record; + /** + * A JSON object describing the module\'s privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB + */ + policies: Record; + /** + * A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object + */ + moduleInfo: Record; + /** + * A JSON object for providing comprehensive information, instructions, and resources related to the module + */ + documentation: Record; + /** + * A JSON object for providing listing specific configuration. Contains button setup, notification url, among others. + */ + configuration: Record; + /** + * A JSON object for providing Listing specific pricing information. + */ + pricing: Record; + /** + * + */ + listings: Array>; + + /** + * Provide a user-friendly representation + * + * @returns Object + */ + toJSON() { + return { + url: this.url, + sid: this.sid, + description: this.description, + support: this.support, + policies: this.policies, + moduleInfo: this.moduleInfo, + documentation: this.documentation, + configuration: this.configuration, + pricing: this.pricing, + listings: this.listings, + }; + } + + [inspect.custom](_depth: any, options: InspectOptions) { + return inspect(this.toJSON(), options); + } +} diff --git a/src/rest/marketplace/v1/moduleDataManagement.ts b/src/rest/marketplace/v1/moduleDataManagement.ts index 15c7642b8..df74c7fb0 100644 --- a/src/rest/marketplace/v1/moduleDataManagement.ts +++ b/src/rest/marketplace/v1/moduleDataManagement.ts @@ -204,13 +204,14 @@ interface ModuleDataManagementPayload extends ModuleDataManagementResource {} interface ModuleDataManagementResource { url: string; sid: string; - description: any; - support: any; - policies: any; - module_info: any; - documentation: any; - configuration: any; - pricing: any; + description: Record; + support: Record; + policies: Record; + module_info: Record; + documentation: Record; + configuration: Record; + pricing: Record; + listings: Array>; } export class ModuleDataManagementInstance { @@ -231,6 +232,7 @@ export class ModuleDataManagementInstance { this.documentation = payload.documentation; this.configuration = payload.configuration; this.pricing = payload.pricing; + this.listings = payload.listings; this._solution = { sid: sid || this.sid }; } @@ -246,31 +248,35 @@ export class ModuleDataManagementInstance { /** * A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers */ - description: any; + description: Record; /** * A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description. */ - support: any; + support: Record; /** * A JSON object describing the module\'s privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB */ - policies: any; + policies: Record; /** * A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object */ - moduleInfo: any; + moduleInfo: Record; /** * A JSON object for providing comprehensive information, instructions, and resources related to the module */ - documentation: any; + documentation: Record; /** * A JSON object for providing listing specific configuration. Contains button setup, notification url, among others. */ - configuration: any; + configuration: Record; /** * A JSON object for providing Listing specific pricing information. */ - pricing: any; + pricing: Record; + /** + * + */ + listings: Array>; private get _proxy(): ModuleDataManagementContext { this._context = @@ -338,6 +344,7 @@ export class ModuleDataManagementInstance { documentation: this.documentation, configuration: this.configuration, pricing: this.pricing, + listings: this.listings, }; } diff --git a/src/rest/messaging/v1/service.ts b/src/rest/messaging/v1/service.ts index db1066e19..66c69c34a 100644 --- a/src/rest/messaging/v1/service.ts +++ b/src/rest/messaging/v1/service.ts @@ -56,7 +56,7 @@ export interface ServiceContextUpdateOptions { fallbackToLongCode?: boolean; /** Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. */ areaCodeGeomatch?: boolean; - /** How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. */ + /** How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. */ validityPeriod?: number; /** Reserved. */ synchronousValidation?: boolean; @@ -94,7 +94,7 @@ export interface ServiceListInstanceCreateOptions { fallbackToLongCode?: boolean; /** Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. */ areaCodeGeomatch?: boolean; - /** How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. */ + /** How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. */ validityPeriod?: number; /** Reserved. */ synchronousValidation?: boolean; @@ -529,7 +529,7 @@ export class ServiceInstance { */ synchronousValidation: boolean; /** - * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. */ validityPeriod: number; /** diff --git a/src/rest/numbers/V1.ts b/src/rest/numbers/V1.ts index af82776f7..148a24ce4 100644 --- a/src/rest/numbers/V1.ts +++ b/src/rest/numbers/V1.ts @@ -21,8 +21,8 @@ import { PortingPortInPhoneNumberListInstance } from "./v1/portingPortInPhoneNum import { PortingPortabilityListInstance } from "./v1/portingPortability"; import { PortingWebhookConfigurationListInstance } from "./v1/portingWebhookConfiguration"; import { PortingWebhookConfigurationDeleteListInstance } from "./v1/portingWebhookConfigurationDelete"; -import { PortingWebhookConfigurationFetchListInstance } from "./v1/portingWebhookConfigurationFetch"; import { SigningRequestConfigurationListInstance } from "./v1/signingRequestConfiguration"; +import { WebhookListInstance } from "./v1/webhook"; export default class V1 extends Version { /** @@ -48,10 +48,10 @@ export default class V1 extends Version { protected _portingWebhookConfigurations?: PortingWebhookConfigurationListInstance; /** portingWebhookConfigurationsDelete - { Twilio.Numbers.V1.PortingWebhookConfigurationDeleteListInstance } resource */ protected _portingWebhookConfigurationsDelete?: PortingWebhookConfigurationDeleteListInstance; - /** portingWebhookConfigurationFetch - { Twilio.Numbers.V1.PortingWebhookConfigurationFetchListInstance } resource */ - protected _portingWebhookConfigurationFetch?: PortingWebhookConfigurationFetchListInstance; /** signingRequestConfigurations - { Twilio.Numbers.V1.SigningRequestConfigurationListInstance } resource */ protected _signingRequestConfigurations?: SigningRequestConfigurationListInstance; + /** webhook - { Twilio.Numbers.V1.WebhookListInstance } resource */ + protected _webhook?: WebhookListInstance; /** Getter for bulkEligibilities resource */ get bulkEligibilities(): BulkEligibilityListInstance { @@ -104,14 +104,6 @@ export default class V1 extends Version { return this._portingWebhookConfigurationsDelete; } - /** Getter for portingWebhookConfigurationFetch resource */ - get portingWebhookConfigurationFetch(): PortingWebhookConfigurationFetchListInstance { - this._portingWebhookConfigurationFetch = - this._portingWebhookConfigurationFetch || - PortingWebhookConfigurationFetchListInstance(this); - return this._portingWebhookConfigurationFetch; - } - /** Getter for signingRequestConfigurations resource */ get signingRequestConfigurations(): SigningRequestConfigurationListInstance { this._signingRequestConfigurations = @@ -119,4 +111,10 @@ export default class V1 extends Version { SigningRequestConfigurationListInstance(this); return this._signingRequestConfigurations; } + + /** Getter for webhook resource */ + get webhook(): WebhookListInstance { + this._webhook = this._webhook || WebhookListInstance(this); + return this._webhook; + } } diff --git a/src/rest/numbers/v1/portingWebhookConfigurationFetch.ts b/src/rest/numbers/v1/webhook.ts similarity index 75% rename from src/rest/numbers/v1/portingWebhookConfigurationFetch.ts rename to src/rest/numbers/v1/webhook.ts index d80f674fb..f48c9294e 100644 --- a/src/rest/numbers/v1/portingWebhookConfigurationFetch.ts +++ b/src/rest/numbers/v1/webhook.ts @@ -18,26 +18,23 @@ const deserialize = require("../../../base/deserialize"); const serialize = require("../../../base/serialize"); import { isValidPathParam } from "../../../base/utility"; -export interface PortingWebhookConfigurationFetchSolution {} +export interface WebhookSolution {} -export interface PortingWebhookConfigurationFetchListInstance { +export interface WebhookListInstance { _version: V1; - _solution: PortingWebhookConfigurationFetchSolution; + _solution: WebhookSolution; _uri: string; /** - * Fetch a PortingWebhookConfigurationFetchInstance + * Fetch a WebhookInstance * * @param callback - Callback to handle processed record * - * @returns Resolves to processed PortingWebhookConfigurationFetchInstance + * @returns Resolves to processed WebhookInstance */ fetch( - callback?: ( - error: Error | null, - item?: PortingWebhookConfigurationFetchInstance - ) => any - ): Promise; + callback?: (error: Error | null, item?: WebhookInstance) => any + ): Promise; /** * Provide a user-friendly representation @@ -46,21 +43,16 @@ export interface PortingWebhookConfigurationFetchListInstance { [inspect.custom](_depth: any, options: InspectOptions): any; } -export function PortingWebhookConfigurationFetchListInstance( - version: V1 -): PortingWebhookConfigurationFetchListInstance { - const instance = {} as PortingWebhookConfigurationFetchListInstance; +export function WebhookListInstance(version: V1): WebhookListInstance { + const instance = {} as WebhookListInstance; instance._version = version; instance._solution = {}; instance._uri = `/Porting/Configuration/Webhook`; instance.fetch = function fetch( - callback?: ( - error: Error | null, - items: PortingWebhookConfigurationFetchInstance - ) => any - ): Promise { + callback?: (error: Error | null, items: WebhookInstance) => any + ): Promise { const headers: any = {}; headers["Accept"] = "application/json"; @@ -72,8 +64,7 @@ export function PortingWebhookConfigurationFetchListInstance( }); operationPromise = operationPromise.then( - (payload) => - new PortingWebhookConfigurationFetchInstance(operationVersion, payload) + (payload) => new WebhookInstance(operationVersion, payload) ); operationPromise = instance._version.setPromiseCallback( @@ -97,10 +88,9 @@ export function PortingWebhookConfigurationFetchListInstance( return instance; } -interface PortingWebhookConfigurationFetchPayload - extends PortingWebhookConfigurationFetchResource {} +interface WebhookPayload extends WebhookResource {} -interface PortingWebhookConfigurationFetchResource { +interface WebhookResource { url: string; port_in_target_url: string; port_out_target_url: string; @@ -109,11 +99,8 @@ interface PortingWebhookConfigurationFetchResource { port_out_target_date_created: Date; } -export class PortingWebhookConfigurationFetchInstance { - constructor( - protected _version: V1, - payload: PortingWebhookConfigurationFetchResource - ) { +export class WebhookInstance { + constructor(protected _version: V1, payload: WebhookResource) { this.url = payload.url; this.portInTargetUrl = payload.port_in_target_url; this.portOutTargetUrl = payload.port_out_target_url;