diff --git a/CHANGES.md b/CHANGES.md index a9cefbcddc..b10a840bb5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,24 @@ twilio-node changelog ===================== +[2018-08-23] Version 3.19.2 +---------------------------- +**Library** +- PR #372: Tests for typescript. Thanks to @ekarson! + +**Api** +- Add Proxy Active Sessions category to usage records + +**Chat** +- Add User Channel instance resource + +**Preview** +- Add `Actions` endpoints and remove `ResponseUrl` from assistants on the Understand api + +**Pricing** +- add voice_country resource (v2) + + [2018-08-09] Version 3.19.1 ---------------------------- **Preview** diff --git a/lib/rest/Preview.d.ts b/lib/rest/Preview.d.ts index 5654f5f09d..4756ed772b 100644 --- a/lib/rest/Preview.d.ts +++ b/lib/rest/Preview.d.ts @@ -11,7 +11,6 @@ import DeployedDevices = require('./preview/DeployedDevices'); import Domain = require('../base/Domain'); import HostedNumbers = require('./preview/HostedNumbers'); import Marketplace = require('./preview/Marketplace'); -import Studio = require('./preview/Studio'); import Sync = require('./preview/Sync'); import Twilio = require('./Twilio'); import Understand = require('./preview/Understand'); @@ -23,7 +22,6 @@ import { CommandListInstance } from './preview/wireless/command'; import { ExportConfigurationListInstance } from './preview/bulk_exports/exportConfiguration'; import { ExportListInstance } from './preview/bulk_exports/export'; import { FleetListInstance } from './preview/deployed_devices/fleet'; -import { FlowListInstance } from './preview/studio/flow'; import { HostedNumberOrderListInstance } from './preview/hosted_numbers/hostedNumberOrder'; import { InstalledAddOnListInstance } from './preview/marketplace/installedAddOn'; import { RatePlanListInstance } from './preview/wireless/ratePlan'; @@ -49,7 +47,6 @@ declare class Preview extends Domain { readonly exportConfiguration: ExportConfigurationListInstance; readonly exports: ExportListInstance; readonly fleets: FleetListInstance; - readonly flows: FlowListInstance; readonly hostedNumberOrders: HostedNumberOrderListInstance; readonly hosted_numbers: HostedNumbers; readonly installedAddOns: InstalledAddOnListInstance; @@ -57,7 +54,6 @@ declare class Preview extends Domain { readonly ratePlans: RatePlanListInstance; readonly services: ServiceListInstance; readonly sims: SimListInstance; - readonly studio: Studio; readonly sync: Sync; readonly understand: Understand; readonly wireless: Wireless; diff --git a/lib/rest/Pricing.d.ts b/lib/rest/Pricing.d.ts index 759fba1552..a0cfdeaa66 100644 --- a/lib/rest/Pricing.d.ts +++ b/lib/rest/Pricing.d.ts @@ -8,9 +8,10 @@ import Domain = require('../base/Domain'); import Twilio = require('./Twilio'); import V1 = require('./pricing/V1'); +import V2 = require('./pricing/V2'); import { MessagingListInstance } from './pricing/v1/messaging'; import { PhoneNumberListInstance } from './pricing/v1/phoneNumber'; -import { VoiceListInstance } from './pricing/v1/voice'; +import { VoiceListInstance } from './pricing/v2/voice'; declare class Pricing extends Domain { @@ -24,6 +25,7 @@ declare class Pricing extends Domain { readonly messaging: MessagingListInstance; readonly phoneNumbers: PhoneNumberListInstance; readonly v1: V1; + readonly v2: V2; readonly voice: VoiceListInstance; } diff --git a/lib/rest/Pricing.js b/lib/rest/Pricing.js index 1c5c581a9d..d7e6137dff 100644 --- a/lib/rest/Pricing.js +++ b/lib/rest/Pricing.js @@ -12,6 +12,7 @@ var _ = require('lodash'); /* jshint ignore:line */ var Domain = require('../base/Domain'); /* jshint ignore:line */ var V1 = require('./pricing/V1'); /* jshint ignore:line */ +var V2 = require('./pricing/V2'); /* jshint ignore:line */ /* jshint ignore:start */ @@ -21,10 +22,11 @@ var V1 = require('./pricing/V1'); /* jshint ignore:line */ * @constructor * * @property {Twilio.Pricing.V1} v1 - v1 version + * @property {Twilio.Pricing.V2} v2 - v2 version * @property {Twilio.Pricing.V1.MessagingList} messaging - messaging resource * @property {Twilio.Pricing.V1.PhoneNumberList} phoneNumbers - * phoneNumbers resource - * @property {Twilio.Pricing.V1.VoiceList} voice - voice resource + * @property {Twilio.Pricing.V2.VoiceList} voice - voice resource * * @param {Twilio} twilio - The twilio client */ @@ -34,6 +36,7 @@ function Pricing(twilio) { // Versions this._v1 = undefined; + this._v2 = undefined; } _.extend(Pricing.prototype, Domain.prototype); @@ -47,6 +50,14 @@ Object.defineProperty(Pricing.prototype, } }); +Object.defineProperty(Pricing.prototype, + 'v2', { + get: function() { + this._v2 = this._v2 || new V2(this); + return this._v2; + } +}); + Object.defineProperty(Pricing.prototype, 'messaging', { get: function() { @@ -64,7 +75,7 @@ Object.defineProperty(Pricing.prototype, Object.defineProperty(Pricing.prototype, 'voice', { get: function() { - return this.v1.voice; + return this.v2.voice; } }); diff --git a/lib/rest/api/v2010/account/sip/domain.d.ts b/lib/rest/api/v2010/account/sip/domain.d.ts index dde81c5761..b813df882c 100644 --- a/lib/rest/api/v2010/account/sip/domain.d.ts +++ b/lib/rest/api/v2010/account/sip/domain.d.ts @@ -268,8 +268,8 @@ declare class DomainInstance extends SerializableClass { /** * Initialize the DomainContext * - * @property accountSid - The unique id of the account that sent the message - * @property apiVersion - The Twilio API version used to process the message + * @property accountSid - The unique id of the account that sent the call + * @property apiVersion - The Twilio API version used to process the call * @property authType - The types of authentication mapped to the domain * @property dateCreated - The date this resource was created * @property dateUpdated - The date this resource was last updated diff --git a/lib/rest/api/v2010/account/sip/domain.js b/lib/rest/api/v2010/account/sip/domain.js index b91de878a8..598038e0fe 100644 --- a/lib/rest/api/v2010/account/sip/domain.js +++ b/lib/rest/api/v2010/account/sip/domain.js @@ -407,10 +407,8 @@ DomainPage.prototype.getInstance = function getInstance(payload) { /** * Initialize the DomainContext * - * @property {string} accountSid - - * The unique id of the account that sent the message - * @property {string} apiVersion - - * The Twilio API version used to process the message + * @property {string} accountSid - The unique id of the account that sent the call + * @property {string} apiVersion - The Twilio API version used to process the call * @property {string} authType - The types of authentication mapped to the domain * @property {Date} dateCreated - The date this resource was created * @property {Date} dateUpdated - The date this resource was last updated diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts b/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts index 944d7e973a..8e24a7293a 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts +++ b/lib/rest/api/v2010/account/sip/domain/authTypes.d.ts @@ -12,7 +12,7 @@ import V2010 = require('../../../../V2010'); * @description Initialize the AuthTypesList * * @param version - Version of the resource - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain */ declare function AuthTypesList(version: V2010, accountSid: string, domainSid: string): AuthTypesListInstance; diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes.js b/lib/rest/api/v2010/account/sip/domain/authTypes.js index 69fb3fa6f6..42eedc9594 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes.js +++ b/lib/rest/api/v2010/account/sip/domain/authTypes.js @@ -22,7 +22,7 @@ var AuthTypesList; * @description Initialize the AuthTypesList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The unique id of the account that sent the message + * @param {string} accountSid - The unique id of the account that sent the call * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.d.ts b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.d.ts index 1bffb5a50e..9b7ecb872f 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.d.ts +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.d.ts @@ -12,7 +12,7 @@ import V2010 = require('../../../../../V2010'); * @description Initialize the AuthTypeCallsList * * @param version - Version of the resource - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain */ declare function AuthTypeCallsList(version: V2010, accountSid: string, domainSid: string): AuthTypeCallsListInstance; diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.js b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.js index 3a20bdd6aa..b37ec73b19 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping.js @@ -22,7 +22,7 @@ var AuthTypeCallsList; * @description Initialize the AuthTypeCallsList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The unique id of the account that sent the message + * @param {string} accountSid - The unique id of the account that sent the call * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.d.ts b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.d.ts index 4ce84ac3be..c13a4a7e86 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.d.ts +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.d.ts @@ -14,7 +14,7 @@ import { SerializableClass } from '../../../../../../../../interfaces'; * @description Initialize the AuthCallsCredentialListMappingList * * @param version - Version of the resource - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain */ declare function AuthCallsCredentialListMappingList(version: V2010, accountSid: string, domainSid: string): AuthCallsCredentialListMappingListInstance; @@ -203,7 +203,7 @@ declare class AuthCallsCredentialListMappingInstance extends SerializableClass { * * @param version - Version of the resource * @param payload - The instance payload - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain * @param sid - Fetch by unique credential list Sid */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.js b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.js index efe0957ffc..db97e0755b 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.js @@ -28,7 +28,7 @@ var AuthCallsCredentialListMappingContext; * @description Initialize the AuthCallsCredentialListMappingList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The unique id of the account that sent the message + * @param {string} accountSid - The unique id of the account that sent the call * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ @@ -407,7 +407,7 @@ AuthCallsCredentialListMappingPage.prototype.getInstance = function * * @param {V2010} version - Version of the resource * @param {AuthCallsCredentialListMappingPayload} payload - The instance payload - * @param {sid} accountSid - The unique id of the account that sent the message + * @param {sid} accountSid - The unique id of the account that sent the call * @param {sid} domainSid - A string that uniquely identifies the SIP Domain * @param {sid} sid - Fetch by unique credential list Sid */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.d.ts b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.d.ts index ca6d9cfdb4..710eb94de7 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.d.ts +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.d.ts @@ -14,7 +14,7 @@ import { SerializableClass } from '../../../../../../../../interfaces'; * @description Initialize the AuthCallsIpAccessControlListMappingList * * @param version - Version of the resource - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain */ declare function AuthCallsIpAccessControlListMappingList(version: V2010, accountSid: string, domainSid: string): AuthCallsIpAccessControlListMappingListInstance; @@ -203,7 +203,7 @@ declare class AuthCallsIpAccessControlListMappingInstance extends SerializableCl * * @param version - Version of the resource * @param payload - The instance payload - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain * @param sid - Fetch by unique IP Access Control List Sid */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.js b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.js index e8bbf93e47..2986a5d161 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.js @@ -28,7 +28,7 @@ var AuthCallsIpAccessControlListMappingContext; * @description Initialize the AuthCallsIpAccessControlListMappingList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The unique id of the account that sent the message + * @param {string} accountSid - The unique id of the account that sent the call * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ @@ -416,7 +416,7 @@ AuthCallsIpAccessControlListMappingPage.prototype.getInstance = function * @param {V2010} version - Version of the resource * @param {AuthCallsIpAccessControlListMappingPayload} payload - * The instance payload - * @param {sid} accountSid - The unique id of the account that sent the message + * @param {sid} accountSid - The unique id of the account that sent the call * @param {sid} domainSid - A string that uniquely identifies the SIP Domain * @param {sid} sid - Fetch by unique IP Access Control List Sid */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.d.ts b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.d.ts index fd48615b11..b10b0b2bc6 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.d.ts +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.d.ts @@ -12,7 +12,7 @@ import V2010 = require('../../../../../V2010'); * @description Initialize the AuthTypeRegistrationsList * * @param version - Version of the resource - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain */ declare function AuthTypeRegistrationsList(version: V2010, accountSid: string, domainSid: string): AuthTypeRegistrationsListInstance; diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.js b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.js index 66671450bb..e884a7dab6 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping.js @@ -20,7 +20,7 @@ var AuthTypeRegistrationsList; * @description Initialize the AuthTypeRegistrationsList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The unique id of the account that sent the message + * @param {string} accountSid - The unique id of the account that sent the call * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.d.ts b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.d.ts index 7c02728886..895919e7bf 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.d.ts +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.d.ts @@ -14,7 +14,7 @@ import { SerializableClass } from '../../../../../../../../interfaces'; * @description Initialize the AuthRegistrationsCredentialListMappingList * * @param version - Version of the resource - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain */ declare function AuthRegistrationsCredentialListMappingList(version: V2010, accountSid: string, domainSid: string): AuthRegistrationsCredentialListMappingListInstance; @@ -203,7 +203,7 @@ declare class AuthRegistrationsCredentialListMappingInstance extends Serializabl * * @param version - Version of the resource * @param payload - The instance payload - * @param accountSid - The unique id of the account that sent the message + * @param accountSid - The unique id of the account that sent the call * @param domainSid - A string that uniquely identifies the SIP Domain * @param sid - Fetch by unique credential list Sid */ diff --git a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.js b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.js index ebc5db4d72..7cc30210b9 100644 --- a/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.js @@ -28,7 +28,7 @@ var AuthRegistrationsCredentialListMappingContext; * @description Initialize the AuthRegistrationsCredentialListMappingList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The unique id of the account that sent the message + * @param {string} accountSid - The unique id of the account that sent the call * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ @@ -416,7 +416,7 @@ AuthRegistrationsCredentialListMappingPage.prototype.getInstance = function * @param {V2010} version - Version of the resource * @param {AuthRegistrationsCredentialListMappingPayload} payload - * The instance payload - * @param {sid} accountSid - The unique id of the account that sent the message + * @param {sid} accountSid - The unique id of the account that sent the call * @param {sid} domainSid - A string that uniquely identifies the SIP Domain * @param {sid} sid - Fetch by unique credential list Sid */ diff --git a/lib/rest/api/v2010/account/usage/record.d.ts b/lib/rest/api/v2010/account/usage/record.d.ts index 698250b538..30b1774a85 100644 --- a/lib/rest/api/v2010/account/usage/record.d.ts +++ b/lib/rest/api/v2010/account/usage/record.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../V2010'); import serialize = require('../../../../../base/serialize'); import { SerializableClass } from '../../../../../interfaces'; -type RecordCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type RecordCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the RecordList diff --git a/lib/rest/api/v2010/account/usage/record/allTime.d.ts b/lib/rest/api/v2010/account/usage/record/allTime.d.ts index 0b0075c4cd..f35d728e72 100644 --- a/lib/rest/api/v2010/account/usage/record/allTime.d.ts +++ b/lib/rest/api/v2010/account/usage/record/allTime.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type AllTimeCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type AllTimeCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the AllTimeList diff --git a/lib/rest/api/v2010/account/usage/record/daily.d.ts b/lib/rest/api/v2010/account/usage/record/daily.d.ts index 2925216a50..44b1228379 100644 --- a/lib/rest/api/v2010/account/usage/record/daily.d.ts +++ b/lib/rest/api/v2010/account/usage/record/daily.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type DailyCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type DailyCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the DailyList diff --git a/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts b/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts index 02b957552b..afc36ba2e7 100644 --- a/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +++ b/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type LastMonthCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type LastMonthCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the LastMonthList diff --git a/lib/rest/api/v2010/account/usage/record/monthly.d.ts b/lib/rest/api/v2010/account/usage/record/monthly.d.ts index 1086309220..1248d6019c 100644 --- a/lib/rest/api/v2010/account/usage/record/monthly.d.ts +++ b/lib/rest/api/v2010/account/usage/record/monthly.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type MonthlyCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type MonthlyCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the MonthlyList diff --git a/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts b/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts index 4616b9b5c5..7e3a25c595 100644 --- a/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +++ b/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type ThisMonthCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type ThisMonthCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the ThisMonthList diff --git a/lib/rest/api/v2010/account/usage/record/today.d.ts b/lib/rest/api/v2010/account/usage/record/today.d.ts index 43cb69511e..23e3ef64d3 100644 --- a/lib/rest/api/v2010/account/usage/record/today.d.ts +++ b/lib/rest/api/v2010/account/usage/record/today.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type TodayCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type TodayCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the TodayList diff --git a/lib/rest/api/v2010/account/usage/record/yearly.d.ts b/lib/rest/api/v2010/account/usage/record/yearly.d.ts index 71865ff58b..49c71150f6 100644 --- a/lib/rest/api/v2010/account/usage/record/yearly.d.ts +++ b/lib/rest/api/v2010/account/usage/record/yearly.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type YearlyCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type YearlyCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the YearlyList diff --git a/lib/rest/api/v2010/account/usage/record/yesterday.d.ts b/lib/rest/api/v2010/account/usage/record/yesterday.d.ts index 1c593314f1..c1817b0b57 100644 --- a/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +++ b/lib/rest/api/v2010/account/usage/record/yesterday.d.ts @@ -11,7 +11,7 @@ import V2010 = require('../../../../V2010'); import serialize = require('../../../../../../base/serialize'); import { SerializableClass } from '../../../../../../interfaces'; -type YesterdayCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type YesterdayCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'cps'|'fraud-lookups'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the YesterdayList diff --git a/lib/rest/api/v2010/account/usage/trigger.d.ts b/lib/rest/api/v2010/account/usage/trigger.d.ts index c05e4b5cbd..cdfc115c52 100644 --- a/lib/rest/api/v2010/account/usage/trigger.d.ts +++ b/lib/rest/api/v2010/account/usage/trigger.d.ts @@ -14,7 +14,7 @@ type TriggerRecurring = 'daily'|'monthly'|'yearly'|'alltime'; type TriggerTriggerField = 'count'|'usage'|'price'; -type TriggerUsageCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'fraud-lookups'|'cps'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; +type TriggerUsageCategory = 'answering-machine-detection'|'authy-authentications'|'authy-calls-outbound'|'authy-monthly-fees'|'authy-phone-intelligence'|'authy-phone-verifications'|'authy-sms-outbound'|'call-progess-events'|'calleridlookups'|'calls'|'calls-client'|'calls-globalconference'|'calls-inbound'|'calls-inbound-local'|'calls-inbound-mobile'|'calls-inbound-tollfree'|'calls-outbound'|'calls-recordings'|'calls-sip'|'calls-sip-inbound'|'calls-sip-outbound'|'carrier-lookups'|'conversations'|'conversations-api-requests'|'conversations-conversation-events'|'conversations-endpoint-connectivity'|'conversations-events'|'conversations-participant-events'|'conversations-participants'|'fraud-lookups'|'cps'|'group-rooms'|'group-rooms-data-track'|'group-rooms-encrypted-media-recorded'|'group-rooms-media-downloaded'|'group-rooms-media-recorded'|'group-rooms-media-routed'|'group-rooms-media-stored'|'group-rooms-participant-minutes'|'group-rooms-recorded-minutes'|'ip-messaging'|'ip-messaging-commands'|'ip-messaging-data-storage'|'ip-messaging-data-transfer'|'ip-messaging-endpoint-connectivity'|'lookups'|'marketplace'|'marketplace-algorithmia-named-entity-recognition'|'marketplace-digital-segment-business-info'|'marketplace-google-speech-to-text'|'marketplace-ibm-watson-message-insights'|'marketplace-ibm-watson-message-sentiment'|'marketplace-ibm-watson-recording-analysis'|'marketplace-icehook-systems-scout'|'marketplace-infogroup-dataaxle-bizinfo'|'marketplace-cadence-transcription'|'marketplace-cadence-translation'|'marketplace-capio-speech-to-text'|'marketplace-facebook-offline-conversions'|'marketplace-keen-io-contact-center-analytics'|'marketplace-marchex-cleancall'|'marketplace-marchex-sentiment-analysis-for-sms'|'marketplace-marketplace-nextcaller-social-id'|'marketplace-mobile-commons-opt-out-classifier'|'marketplace-nexiwave-voicemail-to-text'|'marketplace-nextcaller-advanced-caller-identification'|'marketplace-nomorobo-spam-score'|'marketplace-payfone-tcpa-compliance'|'marketplace-telo-opencnam'|'marketplace-truecnam-true-spam'|'marketplace-twilio-caller-name-lookup-us'|'marketplace-twilio-carrier-information-lookup'|'marketplace-voicebase-pci'|'marketplace-voicebase-transcription'|'marketplace-whitepages-pro-caller-identification'|'marketplace-whitepages-pro-phone-intelligence'|'marketplace-whitepages-pro-phone-reputation'|'marketplace-wolfram-short-answer'|'marketplace-wolfarm-spoken-results'|'marketplace-deepgram-phrase-detector'|'marketplace-convriza-ababa'|'marketplace-ibm-watson-tone-analyzer'|'marketplace-remeeting-automatic-speech-recognition'|'marketplace-tcpa-defense-solutions-blacklist-feed'|'marketplace-voicebase-transcription-custom-vocabulary'|'marketplace-ytica-contact-center-reporting-analytics'|'mediastorage'|'mms'|'mms-inbound'|'mms-inbound-longcode'|'mms-inbound-shortcode'|'mms-outbound'|'mms-outbound-longcode'|'mms-outbound-shortcode'|'monitor-reads'|'monitor-storage'|'monitor-writes'|'notify'|'notify-actions-attempts'|'notify-channels'|'number-format-lookups'|'pchat'|'pchat-actions'|'pchat-aps'|'pchat-notifications'|'pchat-reads'|'pchat-users'|'pchat-messages'|'peer-to-peer-rooms-participant-minutes'|'pfax'|'pfax-minutes'|'pfax-minutes-inbound'|'pfax-minutes-outbound'|'pfax-pages'|'phonenumbers'|'phonenumbers-cps'|'phonenumbers-emergency'|'phonenumbers-local'|'phonenumbers-mobile'|'phonenumbers-setups'|'phonenumbers-tollfree'|'premiumsupport'|'proxy'|'proxy-active-sessions'|'pv'|'pv-composition-media-downloaded'|'pv-composition-media-encrypted'|'pv-composition-media-stored'|'pv-composition-minutes'|'pv-recording-compositions'|'pv-room-participants'|'pv-room-participants-au1'|'pv-room-participants-br1'|'pv-room-participants-ie1'|'pv-room-participants-jp1'|'pv-room-participants-sg1'|'pv-room-participants-us1'|'pv-room-participants-us2'|'pv-rooms'|'pv-sip-endpoint-registrations'|'recordings'|'recordingstorage'|'rooms-group-minutes'|'rooms-group-bandwidth'|'rooms-peer-to-peer-minutes'|'shortcodes'|'shortcodes-customerowned'|'shortcodes-mms-enablement'|'shortcodes-mps'|'shortcodes-random'|'shortcodes-uk'|'shortcodes-vanity'|'sms'|'sms-inbound'|'sms-inbound-longcode'|'sms-inbound-shortcode'|'sms-outbound'|'sms-outbound-content-inspection'|'sms-outbound-longcode'|'sms-outbound-shortcode'|'sms-messages-features'|'sms-messages-features-senderid'|'speech-recognition'|'studio-engagements'|'sync'|'sync-actions'|'sync-endpoint-hours'|'sync-endpoint-hours-above-daily-cap'|'taskrouter-tasks'|'totalprice'|'transcriptions'|'trunking-cps'|'trunking-emergency-calls'|'trunking-origination'|'trunking-origination-local'|'trunking-origination-mobile'|'trunking-origination-tollfree'|'trunking-recordings'|'trunking-secure'|'trunking-termination'|'turnmegabytes'|'turnmegabytes-australia'|'turnmegabytes-brasil'|'turnmegabytes-india'|'turnmegabytes-ireland'|'turnmegabytes-japan'|'turnmegabytes-singapore'|'turnmegabytes-useast'|'turnmegabytes-uswest'|'twilio-interconnect'|'video-recordings'|'voice-insights'|'voice-insights-client-insights-on-demand-minute'|'voice-insights-ptsn-insights-on-demand-minute'|'voice-insights-sip-interface-insights-on-demand-minute'|'voice-insights-sip-trunking-insights-on-demand-minute'|'wireless'|'wireless-orders'|'wireless-orders-artwork'|'wireless-orders-bulk'|'wireless-orders-esim'|'wireless-orders-starter'|'wireless-usage'|'wireless-usage-commands'|'wireless-usage-commands-africa'|'wireless-usage-commands-asia'|'wireless-usage-commands-centralandsouthamerica'|'wireless-usage-commands-europe'|'wireless-usage-commands-home'|'wireless-usage-commands-northamerica'|'wireless-usage-commands-oceania'|'wireless-usage-commands-roaming'|'wireless-usage-data'|'wireless-usage-data-africa'|'wireless-usage-data-asia'|'wireless-usage-data-centralandsouthamerica'|'wireless-usage-data-custom-additionalmb'|'wireless-usage-data-custom-first5mb'|'wireless-usage-data-domestic-roaming'|'wireless-usage-data-europe'|'wireless-usage-data-individual-additionalgb'|'wireless-usage-data-individual-firstgb'|'wireless-usage-data-international-roaming-canada'|'wireless-usage-data-international-roaming-india'|'wireless-usage-data-international-roaming-mexico'|'wireless-usage-data-northamerica'|'wireless-usage-data-oceania'|'wireless-usage-data-pooled'|'wireless-usage-data-pooled-downlink'|'wireless-usage-data-pooled-uplink'|'wireless-usage-mrc'|'wireless-usage-mrc-custom'|'wireless-usage-mrc-individual'|'wireless-usage-mrc-pooled'|'wireless-usage-mrc-suspended'|'wireless-usage-voice'|'wireless-usage-sms'; /** * @description Initialize the TriggerList diff --git a/lib/rest/chat/v2/service.d.ts b/lib/rest/chat/v2/service.d.ts index a9ac15cabb..4bcf4982df 100644 --- a/lib/rest/chat/v2/service.d.ts +++ b/lib/rest/chat/v2/service.d.ts @@ -323,7 +323,7 @@ declare class ServiceInstance extends SerializableClass { * @property defaultServiceRoleSid - The service role assigned to users when they are added to the service. * @property defaultChannelRoleSid - The channel role assigned to users when they are added to a channel. * @property defaultChannelCreatorRoleSid - The channel role assigned to a channel creator when joining a new channel. - * @property readStatusEnabled - Enable the Message Constumption Horizon feature. + * @property readStatusEnabled - Enable the Message Consumption Horizon feature. * @property reachabilityEnabled - Indicates whether the the Reachability feature is enabled for this Service instance. * @property typingIndicatorTimeout - The amount of time in seconds after a "started typing" event when clients should assume that user is no longer typing, even if no "ended typing" message was received. * @property consumptionReportInterval - DEPRECATED. diff --git a/lib/rest/chat/v2/service.js b/lib/rest/chat/v2/service.js index 75e05738e2..346caaf4b4 100644 --- a/lib/rest/chat/v2/service.js +++ b/lib/rest/chat/v2/service.js @@ -386,7 +386,7 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * @property {string} defaultChannelCreatorRoleSid - * The channel role assigned to a channel creator when joining a new channel. * @property {boolean} readStatusEnabled - - * Enable the Message Constumption Horizon feature. + * Enable the Message Consumption Horizon feature. * @property {boolean} reachabilityEnabled - * Indicates whether the the Reachability feature is enabled for this Service instance. * @property {number} typingIndicatorTimeout - diff --git a/lib/rest/chat/v2/service/user/userChannel.d.ts b/lib/rest/chat/v2/service/user/userChannel.d.ts index 4e56974bb1..328090e60c 100644 --- a/lib/rest/chat/v2/service/user/userChannel.d.ts +++ b/lib/rest/chat/v2/service/user/userChannel.d.ts @@ -12,16 +12,31 @@ import { SerializableClass } from '../../../../../interfaces'; type UserChannelChannelStatus = 'joined'|'invited'|'not_participating'; +type UserChannelNotificationLevel = 'default'|'muted'; + /** * @description Initialize the UserChannelList * * @param version - Version of the resource * @param serviceSid - The unique id of the Service this channel belongs to. - * @param userSid - A 34 character string that uniquely identifies this resource. + * @param userSid - The unique id of the User this Channel belongs to. */ declare function UserChannelList(version: V2, serviceSid: string, userSid: string): UserChannelListInstance; +/** + * Options to pass to update + * + * @property notificationLevel - Push notification level to be assigned to Channel of the User. + */ +interface UserChannelInstanceUpdateOptions { + notificationLevel: UserChannelNotificationLevel; +} + interface UserChannelListInstance { + /** + * @param sid - sid of instance + */ + (sid: string): UserChannelContext; /** * Streams UserChannelInstance records from the API. * @@ -36,6 +51,12 @@ interface UserChannelListInstance { * @param callback - Function to process each record */ each(opts?: UserChannelListInstanceEachOptions, callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Constructs a user_channel + * + * @param channelSid - The unique id of a Channel. + */ + get(channelSid: string): UserChannelContext; /** * Retrieve a single target page of UserChannelInstance records from the API. * Request is executed immediately @@ -133,9 +154,12 @@ interface UserChannelResource { last_consumed_message_index: number; links: string; member_sid: string; + notification_level: UserChannelNotificationLevel; service_sid: string; status: UserChannelChannelStatus; unread_messages_count: number; + url: string; + user_sid: string; } interface UserChannelSolution { @@ -144,6 +168,33 @@ interface UserChannelSolution { } +declare class UserChannelContext { + /** + * Initialize the UserChannelContext + * + * @param version - Version of the resource + * @param serviceSid - The unique id of the Service those channels belong to. + * @param userSid - The unique id of a User. + * @param channelSid - The unique id of a Channel. + */ + constructor(version: V2, serviceSid: string, userSid: string, channelSid: string); + + /** + * fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: UserChannelInstance) => any): Promise; + /** + * update a UserChannelInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts: UserChannelInstanceUpdateOptions, callback?: (error: Error | null, items: UserChannelInstance) => any): Promise; +} + + declare class UserChannelInstance extends SerializableClass { /** * Initialize the UserChannelContext @@ -151,24 +202,36 @@ declare class UserChannelInstance extends SerializableClass { * @property accountSid - The unique id of the Account responsible for this channel. * @property serviceSid - The unique id of the Service this channel belongs to. * @property channelSid - The unique id of a Channel. + * @property userSid - The unique id of the User this Channel belongs to. * @property memberSid - The unique id of this User as a Member in this Channel. * @property status - The status of the User on this Channel. * @property lastConsumedMessageIndex - The index of the last read Message in this Channel for this User. * @property unreadMessagesCount - The count of unread Messages in this Channel for this User. * @property links - The links + * @property url - An absolute URL for this User Channel. + * @property notificationLevel - The notification level of the User for this Channel. * * @param version - Version of the resource * @param payload - The instance payload * @param serviceSid - The unique id of the Service this channel belongs to. - * @param userSid - A 34 character string that uniquely identifies this resource. + * @param userSid - The unique id of the User this Channel belongs to. + * @param channelSid - The unique id of a Channel. */ - constructor(version: V2, payload: UserChannelPayload, serviceSid: string, userSid: string); + constructor(version: V2, payload: UserChannelPayload, serviceSid: string, userSid: string, channelSid: string); + private _proxy: UserChannelContext; accountSid: string; channelSid: string; + /** + * fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: UserChannelInstance) => any): void; lastConsumedMessageIndex: number; links: string; memberSid: string; + notificationLevel: UserChannelNotificationLevel; serviceSid: string; status: UserChannelChannelStatus; /** @@ -177,6 +240,15 @@ declare class UserChannelInstance extends SerializableClass { */ toJSON(): any; unreadMessagesCount: number; + /** + * update a UserChannelInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts: UserChannelInstanceUpdateOptions, callback?: (error: Error | null, items: UserChannelInstance) => any): void; + url: string; + userSid: string; } @@ -198,4 +270,4 @@ declare class UserChannelPage extends Page/Users/<%= userSid %>/Channels/<%= channelSid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a UserChannelInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserChannelInstance + */ +/* jshint ignore:end */ +UserChannelContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new UserChannelInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid, + this._solution.channelSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a UserChannelInstance + * + * @param {object} opts - Options for request + * @param {user_channel.notification_level} opts.notificationLevel - + * Push notification level to be assigned to Channel of the User. + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserChannelInstance + */ +/* jshint ignore:end */ +UserChannelContext.prototype.update = function update(opts, callback) { + if (_.isUndefined(opts)) { + throw new Error('Required parameter "opts" missing.'); + } + if (_.isUndefined(opts.notificationLevel)) { + throw new Error('Required parameter "opts.notificationLevel" missing.'); + } + + var deferred = Q.defer(); + var data = values.of({'NotificationLevel': _.get(opts, 'notificationLevel')}); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new UserChannelInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid, + this._solution.channelSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + module.exports = { UserChannelList: UserChannelList, UserChannelPage: UserChannelPage, - UserChannelInstance: UserChannelInstance + UserChannelInstance: UserChannelInstance, + UserChannelContext: UserChannelContext }; diff --git a/lib/rest/ipMessaging/v2/service.d.ts b/lib/rest/ipMessaging/v2/service.d.ts index a9ac15cabb..4bcf4982df 100644 --- a/lib/rest/ipMessaging/v2/service.d.ts +++ b/lib/rest/ipMessaging/v2/service.d.ts @@ -323,7 +323,7 @@ declare class ServiceInstance extends SerializableClass { * @property defaultServiceRoleSid - The service role assigned to users when they are added to the service. * @property defaultChannelRoleSid - The channel role assigned to users when they are added to a channel. * @property defaultChannelCreatorRoleSid - The channel role assigned to a channel creator when joining a new channel. - * @property readStatusEnabled - Enable the Message Constumption Horizon feature. + * @property readStatusEnabled - Enable the Message Consumption Horizon feature. * @property reachabilityEnabled - Indicates whether the the Reachability feature is enabled for this Service instance. * @property typingIndicatorTimeout - The amount of time in seconds after a "started typing" event when clients should assume that user is no longer typing, even if no "ended typing" message was received. * @property consumptionReportInterval - DEPRECATED. diff --git a/lib/rest/ipMessaging/v2/service.js b/lib/rest/ipMessaging/v2/service.js index 7bba54c749..ed88c18f82 100644 --- a/lib/rest/ipMessaging/v2/service.js +++ b/lib/rest/ipMessaging/v2/service.js @@ -386,7 +386,7 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * @property {string} defaultChannelCreatorRoleSid - * The channel role assigned to a channel creator when joining a new channel. * @property {boolean} readStatusEnabled - - * Enable the Message Constumption Horizon feature. + * Enable the Message Consumption Horizon feature. * @property {boolean} reachabilityEnabled - * Indicates whether the the Reachability feature is enabled for this Service instance. * @property {number} typingIndicatorTimeout - diff --git a/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts b/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts index 4e56974bb1..328090e60c 100644 --- a/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts +++ b/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts @@ -12,16 +12,31 @@ import { SerializableClass } from '../../../../../interfaces'; type UserChannelChannelStatus = 'joined'|'invited'|'not_participating'; +type UserChannelNotificationLevel = 'default'|'muted'; + /** * @description Initialize the UserChannelList * * @param version - Version of the resource * @param serviceSid - The unique id of the Service this channel belongs to. - * @param userSid - A 34 character string that uniquely identifies this resource. + * @param userSid - The unique id of the User this Channel belongs to. */ declare function UserChannelList(version: V2, serviceSid: string, userSid: string): UserChannelListInstance; +/** + * Options to pass to update + * + * @property notificationLevel - Push notification level to be assigned to Channel of the User. + */ +interface UserChannelInstanceUpdateOptions { + notificationLevel: UserChannelNotificationLevel; +} + interface UserChannelListInstance { + /** + * @param sid - sid of instance + */ + (sid: string): UserChannelContext; /** * Streams UserChannelInstance records from the API. * @@ -36,6 +51,12 @@ interface UserChannelListInstance { * @param callback - Function to process each record */ each(opts?: UserChannelListInstanceEachOptions, callback?: (item: UserChannelInstance, done: (err?: Error) => void) => void): void; + /** + * Constructs a user_channel + * + * @param channelSid - The unique id of a Channel. + */ + get(channelSid: string): UserChannelContext; /** * Retrieve a single target page of UserChannelInstance records from the API. * Request is executed immediately @@ -133,9 +154,12 @@ interface UserChannelResource { last_consumed_message_index: number; links: string; member_sid: string; + notification_level: UserChannelNotificationLevel; service_sid: string; status: UserChannelChannelStatus; unread_messages_count: number; + url: string; + user_sid: string; } interface UserChannelSolution { @@ -144,6 +168,33 @@ interface UserChannelSolution { } +declare class UserChannelContext { + /** + * Initialize the UserChannelContext + * + * @param version - Version of the resource + * @param serviceSid - The unique id of the Service those channels belong to. + * @param userSid - The unique id of a User. + * @param channelSid - The unique id of a Channel. + */ + constructor(version: V2, serviceSid: string, userSid: string, channelSid: string); + + /** + * fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: UserChannelInstance) => any): Promise; + /** + * update a UserChannelInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts: UserChannelInstanceUpdateOptions, callback?: (error: Error | null, items: UserChannelInstance) => any): Promise; +} + + declare class UserChannelInstance extends SerializableClass { /** * Initialize the UserChannelContext @@ -151,24 +202,36 @@ declare class UserChannelInstance extends SerializableClass { * @property accountSid - The unique id of the Account responsible for this channel. * @property serviceSid - The unique id of the Service this channel belongs to. * @property channelSid - The unique id of a Channel. + * @property userSid - The unique id of the User this Channel belongs to. * @property memberSid - The unique id of this User as a Member in this Channel. * @property status - The status of the User on this Channel. * @property lastConsumedMessageIndex - The index of the last read Message in this Channel for this User. * @property unreadMessagesCount - The count of unread Messages in this Channel for this User. * @property links - The links + * @property url - An absolute URL for this User Channel. + * @property notificationLevel - The notification level of the User for this Channel. * * @param version - Version of the resource * @param payload - The instance payload * @param serviceSid - The unique id of the Service this channel belongs to. - * @param userSid - A 34 character string that uniquely identifies this resource. + * @param userSid - The unique id of the User this Channel belongs to. + * @param channelSid - The unique id of a Channel. */ - constructor(version: V2, payload: UserChannelPayload, serviceSid: string, userSid: string); + constructor(version: V2, payload: UserChannelPayload, serviceSid: string, userSid: string, channelSid: string); + private _proxy: UserChannelContext; accountSid: string; channelSid: string; + /** + * fetch a UserChannelInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: UserChannelInstance) => any): void; lastConsumedMessageIndex: number; links: string; memberSid: string; + notificationLevel: UserChannelNotificationLevel; serviceSid: string; status: UserChannelChannelStatus; /** @@ -177,6 +240,15 @@ declare class UserChannelInstance extends SerializableClass { */ toJSON(): any; unreadMessagesCount: number; + /** + * update a UserChannelInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts: UserChannelInstanceUpdateOptions, callback?: (error: Error | null, items: UserChannelInstance) => any): void; + url: string; + userSid: string; } @@ -198,4 +270,4 @@ declare class UserChannelPage extends Page/Users/<%= userSid %>/Channels/<%= channelSid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a UserChannelInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserChannelInstance + */ +/* jshint ignore:end */ +UserChannelContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new UserChannelInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid, + this._solution.channelSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a UserChannelInstance + * + * @param {object} opts - Options for request + * @param {user_channel.notification_level} opts.notificationLevel - + * Push notification level to be assigned to Channel of the User. + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserChannelInstance + */ +/* jshint ignore:end */ +UserChannelContext.prototype.update = function update(opts, callback) { + if (_.isUndefined(opts)) { + throw new Error('Required parameter "opts" missing.'); + } + if (_.isUndefined(opts.notificationLevel)) { + throw new Error('Required parameter "opts.notificationLevel" missing.'); + } + + var deferred = Q.defer(); + var data = values.of({'NotificationLevel': _.get(opts, 'notificationLevel')}); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new UserChannelInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid, + this._solution.channelSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + module.exports = { UserChannelList: UserChannelList, UserChannelPage: UserChannelPage, - UserChannelInstance: UserChannelInstance + UserChannelInstance: UserChannelInstance, + UserChannelContext: UserChannelContext }; diff --git a/lib/rest/preview/Proxy.d.ts b/lib/rest/preview/Proxy.d.ts deleted file mode 100644 index d457f229de..0000000000 --- a/lib/rest/preview/Proxy.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Preview = require('../Preview'); -import Version = require('../../base/Version'); -import { ServiceList } from './proxy/service'; - - -declare class Proxy extends Version { - /** - * Initialize the Proxy version of Preview - * - * @property services - services resource - * - * @param domain - The twilio domain - */ - constructor(domain: Preview); - - readonly services: ServiceListInstance; -} - -export = Proxy; diff --git a/lib/rest/preview/Studio.d.ts b/lib/rest/preview/Studio.d.ts deleted file mode 100644 index 8ca1f9c2ea..0000000000 --- a/lib/rest/preview/Studio.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Preview = require('../Preview'); -import Version = require('../../base/Version'); -import { FlowList } from './studio/flow'; -import { FlowListInstance } from './studio/flow'; - - -declare class Studio extends Version { - /** - * Initialize the Studio version of Preview - * - * @property flows - flows resource - * - * @param domain - The twilio domain - */ - constructor(domain: Preview); - - readonly flows: FlowListInstance; -} - -export = Studio; diff --git a/lib/rest/preview/proxy/service.d.ts b/lib/rest/preview/proxy/service.d.ts deleted file mode 100644 index b05434eac7..0000000000 --- a/lib/rest/preview/proxy/service.d.ts +++ /dev/null @@ -1,315 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../base/Page'); -import Proxy = require('../Proxy'); -import Response = require('../../../http/response'); -import serialize = require('../../../base/serialize'); -import { PhoneNumberList } from './service/phoneNumber'; -import { SerializableClass } from '../../../interfaces'; -import { SessionList } from './service/session'; -import { ShortCodeList } from './service/shortCode'; - -/** - * @description Initialize the ServiceList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - */ -declare function ServiceList(version: Proxy): ServiceListInstance; - -/** - * Options to pass to update - * - * @property autoCreate - Boolean flag specifying whether to auto-create threads. - * @property callbackUrl - URL Twilio will request for callbacks. - * @property friendlyName - A human readable description of this resource - */ -interface ServiceInstanceUpdateOptions { - autoCreate?: boolean; - callbackUrl?: string; - friendlyName?: string; -} - -interface ServiceListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): ServiceContext; - /** - * create a ServiceInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts?: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item: ServiceInstance) => any): Promise; - /** - * Streams ServiceInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a service - * - * @param sid - A string that uniquely identifies this Service. - */ - get(sid: string): ServiceContext; - /** - * Retrieve a single target page of ServiceInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: ServicePage) => any): Promise; - /** - * Lists ServiceInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise; - /** - * Retrieve a single page of ServiceInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property autoCreate - Boolean flag specifying whether to auto-create threads. - * @property callbackUrl - URL Twilio will request for callbacks. - * @property friendlyName - A human readable description of this resource - */ -interface ServiceListInstanceCreateOptions { - autoCreate?: boolean; - callbackUrl?: string; - friendlyName?: string; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface ServiceListInstanceEachOptions { - callback?: (item: ServiceInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface ServiceListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface ServiceListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface ServicePayload extends ServiceResource, Page.TwilioResponsePayload { -} - -interface ServiceResource { - account_sid: string; - auto_create: boolean; - callback_url: string; - date_created: Date; - date_updated: Date; - friendly_name: string; - links: string; - sid: string; - url: string; -} - -interface ServiceSolution { -} - - -declare class ServicePage extends Page { - /** - * Initialize the ServicePagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: ServiceSolution); - - /** - * Build an instance of ServiceInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: ServicePayload): ServiceInstance; -} - - -declare class ServiceInstance extends SerializableClass { - /** - * Initialize the ServiceContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Service. - * @property friendlyName - A human readable description of this resource - * @property accountSid - Account Sid. - * @property autoCreate - Boolean flag specifying whether to auto-create threads. - * @property callbackUrl - URL Twilio will request for callbacks. - * @property dateCreated - The date this Service was created - * @property dateUpdated - The date this Service was updated - * @property url - The URL of this resource. - * @property links - Nested resource URLs. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param sid - A string that uniquely identifies this Service. - */ - constructor(version: Proxy, payload: ServicePayload, sid: string); - - private _proxy: ServiceContext; - accountSid: string; - autoCreate: boolean; - callbackUrl: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a ServiceInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: ServiceInstance) => any): void; - friendlyName: string; - links: string; - /** - * Access the phoneNumbers - */ - phoneNumbers(); - /** - * remove a ServiceInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: ServiceInstance) => any): void; - /** - * Access the sessions - */ - sessions(); - /** - * Access the shortCodes - */ - shortCodes(); - sid: string; - /** - * Produce a plain JSON object version of the ServiceInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - /** - * update a ServiceInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - update(opts?: ServiceInstanceUpdateOptions, callback?: (error: Error | null, items: ServiceInstance) => any): void; - url: string; -} - - -declare class ServiceContext { - /** - * Initialize the ServiceContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sessions - sessions resource - * @property phoneNumbers - phoneNumbers resource - * @property shortCodes - shortCodes resource - * - * @param version - Version of the resource - * @param sid - A string that uniquely identifies this Service. - */ - constructor(version: Proxy, sid: string); - - /** - * fetch a ServiceInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: ServiceInstance) => any): void; - phoneNumbers?: PhoneNumberList; - /** - * remove a ServiceInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: ServiceInstance) => any): void; - sessions?: SessionList; - shortCodes?: ShortCodeList; - /** - * update a ServiceInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - update(opts?: ServiceInstanceUpdateOptions, callback?: (error: Error | null, items: ServiceInstance) => any): void; -} - -export { ServiceContext, ServiceInstance, ServiceList, ServiceListInstance, ServiceListInstanceCreateOptions, ServiceListInstanceEachOptions, ServiceListInstanceOptions, ServiceListInstancePageOptions, ServicePage, ServicePayload, ServiceResource, ServiceSolution } diff --git a/lib/rest/preview/proxy/service/phoneNumber.d.ts b/lib/rest/preview/proxy/service/phoneNumber.d.ts deleted file mode 100644 index 1a5deafd93..0000000000 --- a/lib/rest/preview/proxy/service/phoneNumber.d.ts +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../base/Page'); -import Proxy = require('../../Proxy'); -import Response = require('../../../../http/response'); -import { SerializableClass } from '../../../../interfaces'; - -/** - * @description Initialize the PhoneNumberList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - */ -declare function PhoneNumberList(version: Proxy, serviceSid: string): PhoneNumberListInstance; - -interface PhoneNumberListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): PhoneNumberContext; - /** - * create a PhoneNumberInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts: PhoneNumberListInstanceCreateOptions, callback?: (error: Error | null, item: PhoneNumberInstance) => any): Promise; - /** - * Streams PhoneNumberInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: PhoneNumberListInstanceEachOptions, callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a phone_number - * - * @param sid - Fetch by unique phone-number Sid - */ - get(sid: string): PhoneNumberContext; - /** - * Retrieve a single target page of PhoneNumberInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; - /** - * Lists PhoneNumberInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: PhoneNumberListInstanceOptions, callback?: (error: Error | null, items: PhoneNumberInstance[]) => any): Promise; - /** - * Retrieve a single page of PhoneNumberInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: PhoneNumberListInstancePageOptions, callback?: (error: Error | null, items: PhoneNumberPage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property sid - Delete by unique phone-number Sid - */ -interface PhoneNumberListInstanceCreateOptions { - sid: string; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface PhoneNumberListInstanceEachOptions { - callback?: (item: PhoneNumberInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface PhoneNumberListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface PhoneNumberListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface PhoneNumberPayload extends PhoneNumberResource, Page.TwilioResponsePayload { -} - -interface PhoneNumberResource { - account_sid: string; - capabilities: string; - country_code: string; - date_created: Date; - date_updated: Date; - phone_number: string; - service_sid: string; - sid: string; - url: string; -} - -interface PhoneNumberSolution { - serviceSid?: string; -} - - -declare class PhoneNumberPage extends Page { - /** - * Initialize the PhoneNumberPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: PhoneNumberSolution); - - /** - * Build an instance of PhoneNumberInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: PhoneNumberPayload): PhoneNumberInstance; -} - - -declare class PhoneNumberInstance extends SerializableClass { - /** - * Initialize the PhoneNumberContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this resource - * @property accountSid - Account Sid. - * @property serviceSid - Service Sid. - * @property dateCreated - The date this resource was created - * @property dateUpdated - The date this resource was last updated - * @property phoneNumber - The phone number - * @property countryCode - The ISO 3166-1 alpha-2 country code - * @property capabilities - Indicate if a phone can receive calls or messages - * @property url - The URL of this resource. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param serviceSid - Service Sid. - * @param sid - Fetch by unique phone-number Sid - */ - constructor(version: Proxy, payload: PhoneNumberPayload, serviceSid: string, sid: string); - - private _proxy: PhoneNumberContext; - accountSid: string; - capabilities: string; - countryCode: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a PhoneNumberInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: PhoneNumberInstance) => any): void; - phoneNumber: string; - /** - * remove a PhoneNumberInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: PhoneNumberInstance) => any): void; - serviceSid: string; - sid: string; - /** - * Produce a plain JSON object version of the PhoneNumberInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - url: string; -} - - -declare class PhoneNumberContext { - /** - * Initialize the PhoneNumberContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - The service_sid - * @param sid - Fetch by unique phone-number Sid - */ - constructor(version: Proxy, serviceSid: string, sid: string); - - /** - * fetch a PhoneNumberInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: PhoneNumberInstance) => any): void; - /** - * remove a PhoneNumberInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: PhoneNumberInstance) => any): void; -} - -export { PhoneNumberContext, PhoneNumberInstance, PhoneNumberList, PhoneNumberListInstance, PhoneNumberListInstanceCreateOptions, PhoneNumberListInstanceEachOptions, PhoneNumberListInstanceOptions, PhoneNumberListInstancePageOptions, PhoneNumberPage, PhoneNumberPayload, PhoneNumberResource, PhoneNumberSolution } diff --git a/lib/rest/preview/proxy/service/session.d.ts b/lib/rest/preview/proxy/service/session.d.ts deleted file mode 100644 index bf900670b6..0000000000 --- a/lib/rest/preview/proxy/service/session.d.ts +++ /dev/null @@ -1,339 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../base/Page'); -import Proxy = require('../../Proxy'); -import Response = require('../../../../http/response'); -import serialize = require('../../../../base/serialize'); -import { InteractionList } from './session/interaction'; -import { ParticipantList } from './session/participant'; -import { SerializableClass } from '../../../../interfaces'; - -type SessionStatus = 'in-progess'|'completed'; - -/** - * @description Initialize the SessionList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - */ -declare function SessionList(version: Proxy, serviceSid: string): SessionListInstance; - -/** - * Options to pass to update - * - * @property participants - The participants - * @property status - The Status of this Session - * @property ttl - How long will this session stay open, in seconds. - * @property uniqueName - A unique, developer assigned name of this Session. - */ -interface SessionInstanceUpdateOptions { - participants?: string[]; - status?: SessionStatus; - ttl?: number; - uniqueName?: string; -} - -interface SessionListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): SessionContext; - /** - * create a SessionInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts?: SessionListInstanceCreateOptions, callback?: (error: Error | null, item: SessionInstance) => any): Promise; - /** - * Streams SessionInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: SessionListInstanceEachOptions, callback?: (item: SessionInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a session - * - * @param sid - A string that uniquely identifies this Session. - */ - get(sid: string): SessionContext; - /** - * Retrieve a single target page of SessionInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: SessionPage) => any): Promise; - /** - * Lists SessionInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: SessionListInstanceOptions, callback?: (error: Error | null, items: SessionInstance[]) => any): Promise; - /** - * Retrieve a single page of SessionInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: SessionListInstancePageOptions, callback?: (error: Error | null, items: SessionPage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property participants - The participants - * @property status - The Status of this Session - * @property ttl - How long will this session stay open, in seconds. - * @property uniqueName - A unique, developer assigned name of this Session. - */ -interface SessionListInstanceCreateOptions { - participants?: string[]; - status?: SessionStatus; - ttl?: number; - uniqueName?: string; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - * @property status - The Status of this Session - * @property uniqueName - A unique, developer assigned name of this Session. - */ -interface SessionListInstanceEachOptions { - callback?: (item: SessionInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; - status?: SessionStatus; - uniqueName?: string; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @property status - The Status of this Session - * @property uniqueName - A unique, developer assigned name of this Session. - */ -interface SessionListInstanceOptions { - limit?: number; - pageSize?: number; - status?: SessionStatus; - uniqueName?: string; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - * @property status - The Status of this Session - * @property uniqueName - A unique, developer assigned name of this Session. - */ -interface SessionListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; - status?: SessionStatus; - uniqueName?: string; -} - -interface SessionPayload extends SessionResource, Page.TwilioResponsePayload { -} - -interface SessionResource { - account_sid: string; - date_created: Date; - date_updated: Date; - end_time: Date; - links: string; - service_sid: string; - sid: string; - start_time: Date; - status: SessionStatus; - ttl: number; - unique_name: string; - url: string; -} - -interface SessionSolution { - serviceSid?: string; -} - - -declare class SessionPage extends Page { - /** - * Initialize the SessionPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: SessionSolution); - - /** - * Build an instance of SessionInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: SessionPayload): SessionInstance; -} - - -declare class SessionInstance extends SerializableClass { - /** - * Initialize the SessionContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Session. - * @property serviceSid - Service Sid. - * @property accountSid - Account Sid. - * @property uniqueName - A unique, developer assigned name of this Session. - * @property ttl - How long will this session stay open, in seconds. - * @property status - The Status of this Session - * @property startTime - The date this Session was started - * @property endTime - The date this Session was ended - * @property dateCreated - The date this Session was created - * @property dateUpdated - The date this Session was updated - * @property url - The URL of this Session. - * @property links - Nested resource URLs. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param serviceSid - Service Sid. - * @param sid - A string that uniquely identifies this Session. - */ - constructor(version: Proxy, payload: SessionPayload, serviceSid: string, sid: string); - - private _proxy: SessionContext; - accountSid: string; - dateCreated: Date; - dateUpdated: Date; - endTime: Date; - /** - * fetch a SessionInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: SessionInstance) => any): void; - /** - * Access the interactions - */ - interactions(); - links: string; - /** - * Access the participants - */ - participants(); - /** - * remove a SessionInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: SessionInstance) => any): void; - serviceSid: string; - sid: string; - startTime: Date; - status: SessionStatus; - /** - * Produce a plain JSON object version of the SessionInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - ttl: number; - uniqueName: string; - /** - * update a SessionInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - update(opts?: SessionInstanceUpdateOptions, callback?: (error: Error | null, items: SessionInstance) => any): void; - url: string; -} - - -declare class SessionContext { - /** - * Initialize the SessionContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property interactions - interactions resource - * @property participants - participants resource - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sid - A string that uniquely identifies this Session. - */ - constructor(version: Proxy, serviceSid: string, sid: string); - - /** - * fetch a SessionInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: SessionInstance) => any): void; - interactions?: InteractionList; - participants?: ParticipantList; - /** - * remove a SessionInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: SessionInstance) => any): void; - /** - * update a SessionInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - update(opts?: SessionInstanceUpdateOptions, callback?: (error: Error | null, items: SessionInstance) => any): void; -} - -export { SessionContext, SessionInstance, SessionList, SessionListInstance, SessionListInstanceCreateOptions, SessionListInstanceEachOptions, SessionListInstanceOptions, SessionListInstancePageOptions, SessionPage, SessionPayload, SessionResource, SessionSolution } diff --git a/lib/rest/preview/proxy/service/session/interaction.d.ts b/lib/rest/preview/proxy/service/session/interaction.d.ts deleted file mode 100644 index 8f367770b5..0000000000 --- a/lib/rest/preview/proxy/service/session/interaction.d.ts +++ /dev/null @@ -1,287 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../../base/Page'); -import Proxy = require('../../../Proxy'); -import Response = require('../../../../../http/response'); -import { SerializableClass } from '../../../../../interfaces'; - -type InteractionResourceStatus = 'queued'|'sending'|'sent'|'failed'|'delivered'|'undelivered'; - -type InteractionStatus = 'completed'|'in-progress'|'failed'; - -/** - * @description Initialize the InteractionList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - */ -declare function InteractionList(version: Proxy, serviceSid: string, sessionSid: string): InteractionListInstance; - -interface InteractionListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): InteractionContext; - /** - * Streams InteractionInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: InteractionListInstanceEachOptions, callback?: (item: InteractionInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a interaction - * - * @param sid - A string that uniquely identifies this Interaction. - */ - get(sid: string): InteractionContext; - /** - * Retrieve a single target page of InteractionInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: InteractionPage) => any): Promise; - /** - * Lists InteractionInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: InteractionListInstanceOptions, callback?: (error: Error | null, items: InteractionInstance[]) => any): Promise; - /** - * Retrieve a single page of InteractionInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: InteractionListInstancePageOptions, callback?: (error: Error | null, items: InteractionPage) => any): Promise; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property inboundParticipantStatus - The Inbound Participant Status of this Interaction - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property outboundParticipantStatus - The Outbound Participant Status of this Interaction - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface InteractionListInstanceEachOptions { - callback?: (item: InteractionInstance, done: (err?: Error) => void) => void; - done?: Function; - inboundParticipantStatus?: InteractionResourceStatus; - limit?: number; - outboundParticipantStatus?: InteractionResourceStatus; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property inboundParticipantStatus - The Inbound Participant Status of this Interaction - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property outboundParticipantStatus - The Outbound Participant Status of this Interaction - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface InteractionListInstanceOptions { - inboundParticipantStatus?: InteractionResourceStatus; - limit?: number; - outboundParticipantStatus?: InteractionResourceStatus; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property inboundParticipantStatus - The Inbound Participant Status of this Interaction - * @property outboundParticipantStatus - The Outbound Participant Status of this Interaction - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface InteractionListInstancePageOptions { - inboundParticipantStatus?: InteractionResourceStatus; - outboundParticipantStatus?: InteractionResourceStatus; - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface InteractionPayload extends InteractionResource, Page.TwilioResponsePayload { -} - -interface InteractionResource { - account_sid: string; - data: string; - date_created: Date; - date_updated: Date; - inbound_participant_sid: string; - inbound_resource_sid: string; - inbound_resource_status: InteractionResourceStatus; - inbound_resource_type: string; - inbound_resource_url: string; - outbound_participant_sid: string; - outbound_resource_sid: string; - outbound_resource_status: InteractionResourceStatus; - outbound_resource_type: string; - outbound_resource_url: string; - service_sid: string; - session_sid: string; - sid: string; - status: InteractionStatus; - url: string; -} - -interface InteractionSolution { - serviceSid?: string; - sessionSid?: string; -} - - -declare class InteractionPage extends Page { - /** - * Initialize the InteractionPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: InteractionSolution); - - /** - * Build an instance of InteractionInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: InteractionPayload): InteractionInstance; -} - - -declare class InteractionInstance extends SerializableClass { - /** - * Initialize the InteractionContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Interaction. - * @property sessionSid - Session Sid. - * @property serviceSid - Service Sid. - * @property accountSid - Account Sid. - * @property data - What happened in this Interaction. - * @property status - The Status of this Interaction - * @property inboundParticipantSid - The inbound_participant_sid - * @property inboundResourceSid - The SID of the inbound resource. - * @property inboundResourceStatus - The Inbound Resource Status of this Interaction - * @property inboundResourceType - The Twilio object type of the inbound resource. - * @property inboundResourceUrl - The URL of the inbound resource. - * @property outboundParticipantSid - The outbound_participant_sid - * @property outboundResourceSid - The SID of the outbound resource. - * @property outboundResourceStatus - The Outbound Resource Status of this Interaction - * @property outboundResourceType - The Twilio object type of the outbound resource. - * @property outboundResourceUrl - The URL of the outbound resource. - * @property dateCreated - The date this Interaction was created - * @property dateUpdated - The date this Interaction was updated - * @property url - The URL of this Interaction. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param sid - A string that uniquely identifies this Interaction. - */ - constructor(version: Proxy, payload: InteractionPayload, serviceSid: string, sessionSid: string, sid: string); - - private _proxy: InteractionContext; - accountSid: string; - data: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a InteractionInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: InteractionInstance) => any): void; - inboundParticipantSid: string; - inboundResourceSid: string; - inboundResourceStatus: InteractionResourceStatus; - inboundResourceType: string; - inboundResourceUrl: string; - outboundParticipantSid: string; - outboundResourceSid: string; - outboundResourceStatus: InteractionResourceStatus; - outboundResourceType: string; - outboundResourceUrl: string; - serviceSid: string; - sessionSid: string; - sid: string; - status: InteractionStatus; - /** - * Produce a plain JSON object version of the InteractionInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - url: string; -} - - -declare class InteractionContext { - /** - * Initialize the InteractionContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param sid - A string that uniquely identifies this Interaction. - */ - constructor(version: Proxy, serviceSid: string, sessionSid: string, sid: string); - - /** - * fetch a InteractionInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: InteractionInstance) => any): void; -} - -export { InteractionContext, InteractionInstance, InteractionList, InteractionListInstance, InteractionListInstanceEachOptions, InteractionListInstanceOptions, InteractionListInstancePageOptions, InteractionPage, InteractionPayload, InteractionResource, InteractionSolution } diff --git a/lib/rest/preview/proxy/service/session/participant.d.ts b/lib/rest/preview/proxy/service/session/participant.d.ts deleted file mode 100644 index 36a6c2cf51..0000000000 --- a/lib/rest/preview/proxy/service/session/participant.d.ts +++ /dev/null @@ -1,331 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../../base/Page'); -import Proxy = require('../../../Proxy'); -import Response = require('../../../../../http/response'); -import { MessageInteractionList } from './participant/messageInteraction'; -import { SerializableClass } from '../../../../../interfaces'; - -type ParticipantParticipantType = 'sms'|'voice'|'phone'; - -/** - * @description Initialize the ParticipantList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - */ -declare function ParticipantList(version: Proxy, serviceSid: string, sessionSid: string): ParticipantListInstance; - -/** - * Options to pass to update - * - * @property friendlyName - A human readable description of this resource - * @property identifier - The Participant's contact identifier, normally a phone number. - * @property participantType - The Type of this Participant - */ -interface ParticipantInstanceUpdateOptions { - friendlyName?: string; - identifier?: string; - participantType?: ParticipantParticipantType; -} - -interface ParticipantListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): ParticipantContext; - /** - * create a ParticipantInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts: ParticipantListInstanceCreateOptions, callback?: (error: Error | null, item: ParticipantInstance) => any): Promise; - /** - * Streams ParticipantInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: ParticipantListInstanceEachOptions, callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a participant - * - * @param sid - A string that uniquely identifies this Participant. - */ - get(sid: string): ParticipantContext; - /** - * Retrieve a single target page of ParticipantInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; - /** - * Lists ParticipantInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: ParticipantListInstanceOptions, callback?: (error: Error | null, items: ParticipantInstance[]) => any): Promise; - /** - * Retrieve a single page of ParticipantInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: ParticipantListInstancePageOptions, callback?: (error: Error | null, items: ParticipantPage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property friendlyName - A human readable description of this resource - * @property identifier - The Participant's contact identifier, normally a phone number. - * @property participantType - The Type of this Participant - */ -interface ParticipantListInstanceCreateOptions { - friendlyName?: string; - identifier: string; - participantType?: ParticipantParticipantType; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property identifier - The Participant's contact identifier, normally a phone number. - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - * @property participantType - The Type of this Participant - */ -interface ParticipantListInstanceEachOptions { - callback?: (item: ParticipantInstance, done: (err?: Error) => void) => void; - done?: Function; - identifier?: string; - limit?: number; - pageSize?: number; - participantType?: ParticipantParticipantType; -} - -/** - * Options to pass to list - * - * @property identifier - The Participant's contact identifier, normally a phone number. - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @property participantType - The Type of this Participant - */ -interface ParticipantListInstanceOptions { - identifier?: string; - limit?: number; - pageSize?: number; - participantType?: ParticipantParticipantType; -} - -/** - * Options to pass to page - * - * @property identifier - The Participant's contact identifier, normally a phone number. - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - * @property participantType - The Type of this Participant - */ -interface ParticipantListInstancePageOptions { - identifier?: string; - pageNumber?: number; - pageSize?: number; - pageToken?: string; - participantType?: ParticipantParticipantType; -} - -interface ParticipantPayload extends ParticipantResource, Page.TwilioResponsePayload { -} - -interface ParticipantResource { - account_sid: string; - date_created: Date; - date_updated: Date; - friendly_name: string; - identifier: string; - links: string; - participant_type: ParticipantParticipantType; - proxy_identifier: string; - service_sid: string; - session_sid: string; - sid: string; - url: string; -} - -interface ParticipantSolution { - serviceSid?: string; - sessionSid?: string; -} - - -declare class ParticipantPage extends Page { - /** - * Initialize the ParticipantPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: ParticipantSolution); - - /** - * Build an instance of ParticipantInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: ParticipantPayload): ParticipantInstance; -} - - -declare class ParticipantInstance extends SerializableClass { - /** - * Initialize the ParticipantContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Participant. - * @property sessionSid - Session Sid. - * @property serviceSid - Service Sid. - * @property accountSid - Account Sid. - * @property friendlyName - A human readable description of this resource - * @property participantType - The Type of this Participant - * @property identifier - The Participant's contact identifier, normally a phone number. - * @property proxyIdentifier - What this Participant communicates with, normally a phone number. - * @property dateCreated - The date this Participant was created - * @property dateUpdated - The date this Participant was updated - * @property url - The URL of this resource. - * @property links - Nested resource URLs. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param sid - A string that uniquely identifies this Participant. - */ - constructor(version: Proxy, payload: ParticipantPayload, serviceSid: string, sessionSid: string, sid: string); - - private _proxy: ParticipantContext; - accountSid: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a ParticipantInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: ParticipantInstance) => any): void; - friendlyName: string; - identifier: string; - links: string; - /** - * Access the messageInteractions - */ - messageInteractions(); - participantType: ParticipantParticipantType; - proxyIdentifier: string; - /** - * remove a ParticipantInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: ParticipantInstance) => any): void; - serviceSid: string; - sessionSid: string; - sid: string; - /** - * Produce a plain JSON object version of the ParticipantInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - /** - * update a ParticipantInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - update(opts?: ParticipantInstanceUpdateOptions, callback?: (error: Error | null, items: ParticipantInstance) => any): void; - url: string; -} - - -declare class ParticipantContext { - /** - * Initialize the ParticipantContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property messageInteractions - messageInteractions resource - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param sid - A string that uniquely identifies this Participant. - */ - constructor(version: Proxy, serviceSid: string, sessionSid: string, sid: string); - - /** - * fetch a ParticipantInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: ParticipantInstance) => any): void; - messageInteractions?: MessageInteractionList; - /** - * remove a ParticipantInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: ParticipantInstance) => any): void; - /** - * update a ParticipantInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - update(opts?: ParticipantInstanceUpdateOptions, callback?: (error: Error | null, items: ParticipantInstance) => any): void; -} - -export { ParticipantContext, ParticipantInstance, ParticipantList, ParticipantListInstance, ParticipantListInstanceCreateOptions, ParticipantListInstanceEachOptions, ParticipantListInstanceOptions, ParticipantListInstancePageOptions, ParticipantPage, ParticipantPayload, ParticipantResource, ParticipantSolution } diff --git a/lib/rest/preview/proxy/service/session/participant/messageInteraction.d.ts b/lib/rest/preview/proxy/service/session/participant/messageInteraction.d.ts deleted file mode 100644 index eda11632b4..0000000000 --- a/lib/rest/preview/proxy/service/session/participant/messageInteraction.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../../../base/Page'); -import Proxy = require('../../../../Proxy'); -import Response = require('../../../../../../http/response'); -import serialize = require('../../../../../../base/serialize'); -import { SerializableClass } from '../../../../../../interfaces'; - -type MessageInteractionResourceStatus = 'queued'|'sending'|'sent'|'failed'|'delivered'|'undelivered'; - -type MessageInteractionStatus = 'completed'|'in-progress'|'failed'; - -/** - * @description Initialize the MessageInteractionList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param participantSid - The participant_sid - */ -declare function MessageInteractionList(version: Proxy, serviceSid: string, sessionSid: string, participantSid: string): MessageInteractionListInstance; - -interface MessageInteractionListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): MessageInteractionContext; - /** - * create a MessageInteractionInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts?: MessageInteractionListInstanceCreateOptions, callback?: (error: Error | null, item: MessageInteractionInstance) => any): Promise; - /** - * Streams MessageInteractionInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: MessageInteractionListInstanceEachOptions, callback?: (item: MessageInteractionInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a message_interaction - * - * @param sid - A string that uniquely identifies this Interaction. - */ - get(sid: string): MessageInteractionContext; - /** - * Retrieve a single target page of MessageInteractionInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: MessageInteractionPage) => any): Promise; - /** - * Lists MessageInteractionInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: MessageInteractionListInstanceOptions, callback?: (error: Error | null, items: MessageInteractionInstance[]) => any): Promise; - /** - * Retrieve a single page of MessageInteractionInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: MessageInteractionListInstancePageOptions, callback?: (error: Error | null, items: MessageInteractionPage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property body - The body of the message. Up to 1600 characters long. - * @property mediaUrl - The url of an image or video. - */ -interface MessageInteractionListInstanceCreateOptions { - body?: string; - mediaUrl?: string[]; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface MessageInteractionListInstanceEachOptions { - callback?: (item: MessageInteractionInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface MessageInteractionListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface MessageInteractionListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface MessageInteractionPayload extends MessageInteractionResource, Page.TwilioResponsePayload { -} - -interface MessageInteractionResource { - account_sid: string; - data: string; - date_created: Date; - date_updated: Date; - inbound_participant_sid: string; - inbound_resource_sid: string; - inbound_resource_status: MessageInteractionResourceStatus; - inbound_resource_type: string; - inbound_resource_url: string; - outbound_participant_sid: string; - outbound_resource_sid: string; - outbound_resource_status: MessageInteractionResourceStatus; - outbound_resource_type: string; - outbound_resource_url: string; - participant_sid: string; - service_sid: string; - session_sid: string; - sid: string; - status: MessageInteractionStatus; - url: string; -} - -interface MessageInteractionSolution { - participantSid?: string; - serviceSid?: string; - sessionSid?: string; -} - - -declare class MessageInteractionPage extends Page { - /** - * Initialize the MessageInteractionPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: MessageInteractionSolution); - - /** - * Build an instance of MessageInteractionInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: MessageInteractionPayload): MessageInteractionInstance; -} - - -declare class MessageInteractionInstance extends SerializableClass { - /** - * Initialize the MessageInteractionContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Interaction. - * @property sessionSid - Session Sid. - * @property serviceSid - Service Sid. - * @property accountSid - Account Sid. - * @property data - What happened in this Interaction. - * @property status - The Status of this Interaction - * @property participantSid - The participant_sid - * @property inboundParticipantSid - The inbound_participant_sid - * @property inboundResourceSid - The SID of the inbound resource. - * @property inboundResourceStatus - The Inbound Resource Status of this Interaction - * @property inboundResourceType - The Twilio object type of the inbound resource. - * @property inboundResourceUrl - The URL of the inbound resource. - * @property outboundParticipantSid - The outbound_participant_sid - * @property outboundResourceSid - The SID of the outbound resource. - * @property outboundResourceStatus - The Outbound Resource Status of this Interaction - * @property outboundResourceType - The Twilio object type of the outbound resource. - * @property outboundResourceUrl - The URL of the outbound resource. - * @property dateCreated - The date this Interaction was created - * @property dateUpdated - The date this Interaction was updated - * @property url - The URL of this Interaction. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param participantSid - The participant_sid - * @param sid - A string that uniquely identifies this Interaction. - */ - constructor(version: Proxy, payload: MessageInteractionPayload, serviceSid: string, sessionSid: string, participantSid: string, sid: string); - - private _proxy: MessageInteractionContext; - accountSid: string; - data: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a MessageInteractionInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: MessageInteractionInstance) => any): void; - inboundParticipantSid: string; - inboundResourceSid: string; - inboundResourceStatus: MessageInteractionResourceStatus; - inboundResourceType: string; - inboundResourceUrl: string; - outboundParticipantSid: string; - outboundResourceSid: string; - outboundResourceStatus: MessageInteractionResourceStatus; - outboundResourceType: string; - outboundResourceUrl: string; - participantSid: string; - serviceSid: string; - sessionSid: string; - sid: string; - status: MessageInteractionStatus; - /** - * Produce a plain JSON object version of the MessageInteractionInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - url: string; -} - - -declare class MessageInteractionContext { - /** - * Initialize the MessageInteractionContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - * @param sessionSid - Session Sid. - * @param participantSid - Participant Sid. - * @param sid - A string that uniquely identifies this Interaction. - */ - constructor(version: Proxy, serviceSid: string, sessionSid: string, participantSid: string, sid: string); - - /** - * fetch a MessageInteractionInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: MessageInteractionInstance) => any): void; -} - -export { MessageInteractionContext, MessageInteractionInstance, MessageInteractionList, MessageInteractionListInstance, MessageInteractionListInstanceCreateOptions, MessageInteractionListInstanceEachOptions, MessageInteractionListInstanceOptions, MessageInteractionListInstancePageOptions, MessageInteractionPage, MessageInteractionPayload, MessageInteractionResource, MessageInteractionSolution } diff --git a/lib/rest/preview/proxy/service/shortCode.d.ts b/lib/rest/preview/proxy/service/shortCode.d.ts deleted file mode 100644 index a2cc3ba852..0000000000 --- a/lib/rest/preview/proxy/service/shortCode.d.ts +++ /dev/null @@ -1,265 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../base/Page'); -import Proxy = require('../../Proxy'); -import Response = require('../../../../http/response'); -import { SerializableClass } from '../../../../interfaces'; - -/** - * @description Initialize the ShortCodeList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - Service Sid. - */ -declare function ShortCodeList(version: Proxy, serviceSid: string): ShortCodeListInstance; - -interface ShortCodeListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): ShortCodeContext; - /** - * create a ShortCodeInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts: ShortCodeListInstanceCreateOptions, callback?: (error: Error | null, item: ShortCodeInstance) => any): Promise; - /** - * Streams ShortCodeInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: ShortCodeListInstanceEachOptions, callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a short_code - * - * @param sid - Fetch by unique shortcode Sid - */ - get(sid: string): ShortCodeContext; - /** - * Retrieve a single target page of ShortCodeInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; - /** - * Lists ShortCodeInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: ShortCodeListInstanceOptions, callback?: (error: Error | null, items: ShortCodeInstance[]) => any): Promise; - /** - * Retrieve a single page of ShortCodeInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: ShortCodeListInstancePageOptions, callback?: (error: Error | null, items: ShortCodePage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property sid - Delete by unique shortcode Sid - */ -interface ShortCodeListInstanceCreateOptions { - sid: string; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface ShortCodeListInstanceEachOptions { - callback?: (item: ShortCodeInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface ShortCodeListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface ShortCodeListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface ShortCodePayload extends ShortCodeResource, Page.TwilioResponsePayload { -} - -interface ShortCodeResource { - account_sid: string; - capabilities: string; - country_code: string; - date_created: Date; - date_updated: Date; - service_sid: string; - short_code: string; - sid: string; - url: string; -} - -interface ShortCodeSolution { - serviceSid?: string; -} - - -declare class ShortCodePage extends Page { - /** - * Initialize the ShortCodePagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Proxy, response: Response, solution: ShortCodeSolution); - - /** - * Build an instance of ShortCodeInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: ShortCodePayload): ShortCodeInstance; -} - - -declare class ShortCodeInstance extends SerializableClass { - /** - * Initialize the ShortCodeContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this resource - * @property accountSid - Account Sid. - * @property serviceSid - Service Sid. - * @property dateCreated - The date this resource was created - * @property dateUpdated - The date this resource was last updated - * @property shortCode - The short code. e.g., 894546. - * @property countryCode - The ISO 3166-1 alpha-2 country code - * @property capabilities - Indicate if a shortcode can receive messages - * @property url - The URL of this resource. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param serviceSid - Service Sid. - * @param sid - Fetch by unique shortcode Sid - */ - constructor(version: Proxy, payload: ShortCodePayload, serviceSid: string, sid: string); - - private _proxy: ShortCodeContext; - accountSid: string; - capabilities: string; - countryCode: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a ShortCodeInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: ShortCodeInstance) => any): void; - /** - * remove a ShortCodeInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: ShortCodeInstance) => any): void; - serviceSid: string; - shortCode: string; - sid: string; - /** - * Produce a plain JSON object version of the ShortCodeInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - url: string; -} - - -declare class ShortCodeContext { - /** - * Initialize the ShortCodeContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param serviceSid - The service_sid - * @param sid - Fetch by unique shortcode Sid - */ - constructor(version: Proxy, serviceSid: string, sid: string); - - /** - * fetch a ShortCodeInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: ShortCodeInstance) => any): void; - /** - * remove a ShortCodeInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: ShortCodeInstance) => any): void; -} - -export { ShortCodeContext, ShortCodeInstance, ShortCodeList, ShortCodeListInstance, ShortCodeListInstanceCreateOptions, ShortCodeListInstanceEachOptions, ShortCodeListInstanceOptions, ShortCodeListInstancePageOptions, ShortCodePage, ShortCodePayload, ShortCodeResource, ShortCodeSolution } diff --git a/lib/rest/preview/studio/flow.d.ts b/lib/rest/preview/studio/flow.d.ts deleted file mode 100644 index b7dc7db98c..0000000000 --- a/lib/rest/preview/studio/flow.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../base/Page'); -import Response = require('../../../http/response'); -import Studio = require('../Studio'); -import { EngagementList } from './flow/engagement'; -import { EngagementListInstance } from './flow/engagement'; -import { SerializableClass } from '../../../interfaces'; - -type FlowStatus = 'draft'|'published'; - -/** - * @description Initialize the FlowList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - */ -declare function FlowList(version: Studio): FlowListInstance; - -interface FlowListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): FlowContext; - /** - * Streams FlowInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: FlowListInstanceEachOptions, callback?: (item: FlowInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a flow - * - * @param sid - The sid - */ - get(sid: string): FlowContext; - /** - * Retrieve a single target page of FlowInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: FlowPage) => any): Promise; - /** - * Lists FlowInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: FlowListInstanceOptions, callback?: (error: Error | null, items: FlowInstance[]) => any): Promise; - /** - * Retrieve a single page of FlowInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: FlowListInstancePageOptions, callback?: (error: Error | null, items: FlowPage) => any): Promise; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface FlowListInstanceEachOptions { - callback?: (item: FlowInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface FlowListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface FlowListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface FlowPayload extends FlowResource, Page.TwilioResponsePayload { -} - -interface FlowResource { - account_sid: string; - date_created: Date; - date_updated: Date; - debug: boolean; - friendly_name: string; - links: string; - sid: string; - status: FlowStatus; - url: string; - version: number; -} - -interface FlowSolution { -} - - -declare class FlowContext { - /** - * Initialize the FlowContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property engagements - engagements resource - * - * @param version - Version of the resource - * @param sid - The sid - */ - constructor(version: Studio, sid: string); - - engagements: EngagementListInstance; - /** - * fetch a FlowInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: FlowInstance) => any): Promise; - /** - * remove a FlowInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: FlowInstance) => any): void; -} - - -declare class FlowInstance extends SerializableClass { - /** - * Initialize the FlowContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Flow. - * @property accountSid - Account Sid. - * @property friendlyName - A human readable description of this resource. - * @property status - The Status of this Flow - * @property debug - Toggle extra logging. - * @property version - The latest version number of this Flow's definition. - * @property dateCreated - The date this Flow was created - * @property dateUpdated - The date this Flow was updated - * @property url - The URL of this resource. - * @property links - Nested resource URLs. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param sid - The sid - */ - constructor(version: Studio, payload: FlowPayload, sid: string); - - private _proxy: FlowContext; - accountSid: string; - dateCreated: Date; - dateUpdated: Date; - debug: boolean; - /** - * Access the engagements - */ - engagements(): EngagementListInstance; - /** - * fetch a FlowInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: FlowInstance) => any): void; - friendlyName: string; - links: string; - /** - * remove a FlowInstance - * - * @param callback - Callback to handle processed record - */ - remove(callback?: (error: Error | null, items: FlowInstance) => any): void; - sid: string; - status: FlowStatus; - /** - * Produce a plain JSON object version of the FlowInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - url: string; - version: number; -} - - -declare class FlowPage extends Page { - /** - * Initialize the FlowPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Studio, response: Response, solution: FlowSolution); - - /** - * Build an instance of FlowInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: FlowPayload): FlowInstance; -} - -export { FlowContext, FlowInstance, FlowList, FlowListInstance, FlowListInstanceEachOptions, FlowListInstanceOptions, FlowListInstancePageOptions, FlowPage, FlowPayload, FlowResource, FlowSolution } diff --git a/lib/rest/preview/studio/flow/engagement.d.ts b/lib/rest/preview/studio/flow/engagement.d.ts deleted file mode 100644 index 3ff26ed3c7..0000000000 --- a/lib/rest/preview/studio/flow/engagement.d.ts +++ /dev/null @@ -1,274 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../base/Page'); -import Response = require('../../../../http/response'); -import Studio = require('../../Studio'); -import { SerializableClass } from '../../../../interfaces'; -import { StepList } from './engagement/step'; -import { StepListInstance } from './engagement/step'; - -type EngagementStatus = 'active'|'ended'; - -/** - * @description Initialize the EngagementList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param flowSid - Flow Sid. - */ -declare function EngagementList(version: Studio, flowSid: string): EngagementListInstance; - -interface EngagementListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): EngagementContext; - /** - * create a EngagementInstance - * - * @param opts - Options for request - * @param callback - Callback to handle processed record - */ - create(opts: EngagementListInstanceCreateOptions, callback?: (error: Error | null, item: EngagementInstance) => any): Promise; - /** - * Streams EngagementInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: EngagementListInstanceEachOptions, callback?: (item: EngagementInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a engagement - * - * @param sid - The sid - */ - get(sid: string): EngagementContext; - /** - * Retrieve a single target page of EngagementInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: EngagementPage) => any): Promise; - /** - * Lists EngagementInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: EngagementListInstanceOptions, callback?: (error: Error | null, items: EngagementInstance[]) => any): Promise; - /** - * Retrieve a single page of EngagementInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: EngagementListInstancePageOptions, callback?: (error: Error | null, items: EngagementPage) => any): Promise; -} - -/** - * Options to pass to create - * - * @property from - The from - * @property parameters - The parameters - * @property to - The to - */ -interface EngagementListInstanceCreateOptions { - from: string; - parameters?: string; - to: string; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface EngagementListInstanceEachOptions { - callback?: (item: EngagementInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface EngagementListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface EngagementListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface EngagementPayload extends EngagementResource, Page.TwilioResponsePayload { -} - -interface EngagementResource { - account_sid: string; - contact_channel_address: string; - contact_sid: string; - context: string; - date_created: Date; - date_updated: Date; - flow_sid: string; - links: string; - sid: string; - status: EngagementStatus; - url: string; -} - -interface EngagementSolution { - flowSid?: string; -} - - -declare class EngagementContext { - /** - * Initialize the EngagementContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property steps - steps resource - * - * @param version - Version of the resource - * @param flowSid - The flow_sid - * @param sid - The sid - */ - constructor(version: Studio, flowSid: string, sid: string); - - /** - * fetch a EngagementInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: EngagementInstance) => any): Promise; - steps: StepListInstance; -} - - -declare class EngagementInstance extends SerializableClass { - /** - * Initialize the EngagementContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Engagement. - * @property accountSid - Account Sid. - * @property flowSid - Flow Sid. - * @property contactSid - Contact Sid. - * @property contactChannelAddress - The phone number, SIP address or Client identifier that triggered this Engagement. - * @property status - The Status of this Engagement - * @property context - Nested resource URLs. - * @property dateCreated - The date this Engagement was created - * @property dateUpdated - The date this Engagement was updated - * @property url - The URL of this resource. - * @property links - Nested resource URLs. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param flowSid - Flow Sid. - * @param sid - The sid - */ - constructor(version: Studio, payload: EngagementPayload, flowSid: string, sid: string); - - private _proxy: EngagementContext; - accountSid: string; - contactChannelAddress: string; - contactSid: string; - context: string; - dateCreated: Date; - dateUpdated: Date; - /** - * fetch a EngagementInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: EngagementInstance) => any): void; - flowSid: string; - links: string; - sid: string; - status: EngagementStatus; - /** - * Access the steps - */ - steps(): StepListInstance; - /** - * Produce a plain JSON object version of the EngagementInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - url: string; -} - - -declare class EngagementPage extends Page { - /** - * Initialize the EngagementPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Studio, response: Response, solution: EngagementSolution); - - /** - * Build an instance of EngagementInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: EngagementPayload): EngagementInstance; -} - -export { EngagementContext, EngagementInstance, EngagementList, EngagementListInstance, EngagementListInstanceCreateOptions, EngagementListInstanceEachOptions, EngagementListInstanceOptions, EngagementListInstancePageOptions, EngagementPage, EngagementPayload, EngagementResource, EngagementSolution } diff --git a/lib/rest/preview/studio/flow/engagement/step.d.ts b/lib/rest/preview/studio/flow/engagement/step.d.ts deleted file mode 100644 index be2f2aec1c..0000000000 --- a/lib/rest/preview/studio/flow/engagement/step.d.ts +++ /dev/null @@ -1,247 +0,0 @@ -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -import Page = require('../../../../../base/Page'); -import Response = require('../../../../../http/response'); -import Studio = require('../../../Studio'); -import { SerializableClass } from '../../../../../interfaces'; - -/** - * @description Initialize the StepList - * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param flowSid - Flow Sid. - * @param engagementSid - Engagement Sid. - */ -declare function StepList(version: Studio, flowSid: string, engagementSid: string): StepListInstance; - -interface StepListInstance { - /** - * @param sid - sid of instance - */ - (sid: string): StepContext; - /** - * Streams StepInstance records from the API. - * - * This operation lazily loads records as efficiently as possible until the limit - * is reached. - * - * The results are passed into the callback function, so this operation is memory efficient. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Function to process each record - */ - each(opts?: StepListInstanceEachOptions, callback?: (item: StepInstance, done: (err?: Error) => void) => void): void; - /** - * Constructs a step - * - * @param sid - The sid - */ - get(sid: string): StepContext; - /** - * Retrieve a single target page of StepInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param targetUrl - API-generated URL for the requested results page - * @param callback - Callback to handle list of records - */ - getPage(targetUrl?: string, callback?: (error: Error | null, items: StepPage) => any): Promise; - /** - * Lists StepInstance records from the API as a list. - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - list(opts?: StepListInstanceOptions, callback?: (error: Error | null, items: StepInstance[]) => any): Promise; - /** - * Retrieve a single page of StepInstance records from the API. - * Request is executed immediately - * - * If a function is passed as the first argument, it will be used as the callback function. - * - * @param opts - Options for request - * @param callback - Callback to handle list of records - */ - page(opts?: StepListInstancePageOptions, callback?: (error: Error | null, items: StepPage) => any): Promise; -} - -/** - * Options to pass to each - * - * @property callback - - * Function to process each record. If this and a positional - * callback are passed, this one will be used - * @property done - Function to be called upon completion of streaming - * @property limit - - * Upper limit for the number of records to return. - * each() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no pageSize is defined but a limit is defined, - * each() will attempt to read the limit with the most efficient - * page size, i.e. min(limit, 1000) - */ -interface StepListInstanceEachOptions { - callback?: (item: StepInstance, done: (err?: Error) => void) => void; - done?: Function; - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to list - * - * @property limit - - * Upper limit for the number of records to return. - * list() guarantees never to return more than limit. - * Default is no limit - * @property pageSize - - * Number of records to fetch per request, - * when not set will use the default value of 50 records. - * If no page_size is defined but a limit is defined, - * list() will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - */ -interface StepListInstanceOptions { - limit?: number; - pageSize?: number; -} - -/** - * Options to pass to page - * - * @property pageNumber - Page Number, this value is simply for client state - * @property pageSize - Number of records to return, defaults to 50 - * @property pageToken - PageToken provided by the API - */ -interface StepListInstancePageOptions { - pageNumber?: number; - pageSize?: number; - pageToken?: string; -} - -interface StepPayload extends StepResource, Page.TwilioResponsePayload { -} - -interface StepResource { - account_sid: string; - context: string; - date_created: Date; - date_updated: Date; - engagement_sid: string; - flow_sid: string; - name: string; - sid: string; - transitioned_from: string; - transitioned_to: string; - url: string; -} - -interface StepSolution { - engagementSid?: string; - flowSid?: string; -} - - -declare class StepContext { - /** - * Initialize the StepContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param flowSid - The flow_sid - * @param engagementSid - The engagement_sid - * @param sid - The sid - */ - constructor(version: Studio, flowSid: string, engagementSid: string, sid: string); - - /** - * fetch a StepInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: StepInstance) => any): Promise; -} - - -declare class StepInstance extends SerializableClass { - /** - * Initialize the StepContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @property sid - A string that uniquely identifies this Step. - * @property accountSid - Account Sid. - * @property flowSid - Flow Sid. - * @property engagementSid - Engagement Sid. - * @property name - The Widget that implemented this Step. - * @property context - Nested resource URLs. - * @property transitionedFrom - The Widget that preceded the Widget for this Step. - * @property transitionedTo - The Widget that will follow the Widget for this Step. - * @property dateCreated - The date this Step was created - * @property dateUpdated - The date this Step was updated - * @property url - The URL of this resource. - * - * @param version - Version of the resource - * @param payload - The instance payload - * @param flowSid - Flow Sid. - * @param engagementSid - Engagement Sid. - * @param sid - The sid - */ - constructor(version: Studio, payload: StepPayload, flowSid: string, engagementSid: string, sid: string); - - private _proxy: StepContext; - accountSid: string; - context: string; - dateCreated: Date; - dateUpdated: Date; - engagementSid: string; - /** - * fetch a StepInstance - * - * @param callback - Callback to handle processed record - */ - fetch(callback?: (error: Error | null, items: StepInstance) => any): void; - flowSid: string; - name: string; - sid: string; - /** - * Produce a plain JSON object version of the StepInstance for serialization. - * Removes any circular references in the object. - */ - toJSON(): any; - transitionedFrom: string; - transitionedTo: string; - url: string; -} - - -declare class StepPage extends Page { - /** - * Initialize the StepPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. - * - * @param version - Version of the resource - * @param response - Response from the API - * @param solution - Path solution - */ - constructor(version: Studio, response: Response, solution: StepSolution); - - /** - * Build an instance of StepInstance - * - * @param payload - Payload response from the API - */ - getInstance(payload: StepPayload): StepInstance; -} - -export { StepContext, StepInstance, StepList, StepListInstance, StepListInstanceEachOptions, StepListInstanceOptions, StepListInstancePageOptions, StepPage, StepPayload, StepResource, StepSolution } diff --git a/lib/rest/preview/understand/assistant.d.ts b/lib/rest/preview/understand/assistant.d.ts index f65029ae73..a577595f1b 100644 --- a/lib/rest/preview/understand/assistant.d.ts +++ b/lib/rest/preview/understand/assistant.d.ts @@ -9,6 +9,10 @@ import Page = require('../../../base/Page'); import Response = require('../../../http/response'); import Understand = require('../Understand'); import serialize = require('../../../base/serialize'); +import { AssistantFallbackActionsList } from './assistant/assistantFallbackActions'; +import { AssistantFallbackActionsListInstance } from './assistant/assistantFallbackActions'; +import { AssistantInitiationActionsList } from './assistant/assistantInitiationActions'; +import { AssistantInitiationActionsListInstance } from './assistant/assistantInitiationActions'; import { FieldTypeList } from './assistant/fieldType'; import { FieldTypeListInstance } from './assistant/fieldType'; import { IntentList } from './assistant/intent'; @@ -32,17 +36,19 @@ declare function AssistantList(version: Understand): AssistantListInstance; * * @property callbackEvents - The callback_events * @property callbackUrl - The callback_url + * @property fallbackActions - The fallback_actions * @property friendlyName - A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @property initiationActions - The initiation_actions * @property logQueries - A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - * @property responseUrl - The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @property uniqueName - A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. */ interface AssistantInstanceUpdateOptions { callbackEvents?: string; callbackUrl?: string; + fallbackActions?: string; friendlyName?: string; + initiationActions?: string; logQueries?: boolean; - responseUrl?: string; uniqueName?: string; } @@ -114,17 +120,19 @@ interface AssistantListInstance { * * @property callbackEvents - The callback_events * @property callbackUrl - The callback_url + * @property fallbackActions - The fallback_actions * @property friendlyName - A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @property initiationActions - The initiation_actions * @property logQueries - A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - * @property responseUrl - The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @property uniqueName - A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. */ interface AssistantListInstanceCreateOptions { callbackEvents?: string; callbackUrl?: string; + fallbackActions?: string; friendlyName?: string; + initiationActions?: string; logQueries?: boolean; - responseUrl?: string; uniqueName?: string; } @@ -198,7 +206,6 @@ interface AssistantResource { latest_model_build_sid: string; links: string; log_queries: boolean; - response_url: string; sid: string; unique_name: string; url: string; @@ -216,12 +223,16 @@ declare class AssistantContext { * @property intents - intents resource * @property modelBuilds - modelBuilds resource * @property queries - queries resource + * @property assistantFallbackActions - assistantFallbackActions resource + * @property assistantInitiationActions - assistantInitiationActions resource * * @param version - Version of the resource * @param sid - The sid */ constructor(version: Understand, sid: string); + assistantFallbackActions: AssistantFallbackActionsListInstance; + assistantInitiationActions: AssistantInitiationActionsListInstance; /** * fetch a AssistantInstance * @@ -262,7 +273,6 @@ declare class AssistantInstance extends SerializableClass { * @property sid - A 34 character string that uniquely identifies this resource. * @property uniqueName - A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long. * @property url - The url - * @property responseUrl - The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @property callbackUrl - The callback_url * @property callbackEvents - The callback_events * @@ -274,6 +284,14 @@ declare class AssistantInstance extends SerializableClass { private _proxy: AssistantContext; accountSid: string; + /** + * Access the assistantFallbackActions + */ + assistantFallbackActions(): AssistantFallbackActionsListInstance; + /** + * Access the assistantInitiationActions + */ + assistantInitiationActions(): AssistantInitiationActionsListInstance; callbackEvents: string; callbackUrl: string; dateCreated: Date; @@ -310,7 +328,6 @@ declare class AssistantInstance extends SerializableClass { * @param callback - Callback to handle processed record */ remove(callback?: (error: Error | null, items: AssistantInstance) => any): void; - responseUrl: string; sid: string; /** * Produce a plain JSON object version of the AssistantInstance for serialization. diff --git a/lib/rest/preview/understand/assistant.js b/lib/rest/preview/understand/assistant.js index 9b1882409c..d1a677f4e7 100644 --- a/lib/rest/preview/understand/assistant.js +++ b/lib/rest/preview/understand/assistant.js @@ -11,6 +11,10 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ +var AssistantFallbackActionsList = require( + './assistant/assistantFallbackActions').AssistantFallbackActionsList; +var AssistantInitiationActionsList = require( + './assistant/assistantInitiationActions').AssistantInitiationActionsList; var FieldTypeList = require('./assistant/fieldType').FieldTypeList; var IntentList = require('./assistant/intent').IntentList; var ModelBuildList = require('./assistant/modelBuild').ModelBuildList; @@ -288,10 +292,10 @@ AssistantList = function AssistantList(version) { * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * @param {string} [opts.uniqueName] - * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - * @param {string} [opts.responseUrl] - - * The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @param {string} [opts.callbackUrl] - The callback_url * @param {string} [opts.callbackEvents] - The callback_events + * @param {string} [opts.fallbackActions] - The fallback_actions + * @param {string} [opts.initiationActions] - The initiation_actions * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance @@ -309,9 +313,10 @@ AssistantList = function AssistantList(version) { 'FriendlyName': _.get(opts, 'friendlyName'), 'LogQueries': serialize.bool(_.get(opts, 'logQueries')), 'UniqueName': _.get(opts, 'uniqueName'), - 'ResponseUrl': _.get(opts, 'responseUrl'), 'CallbackUrl': _.get(opts, 'callbackUrl'), - 'CallbackEvents': _.get(opts, 'callbackEvents') + 'CallbackEvents': _.get(opts, 'callbackEvents'), + 'FallbackActions': serialize.object(_.get(opts, 'fallbackActions')), + 'InitiationActions': serialize.object(_.get(opts, 'initiationActions')) }); var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); @@ -403,8 +408,6 @@ AssistantPage.prototype.getInstance = function getInstance(payload) { * @property {string} uniqueName - * A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long. * @property {string} url - The url - * @property {string} responseUrl - - * The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @property {string} callbackUrl - The callback_url * @property {string} callbackEvents - The callback_events * @@ -427,7 +430,6 @@ AssistantInstance = function AssistantInstance(version, payload, sid) { this.sid = payload.sid; // jshint ignore:line this.uniqueName = payload.unique_name; // jshint ignore:line this.url = payload.url; // jshint ignore:line - this.responseUrl = payload.response_url; // jshint ignore:line this.callbackUrl = payload.callback_url; // jshint ignore:line this.callbackEvents = payload.callback_events; // jshint ignore:line @@ -471,10 +473,10 @@ AssistantInstance.prototype.fetch = function fetch(callback) { * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * @param {string} [opts.uniqueName] - * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - * @param {string} [opts.responseUrl] - - * The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @param {string} [opts.callbackUrl] - The callback_url * @param {string} [opts.callbackEvents] - The callback_events + * @param {string} [opts.fallbackActions] - The fallback_actions + * @param {string} [opts.initiationActions] - The initiation_actions * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance @@ -541,6 +543,30 @@ AssistantInstance.prototype.queries = function queries() { return this._proxy.queries; }; +/* jshint ignore:start */ +/** + * Access the assistantFallbackActions + * + * @returns {Twilio.Preview.Understand.AssistantContext.AssistantFallbackActionsList} + */ +/* jshint ignore:end */ +AssistantInstance.prototype.assistantFallbackActions = function + assistantFallbackActions() { + return this._proxy.assistantFallbackActions; +}; + +/* jshint ignore:start */ +/** + * Access the assistantInitiationActions + * + * @returns {Twilio.Preview.Understand.AssistantContext.AssistantInitiationActionsList} + */ +/* jshint ignore:end */ +AssistantInstance.prototype.assistantInitiationActions = function + assistantInitiationActions() { + return this._proxy.assistantInitiationActions; +}; + /* jshint ignore:start */ /** * Produce a plain JSON object version of the AssistantInstance for serialization. @@ -572,6 +598,10 @@ AssistantInstance.prototype.toJSON = function toJSON() { * modelBuilds resource * @property {Twilio.Preview.Understand.AssistantContext.QueryList} queries - * queries resource + * @property {Twilio.Preview.Understand.AssistantContext.AssistantFallbackActionsList} assistantFallbackActions - + * assistantFallbackActions resource + * @property {Twilio.Preview.Understand.AssistantContext.AssistantInitiationActionsList} assistantInitiationActions - + * assistantInitiationActions resource * * @param {Understand} version - Version of the resource * @param {sid_like} sid - The sid @@ -591,6 +621,8 @@ AssistantContext = function AssistantContext(version, sid) { this._intents = undefined; this._modelBuilds = undefined; this._queries = undefined; + this._assistantFallbackActions = undefined; + this._assistantInitiationActions = undefined; }; /* jshint ignore:start */ @@ -632,10 +664,10 @@ AssistantContext.prototype.fetch = function fetch(callback) { * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * @param {string} [opts.uniqueName] - * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - * @param {string} [opts.responseUrl] - - * The webhook URL called to fetch the response to an incoming communication expressed in Assistant TwiML. * @param {string} [opts.callbackUrl] - The callback_url * @param {string} [opts.callbackEvents] - The callback_events + * @param {string} [opts.fallbackActions] - The fallback_actions + * @param {string} [opts.initiationActions] - The initiation_actions * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AssistantInstance @@ -653,9 +685,10 @@ AssistantContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName'), 'LogQueries': serialize.bool(_.get(opts, 'logQueries')), 'UniqueName': _.get(opts, 'uniqueName'), - 'ResponseUrl': _.get(opts, 'responseUrl'), 'CallbackUrl': _.get(opts, 'callbackUrl'), - 'CallbackEvents': _.get(opts, 'callbackEvents') + 'CallbackEvents': _.get(opts, 'callbackEvents'), + 'FallbackActions': serialize.object(_.get(opts, 'fallbackActions')), + 'InitiationActions': serialize.object(_.get(opts, 'initiationActions')) }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); @@ -743,6 +776,32 @@ Object.defineProperty(AssistantContext.prototype, } }); +Object.defineProperty(AssistantContext.prototype, + 'assistantFallbackActions', { + get: function() { + if (!this._assistantFallbackActions) { + this._assistantFallbackActions = new AssistantFallbackActionsList( + this._version, + this._solution.sid + ); + } + return this._assistantFallbackActions; + } +}); + +Object.defineProperty(AssistantContext.prototype, + 'assistantInitiationActions', { + get: function() { + if (!this._assistantInitiationActions) { + this._assistantInitiationActions = new AssistantInitiationActionsList( + this._version, + this._solution.sid + ); + } + return this._assistantInitiationActions; + } +}); + module.exports = { AssistantList: AssistantList, AssistantPage: AssistantPage, diff --git a/lib/rest/preview/understand/assistant/assistantFallbackActions.d.ts b/lib/rest/preview/understand/assistant/assistantFallbackActions.d.ts new file mode 100644 index 0000000000..9598891ceb --- /dev/null +++ b/lib/rest/preview/understand/assistant/assistantFallbackActions.d.ts @@ -0,0 +1,142 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Page = require('../../../../base/Page'); +import Response = require('../../../../http/response'); +import Understand = require('../../Understand'); +import serialize = require('../../../../base/serialize'); +import { SerializableClass } from '../../../../interfaces'; + +/** + * @description Initialize the AssistantFallbackActionsList + * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param assistantSid - The assistant_sid + */ +declare function AssistantFallbackActionsList(version: Understand, assistantSid: string): AssistantFallbackActionsListInstance; + +/** + * Options to pass to update + * + * @property fallbackActions - The fallback_actions + */ +interface AssistantFallbackActionsInstanceUpdateOptions { + fallbackActions?: string; +} + +interface AssistantFallbackActionsListInstance { + /** + * @param sid - sid of instance + */ + (sid: string): AssistantFallbackActionsContext; + /** + * Constructs a assistant_fallback_actions + */ + get(): AssistantFallbackActionsContext; +} + +interface AssistantFallbackActionsPayload extends AssistantFallbackActionsResource, Page.TwilioResponsePayload { +} + +interface AssistantFallbackActionsResource { + account_sid: string; + assistant_sid: string; + data: string; + url: string; +} + +interface AssistantFallbackActionsSolution { + assistantSid?: string; +} + + +declare class AssistantFallbackActionsContext { + /** + * Initialize the AssistantFallbackActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param assistantSid - The assistant_sid + */ + constructor(version: Understand, assistantSid: string); + + /** + * fetch a AssistantFallbackActionsInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: AssistantFallbackActionsInstance) => any): Promise; + /** + * update a AssistantFallbackActionsInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts?: AssistantFallbackActionsInstanceUpdateOptions, callback?: (error: Error | null, items: AssistantFallbackActionsInstance) => any): Promise; +} + + +declare class AssistantFallbackActionsInstance extends SerializableClass { + /** + * Initialize the AssistantFallbackActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @property accountSid - The account_sid + * @property assistantSid - The assistant_sid + * @property url - The url + * @property data - The data + * + * @param version - Version of the resource + * @param payload - The instance payload + * @param assistantSid - The assistant_sid + */ + constructor(version: Understand, payload: AssistantFallbackActionsPayload, assistantSid: string); + + private _proxy: AssistantFallbackActionsContext; + accountSid: string; + assistantSid: string; + data: string; + /** + * fetch a AssistantFallbackActionsInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: AssistantFallbackActionsInstance) => any): void; + /** + * Produce a plain JSON object version of the AssistantFallbackActionsInstance for serialization. + * Removes any circular references in the object. + */ + toJSON(): any; + /** + * update a AssistantFallbackActionsInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts?: AssistantFallbackActionsInstanceUpdateOptions, callback?: (error: Error | null, items: AssistantFallbackActionsInstance) => any): void; + url: string; +} + + +declare class AssistantFallbackActionsPage extends Page { + /** + * Initialize the AssistantFallbackActionsPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Understand, response: Response, solution: AssistantFallbackActionsSolution); + + /** + * Build an instance of AssistantFallbackActionsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssistantFallbackActionsPayload): AssistantFallbackActionsInstance; +} + +export { AssistantFallbackActionsContext, AssistantFallbackActionsInstance, AssistantFallbackActionsList, AssistantFallbackActionsListInstance, AssistantFallbackActionsPage, AssistantFallbackActionsPayload, AssistantFallbackActionsResource, AssistantFallbackActionsSolution } diff --git a/lib/rest/preview/understand/assistant/assistantFallbackActions.js b/lib/rest/preview/understand/assistant/assistantFallbackActions.js new file mode 100644 index 0000000000..18e5f25dcf --- /dev/null +++ b/lib/rest/preview/understand/assistant/assistantFallbackActions.js @@ -0,0 +1,287 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var Q = require('q'); /* jshint ignore:line */ +var _ = require('lodash'); /* jshint ignore:line */ +var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var serialize = require('../../../../base/serialize'); /* jshint ignore:line */ +var values = require('../../../../base/values'); /* jshint ignore:line */ + +var AssistantFallbackActionsList; +var AssistantFallbackActionsPage; +var AssistantFallbackActionsInstance; +var AssistantFallbackActionsContext; + +/* jshint ignore:start */ +/** + * @description Initialize the AssistantFallbackActionsList + * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Twilio.Preview.Understand} version - Version of the resource + * @param {string} assistantSid - The assistant_sid + */ +/* jshint ignore:end */ +AssistantFallbackActionsList = function AssistantFallbackActionsList(version, + assistantSid) { + /* jshint ignore:start */ + /** + * @param {string} sid - sid of instance + * + * @returns {Twilio.Preview.Understand.AssistantContext.AssistantFallbackActionsContext} + */ + /* jshint ignore:end */ + function AssistantFallbackActionsListInstance(sid) { + return AssistantFallbackActionsListInstance.get(sid); + } + + AssistantFallbackActionsListInstance._version = version; + // Path Solution + AssistantFallbackActionsListInstance._solution = {assistantSid: assistantSid}; + /* jshint ignore:start */ + /** + * Constructs a assistant_fallback_actions + * + * @returns {Twilio.Preview.Understand.AssistantContext.AssistantFallbackActionsContext} + */ + /* jshint ignore:end */ + AssistantFallbackActionsListInstance.get = function get() { + return new AssistantFallbackActionsContext(this._version, this._solution.assistantSid); + }; + + return AssistantFallbackActionsListInstance; +}; + + +/* jshint ignore:start */ +/** + * Initialize the AssistantFallbackActionsPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Understand} version - Version of the resource + * @param {Response} response - Response from the API + * @param {AssistantFallbackActionsSolution} solution - Path solution + * + * @returns AssistantFallbackActionsPage + */ +/* jshint ignore:end */ +AssistantFallbackActionsPage = function AssistantFallbackActionsPage(version, + response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(AssistantFallbackActionsPage.prototype, Page.prototype); +AssistantFallbackActionsPage.prototype.constructor = AssistantFallbackActionsPage; + +/* jshint ignore:start */ +/** + * Build an instance of AssistantFallbackActionsInstance + * + * @param {AssistantFallbackActionsPayload} payload - Payload response from the API + * + * @returns AssistantFallbackActionsInstance + */ +/* jshint ignore:end */ +AssistantFallbackActionsPage.prototype.getInstance = function + getInstance(payload) { + return new AssistantFallbackActionsInstance(this._version, payload, this._solution.assistantSid); +}; + + +/* jshint ignore:start */ +/** + * Initialize the AssistantFallbackActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @property {string} accountSid - The account_sid + * @property {string} assistantSid - The assistant_sid + * @property {string} url - The url + * @property {string} data - The data + * + * @param {Understand} version - Version of the resource + * @param {AssistantFallbackActionsPayload} payload - The instance payload + * @param {sid} assistantSid - The assistant_sid + */ +/* jshint ignore:end */ +AssistantFallbackActionsInstance = function + AssistantFallbackActionsInstance(version, payload, assistantSid) { + this._version = version; + + // Marshaled Properties + this.accountSid = payload.account_sid; // jshint ignore:line + this.assistantSid = payload.assistant_sid; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.data = payload.data; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {assistantSid: assistantSid, }; +}; + +Object.defineProperty(AssistantFallbackActionsInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new AssistantFallbackActionsContext(this._version, this._solution.assistantSid); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a AssistantFallbackActionsInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantFallbackActionsInstance + */ +/* jshint ignore:end */ +AssistantFallbackActionsInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * update a AssistantFallbackActionsInstance + * + * @param {object} [opts] - Options for request + * @param {string} [opts.fallbackActions] - The fallback_actions + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantFallbackActionsInstance + */ +/* jshint ignore:end */ +AssistantFallbackActionsInstance.prototype.update = function update(opts, + callback) { + return this._proxy.update(opts, callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the AssistantFallbackActionsInstance for serialization. + * Removes any circular references in the object. + * + * @returns Object + */ +/* jshint ignore:end */ +AssistantFallbackActionsInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * Initialize the AssistantFallbackActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Understand} version - Version of the resource + * @param {sid_like} assistantSid - The assistant_sid + */ +/* jshint ignore:end */ +AssistantFallbackActionsContext = function + AssistantFallbackActionsContext(version, assistantSid) { + this._version = version; + + // Path Solution + this._solution = {assistantSid: assistantSid, }; + this._uri = _.template( + '/Assistants/<%= assistantSid %>/FallbackActions' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a AssistantFallbackActionsInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantFallbackActionsInstance + */ +/* jshint ignore:end */ +AssistantFallbackActionsContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new AssistantFallbackActionsInstance( + this._version, + payload, + this._solution.assistantSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a AssistantFallbackActionsInstance + * + * @param {object} [opts] - Options for request + * @param {string} [opts.fallbackActions] - The fallback_actions + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantFallbackActionsInstance + */ +/* jshint ignore:end */ +AssistantFallbackActionsContext.prototype.update = function update(opts, + callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({'FallbackActions': serialize.object(_.get(opts, 'fallbackActions'))}); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new AssistantFallbackActionsInstance( + this._version, + payload, + this._solution.assistantSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + AssistantFallbackActionsList: AssistantFallbackActionsList, + AssistantFallbackActionsPage: AssistantFallbackActionsPage, + AssistantFallbackActionsInstance: AssistantFallbackActionsInstance, + AssistantFallbackActionsContext: AssistantFallbackActionsContext +}; diff --git a/lib/rest/preview/understand/assistant/assistantInitiationActions.d.ts b/lib/rest/preview/understand/assistant/assistantInitiationActions.d.ts new file mode 100644 index 0000000000..a2ca1c7286 --- /dev/null +++ b/lib/rest/preview/understand/assistant/assistantInitiationActions.d.ts @@ -0,0 +1,142 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Page = require('../../../../base/Page'); +import Response = require('../../../../http/response'); +import Understand = require('../../Understand'); +import serialize = require('../../../../base/serialize'); +import { SerializableClass } from '../../../../interfaces'; + +/** + * @description Initialize the AssistantInitiationActionsList + * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param assistantSid - The assistant_sid + */ +declare function AssistantInitiationActionsList(version: Understand, assistantSid: string): AssistantInitiationActionsListInstance; + +/** + * Options to pass to update + * + * @property initiationActions - The initiation_actions + */ +interface AssistantInitiationActionsInstanceUpdateOptions { + initiationActions?: string; +} + +interface AssistantInitiationActionsListInstance { + /** + * @param sid - sid of instance + */ + (sid: string): AssistantInitiationActionsContext; + /** + * Constructs a assistant_initiation_actions + */ + get(): AssistantInitiationActionsContext; +} + +interface AssistantInitiationActionsPayload extends AssistantInitiationActionsResource, Page.TwilioResponsePayload { +} + +interface AssistantInitiationActionsResource { + account_sid: string; + assistant_sid: string; + data: string; + url: string; +} + +interface AssistantInitiationActionsSolution { + assistantSid?: string; +} + + +declare class AssistantInitiationActionsContext { + /** + * Initialize the AssistantInitiationActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param assistantSid - The assistant_sid + */ + constructor(version: Understand, assistantSid: string); + + /** + * fetch a AssistantInitiationActionsInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: AssistantInitiationActionsInstance) => any): Promise; + /** + * update a AssistantInitiationActionsInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts?: AssistantInitiationActionsInstanceUpdateOptions, callback?: (error: Error | null, items: AssistantInitiationActionsInstance) => any): Promise; +} + + +declare class AssistantInitiationActionsInstance extends SerializableClass { + /** + * Initialize the AssistantInitiationActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @property accountSid - The account_sid + * @property assistantSid - The assistant_sid + * @property url - The url + * @property data - The data + * + * @param version - Version of the resource + * @param payload - The instance payload + * @param assistantSid - The assistant_sid + */ + constructor(version: Understand, payload: AssistantInitiationActionsPayload, assistantSid: string); + + private _proxy: AssistantInitiationActionsContext; + accountSid: string; + assistantSid: string; + data: string; + /** + * fetch a AssistantInitiationActionsInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: AssistantInitiationActionsInstance) => any): void; + /** + * Produce a plain JSON object version of the AssistantInitiationActionsInstance for serialization. + * Removes any circular references in the object. + */ + toJSON(): any; + /** + * update a AssistantInitiationActionsInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts?: AssistantInitiationActionsInstanceUpdateOptions, callback?: (error: Error | null, items: AssistantInitiationActionsInstance) => any): void; + url: string; +} + + +declare class AssistantInitiationActionsPage extends Page { + /** + * Initialize the AssistantInitiationActionsPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Understand, response: Response, solution: AssistantInitiationActionsSolution); + + /** + * Build an instance of AssistantInitiationActionsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: AssistantInitiationActionsPayload): AssistantInitiationActionsInstance; +} + +export { AssistantInitiationActionsContext, AssistantInitiationActionsInstance, AssistantInitiationActionsList, AssistantInitiationActionsListInstance, AssistantInitiationActionsPage, AssistantInitiationActionsPayload, AssistantInitiationActionsResource, AssistantInitiationActionsSolution } diff --git a/lib/rest/preview/understand/assistant/assistantInitiationActions.js b/lib/rest/preview/understand/assistant/assistantInitiationActions.js new file mode 100644 index 0000000000..39813516bd --- /dev/null +++ b/lib/rest/preview/understand/assistant/assistantInitiationActions.js @@ -0,0 +1,288 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var Q = require('q'); /* jshint ignore:line */ +var _ = require('lodash'); /* jshint ignore:line */ +var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var serialize = require('../../../../base/serialize'); /* jshint ignore:line */ +var values = require('../../../../base/values'); /* jshint ignore:line */ + +var AssistantInitiationActionsList; +var AssistantInitiationActionsPage; +var AssistantInitiationActionsInstance; +var AssistantInitiationActionsContext; + +/* jshint ignore:start */ +/** + * @description Initialize the AssistantInitiationActionsList + * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Twilio.Preview.Understand} version - Version of the resource + * @param {string} assistantSid - The assistant_sid + */ +/* jshint ignore:end */ +AssistantInitiationActionsList = function + AssistantInitiationActionsList(version, assistantSid) { + /* jshint ignore:start */ + /** + * @param {string} sid - sid of instance + * + * @returns {Twilio.Preview.Understand.AssistantContext.AssistantInitiationActionsContext} + */ + /* jshint ignore:end */ + function AssistantInitiationActionsListInstance(sid) { + return AssistantInitiationActionsListInstance.get(sid); + } + + AssistantInitiationActionsListInstance._version = version; + // Path Solution + AssistantInitiationActionsListInstance._solution = {assistantSid: assistantSid}; + /* jshint ignore:start */ + /** + * Constructs a assistant_initiation_actions + * + * @returns {Twilio.Preview.Understand.AssistantContext.AssistantInitiationActionsContext} + */ + /* jshint ignore:end */ + AssistantInitiationActionsListInstance.get = function get() { + return new AssistantInitiationActionsContext(this._version, this._solution.assistantSid); + }; + + return AssistantInitiationActionsListInstance; +}; + + +/* jshint ignore:start */ +/** + * Initialize the AssistantInitiationActionsPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Understand} version - Version of the resource + * @param {Response} response - Response from the API + * @param {AssistantInitiationActionsSolution} solution - Path solution + * + * @returns AssistantInitiationActionsPage + */ +/* jshint ignore:end */ +AssistantInitiationActionsPage = function + AssistantInitiationActionsPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(AssistantInitiationActionsPage.prototype, Page.prototype); +AssistantInitiationActionsPage.prototype.constructor = AssistantInitiationActionsPage; + +/* jshint ignore:start */ +/** + * Build an instance of AssistantInitiationActionsInstance + * + * @param {AssistantInitiationActionsPayload} payload - + * Payload response from the API + * + * @returns AssistantInitiationActionsInstance + */ +/* jshint ignore:end */ +AssistantInitiationActionsPage.prototype.getInstance = function + getInstance(payload) { + return new AssistantInitiationActionsInstance(this._version, payload, this._solution.assistantSid); +}; + + +/* jshint ignore:start */ +/** + * Initialize the AssistantInitiationActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @property {string} accountSid - The account_sid + * @property {string} assistantSid - The assistant_sid + * @property {string} url - The url + * @property {string} data - The data + * + * @param {Understand} version - Version of the resource + * @param {AssistantInitiationActionsPayload} payload - The instance payload + * @param {sid} assistantSid - The assistant_sid + */ +/* jshint ignore:end */ +AssistantInitiationActionsInstance = function + AssistantInitiationActionsInstance(version, payload, assistantSid) { + this._version = version; + + // Marshaled Properties + this.accountSid = payload.account_sid; // jshint ignore:line + this.assistantSid = payload.assistant_sid; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.data = payload.data; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {assistantSid: assistantSid, }; +}; + +Object.defineProperty(AssistantInitiationActionsInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new AssistantInitiationActionsContext(this._version, this._solution.assistantSid); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a AssistantInitiationActionsInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantInitiationActionsInstance + */ +/* jshint ignore:end */ +AssistantInitiationActionsInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * update a AssistantInitiationActionsInstance + * + * @param {object} [opts] - Options for request + * @param {string} [opts.initiationActions] - The initiation_actions + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantInitiationActionsInstance + */ +/* jshint ignore:end */ +AssistantInitiationActionsInstance.prototype.update = function update(opts, + callback) { + return this._proxy.update(opts, callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the AssistantInitiationActionsInstance for serialization. + * Removes any circular references in the object. + * + * @returns Object + */ +/* jshint ignore:end */ +AssistantInitiationActionsInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * Initialize the AssistantInitiationActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Understand} version - Version of the resource + * @param {sid_like} assistantSid - The assistant_sid + */ +/* jshint ignore:end */ +AssistantInitiationActionsContext = function + AssistantInitiationActionsContext(version, assistantSid) { + this._version = version; + + // Path Solution + this._solution = {assistantSid: assistantSid, }; + this._uri = _.template( + '/Assistants/<%= assistantSid %>/InitiationActions' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a AssistantInitiationActionsInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantInitiationActionsInstance + */ +/* jshint ignore:end */ +AssistantInitiationActionsContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new AssistantInitiationActionsInstance( + this._version, + payload, + this._solution.assistantSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a AssistantInitiationActionsInstance + * + * @param {object} [opts] - Options for request + * @param {string} [opts.initiationActions] - The initiation_actions + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed AssistantInitiationActionsInstance + */ +/* jshint ignore:end */ +AssistantInitiationActionsContext.prototype.update = function update(opts, + callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({'InitiationActions': serialize.object(_.get(opts, 'initiationActions'))}); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new AssistantInitiationActionsInstance( + this._version, + payload, + this._solution.assistantSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + AssistantInitiationActionsList: AssistantInitiationActionsList, + AssistantInitiationActionsPage: AssistantInitiationActionsPage, + AssistantInitiationActionsInstance: AssistantInitiationActionsInstance, + AssistantInitiationActionsContext: AssistantInitiationActionsContext +}; diff --git a/lib/rest/preview/understand/assistant/intent.d.ts b/lib/rest/preview/understand/assistant/intent.d.ts index db45d21cff..4ac91fd37a 100644 --- a/lib/rest/preview/understand/assistant/intent.d.ts +++ b/lib/rest/preview/understand/assistant/intent.d.ts @@ -8,8 +8,11 @@ import Page = require('../../../../base/Page'); import Response = require('../../../../http/response'); import Understand = require('../../Understand'); +import serialize = require('../../../../base/serialize'); import { FieldList } from './intent/field'; import { FieldListInstance } from './intent/field'; +import { IntentActionsList } from './intent/intentActions'; +import { IntentActionsListInstance } from './intent/intentActions'; import { IntentStatisticsList } from './intent/intentStatistics'; import { IntentStatisticsListInstance } from './intent/intentStatistics'; import { SampleList } from './intent/sample'; @@ -28,10 +31,12 @@ declare function IntentList(version: Understand, assistantSid: string): IntentLi /** * Options to pass to update * + * @property actions - The actions * @property friendlyName - A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @property uniqueName - A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. */ interface IntentInstanceUpdateOptions { + actions?: string; friendlyName?: string; uniqueName?: string; } @@ -102,10 +107,12 @@ interface IntentListInstance { /** * Options to pass to create * + * @property actions - The actions * @property friendlyName - A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @property uniqueName - A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. */ interface IntentListInstanceCreateOptions { + actions?: string; friendlyName?: string; uniqueName: string; } @@ -193,6 +200,7 @@ declare class IntentContext { * * @property fields - fields resource * @property samples - samples resource + * @property intentActions - intentActions resource * @property statistics - statistics resource * * @param version - Version of the resource @@ -208,6 +216,7 @@ declare class IntentContext { */ fetch(callback?: (error: Error | null, items: IntentInstance) => any): Promise; fields: FieldListInstance; + intentActions: IntentActionsListInstance; /** * remove a IntentInstance * @@ -263,6 +272,10 @@ declare class IntentInstance extends SerializableClass { */ fields(): FieldListInstance; friendlyName: string; + /** + * Access the intentActions + */ + intentActions(): IntentActionsListInstance; links: string; /** * remove a IntentInstance diff --git a/lib/rest/preview/understand/assistant/intent.js b/lib/rest/preview/understand/assistant/intent.js index 346e85e538..b345ee7d60 100644 --- a/lib/rest/preview/understand/assistant/intent.js +++ b/lib/rest/preview/understand/assistant/intent.js @@ -12,12 +12,14 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ var FieldList = require('./intent/field').FieldList; +var IntentActionsList = require('./intent/intentActions').IntentActionsList; var IntentStatisticsList = require( './intent/intentStatistics').IntentStatisticsList; var Page = require('../../../../base/Page'); /* jshint ignore:line */ var SampleList = require('./intent/sample').SampleList; var deserialize = require( '../../../../base/deserialize'); /* jshint ignore:line */ +var serialize = require('../../../../base/serialize'); /* jshint ignore:line */ var values = require('../../../../base/values'); /* jshint ignore:line */ var IntentList; @@ -286,6 +288,7 @@ IntentList = function IntentList(version, assistantSid) { * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @param {string} [opts.friendlyName] - * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @param {string} [opts.actions] - The actions * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed IntentInstance @@ -302,7 +305,8 @@ IntentList = function IntentList(version, assistantSid) { var deferred = Q.defer(); var data = values.of({ 'UniqueName': _.get(opts, 'uniqueName'), - 'FriendlyName': _.get(opts, 'friendlyName') + 'FriendlyName': _.get(opts, 'friendlyName'), + 'Actions': serialize.object(_.get(opts, 'actions')) }); var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); @@ -455,6 +459,7 @@ IntentInstance.prototype.fetch = function fetch(callback) { * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @param {string} [opts.uniqueName] - * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param {string} [opts.actions] - The actions * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed IntentInstance @@ -499,6 +504,17 @@ IntentInstance.prototype.samples = function samples() { return this._proxy.samples; }; +/* jshint ignore:start */ +/** + * Access the intentActions + * + * @returns {Twilio.Preview.Understand.AssistantContext.IntentContext.IntentActionsList} + */ +/* jshint ignore:end */ +IntentInstance.prototype.intentActions = function intentActions() { + return this._proxy.intentActions; +}; + /* jshint ignore:start */ /** * Access the statistics @@ -537,6 +553,8 @@ IntentInstance.prototype.toJSON = function toJSON() { * fields resource * @property {Twilio.Preview.Understand.AssistantContext.IntentContext.SampleList} samples - * samples resource + * @property {Twilio.Preview.Understand.AssistantContext.IntentContext.IntentActionsList} intentActions - + * intentActions resource * @property {Twilio.Preview.Understand.AssistantContext.IntentContext.IntentStatisticsList} statistics - * statistics resource * @@ -557,6 +575,7 @@ IntentContext = function IntentContext(version, assistantSid, sid) { // Dependents this._fields = undefined; this._samples = undefined; + this._intentActions = undefined; this._statistics = undefined; }; @@ -602,6 +621,7 @@ IntentContext.prototype.fetch = function fetch(callback) { * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @param {string} [opts.uniqueName] - * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param {string} [opts.actions] - The actions * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed IntentInstance @@ -617,7 +637,8 @@ IntentContext.prototype.update = function update(opts, callback) { var deferred = Q.defer(); var data = values.of({ 'FriendlyName': _.get(opts, 'friendlyName'), - 'UniqueName': _.get(opts, 'uniqueName') + 'UniqueName': _.get(opts, 'uniqueName'), + 'Actions': serialize.object(_.get(opts, 'actions')) }); var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); @@ -690,6 +711,20 @@ Object.defineProperty(IntentContext.prototype, } }); +Object.defineProperty(IntentContext.prototype, + 'intentActions', { + get: function() { + if (!this._intentActions) { + this._intentActions = new IntentActionsList( + this._version, + this._solution.assistantSid, + this._solution.sid + ); + } + return this._intentActions; + } +}); + Object.defineProperty(IntentContext.prototype, 'statistics', { get: function() { diff --git a/lib/rest/preview/understand/assistant/intent/intentActions.d.ts b/lib/rest/preview/understand/assistant/intent/intentActions.d.ts new file mode 100644 index 0000000000..3c2cee7a9b --- /dev/null +++ b/lib/rest/preview/understand/assistant/intent/intentActions.d.ts @@ -0,0 +1,149 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Page = require('../../../../../base/Page'); +import Response = require('../../../../../http/response'); +import Understand = require('../../../Understand'); +import serialize = require('../../../../../base/serialize'); +import { SerializableClass } from '../../../../../interfaces'; + +/** + * @description Initialize the IntentActionsList + * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param assistantSid - The assistant_sid + * @param intentSid - The intent_sid + */ +declare function IntentActionsList(version: Understand, assistantSid: string, intentSid: string): IntentActionsListInstance; + +/** + * Options to pass to update + * + * @property actions - The actions + */ +interface IntentActionsInstanceUpdateOptions { + actions?: string; +} + +interface IntentActionsListInstance { + /** + * @param sid - sid of instance + */ + (sid: string): IntentActionsContext; + /** + * Constructs a intent_actions + */ + get(): IntentActionsContext; +} + +interface IntentActionsPayload extends IntentActionsResource, Page.TwilioResponsePayload { +} + +interface IntentActionsResource { + account_sid: string; + assistant_sid: string; + data: string; + intent_sid: string; + url: string; +} + +interface IntentActionsSolution { + assistantSid?: string; + intentSid?: string; +} + + +declare class IntentActionsContext { + /** + * Initialize the IntentActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param assistantSid - The assistant_sid + * @param intentSid - The intent_sid + */ + constructor(version: Understand, assistantSid: string, intentSid: string); + + /** + * fetch a IntentActionsInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: IntentActionsInstance) => any): Promise; + /** + * update a IntentActionsInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts?: IntentActionsInstanceUpdateOptions, callback?: (error: Error | null, items: IntentActionsInstance) => any): Promise; +} + + +declare class IntentActionsInstance extends SerializableClass { + /** + * Initialize the IntentActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @property accountSid - The account_sid + * @property assistantSid - The assistant_sid + * @property intentSid - The intent_sid + * @property url - The url + * @property data - The data + * + * @param version - Version of the resource + * @param payload - The instance payload + * @param assistantSid - The assistant_sid + * @param intentSid - The intent_sid + */ + constructor(version: Understand, payload: IntentActionsPayload, assistantSid: string, intentSid: string); + + private _proxy: IntentActionsContext; + accountSid: string; + assistantSid: string; + data: string; + /** + * fetch a IntentActionsInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: IntentActionsInstance) => any): void; + intentSid: string; + /** + * Produce a plain JSON object version of the IntentActionsInstance for serialization. + * Removes any circular references in the object. + */ + toJSON(): any; + /** + * update a IntentActionsInstance + * + * @param opts - Options for request + * @param callback - Callback to handle processed record + */ + update(opts?: IntentActionsInstanceUpdateOptions, callback?: (error: Error | null, items: IntentActionsInstance) => any): void; + url: string; +} + + +declare class IntentActionsPage extends Page { + /** + * Initialize the IntentActionsPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: Understand, response: Response, solution: IntentActionsSolution); + + /** + * Build an instance of IntentActionsInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: IntentActionsPayload): IntentActionsInstance; +} + +export { IntentActionsContext, IntentActionsInstance, IntentActionsList, IntentActionsListInstance, IntentActionsPage, IntentActionsPayload, IntentActionsResource, IntentActionsSolution } diff --git a/lib/rest/preview/understand/assistant/intent/intentActions.js b/lib/rest/preview/understand/assistant/intent/intentActions.js new file mode 100644 index 0000000000..3d1dc39c64 --- /dev/null +++ b/lib/rest/preview/understand/assistant/intent/intentActions.js @@ -0,0 +1,305 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var Q = require('q'); /* jshint ignore:line */ +var _ = require('lodash'); /* jshint ignore:line */ +var Page = require('../../../../../base/Page'); /* jshint ignore:line */ +var serialize = require( + '../../../../../base/serialize'); /* jshint ignore:line */ +var values = require('../../../../../base/values'); /* jshint ignore:line */ + +var IntentActionsList; +var IntentActionsPage; +var IntentActionsInstance; +var IntentActionsContext; + +/* jshint ignore:start */ +/** + * @description Initialize the IntentActionsList + * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Twilio.Preview.Understand} version - Version of the resource + * @param {string} assistantSid - The assistant_sid + * @param {string} intentSid - The intent_sid + */ +/* jshint ignore:end */ +IntentActionsList = function IntentActionsList(version, assistantSid, intentSid) + { + /* jshint ignore:start */ + /** + * @param {string} sid - sid of instance + * + * @returns {Twilio.Preview.Understand.AssistantContext.IntentContext.IntentActionsContext} + */ + /* jshint ignore:end */ + function IntentActionsListInstance(sid) { + return IntentActionsListInstance.get(sid); + } + + IntentActionsListInstance._version = version; + // Path Solution + IntentActionsListInstance._solution = {assistantSid: assistantSid, intentSid: intentSid}; + /* jshint ignore:start */ + /** + * Constructs a intent_actions + * + * @returns {Twilio.Preview.Understand.AssistantContext.IntentContext.IntentActionsContext} + */ + /* jshint ignore:end */ + IntentActionsListInstance.get = function get() { + return new IntentActionsContext( + this._version, + this._solution.assistantSid, + this._solution.intentSid + ); + }; + + return IntentActionsListInstance; +}; + + +/* jshint ignore:start */ +/** + * Initialize the IntentActionsPagePLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Understand} version - Version of the resource + * @param {Response} response - Response from the API + * @param {IntentActionsSolution} solution - Path solution + * + * @returns IntentActionsPage + */ +/* jshint ignore:end */ +IntentActionsPage = function IntentActionsPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(IntentActionsPage.prototype, Page.prototype); +IntentActionsPage.prototype.constructor = IntentActionsPage; + +/* jshint ignore:start */ +/** + * Build an instance of IntentActionsInstance + * + * @param {IntentActionsPayload} payload - Payload response from the API + * + * @returns IntentActionsInstance + */ +/* jshint ignore:end */ +IntentActionsPage.prototype.getInstance = function getInstance(payload) { + return new IntentActionsInstance( + this._version, + payload, + this._solution.assistantSid, + this._solution.intentSid + ); +}; + + +/* jshint ignore:start */ +/** + * Initialize the IntentActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @property {string} accountSid - The account_sid + * @property {string} assistantSid - The assistant_sid + * @property {string} intentSid - The intent_sid + * @property {string} url - The url + * @property {string} data - The data + * + * @param {Understand} version - Version of the resource + * @param {IntentActionsPayload} payload - The instance payload + * @param {sid} assistantSid - The assistant_sid + * @param {sid} intentSid - The intent_sid + */ +/* jshint ignore:end */ +IntentActionsInstance = function IntentActionsInstance(version, payload, + assistantSid, intentSid) + { + this._version = version; + + // Marshaled Properties + this.accountSid = payload.account_sid; // jshint ignore:line + this.assistantSid = payload.assistant_sid; // jshint ignore:line + this.intentSid = payload.intent_sid; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.data = payload.data; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {assistantSid: assistantSid, intentSid: intentSid, }; +}; + +Object.defineProperty(IntentActionsInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new IntentActionsContext( + this._version, + this._solution.assistantSid, + this._solution.intentSid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a IntentActionsInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed IntentActionsInstance + */ +/* jshint ignore:end */ +IntentActionsInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * update a IntentActionsInstance + * + * @param {object} [opts] - Options for request + * @param {string} [opts.actions] - The actions + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed IntentActionsInstance + */ +/* jshint ignore:end */ +IntentActionsInstance.prototype.update = function update(opts, callback) { + return this._proxy.update(opts, callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the IntentActionsInstance for serialization. + * Removes any circular references in the object. + * + * @returns Object + */ +/* jshint ignore:end */ +IntentActionsInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * Initialize the IntentActionsContextPLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. + * + * @param {Understand} version - Version of the resource + * @param {sid_like} assistantSid - The assistant_sid + * @param {sid_like} intentSid - The intent_sid + */ +/* jshint ignore:end */ +IntentActionsContext = function IntentActionsContext(version, assistantSid, + intentSid) { + this._version = version; + + // Path Solution + this._solution = {assistantSid: assistantSid, intentSid: intentSid, }; + this._uri = _.template( + '/Assistants/<%= assistantSid %>/Intents/<%= intentSid %>/Actions' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a IntentActionsInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed IntentActionsInstance + */ +/* jshint ignore:end */ +IntentActionsContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new IntentActionsInstance( + this._version, + payload, + this._solution.assistantSid, + this._solution.intentSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a IntentActionsInstance + * + * @param {object} [opts] - Options for request + * @param {string} [opts.actions] - The actions + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed IntentActionsInstance + */ +/* jshint ignore:end */ +IntentActionsContext.prototype.update = function update(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({'Actions': serialize.object(_.get(opts, 'actions'))}); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new IntentActionsInstance( + this._version, + payload, + this._solution.assistantSid, + this._solution.intentSid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + IntentActionsList: IntentActionsList, + IntentActionsPage: IntentActionsPage, + IntentActionsInstance: IntentActionsInstance, + IntentActionsContext: IntentActionsContext +}; diff --git a/lib/rest/pricing/V2.d.ts b/lib/rest/pricing/V2.d.ts new file mode 100644 index 0000000000..510a46b892 --- /dev/null +++ b/lib/rest/pricing/V2.d.ts @@ -0,0 +1,27 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Pricing = require('../Pricing'); +import Version = require('../../base/Version'); +import { VoiceList } from './v2/voice'; +import { VoiceListInstance } from './v2/voice'; + + +declare class V2 extends Version { + /** + * Initialize the V2 version of Pricing + * + * @property voice - voice resource + * + * @param domain - The twilio domain + */ + constructor(domain: Pricing); + + readonly voice: VoiceListInstance; +} + +export = V2; diff --git a/lib/rest/pricing/V2.js b/lib/rest/pricing/V2.js new file mode 100644 index 0000000000..06ef4f3304 --- /dev/null +++ b/lib/rest/pricing/V2.js @@ -0,0 +1,44 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Version = require('../../base/Version'); /* jshint ignore:line */ +var VoiceList = require('./v2/voice').VoiceList; + + +/* jshint ignore:start */ +/** + * Initialize the V2 version of Pricing + * + * @property {Twilio.Pricing.V2.VoiceList} voice - voice resource + * + * @param {Twilio.Pricing} domain - The twilio domain + */ +/* jshint ignore:end */ +function V2(domain) { + Version.prototype.constructor.call(this, domain, 'v2'); + + // Resources + this._voice = undefined; +} + +_.extend(V2.prototype, Version.prototype); +V2.prototype.constructor = V2; + +Object.defineProperty(V2.prototype, + 'voice', { + get: function() { + this._voice = this._voice || new VoiceList(this); + return this._voice; + } +}); + +module.exports = V2; diff --git a/lib/rest/pricing/v2/voice.d.ts b/lib/rest/pricing/v2/voice.d.ts new file mode 100644 index 0000000000..de6ef523bd --- /dev/null +++ b/lib/rest/pricing/v2/voice.d.ts @@ -0,0 +1,79 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Page = require('../../../base/Page'); +import Response = require('../../../http/response'); +import V2 = require('../V2'); +import { SerializableClass } from '../../../interfaces'; + +/** + * @description Initialize the VoiceList + * + * @param version - Version of the resource + */ +declare function VoiceList(version: V2): VoiceListInstance; + +interface VoiceListInstance { + countries?: object; +} + +interface VoicePayload extends VoiceResource, Page.TwilioResponsePayload { +} + +interface VoiceResource { + links: string; + name: string; + url: string; +} + +interface VoiceSolution { +} + + +declare class VoiceInstance extends SerializableClass { + /** + * Initialize the VoiceContext + * + * @property name - The name + * @property url - The url + * @property links - The links + * + * @param version - Version of the resource + * @param payload - The instance payload + */ + constructor(version: V2, payload: VoicePayload); + + links: string; + name: string; + /** + * Produce a plain JSON object version of the VoiceInstance for serialization. + * Removes any circular references in the object. + */ + toJSON(): any; + url: string; +} + + +declare class VoicePage extends Page { + /** + * Initialize the VoicePage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: VoiceSolution); + + /** + * Build an instance of VoiceInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: VoicePayload): VoiceInstance; +} + +export { VoiceInstance, VoiceList, VoiceListInstance, VoicePage, VoicePayload, VoiceResource, VoiceSolution } diff --git a/lib/rest/pricing/v2/voice.js b/lib/rest/pricing/v2/voice.js new file mode 100644 index 0000000000..60469127a4 --- /dev/null +++ b/lib/rest/pricing/v2/voice.js @@ -0,0 +1,143 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var CountryList = require('./voice/country').CountryList; +var Page = require('../../../base/Page'); /* jshint ignore:line */ + +var VoiceList; +var VoicePage; +var VoiceInstance; + +/* jshint ignore:start */ +/** + * @description Initialize the VoiceList + * + * @param {Twilio.Pricing.V2} version - Version of the resource + */ +/* jshint ignore:end */ +VoiceList = function VoiceList(version) { + /* jshint ignore:start */ + /** + * @param {string} sid - sid of instance + * + * @returns {Twilio.Pricing.V2.VoiceContext} + */ + /* jshint ignore:end */ + function VoiceListInstance(sid) { + return VoiceListInstance.get(sid); + } + + VoiceListInstance._version = version; + // Path Solution + VoiceListInstance._solution = {}; + + // Components + VoiceListInstance._countries = undefined; + + Object.defineProperty(VoiceListInstance, + 'countries', { + get: function countries() { + if (!this._countries) { + this._countries = new CountryList(this._version); + } + + return this._countries; + } + }); + + return VoiceListInstance; +}; + + +/* jshint ignore:start */ +/** + * Initialize the VoicePage + * + * @param {V2} version - Version of the resource + * @param {Response} response - Response from the API + * @param {VoiceSolution} solution - Path solution + * + * @returns VoicePage + */ +/* jshint ignore:end */ +VoicePage = function VoicePage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(VoicePage.prototype, Page.prototype); +VoicePage.prototype.constructor = VoicePage; + +/* jshint ignore:start */ +/** + * Build an instance of VoiceInstance + * + * @param {VoicePayload} payload - Payload response from the API + * + * @returns VoiceInstance + */ +/* jshint ignore:end */ +VoicePage.prototype.getInstance = function getInstance(payload) { + return new VoiceInstance(this._version, payload); +}; + + +/* jshint ignore:start */ +/** + * Initialize the VoiceContext + * + * @property {string} name - The name + * @property {string} url - The url + * @property {string} links - The links + * + * @param {V2} version - Version of the resource + * @param {VoicePayload} payload - The instance payload + */ +/* jshint ignore:end */ +VoiceInstance = function VoiceInstance(version, payload) { + this._version = version; + + // Marshaled Properties + this.name = payload.name; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.links = payload.links; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {}; +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the VoiceInstance for serialization. + * Removes any circular references in the object. + * + * @returns Object + */ +/* jshint ignore:end */ +VoiceInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + +module.exports = { + VoiceList: VoiceList, + VoicePage: VoicePage, + VoiceInstance: VoiceInstance +}; diff --git a/lib/rest/pricing/v2/voice/country.d.ts b/lib/rest/pricing/v2/voice/country.d.ts new file mode 100644 index 0000000000..32da2e6bb5 --- /dev/null +++ b/lib/rest/pricing/v2/voice/country.d.ts @@ -0,0 +1,223 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Page = require('../../../../base/Page'); +import Response = require('../../../../http/response'); +import V2 = require('../../V2'); +import { SerializableClass } from '../../../../interfaces'; + +/** + * @description Initialize the CountryList + * + * @param version - Version of the resource + */ +declare function CountryList(version: V2): CountryListInstance; + +interface CountryListInstance { + /** + * @param sid - sid of instance + */ + (sid: string): CountryContext; + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory efficient. + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param opts - Options for request + * @param callback - Function to process each record + */ + each(opts?: CountryListInstanceEachOptions, callback?: (item: CountryInstance, done: (err?: Error) => void) => void): void; + /** + * Constructs a country + * + * @param isoCountry - Fetches voice prices for country + */ + get(isoCountry: string): CountryContext; + /** + * Retrieve a single target page of CountryInstance records from the API. + * Request is executed immediately + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param targetUrl - API-generated URL for the requested results page + * @param callback - Callback to handle list of records + */ + getPage(targetUrl?: string, callback?: (error: Error | null, items: CountryPage) => any): Promise; + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param opts - Options for request + * @param callback - Callback to handle list of records + */ + list(opts?: CountryListInstanceOptions, callback?: (error: Error | null, items: CountryInstance[]) => any): Promise; + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param opts - Options for request + * @param callback - Callback to handle list of records + */ + page(opts?: CountryListInstancePageOptions, callback?: (error: Error | null, items: CountryPage) => any): Promise; +} + +/** + * Options to pass to each + * + * @property callback - + * Function to process each record. If this and a positional + * callback are passed, this one will be used + * @property done - Function to be called upon completion of streaming + * @property limit - + * Upper limit for the number of records to return. + * each() guarantees never to return more than limit. + * Default is no limit + * @property pageSize - + * Number of records to fetch per request, + * when not set will use the default value of 50 records. + * If no pageSize is defined but a limit is defined, + * each() will attempt to read the limit with the most efficient + * page size, i.e. min(limit, 1000) + */ +interface CountryListInstanceEachOptions { + callback?: (item: CountryInstance, done: (err?: Error) => void) => void; + done?: Function; + limit?: number; + pageSize?: number; +} + +/** + * Options to pass to list + * + * @property limit - + * Upper limit for the number of records to return. + * list() guarantees never to return more than limit. + * Default is no limit + * @property pageSize - + * Number of records to fetch per request, + * when not set will use the default value of 50 records. + * If no page_size is defined but a limit is defined, + * list() will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + */ +interface CountryListInstanceOptions { + limit?: number; + pageSize?: number; +} + +/** + * Options to pass to page + * + * @property pageNumber - Page Number, this value is simply for client state + * @property pageSize - Number of records to return, defaults to 50 + * @property pageToken - PageToken provided by the API + */ +interface CountryListInstancePageOptions { + pageNumber?: number; + pageSize?: number; + pageToken?: string; +} + +interface CountryPayload extends CountryResource, Page.TwilioResponsePayload { +} + +interface CountryResource { + country: string; + inbound_call_prices?: string; + iso_country: string; + outbound_prefix_prices?: string; + price_unit?: string; + url: string; +} + +interface CountrySolution { +} + + +declare class CountryContext { + /** + * Initialize the CountryContext + * + * @param version - Version of the resource + * @param isoCountry - Fetches voice prices for country + */ + constructor(version: V2, isoCountry: string); + + /** + * fetch a CountryInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: CountryInstance) => any): Promise; +} + + +declare class CountryInstance extends SerializableClass { + /** + * Initialize the CountryContext + * + * @property country - Name of the country + * @property isoCountry - The ISO country code + * @property outboundPrefixPrices - List of OutboundPrefixPriceWithOrigin records + * @property inboundCallPrices - List of InboundCallPrice records + * @property priceUnit - The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy). + * @property url - The URL of this resource. + * + * @param version - Version of the resource + * @param payload - The instance payload + * @param isoCountry - Fetches voice prices for country + */ + constructor(version: V2, payload: CountryPayload, isoCountry: string); + + private _proxy: CountryContext; + country: string; + /** + * fetch a CountryInstance + * + * @param callback - Callback to handle processed record + */ + fetch(callback?: (error: Error | null, items: CountryInstance) => any): void; + inboundCallPrices: string; + isoCountry: string; + outboundPrefixPrices: string; + priceUnit: string; + /** + * Produce a plain JSON object version of the CountryInstance for serialization. + * Removes any circular references in the object. + */ + toJSON(): any; + url: string; +} + + +declare class CountryPage extends Page { + /** + * Initialize the CountryPage + * + * @param version - Version of the resource + * @param response - Response from the API + * @param solution - Path solution + */ + constructor(version: V2, response: Response, solution: CountrySolution); + + /** + * Build an instance of CountryInstance + * + * @param payload - Payload response from the API + */ + getInstance(payload: CountryPayload): CountryInstance; +} + +export { CountryContext, CountryInstance, CountryList, CountryListInstance, CountryListInstanceEachOptions, CountryListInstanceOptions, CountryListInstancePageOptions, CountryPage, CountryPayload, CountryResource, CountrySolution } diff --git a/lib/rest/pricing/v2/voice/country.js b/lib/rest/pricing/v2/voice/country.js new file mode 100644 index 0000000000..74109e0361 --- /dev/null +++ b/lib/rest/pricing/v2/voice/country.js @@ -0,0 +1,452 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var Q = require('q'); /* jshint ignore:line */ +var _ = require('lodash'); /* jshint ignore:line */ +var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var values = require('../../../../base/values'); /* jshint ignore:line */ + +var CountryList; +var CountryPage; +var CountryInstance; +var CountryContext; + +/* jshint ignore:start */ +/** + * @description Initialize the CountryList + * + * @param {Twilio.Pricing.V2} version - Version of the resource + */ +/* jshint ignore:end */ +CountryList = function CountryList(version) { + /* jshint ignore:start */ + /** + * @param {string} sid - sid of instance + * + * @returns {Twilio.Pricing.V2.VoiceContext.CountryContext} + */ + /* jshint ignore:end */ + function CountryListInstance(sid) { + return CountryListInstance.get(sid); + } + + CountryListInstance._version = version; + // Path Solution + CountryListInstance._solution = {}; + CountryListInstance._uri = _.template( + '/Voice/Countries' // jshint ignore:line + )(CountryListInstance._solution); + /* jshint ignore:start */ + /** + * Streams CountryInstance records from the API. + * + * This operation lazily loads records as efficiently as possible until the limit + * is reached. + * + * The results are passed into the callback function, so this operation is memory efficient. + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param {object} [opts] - Options for request + * @param {number} [opts.limit] - + * Upper limit for the number of records to return. + * each() guarantees never to return more than limit. + * Default is no limit + * @param {number} [opts.pageSize] - + * Number of records to fetch per request, + * when not set will use the default value of 50 records. + * If no pageSize is defined but a limit is defined, + * each() will attempt to read the limit with the most efficient + * page size, i.e. min(limit, 1000) + * @param {Function} [opts.callback] - + * Function to process each record. If this and a positional + * callback are passed, this one will be used + * @param {Function} [opts.done] - + * Function to be called upon completion of streaming + * @param {Function} [callback] - Function to process each record + */ + /* jshint ignore:end */ + CountryListInstance.each = function each(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + if (opts.callback) { + callback = opts.callback; + } + if (_.isUndefined(callback)) { + throw new Error('Callback function must be provided'); + } + + var done = false; + var currentPage = 1; + var currentResource = 0; + var limits = this._version.readLimits({ + limit: opts.limit, + pageSize: opts.pageSize + }); + + function onComplete(error) { + done = true; + if (_.isFunction(opts.done)) { + opts.done(error); + } + } + + function fetchNextPage(fn) { + var promise = fn(); + if (_.isUndefined(promise)) { + onComplete(); + return; + } + + promise.then(function(page) { + _.each(page.instances, function(instance) { + if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) { + done = true; + return false; + } + + currentResource++; + callback(instance, onComplete); + }); + + if ((limits.pageLimit && limits.pageLimit <= currentPage)) { + onComplete(); + } else if (!done) { + currentPage++; + fetchNextPage(_.bind(page.nextPage, page)); + } + }); + + promise.catch(onComplete); + } + + fetchNextPage(_.bind(this.page, this, _.merge(opts, limits))); + }; + + /* jshint ignore:start */ + /** + * Lists CountryInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param {object} [opts] - Options for request + * @param {number} [opts.limit] - + * Upper limit for the number of records to return. + * list() guarantees never to return more than limit. + * Default is no limit + * @param {number} [opts.pageSize] - + * Number of records to fetch per request, + * when not set will use the default value of 50 records. + * If no page_size is defined but a limit is defined, + * list() will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @param {function} [callback] - Callback to handle list of records + * + * @returns {Promise} Resolves to a list of records + */ + /* jshint ignore:end */ + CountryListInstance.list = function list(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + var deferred = Q.defer(); + var allResources = []; + opts.callback = function(resource, done) { + allResources.push(resource); + + if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) { + done(); + } + }; + + opts.done = function(error) { + if (_.isUndefined(error)) { + deferred.resolve(allResources); + } else { + deferred.reject(error); + } + }; + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + this.each(opts); + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param {object} [opts] - Options for request + * @param {string} [opts.pageToken] - PageToken provided by the API + * @param {number} [opts.pageNumber] - + * Page Number, this value is simply for client state + * @param {number} [opts.pageSize] - Number of records to return, defaults to 50 + * @param {function} [callback] - Callback to handle list of records + * + * @returns {Promise} Resolves to a list of records + */ + /* jshint ignore:end */ + CountryListInstance.page = function page(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'PageToken': opts.pageToken, + 'Page': opts.pageNumber, + 'PageSize': opts.pageSize + }); + + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new CountryPage(this._version, payload, this._solution)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Retrieve a single target page of CountryInstance records from the API. + * Request is executed immediately + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @param {string} [targetUrl] - API-generated URL for the requested results page + * @param {function} [callback] - Callback to handle list of records + * + * @returns {Promise} Resolves to a list of records + */ + /* jshint ignore:end */ + CountryListInstance.getPage = function getPage(targetUrl, callback) { + var deferred = Q.defer(); + + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); + + promise = promise.then(function(payload) { + deferred.resolve(new CountryPage(this._version, payload, this._solution)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a country + * + * @param {string} isoCountry - Fetches voice prices for country + * + * @returns {Twilio.Pricing.V2.VoiceContext.CountryContext} + */ + /* jshint ignore:end */ + CountryListInstance.get = function get(isoCountry) { + return new CountryContext(this._version, isoCountry); + }; + + return CountryListInstance; +}; + + +/* jshint ignore:start */ +/** + * Initialize the CountryPage + * + * @param {V2} version - Version of the resource + * @param {Response} response - Response from the API + * @param {CountrySolution} solution - Path solution + * + * @returns CountryPage + */ +/* jshint ignore:end */ +CountryPage = function CountryPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(CountryPage.prototype, Page.prototype); +CountryPage.prototype.constructor = CountryPage; + +/* jshint ignore:start */ +/** + * Build an instance of CountryInstance + * + * @param {CountryPayload} payload - Payload response from the API + * + * @returns CountryInstance + */ +/* jshint ignore:end */ +CountryPage.prototype.getInstance = function getInstance(payload) { + return new CountryInstance(this._version, payload); +}; + + +/* jshint ignore:start */ +/** + * Initialize the CountryContext + * + * @property {string} country - Name of the country + * @property {string} isoCountry - The ISO country code + * @property {string} outboundPrefixPrices - + * List of OutboundPrefixPriceWithOrigin records + * @property {string} inboundCallPrices - List of InboundCallPrice records + * @property {string} priceUnit - + * The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy). + * @property {string} url - The URL of this resource. + * + * @param {V2} version - Version of the resource + * @param {CountryPayload} payload - The instance payload + * @param {iso_country_code} isoCountry - Fetches voice prices for country + */ +/* jshint ignore:end */ +CountryInstance = function CountryInstance(version, payload, isoCountry) { + this._version = version; + + // Marshaled Properties + this.country = payload.country; // jshint ignore:line + this.isoCountry = payload.iso_country; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.outboundPrefixPrices = payload.outbound_prefix_prices; // jshint ignore:line + this.inboundCallPrices = payload.inbound_call_prices; // jshint ignore:line + this.priceUnit = payload.price_unit; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {isoCountry: isoCountry || this.isoCountry, }; +}; + +Object.defineProperty(CountryInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new CountryContext(this._version, this._solution.isoCountry); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a CountryInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed CountryInstance + */ +/* jshint ignore:end */ +CountryInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the CountryInstance for serialization. + * Removes any circular references in the object. + * + * @returns Object + */ +/* jshint ignore:end */ +CountryInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * Initialize the CountryContext + * + * @param {V2} version - Version of the resource + * @param {iso_country_code} isoCountry - Fetches voice prices for country + */ +/* jshint ignore:end */ +CountryContext = function CountryContext(version, isoCountry) { + this._version = version; + + // Path Solution + this._solution = {isoCountry: isoCountry, }; + this._uri = _.template( + '/Voice/Countries/<%= isoCountry %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a CountryInstance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed CountryInstance + */ +/* jshint ignore:end */ +CountryContext.prototype.fetch = function fetch(callback) { + var deferred = Q.defer(); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); + + promise = promise.then(function(payload) { + deferred.resolve(new CountryInstance(this._version, payload, this._solution.isoCountry)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + CountryList: CountryList, + CountryPage: CountryPage, + CountryInstance: CountryInstance, + CountryContext: CountryContext +}; diff --git a/lib/rest/studio/v1/flow.d.ts b/lib/rest/studio/v1/flow.d.ts index a519cffe17..44c981fc04 100644 --- a/lib/rest/studio/v1/flow.d.ts +++ b/lib/rest/studio/v1/flow.d.ts @@ -18,7 +18,6 @@ type FlowStatus = 'draft'|'published'; /** * @description Initialize the FlowList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource */ @@ -158,7 +157,7 @@ interface FlowSolution { declare class FlowContext { /** - * Initialize the FlowContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the FlowContext * * @property engagements - engagements resource * @property executions - executions resource @@ -187,7 +186,7 @@ declare class FlowContext { declare class FlowInstance extends SerializableClass { /** - * Initialize the FlowContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the FlowContext * * @property sid - A string that uniquely identifies this Flow. * @property accountSid - Account Sid. @@ -245,7 +244,7 @@ declare class FlowInstance extends SerializableClass { declare class FlowPage extends Page { /** - * Initialize the FlowPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the FlowPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/engagement.d.ts b/lib/rest/studio/v1/flow/engagement.d.ts index 7ff8038562..285b8197fa 100644 --- a/lib/rest/studio/v1/flow/engagement.d.ts +++ b/lib/rest/studio/v1/flow/engagement.d.ts @@ -19,7 +19,6 @@ type EngagementStatus = 'active'|'ended'; /** * @description Initialize the EngagementList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -183,7 +182,7 @@ interface EngagementSolution { declare class EngagementContext { /** - * Initialize the EngagementContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the EngagementContext * * @property steps - steps resource * @property engagementContext - engagementContext resource @@ -213,7 +212,7 @@ declare class EngagementContext { declare class EngagementInstance extends SerializableClass { /** - * Initialize the EngagementContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the EngagementContext * * @property sid - A string that uniquely identifies this Engagement. * @property accountSid - Account Sid. @@ -276,7 +275,7 @@ declare class EngagementInstance extends SerializableClass { declare class EngagementPage extends Page { /** - * Initialize the EngagementPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the EngagementPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts b/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts index 11c3faff64..512eb9f81b 100644 --- a/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts +++ b/lib/rest/studio/v1/flow/engagement/engagementContext.d.ts @@ -12,7 +12,6 @@ import { SerializableClass } from '../../../../../interfaces'; /** * @description Initialize the EngagementContextList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -50,7 +49,7 @@ interface EngagementContextSolution { declare class EngagementContextContext { /** - * Initialize the EngagementContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the EngagementContextContext * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -69,7 +68,7 @@ declare class EngagementContextContext { declare class EngagementContextInstance extends SerializableClass { /** - * Initialize the EngagementContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the EngagementContextContext * * @property accountSid - Account Sid. * @property context - Flow state. @@ -106,7 +105,7 @@ declare class EngagementContextInstance extends SerializableClass { declare class EngagementContextPage extends Page { /** - * Initialize the EngagementContextPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the EngagementContextPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/engagement/step.d.ts b/lib/rest/studio/v1/flow/engagement/step.d.ts index 91e3d3078f..ea6cfd51ce 100644 --- a/lib/rest/studio/v1/flow/engagement/step.d.ts +++ b/lib/rest/studio/v1/flow/engagement/step.d.ts @@ -14,7 +14,6 @@ import { StepContextListInstance } from './step/stepContext'; /** * @description Initialize the StepList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -161,7 +160,7 @@ interface StepSolution { declare class StepContext { /** - * Initialize the StepContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the StepContext * * @property stepContext - stepContext resource * @@ -184,7 +183,7 @@ declare class StepContext { declare class StepInstance extends SerializableClass { /** - * Initialize the StepContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the StepContext * * @property sid - A string that uniquely identifies this Step. * @property accountSid - Account Sid. @@ -240,7 +239,7 @@ declare class StepInstance extends SerializableClass { declare class StepPage extends Page { /** - * Initialize the StepPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the StepPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts b/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts index 3cda667b14..ac1a3a9e56 100644 --- a/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts +++ b/lib/rest/studio/v1/flow/engagement/step/stepContext.d.ts @@ -12,7 +12,6 @@ import { SerializableClass } from '../../../../../../interfaces'; /** * @description Initialize the StepContextList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -53,7 +52,7 @@ interface StepContextSolution { declare class StepContextContext { /** - * Initialize the StepContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the StepContextContext * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -73,7 +72,7 @@ declare class StepContextContext { declare class StepContextInstance extends SerializableClass { /** - * Initialize the StepContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the StepContextContext * * @property accountSid - Account Sid. * @property context - Flow state. @@ -113,7 +112,7 @@ declare class StepContextInstance extends SerializableClass { declare class StepContextPage extends Page { /** - * Initialize the StepContextPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the StepContextPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/execution.d.ts b/lib/rest/studio/v1/flow/execution.d.ts index 49ff431c58..65e7a9dae0 100644 --- a/lib/rest/studio/v1/flow/execution.d.ts +++ b/lib/rest/studio/v1/flow/execution.d.ts @@ -19,7 +19,6 @@ type ExecutionStatus = 'active'|'ended'; /** * @description Initialize the ExecutionList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -183,7 +182,7 @@ interface ExecutionSolution { declare class ExecutionContext { /** - * Initialize the ExecutionContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionContext * * @property steps - steps resource * @property executionContext - executionContext resource @@ -213,7 +212,7 @@ declare class ExecutionContext { declare class ExecutionInstance extends SerializableClass { /** - * Initialize the ExecutionContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionContext * * @property sid - A string that uniquely identifies this Execution. * @property accountSid - Account Sid. @@ -276,7 +275,7 @@ declare class ExecutionInstance extends SerializableClass { declare class ExecutionPage extends Page { /** - * Initialize the ExecutionPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/execution/executionContext.d.ts b/lib/rest/studio/v1/flow/execution/executionContext.d.ts index b4cbd6a6dc..d824af5556 100644 --- a/lib/rest/studio/v1/flow/execution/executionContext.d.ts +++ b/lib/rest/studio/v1/flow/execution/executionContext.d.ts @@ -12,7 +12,6 @@ import { SerializableClass } from '../../../../../interfaces'; /** * @description Initialize the ExecutionContextList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -50,7 +49,7 @@ interface ExecutionContextSolution { declare class ExecutionContextContext { /** - * Initialize the ExecutionContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionContextContext * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -69,7 +68,7 @@ declare class ExecutionContextContext { declare class ExecutionContextInstance extends SerializableClass { /** - * Initialize the ExecutionContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionContextContext * * @property accountSid - Account Sid. * @property context - Flow state. @@ -106,7 +105,7 @@ declare class ExecutionContextInstance extends SerializableClass { declare class ExecutionContextPage extends Page { /** - * Initialize the ExecutionContextPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionContextPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/execution/executionStep.d.ts b/lib/rest/studio/v1/flow/execution/executionStep.d.ts index 41580b80f8..b152263d55 100644 --- a/lib/rest/studio/v1/flow/execution/executionStep.d.ts +++ b/lib/rest/studio/v1/flow/execution/executionStep.d.ts @@ -14,7 +14,6 @@ import { SerializableClass } from '../../../../../interfaces'; /** * @description Initialize the ExecutionStepList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -161,7 +160,7 @@ interface ExecutionStepSolution { declare class ExecutionStepContext { /** - * Initialize the ExecutionStepContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionStepContext * * @property stepContext - stepContext resource * @@ -184,7 +183,7 @@ declare class ExecutionStepContext { declare class ExecutionStepInstance extends SerializableClass { /** - * Initialize the ExecutionStepContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionStepContext * * @property sid - A string that uniquely identifies this Step. * @property accountSid - Account Sid. @@ -240,7 +239,7 @@ declare class ExecutionStepInstance extends SerializableClass { declare class ExecutionStepPage extends Page { /** - * Initialize the ExecutionStepPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionStepPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts b/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts index 79cf61caaa..49136e1279 100644 --- a/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts +++ b/lib/rest/studio/v1/flow/execution/executionStep/executionStepContext.d.ts @@ -12,7 +12,6 @@ import { SerializableClass } from '../../../../../../interfaces'; /** * @description Initialize the ExecutionStepContextList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -53,7 +52,7 @@ interface ExecutionStepContextSolution { declare class ExecutionStepContextContext { /** - * Initialize the ExecutionStepContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionStepContextContext * * @param version - Version of the resource * @param flowSid - Flow Sid. @@ -73,7 +72,7 @@ declare class ExecutionStepContextContext { declare class ExecutionStepContextInstance extends SerializableClass { /** - * Initialize the ExecutionStepContextContextPLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionStepContextContext * * @property accountSid - Account Sid. * @property context - Flow state. @@ -113,7 +112,7 @@ declare class ExecutionStepContextInstance extends SerializableClass { declare class ExecutionStepContextPage extends Page { /** - * Initialize the ExecutionStepContextPagePLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. + * Initialize the ExecutionStepContextPage * * @param version - Version of the resource * @param response - Response from the API diff --git a/spec/integration/rest/chat/v2/service/user/userChannel.spec.js b/spec/integration/rest/chat/v2/service/user/userChannel.spec.js index 074ba55200..6086ac8cf7 100644 --- a/spec/integration/rest/chat/v2/service/user/userChannel.spec.js +++ b/spec/integration/rest/chat/v2/service/user/userChannel.spec.js @@ -47,10 +47,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -81,10 +84,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -120,10 +126,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -180,10 +189,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -232,6 +244,130 @@ describe('UserChannel', function() { throw new Error('failed'); }); + promise.done(); + } + ); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + userSid: 'USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels/<%= channelSid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'status': 'joined', + 'last_consumed_message_index': 5, + 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid update request', + function() { + holodeck.mock(new Response(500, '{}')); + + var opts = {notificationLevel: 'default'}; + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + userSid: 'USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels/<%= channelSid %>')(solution); + + var values = {NotificationLevel: 'default', }; + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url, + data: values + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'status': 'joined', + 'last_consumed_message_index': 5, + 'unread_messages_count': 5, + 'notification_level': 'muted', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + }); + + holodeck.mock(new Response(200, body)); + + var opts = {notificationLevel: 'default'}; + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + promise.done(); } ); diff --git a/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js b/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js index 90a98a00cf..498cd63a80 100644 --- a/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js @@ -47,10 +47,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -81,10 +84,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -120,10 +126,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -180,10 +189,13 @@ describe('UserChannel', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'joined', 'last_consumed_message_index': 5, 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' @@ -232,6 +244,130 @@ describe('UserChannel', function() { throw new Error('failed'); }); + promise.done(); + } + ); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + userSid: 'USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels/<%= channelSid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'status': 'joined', + 'last_consumed_message_index': 5, + 'unread_messages_count': 5, + 'notification_level': 'default', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid update request', + function() { + holodeck.mock(new Response(500, '{}')); + + var opts = {notificationLevel: 'default'}; + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + userSid: 'USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels/<%= channelSid %>')(solution); + + var values = {NotificationLevel: 'default', }; + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url, + data: values + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member_sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'status': 'joined', + 'last_consumed_message_index': 5, + 'unread_messages_count': 5, + 'notification_level': 'muted', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + }); + + holodeck.mock(new Response(200, body)); + + var opts = {notificationLevel: 'default'}; + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .userChannels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + promise.done(); } ); diff --git a/spec/integration/rest/preview/understand/assistant.spec.js b/spec/integration/rest/preview/understand/assistant.spec.js index c149a9461d..6d198f9d73 100644 --- a/spec/integration/rest/preview/understand/assistant.spec.js +++ b/spec/integration/rest/preview/understand/assistant.spec.js @@ -66,10 +66,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' }); @@ -103,10 +104,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' } @@ -142,10 +144,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' } @@ -186,10 +189,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' } @@ -272,10 +276,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' } @@ -338,10 +343,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' }); @@ -394,10 +400,11 @@ describe('Assistant', function() { 'field_types': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', 'intents': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', 'model_builds': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds', - 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' + 'queries': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', + 'assistant_fallback_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'assistant_initiation_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' }, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - 'response_url': 'https://example.com/response_url', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' }); diff --git a/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js b/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js new file mode 100644 index 0000000000..3f8f3980d4 --- /dev/null +++ b/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js @@ -0,0 +1,121 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('AssistantFallbackActions', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantFallbackActions().fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {assistantSid: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; + var url = _.template('https://preview.twilio.com/understand/Assistants/<%= assistantSid %>/FallbackActions')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'data': {} + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantFallbackActions().fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid update request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantFallbackActions().update(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {assistantSid: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; + var url = _.template('https://preview.twilio.com/understand/Assistants/<%= assistantSid %>/FallbackActions')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', + 'data': {} + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantFallbackActions().update(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); diff --git a/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js b/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js new file mode 100644 index 0000000000..c8d74fbca9 --- /dev/null +++ b/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js @@ -0,0 +1,121 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('AssistantInitiationActions', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantInitiationActions().fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {assistantSid: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; + var url = _.template('https://preview.twilio.com/understand/Assistants/<%= assistantSid %>/InitiationActions')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'data': {}, + 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantInitiationActions().fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid update request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantInitiationActions().update(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {assistantSid: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; + var url = _.template('https://preview.twilio.com/understand/Assistants/<%= assistantSid %>/InitiationActions')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions', + 'data': {} + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .assistantInitiationActions().update(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); diff --git a/spec/integration/rest/preview/understand/assistant/intent.spec.js b/spec/integration/rest/preview/understand/assistant/intent.spec.js index a77be0d99b..a60e167adf 100644 --- a/spec/integration/rest/preview/understand/assistant/intent.spec.js +++ b/spec/integration/rest/preview/understand/assistant/intent.spec.js @@ -62,6 +62,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -104,6 +105,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -139,6 +141,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,6 +182,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -264,6 +268,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -322,6 +327,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -379,6 +385,7 @@ describe('Intent', function() { 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', 'samples': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', + 'intent_actions': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Actions', 'statistics': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' }, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', diff --git a/spec/integration/rest/preview/understand/assistant/intent/intentActions.spec.js b/spec/integration/rest/preview/understand/assistant/intent/intentActions.spec.js new file mode 100644 index 0000000000..ecb77cadf9 --- /dev/null +++ b/spec/integration/rest/preview/understand/assistant/intent/intentActions.spec.js @@ -0,0 +1,133 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('IntentActions', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intents('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intentActions().fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + assistantSid: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + intentSid: 'UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://preview.twilio.com/understand/Assistants/<%= assistantSid %>/Intents/<%= intentSid %>/Actions')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'intent_sid': 'UDdddddddddddddddddddddddddddddddd', + 'data': {}, + 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDdddddddddddddddddddddddddddddddd/Actions' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intents('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intentActions().fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid update request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intents('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intentActions().update(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + assistantSid: 'UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + intentSid: 'UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://preview.twilio.com/understand/Assistants/<%= assistantSid %>/Intents/<%= intentSid %>/Actions')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'intent_sid': 'UDdddddddddddddddddddddddddddddddd', + 'data': {}, + 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDdddddddddddddddddddddddddddddddd/Actions' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intents('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .intentActions().update(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); diff --git a/spec/integration/rest/pricing/v2/voice.spec.js b/spec/integration/rest/pricing/v2/voice.spec.js new file mode 100644 index 0000000000..8c43d400b5 --- /dev/null +++ b/spec/integration/rest/pricing/v2/voice.spec.js @@ -0,0 +1,33 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('Voice', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); +}); diff --git a/spec/integration/rest/pricing/v2/voice/country.spec.js b/spec/integration/rest/pricing/v2/voice/country.spec.js new file mode 100644 index 0000000000..68c7c43477 --- /dev/null +++ b/spec/integration/rest/pricing/v2/voice/country.spec.js @@ -0,0 +1,303 @@ +'use strict'; + +/* jshint ignore:start */ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ +/* jshint ignore:end */ + +var _ = require('lodash'); /* jshint ignore:line */ +var Holodeck = require('../../../../holodeck'); /* jshint ignore:line */ +var Request = require( + '../../../../../../lib/http/request'); /* jshint ignore:line */ +var Response = require( + '../../../../../../lib/http/response'); /* jshint ignore:line */ +var RestException = require( + '../../../../../../lib/base/RestException'); /* jshint ignore:line */ +var Twilio = require('../../../../../../lib'); /* jshint ignore:line */ + + +var client; +var holodeck; + +describe('Country', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should treat the first each arg as a callback', + function(done) { + var body = JSON.stringify({ + 'countries': [ + { + 'country': 'Andorra', + 'iso_country': 'AD', + 'url': 'https://pricing.twilio.com/v2/Voice/Countries/AD' + } + ], + 'meta': { + 'first_page_url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0', + 'key': 'countries', + 'next_page_url': null, + 'page': 0, + 'page_size': 50, + 'previous_page_url': null, + 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' + } + }); + holodeck.mock(new Response(200, body)); + client.pricing.v2.voice + .countries.each(() => done()); + } + ); + it('should treat the second arg as a callback', + function(done) { + var body = JSON.stringify({ + 'countries': [ + { + 'country': 'Andorra', + 'iso_country': 'AD', + 'url': 'https://pricing.twilio.com/v2/Voice/Countries/AD' + } + ], + 'meta': { + 'first_page_url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0', + 'key': 'countries', + 'next_page_url': null, + 'page': 0, + 'page_size': 50, + 'previous_page_url': null, + 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' + } + }); + holodeck.mock(new Response(200, body)); + client.pricing.v2.voice + .countries.each({pageSize: 20}, () => done()); + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: 'https://pricing.twilio.com/v2/Voice/Countries', + params: {PageSize: 20}, + })); + } + ); + it('should find the callback in the opts object', + function(done) { + var body = JSON.stringify({ + 'countries': [ + { + 'country': 'Andorra', + 'iso_country': 'AD', + 'url': 'https://pricing.twilio.com/v2/Voice/Countries/AD' + } + ], + 'meta': { + 'first_page_url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0', + 'key': 'countries', + 'next_page_url': null, + 'page': 0, + 'page_size': 50, + 'previous_page_url': null, + 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' + } + }); + holodeck.mock(new Response(200, body)); + client.pricing.v2.voice + .countries.each({callback: () => done()}, () => fail('wrong callback!')); + } + ); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.pricing.v2.voice + .countries.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var url = 'https://pricing.twilio.com/v2/Voice/Countries'; + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid read_full response', + function() { + var body = JSON.stringify({ + 'countries': [ + { + 'country': 'Andorra', + 'iso_country': 'AD', + 'url': 'https://pricing.twilio.com/v2/Voice/Countries/AD' + } + ], + 'meta': { + 'first_page_url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0', + 'key': 'countries', + 'next_page_url': null, + 'page': 0, + 'page_size': 50, + 'previous_page_url': null, + 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' + } + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.pricing.v2.voice + .countries.list(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid read_empty response', + function() { + var body = JSON.stringify({ + 'countries': [], + 'meta': { + 'first_page_url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0', + 'key': 'countries', + 'next_page_url': null, + 'page': 0, + 'page_size': 50, + 'previous_page_url': null, + 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' + } + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.pricing.v2.voice + .countries.list(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid fetch request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.pricing.v2.voice + .countries('US').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {isoCountry: 'US'}; + var url = _.template('https://pricing.twilio.com/v2/Voice/Countries/<%= isoCountry %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'country': 'United States', + 'inbound_call_prices': [ + { + 'base_price': '0.0085', + 'current_price': '0.0085', + 'number_type': 'local' + }, + { + 'base_price': '0.022', + 'current_price': '0.022', + 'number_type': 'toll free' + } + ], + 'iso_country': 'US', + 'outbound_prefix_prices': [ + { + 'base_price': '0.090', + 'current_price': '0.090', + 'destination_prefixes': [ + '1907' + ], + 'friendly_name': 'Programmable Outbound Minute - United States - Alaska', + 'origination_prefixes': [ + 'ALL' + ] + }, + { + 'base_price': '0.013', + 'current_price': '0.013', + 'destination_prefixes': [ + '1808' + ], + 'friendly_name': 'Programmable Outbound Minute - United States - Hawaii', + 'origination_prefixes': [ + 'ALL' + ] + }, + { + 'base_price': '0.013', + 'current_price': '0.013', + 'destination_prefixes': [ + '1800', + '1844', + '1855', + '1866', + '1877', + '1888' + ], + 'friendly_name': 'Programmable Outbound Minute - United States & Canada - Toll Free', + 'origination_prefixes': [ + 'ALL' + ] + }, + { + 'base_price': '0.013', + 'current_price': '0.013', + 'destination_prefixes': [ + '1' + ], + 'friendly_name': 'Programmable Outbound Minute - United States & Canada', + 'origination_prefixes': [ + 'ALL' + ] + } + ], + 'price_unit': 'USD', + 'url': 'https://pricing.twilio.com/v2/Voice/Countries/US' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.pricing.v2.voice + .countries('US').fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +});