From 52285b4e174f1dd295f296de27b905fa5f7bd43c Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 11 May 2018 16:50:47 -0400 Subject: [PATCH] [Librarian] Regenerated @ a7d73bbe66630cbe95e957d5c5b4df5d1692ca33 --- CHANGES.md | 15 + lib/rest/Accounts.d.ts | 32 + lib/rest/Api.d.ts | 152 ++ lib/rest/Chat.d.ts | 39 + lib/rest/Fax.d.ts | 32 + lib/rest/IpMessaging.d.ts | 39 + lib/rest/Lookups.d.ts | 32 + lib/rest/Messaging.d.ts | 32 + lib/rest/Monitor.d.ts | 37 + lib/rest/Notify.d.ts | 37 + lib/rest/Preview.d.ts | 110 ++ lib/rest/Preview.js | 12 +- lib/rest/Pricing.d.ts | 42 + lib/rest/Proxy.d.ts | 32 + lib/rest/Studio.d.ts | 32 + lib/rest/Sync.d.ts | 32 + lib/rest/Taskrouter.d.ts | 32 + lib/rest/Trunking.d.ts | 32 + lib/rest/Twilio.d.ts | 151 ++ lib/rest/Video.d.ts | 42 + lib/rest/Video.js | 10 +- lib/rest/Wireless.d.ts | 42 + lib/rest/accounts/V1.d.ts | 26 + lib/rest/api/V2010.d.ts | 74 + lib/rest/api/v2010/account.js | 14 +- .../api/v2010/account/availablePhoneNumber.js | 2 +- .../account/availablePhoneNumber/local.js | 76 +- .../account/availablePhoneNumber/mobile.js | 66 +- .../account/availablePhoneNumber/tollFree.js | 64 +- lib/rest/api/v2010/account/call/feedback.js | 8 +- lib/rest/api/v2010/account/key.js | 6 +- .../api/v2010/account/message/feedback.js | 3 +- lib/rest/api/v2010/account/newKey.js | 18 +- .../v2010/account/recording/addOnResult.js | 2 +- .../account/recording/addOnResult/payload.js | 2 +- .../api/v2010/account/sip/credentialList.js | 14 +- .../account/sip/credentialList/credential.js | 6 +- .../sip/domain/credentialListMapping.js | 21 +- .../sip/domain/ipAccessControlListMapping.js | 21 +- .../sip/ipAccessControlList/ipAddress.js | 24 +- lib/rest/api/v2010/account/usage/record.js | 5 + lib/rest/chat/V1.d.ts | 28 + lib/rest/chat/V2.d.ts | 28 + lib/rest/chat/v1/credential.js | 65 +- lib/rest/chat/v1/service.js | 108 +- lib/rest/chat/v1/service/channel.js | 57 +- lib/rest/chat/v1/service/channel/invite.js | 44 +- lib/rest/chat/v1/service/channel/member.js | 58 +- lib/rest/chat/v1/service/channel/message.js | 42 +- lib/rest/chat/v1/service/role.js | 35 +- lib/rest/chat/v1/service/user.js | 66 +- lib/rest/chat/v1/service/user/userChannel.js | 3 +- lib/rest/chat/v2/credential.js | 74 +- lib/rest/chat/v2/service.js | 136 +- lib/rest/chat/v2/service/channel.js | 117 +- lib/rest/chat/v2/service/channel/invite.js | 44 +- lib/rest/chat/v2/service/channel/member.js | 59 +- lib/rest/chat/v2/service/channel/message.js | 99 +- lib/rest/chat/v2/service/channel/webhook.js | 725 +++++++++ lib/rest/chat/v2/service/role.js | 35 +- lib/rest/chat/v2/service/user.js | 69 +- lib/rest/chat/v2/service/user/userChannel.js | 3 +- lib/rest/fax/V1.d.ts | 26 + lib/rest/ipMessaging/V1.d.ts | 28 + lib/rest/ipMessaging/V2.d.ts | 28 + lib/rest/ipMessaging/v1/credential.js | 65 +- lib/rest/ipMessaging/v1/service.js | 108 +- lib/rest/ipMessaging/v1/service/channel.js | 57 +- .../ipMessaging/v1/service/channel/invite.js | 44 +- .../ipMessaging/v1/service/channel/member.js | 58 +- .../ipMessaging/v1/service/channel/message.js | 42 +- lib/rest/ipMessaging/v1/service/role.js | 35 +- lib/rest/ipMessaging/v1/service/user.js | 66 +- .../v1/service/user/userChannel.js | 3 +- lib/rest/ipMessaging/v2/credential.js | 74 +- lib/rest/ipMessaging/v2/service.js | 136 +- lib/rest/ipMessaging/v2/service/channel.js | 117 +- .../ipMessaging/v2/service/channel/invite.js | 44 +- .../ipMessaging/v2/service/channel/member.js | 59 +- .../ipMessaging/v2/service/channel/message.js | 99 +- .../ipMessaging/v2/service/channel/webhook.js | 725 +++++++++ lib/rest/ipMessaging/v2/service/role.js | 35 +- lib/rest/ipMessaging/v2/service/user.js | 69 +- .../v2/service/user/userChannel.js | 3 +- lib/rest/lookups/V1.d.ts | 26 + lib/rest/messaging/V1.d.ts | 26 + lib/rest/messaging/v1/service/shortCode.js | 22 +- lib/rest/monitor/V1.d.ts | 28 + lib/rest/monitor/v1/event.js | 13 +- lib/rest/notify/V1.d.ts | 28 + lib/rest/notify/v1/credential.js | 62 +- lib/rest/notify/v1/service.js | 103 +- lib/rest/notify/v1/service/binding.js | 78 +- lib/rest/notify/v1/service/notification.js | 79 +- lib/rest/preview/AccSecurity.d.ts | 26 + lib/rest/preview/BulkExports.d.ts | 28 + lib/rest/preview/DeployedDevices.d.ts | 26 + lib/rest/preview/HostedNumbers.d.ts | 28 + lib/rest/preview/Marketplace.d.ts | 28 + lib/rest/preview/Marketplace.js | 18 +- lib/rest/preview/Proxy.d.ts | 26 + lib/rest/preview/Studio.d.ts | 26 + lib/rest/preview/Sync.d.ts | 26 + lib/rest/preview/Understand.d.ts | 26 + lib/rest/preview/Wireless.d.ts | 30 + lib/rest/preview/understand/assistant.js | 61 +- .../preview/understand/assistant/fieldType.js | 38 +- .../assistant/fieldType/fieldValue.js | 39 +- .../preview/understand/assistant/intent.js | 38 +- .../understand/assistant/intent/field.js | 31 +- .../understand/assistant/intent/sample.js | 60 +- .../understand/assistant/modelBuild.js | 32 +- .../preview/understand/assistant/query.js | 79 +- lib/rest/pricing/V1.d.ts | 30 + lib/rest/pricing/v1/messaging/country.js | 11 +- lib/rest/pricing/v1/phoneNumber/country.js | 9 +- lib/rest/pricing/v1/voice/country.js | 7 +- lib/rest/pricing/v1/voice/number.js | 12 +- lib/rest/proxy/V1.d.ts | 26 + lib/rest/studio/V1.d.ts | 26 + lib/rest/sync/V1.d.ts | 26 + lib/rest/sync/v1/service/syncList.js | 6 +- .../sync/v1/service/syncList/syncListItem.js | 15 +- .../sync/v1/service/syncMap/syncMapItem.js | 23 +- lib/rest/taskrouter/V1.d.ts | 26 + lib/rest/trunking/V1.d.ts | 26 + lib/rest/video/V1.d.ts | 30 + lib/rest/video/V1.js | 16 +- lib/rest/video/v1/composition.js | 4 +- lib/rest/video/v1/recording.js | 101 +- lib/rest/video/v1/room/recording.js | 4 +- lib/rest/video/v1/room/roomParticipant.js | 24 +- lib/rest/wireless/V1.d.ts | 30 + lib/rest/wireless/v1/command.js | 81 +- lib/rest/wireless/v1/ratePlan.js | 83 +- lib/rest/wireless/v1/sim.js | 182 ++- lib/rest/wireless/v1/sim/dataSession.js | 51 +- lib/rest/wireless/v1/sim/usageRecord.js | 56 +- lib/twiml/FaxResponse.d.ts | 70 + lib/twiml/MessagingResponse.d.ts | 175 ++ lib/twiml/VoiceResponse.d.ts | 1431 +++++++++++++++++ .../rest/chat/v2/service/channel.spec.js | 4 + .../chat/v2/service/channel/webhook.spec.js | 401 +++++ .../ipMessaging/v2/service/channel.spec.js | 4 + .../v2/service/channel/webhook.spec.js | 401 +++++ 145 files changed, 8267 insertions(+), 1539 deletions(-) create mode 100644 lib/rest/Accounts.d.ts create mode 100644 lib/rest/Api.d.ts create mode 100644 lib/rest/Chat.d.ts create mode 100644 lib/rest/Fax.d.ts create mode 100644 lib/rest/IpMessaging.d.ts create mode 100644 lib/rest/Lookups.d.ts create mode 100644 lib/rest/Messaging.d.ts create mode 100644 lib/rest/Monitor.d.ts create mode 100644 lib/rest/Notify.d.ts create mode 100644 lib/rest/Preview.d.ts create mode 100644 lib/rest/Pricing.d.ts create mode 100644 lib/rest/Proxy.d.ts create mode 100644 lib/rest/Studio.d.ts create mode 100644 lib/rest/Sync.d.ts create mode 100644 lib/rest/Taskrouter.d.ts create mode 100644 lib/rest/Trunking.d.ts create mode 100644 lib/rest/Twilio.d.ts create mode 100644 lib/rest/Video.d.ts create mode 100644 lib/rest/Wireless.d.ts create mode 100644 lib/rest/accounts/V1.d.ts create mode 100644 lib/rest/api/V2010.d.ts create mode 100644 lib/rest/chat/V1.d.ts create mode 100644 lib/rest/chat/V2.d.ts create mode 100644 lib/rest/chat/v2/service/channel/webhook.js create mode 100644 lib/rest/fax/V1.d.ts create mode 100644 lib/rest/ipMessaging/V1.d.ts create mode 100644 lib/rest/ipMessaging/V2.d.ts create mode 100644 lib/rest/ipMessaging/v2/service/channel/webhook.js create mode 100644 lib/rest/lookups/V1.d.ts create mode 100644 lib/rest/messaging/V1.d.ts create mode 100644 lib/rest/monitor/V1.d.ts create mode 100644 lib/rest/notify/V1.d.ts create mode 100644 lib/rest/preview/AccSecurity.d.ts create mode 100644 lib/rest/preview/BulkExports.d.ts create mode 100644 lib/rest/preview/DeployedDevices.d.ts create mode 100644 lib/rest/preview/HostedNumbers.d.ts create mode 100644 lib/rest/preview/Marketplace.d.ts create mode 100644 lib/rest/preview/Proxy.d.ts create mode 100644 lib/rest/preview/Studio.d.ts create mode 100644 lib/rest/preview/Sync.d.ts create mode 100644 lib/rest/preview/Understand.d.ts create mode 100644 lib/rest/preview/Wireless.d.ts create mode 100644 lib/rest/pricing/V1.d.ts create mode 100644 lib/rest/proxy/V1.d.ts create mode 100644 lib/rest/studio/V1.d.ts create mode 100644 lib/rest/sync/V1.d.ts create mode 100644 lib/rest/taskrouter/V1.d.ts create mode 100644 lib/rest/trunking/V1.d.ts create mode 100644 lib/rest/video/V1.d.ts create mode 100644 lib/rest/wireless/V1.d.ts create mode 100644 lib/twiml/FaxResponse.d.ts create mode 100644 lib/twiml/MessagingResponse.d.ts create mode 100644 lib/twiml/VoiceResponse.d.ts create mode 100644 spec/integration/rest/chat/v2/service/channel/webhook.spec.js create mode 100644 spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js diff --git a/CHANGES.md b/CHANGES.md index bfb675090e..40e83b430d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,21 @@ twilio-node changelog ===================== +[2018-05-11] Version 3.17.0 +---------------------------- +**Library** +- PR #340: Update request version RE sec. advisory #606. Thanks to @cjcodes! + +**Chat** +- Add Channel Webhooks resource + +**Monitor** +- Update event filtering to support date/time **(breaking change)** + +**Wireless** +- Updated `maturity` to `ga` for all wireless apis + + [2018-04-28] Version 3.16.0 ---------------------------- **Library** diff --git a/lib/rest/Accounts.d.ts b/lib/rest/Accounts.d.ts new file mode 100644 index 0000000000..bd9a1ac2cc --- /dev/null +++ b/lib/rest/Accounts.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./accounts/V1'); +import { CredentialListInstance } from './accounts/v1/credential'; + + +/** + * Initialize accounts domain + */ +declare class Accounts extends Domain { + /** + * Initialize accounts domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Credential resource + */ + readonly credentials: CredentialListInstance; + readonly v1: V1; +} + +export = Accounts; diff --git a/lib/rest/Api.d.ts b/lib/rest/Api.d.ts new file mode 100644 index 0000000000..a2e0585402 --- /dev/null +++ b/lib/rest/Api.d.ts @@ -0,0 +1,152 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V2010 = require('./api/V2010'); +import { AccountContext } from './api/v2010/account'; +import { AccountListInstance } from './api/v2010/account'; +import { AddressListInstance } from './api/v2010/account/address'; +import { ApplicationListInstance } from './api/v2010/account/application'; +import { AuthorizedConnectAppListInstance } from './api/v2010/account/authorizedConnectApp'; +import { AvailablePhoneNumberCountryListInstance } from './api/v2010/account/availablePhoneNumber'; +import { CallListInstance } from './api/v2010/account/call'; +import { ConferenceListInstance } from './api/v2010/account/conference'; +import { ConnectAppListInstance } from './api/v2010/account/connectApp'; +import { IncomingPhoneNumberListInstance } from './api/v2010/account/incomingPhoneNumber'; +import { KeyListInstance } from './api/v2010/account/key'; +import { MessageListInstance } from './api/v2010/account/message'; +import { NewKeyListInstance } from './api/v2010/account/newKey'; +import { NewSigningKeyListInstance } from './api/v2010/account/newSigningKey'; +import { NotificationListInstance } from './api/v2010/account/notification'; +import { OutgoingCallerIdListInstance } from './api/v2010/account/outgoingCallerId'; +import { QueueListInstance } from './api/v2010/account/queue'; +import { RecordingListInstance } from './api/v2010/account/recording'; +import { ShortCodeListInstance } from './api/v2010/account/shortCode'; +import { SigningKeyListInstance } from './api/v2010/account/signingKey'; +import { SipListInstance } from './api/v2010/account/sip'; +import { TokenListInstance } from './api/v2010/account/token'; +import { TranscriptionListInstance } from './api/v2010/account/transcription'; +import { UsageListInstance } from './api/v2010/account/usage'; +import { ValidationRequestListInstance } from './api/v2010/account/validationRequest'; + + +/** + * Initialize api domain + */ +declare class Api extends Domain { + /** + * Initialize api domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Main account resource + */ + readonly account: AccountContext; + /** + * Account resource + */ + readonly accounts: AccountListInstance; + /** + * Address resource + */ + readonly addresses: AddressListInstance; + /** + * Application resource + */ + readonly applications: ApplicationListInstance; + /** + * AuthorizedConnectApp resource + */ + readonly authorizedConnectApps: AuthorizedConnectAppListInstance; + /** + * AvailablePhoneNumberCountry resource + */ + readonly availablePhoneNumbers: AvailablePhoneNumberCountryListInstance; + /** + * Call resource + */ + readonly calls: CallListInstance; + /** + * Conference resource + */ + readonly conferences: ConferenceListInstance; + /** + * ConnectApp resource + */ + readonly connectApps: ConnectAppListInstance; + /** + * IncomingPhoneNumber resource + */ + readonly incomingPhoneNumbers: IncomingPhoneNumberListInstance; + /** + * Key resource + */ + readonly keys: KeyListInstance; + /** + * Message resource + */ + readonly messages: MessageListInstance; + /** + * NewKey resource + */ + readonly newKeys: NewKeyListInstance; + /** + * NewSigningKey resource + */ + readonly newSigningKeys: NewSigningKeyListInstance; + /** + * Notification resource + */ + readonly notifications: NotificationListInstance; + /** + * OutgoingCallerId resource + */ + readonly outgoingCallerIds: OutgoingCallerIdListInstance; + /** + * Queue resource + */ + readonly queues: QueueListInstance; + /** + * Recording resource + */ + readonly recordings: RecordingListInstance; + /** + * ShortCode resource + */ + readonly shortCodes: ShortCodeListInstance; + /** + * SigningKey resource + */ + readonly signingKeys: SigningKeyListInstance; + /** + * Sip resource + */ + readonly sip: SipListInstance; + /** + * Token resource + */ + readonly tokens: TokenListInstance; + /** + * Transcription resource + */ + readonly transcriptions: TranscriptionListInstance; + /** + * Usage resource + */ + readonly usage: UsageListInstance; + readonly v2010: V2010; + /** + * ValidationRequest resource + */ + readonly validationRequests: ValidationRequestListInstance; +} + +export = Api; diff --git a/lib/rest/Chat.d.ts b/lib/rest/Chat.d.ts new file mode 100644 index 0000000000..8f386fe960 --- /dev/null +++ b/lib/rest/Chat.d.ts @@ -0,0 +1,39 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./chat/V1'); +import V2 = require('./chat/V2'); +import { CredentialListInstance } from './chat/v2/credential'; +import { ServiceListInstance } from './chat/v2/service'; + + +/** + * Initialize chat domain + */ +declare class Chat extends Domain { + /** + * Initialize chat domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Credential resource + */ + readonly credentials: CredentialListInstance; + /** + * Service resource + */ + readonly services: ServiceListInstance; + readonly v1: V1; + readonly v2: V2; +} + +export = Chat; diff --git a/lib/rest/Fax.d.ts b/lib/rest/Fax.d.ts new file mode 100644 index 0000000000..17c9e72caa --- /dev/null +++ b/lib/rest/Fax.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./fax/V1'); +import { FaxListInstance } from './fax/v1/fax'; + + +/** + * Initialize fax domain + */ +declare class Fax extends Domain { + /** + * Initialize fax domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Fax resource + */ + readonly faxes: FaxListInstance; + readonly v1: V1; +} + +export = Fax; diff --git a/lib/rest/IpMessaging.d.ts b/lib/rest/IpMessaging.d.ts new file mode 100644 index 0000000000..4cd1e36da9 --- /dev/null +++ b/lib/rest/IpMessaging.d.ts @@ -0,0 +1,39 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./ipMessaging/V1'); +import V2 = require('./ipMessaging/V2'); +import { CredentialListInstance } from './ipMessaging/v2/credential'; +import { ServiceListInstance } from './ipMessaging/v2/service'; + + +/** + * Initialize ip_messaging domain + */ +declare class IpMessaging extends Domain { + /** + * Initialize ip_messaging domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Credential resource + */ + readonly credentials: CredentialListInstance; + /** + * Service resource + */ + readonly services: ServiceListInstance; + readonly v1: V1; + readonly v2: V2; +} + +export = IpMessaging; diff --git a/lib/rest/Lookups.d.ts b/lib/rest/Lookups.d.ts new file mode 100644 index 0000000000..0bbc904bcb --- /dev/null +++ b/lib/rest/Lookups.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./lookups/V1'); +import { PhoneNumberListInstance } from './lookups/v1/phoneNumber'; + + +/** + * Initialize lookups domain + */ +declare class Lookups extends Domain { + /** + * Initialize lookups domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * PhoneNumber resource + */ + readonly phoneNumbers: PhoneNumberListInstance; + readonly v1: V1; +} + +export = Lookups; diff --git a/lib/rest/Messaging.d.ts b/lib/rest/Messaging.d.ts new file mode 100644 index 0000000000..c0b56a1113 --- /dev/null +++ b/lib/rest/Messaging.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./messaging/V1'); +import { ServiceListInstance } from './messaging/v1/service'; + + +/** + * Initialize messaging domain + */ +declare class Messaging extends Domain { + /** + * Initialize messaging domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Service resource + */ + readonly services: ServiceListInstance; + readonly v1: V1; +} + +export = Messaging; diff --git a/lib/rest/Monitor.d.ts b/lib/rest/Monitor.d.ts new file mode 100644 index 0000000000..23e31dc790 --- /dev/null +++ b/lib/rest/Monitor.d.ts @@ -0,0 +1,37 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./monitor/V1'); +import { AlertListInstance } from './monitor/v1/alert'; +import { EventListInstance } from './monitor/v1/event'; + + +/** + * Initialize monitor domain + */ +declare class Monitor extends Domain { + /** + * Initialize monitor domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Alert resource + */ + readonly alerts: AlertListInstance; + /** + * Event resource + */ + readonly events: EventListInstance; + readonly v1: V1; +} + +export = Monitor; diff --git a/lib/rest/Notify.d.ts b/lib/rest/Notify.d.ts new file mode 100644 index 0000000000..ee95e3b3ea --- /dev/null +++ b/lib/rest/Notify.d.ts @@ -0,0 +1,37 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./notify/V1'); +import { CredentialListInstance } from './notify/v1/credential'; +import { ServiceListInstance } from './notify/v1/service'; + + +/** + * Initialize notify domain + */ +declare class Notify extends Domain { + /** + * Initialize notify domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Credential resource + */ + readonly credentials: CredentialListInstance; + /** + * Service resource + */ + readonly services: ServiceListInstance; + readonly v1: V1; +} + +export = Notify; diff --git a/lib/rest/Preview.d.ts b/lib/rest/Preview.d.ts new file mode 100644 index 0000000000..859a89c64c --- /dev/null +++ b/lib/rest/Preview.d.ts @@ -0,0 +1,110 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import AccSecurity = require('./preview/AccSecurity'); +import BulkExports = require('./preview/BulkExports'); +import DeployedDevices = require('./preview/DeployedDevices'); +import Domain = require('../base/Domain'); +import HostedNumbers = require('./preview/HostedNumbers'); +import Marketplace = require('./preview/Marketplace'); +import Proxy = require('./preview/Proxy'); +import Studio = require('./preview/Studio'); +import Sync = require('./preview/Sync'); +import TwilioClient = require('./Twilio'); +import Understand = require('./preview/Understand'); +import Wireless = require('./preview/Wireless'); +import { AssistantListInstance } from './preview/understand/assistant'; +import { AuthorizationDocumentListInstance } from './preview/hosted_numbers/authorizationDocument'; +import { AvailableAddOnListInstance } from './preview/marketplace/availableAddOn'; +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'; +import { ServiceListInstance } from './preview/sync/service'; +import { SimListInstance } from './preview/wireless/sim'; + + +/** + * Initialize preview domain + */ +declare class Preview extends Domain { + /** + * Initialize preview domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + readonly acc_security: AccSecurity; + /** + * Assistant resource + */ + readonly assistants: AssistantListInstance; + /** + * AuthorizationDocument resource + */ + readonly authorizationDocuments: AuthorizationDocumentListInstance; + /** + * AvailableAddOn resource + */ + readonly availableAddOns: AvailableAddOnListInstance; + readonly bulk_exports: BulkExports; + /** + * Command resource + */ + readonly commands: CommandListInstance; + readonly deployed_devices: DeployedDevices; + /** + * ExportConfiguration resource + */ + readonly exportConfiguration: ExportConfigurationListInstance; + /** + * Export resource + */ + readonly exports: ExportListInstance; + /** + * Fleet resource + */ + readonly fleets: FleetListInstance; + /** + * Flow resource + */ + readonly flows: FlowListInstance; + /** + * HostedNumberOrder resource + */ + readonly hostedNumberOrders: HostedNumberOrderListInstance; + readonly hosted_numbers: HostedNumbers; + /** + * InstalledAddOn resource + */ + readonly installedAddOns: InstalledAddOnListInstance; + readonly marketplace: Marketplace; + readonly proxy: Proxy; + /** + * RatePlan resource + */ + readonly ratePlans: RatePlanListInstance; + /** + * Service resource + */ + readonly services: ServiceListInstance; + /** + * Sim resource + */ + readonly sims: SimListInstance; + readonly studio: Studio; + readonly sync: Sync; + readonly understand: Understand; + readonly wireless: Wireless; +} + +export = Preview; diff --git a/lib/rest/Preview.js b/lib/rest/Preview.js index a24fd4e816..5d0586503e 100644 --- a/lib/rest/Preview.js +++ b/lib/rest/Preview.js @@ -50,10 +50,10 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */ * authorizationDocuments resource * @property {Twilio.Preview.HostedNumbers.HostedNumberOrderList} hostedNumberOrders - * hostedNumberOrders resource - * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - - * availableAddOns resource * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns - * installedAddOns resource + * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - + * availableAddOns resource * @property {Twilio.Preview.Sync.ServiceList} services - services resource * @property {Twilio.Preview.Studio.FlowList} flows - flows resource * @property {Twilio.Preview.Understand.AssistantList} assistants - @@ -200,16 +200,16 @@ Object.defineProperty(Preview.prototype, }); Object.defineProperty(Preview.prototype, - 'availableAddOns', { + 'installedAddOns', { get: function() { - return this.marketplace.availableAddOns; + return this.marketplace.installedAddOns; } }); Object.defineProperty(Preview.prototype, - 'installedAddOns', { + 'availableAddOns', { get: function() { - return this.marketplace.installedAddOns; + return this.marketplace.availableAddOns; } }); diff --git a/lib/rest/Pricing.d.ts b/lib/rest/Pricing.d.ts new file mode 100644 index 0000000000..2837ceb76c --- /dev/null +++ b/lib/rest/Pricing.d.ts @@ -0,0 +1,42 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./pricing/V1'); +import { MessagingListInstance } from './pricing/v1/messaging'; +import { PhoneNumberListInstance } from './pricing/v1/phoneNumber'; +import { VoiceListInstance } from './pricing/v1/voice'; + + +/** + * Initialize pricing domain + */ +declare class Pricing extends Domain { + /** + * Initialize pricing domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Messaging resource + */ + readonly messaging: MessagingListInstance; + /** + * PhoneNumber resource + */ + readonly phoneNumbers: PhoneNumberListInstance; + readonly v1: V1; + /** + * Voice resource + */ + readonly voice: VoiceListInstance; +} + +export = Pricing; diff --git a/lib/rest/Proxy.d.ts b/lib/rest/Proxy.d.ts new file mode 100644 index 0000000000..24402d5672 --- /dev/null +++ b/lib/rest/Proxy.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./proxy/V1'); +import { ServiceListInstance } from './proxy/v1/service'; + + +/** + * Initialize proxy domain + */ +declare class Proxy extends Domain { + /** + * Initialize proxy domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Service resource + */ + readonly services: ServiceListInstance; + readonly v1: V1; +} + +export = Proxy; diff --git a/lib/rest/Studio.d.ts b/lib/rest/Studio.d.ts new file mode 100644 index 0000000000..b873425387 --- /dev/null +++ b/lib/rest/Studio.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./studio/V1'); +import { FlowListInstance } from './studio/v1/flow'; + + +/** + * Initialize studio domain + */ +declare class Studio extends Domain { + /** + * Initialize studio domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Flow resource + */ + readonly flows: FlowListInstance; + readonly v1: V1; +} + +export = Studio; diff --git a/lib/rest/Sync.d.ts b/lib/rest/Sync.d.ts new file mode 100644 index 0000000000..8444d10b20 --- /dev/null +++ b/lib/rest/Sync.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./sync/V1'); +import { ServiceListInstance } from './sync/v1/service'; + + +/** + * Initialize sync domain + */ +declare class Sync extends Domain { + /** + * Initialize sync domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Service resource + */ + readonly services: ServiceListInstance; + readonly v1: V1; +} + +export = Sync; diff --git a/lib/rest/Taskrouter.d.ts b/lib/rest/Taskrouter.d.ts new file mode 100644 index 0000000000..49d5a6ab08 --- /dev/null +++ b/lib/rest/Taskrouter.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./taskrouter/V1'); +import { WorkspaceListInstance } from './taskrouter/v1/workspace'; + + +/** + * Initialize taskrouter domain + */ +declare class Taskrouter extends Domain { + /** + * Initialize taskrouter domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + readonly v1: V1; + /** + * Workspace resource + */ + readonly workspaces: WorkspaceListInstance; +} + +export = Taskrouter; diff --git a/lib/rest/Trunking.d.ts b/lib/rest/Trunking.d.ts new file mode 100644 index 0000000000..f6dec781ed --- /dev/null +++ b/lib/rest/Trunking.d.ts @@ -0,0 +1,32 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./trunking/V1'); +import { TrunkListInstance } from './trunking/v1/trunk'; + + +/** + * Initialize trunking domain + */ +declare class Trunking extends Domain { + /** + * Initialize trunking domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Trunk resource + */ + readonly trunks: TrunkListInstance; + readonly v1: V1; +} + +export = Trunking; diff --git a/lib/rest/Twilio.d.ts b/lib/rest/Twilio.d.ts new file mode 100644 index 0000000000..72a8108b54 --- /dev/null +++ b/lib/rest/Twilio.d.ts @@ -0,0 +1,151 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Accounts = require('./Accounts'); +import Api = require('./Api'); +import Chat = require('./Chat'); +import Fax = require('./Fax'); +import IpMessaging = require('./IpMessaging'); +import Lookups = require('./Lookups'); +import Messaging = require('./Messaging'); +import Monitor = require('./Monitor'); +import Notify = require('./Notify'); +import Preview = require('./Preview'); +import Pricing = require('./Pricing'); +import Proxy = require('./Proxy'); +import RequestClient = require('../base/RequestClient'); +import Studio = require('./Studio'); +import Sync = require('./Sync'); +import Taskrouter = require('./Taskrouter'); +import Trunking = require('./Trunking'); +import Video = require('./Video'); +import Wireless = require('./Wireless'); + +declare class Twilio { + /** + * Twilio Client to interact with the Rest API + * + * @param username - The username used for authentication. This is normally account sid, but if using key/secret auth will be the api key sid. + * @param password - The password used for authentication. This is normally auth token, but if using key/secret auth will be the secret. + * @param opts - Options to alter the behavior of the Twilio Client + * + * @returns A new instance of Twilio client + */ + constructor(username: string, password: string, opts?: Twilio.TwilioClientOptions); + + private _accounts?: Accounts; + private _api?: Api; + private _chat?: Chat; + private _fax?: Fax; + private _ipMessaging?: IpMessaging; + private _lookups?: Lookups; + private _messaging?: Messaging; + private _monitor?: Monitor; + private _notify?: Notify; + private _preview?: Preview; + private _pricing?: Pricing; + private _proxy?: Proxy; + private _studio?: Studio; + private _sync?: Sync; + private _taskrouter?: Taskrouter; + private _trunking?: Trunking; + private _video?: Video; + private _wireless?: Wireless; + accounts: Accounts; + addresses: (typeof Api.prototype.account.addresses); + api: Api; + applications: (typeof Api.prototype.account.applications); + authorizedConnectApps: (typeof Api.prototype.account.authorizedConnectApps); + availablePhoneNumbers: (typeof Api.prototype.account.availablePhoneNumbers); + calls: (typeof Api.prototype.account.calls); + chat: Chat; + conferences: (typeof Api.prototype.account.conferences); + connectApps: (typeof Api.prototype.account.connectApps); + fax: Fax; + incomingPhoneNumbers: (typeof Api.prototype.account.incomingPhoneNumbers); + ipMessaging: IpMessaging; + keys: (typeof Api.prototype.account.keys); + lookups: Lookups; + messages: (typeof Api.prototype.account.messages); + messaging: Messaging; + monitor: Monitor; + newKeys: (typeof Api.prototype.account.newKeys); + newSigningKeys: (typeof Api.prototype.account.newSigningKeys); + notifications: (typeof Api.prototype.account.notifications); + notify: Notify; + outgoingCallerIds: (typeof Api.prototype.account.outgoingCallerIds); + preview: Preview; + pricing: Pricing; + proxy: Proxy; + queues: (typeof Api.prototype.account.queues); + recordings: (typeof Api.prototype.account.recordings); + /** + * Makes a request to the Twilio API using the configured http client. + * Authentication information is automatically added if none is provided. + * + * @param opts - The options argument + */ + request(opts?: Twilio.RequestOptions): any; + shortCodes: (typeof Api.prototype.account.shortCodes); + signingKeys: (typeof Api.prototype.account.signingKeys); + sip: (typeof Api.prototype.account.sip); + studio: Studio; + sync: Sync; + taskrouter: Taskrouter; + tokens: (typeof Api.prototype.account.tokens); + transcriptions: (typeof Api.prototype.account.transcriptions); + trunking: Trunking; + usage: (typeof Api.prototype.account.usage); + validationRequests: (typeof Api.prototype.account.validationRequests); + video: Video; + wireless: Wireless; +} + +declare namespace Twilio { + + /** + * Options to pass to the Twilio Client constructor + * + * @property httpClient - The client used for http requests. Defaults to RequestClient + * @property accountSid - The default accountSid. This is set to username if not provided + * @property env - The environment object. Defaults to process.env + * @property httpClient - Twilio region to use. Defaults to none + */ + export interface TwilioClientOptions { + accountSid?: string; + env?: object; + httpClient?: RequestClient; + region?: string; + } + + /** + * Options for the request + * + * @property method - The http method + * @property uri - The request uri + * @property username - The username used for auth + * @property password - The password used for auth + * @property headers - The request headers + * @property params - The request params + * @property data - The request data + * @property timeout - The request timeout in milliseconds + * @property allowRedirects - Should the client follow redirects + */ + export interface RequestOptions { + allowRedirects?: boolean; + data?: object; + headers?: object; + method: string; + params?: object; + password?: string; + timeout?: number; + uri: string; + username?: string; + } + +} +export = Twilio; diff --git a/lib/rest/Video.d.ts b/lib/rest/Video.d.ts new file mode 100644 index 0000000000..91ce481c01 --- /dev/null +++ b/lib/rest/Video.d.ts @@ -0,0 +1,42 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./video/V1'); +import { CompositionListInstance } from './video/v1/composition'; +import { RecordingListInstance } from './video/v1/recording'; +import { RoomListInstance } from './video/v1/room'; + + +/** + * Initialize video domain + */ +declare class Video extends Domain { + /** + * Initialize video domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Composition resource + */ + readonly compositions: CompositionListInstance; + /** + * Recording resource + */ + readonly recordings: RecordingListInstance; + /** + * Room resource + */ + readonly rooms: RoomListInstance; + readonly v1: V1; +} + +export = Video; diff --git a/lib/rest/Video.js b/lib/rest/Video.js index df6b30f163..b0e308a53c 100644 --- a/lib/rest/Video.js +++ b/lib/rest/Video.js @@ -21,8 +21,8 @@ var V1 = require('./video/V1'); /* jshint ignore:line */ * @constructor Twilio.Video * * @property {Twilio.Video.V1} v1 - v1 version - * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.RecordingList} recordings - recordings resource + * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.RoomList} rooms - rooms resource * * @param {Twilio} twilio - The twilio client @@ -47,16 +47,16 @@ Object.defineProperty(Video.prototype, }); Object.defineProperty(Video.prototype, - 'compositions', { + 'recordings', { get: function() { - return this.v1.compositions; + return this.v1.recordings; } }); Object.defineProperty(Video.prototype, - 'recordings', { + 'compositions', { get: function() { - return this.v1.recordings; + return this.v1.compositions; } }); diff --git a/lib/rest/Wireless.d.ts b/lib/rest/Wireless.d.ts new file mode 100644 index 0000000000..dea7d84b35 --- /dev/null +++ b/lib/rest/Wireless.d.ts @@ -0,0 +1,42 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Domain = require('../base/Domain'); +import TwilioClient = require('./Twilio'); +import V1 = require('./wireless/V1'); +import { CommandListInstance } from './wireless/v1/command'; +import { RatePlanListInstance } from './wireless/v1/ratePlan'; +import { SimListInstance } from './wireless/v1/sim'; + + +/** + * Initialize wireless domain + */ +declare class Wireless extends Domain { + /** + * Initialize wireless domain + * + * @param twilio - The twilio client + */ + constructor(twilio: TwilioClient); + + /** + * Command resource + */ + readonly commands: CommandListInstance; + /** + * RatePlan resource + */ + readonly ratePlans: RatePlanListInstance; + /** + * Sim resource + */ + readonly sims: SimListInstance; + readonly v1: V1; +} + +export = Wireless; diff --git a/lib/rest/accounts/V1.d.ts b/lib/rest/accounts/V1.d.ts new file mode 100644 index 0000000000..33cc2db9f3 --- /dev/null +++ b/lib/rest/accounts/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CredentialListInstance } from './v1/credential'; + + +/** + * Initialize the V1 version of Accounts + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Accounts + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly credentials: CredentialListInstance; +} + +export = V1; diff --git a/lib/rest/api/V2010.d.ts b/lib/rest/api/V2010.d.ts new file mode 100644 index 0000000000..e2bb2f6da1 --- /dev/null +++ b/lib/rest/api/V2010.d.ts @@ -0,0 +1,74 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { AccountContext } from './v2010/account'; +import { AccountListInstance } from './v2010/account'; +import { AddressListInstance } from './v2010/account/address'; +import { ApplicationListInstance } from './v2010/account/application'; +import { AuthorizedConnectAppListInstance } from './v2010/account/authorizedConnectApp'; +import { AvailablePhoneNumberCountryListInstance } from './v2010/account/availablePhoneNumber'; +import { CallListInstance } from './v2010/account/call'; +import { ConferenceListInstance } from './v2010/account/conference'; +import { ConnectAppListInstance } from './v2010/account/connectApp'; +import { IncomingPhoneNumberListInstance } from './v2010/account/incomingPhoneNumber'; +import { KeyListInstance } from './v2010/account/key'; +import { MessageListInstance } from './v2010/account/message'; +import { NewKeyListInstance } from './v2010/account/newKey'; +import { NewSigningKeyListInstance } from './v2010/account/newSigningKey'; +import { NotificationListInstance } from './v2010/account/notification'; +import { OutgoingCallerIdListInstance } from './v2010/account/outgoingCallerId'; +import { QueueListInstance } from './v2010/account/queue'; +import { RecordingListInstance } from './v2010/account/recording'; +import { ShortCodeListInstance } from './v2010/account/shortCode'; +import { SigningKeyListInstance } from './v2010/account/signingKey'; +import { SipListInstance } from './v2010/account/sip'; +import { TokenListInstance } from './v2010/account/token'; +import { TranscriptionListInstance } from './v2010/account/transcription'; +import { UsageListInstance } from './v2010/account/usage'; +import { ValidationRequestListInstance } from './v2010/account/validationRequest'; + + +/** + * Initialize the V2010 version of Api + */ +declare class V2010 extends Version { + /** + * Initialize the V2010 version of Api + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + account: AccountContext; + readonly accounts: AccountListInstance; + readonly addresses: AddressListInstance; + readonly applications: ApplicationListInstance; + readonly authorizedConnectApps: AuthorizedConnectAppListInstance; + readonly availablePhoneNumbers: AvailablePhoneNumberCountryListInstance; + readonly calls: CallListInstance; + readonly conferences: ConferenceListInstance; + readonly connectApps: ConnectAppListInstance; + readonly incomingPhoneNumbers: IncomingPhoneNumberListInstance; + readonly keys: KeyListInstance; + readonly messages: MessageListInstance; + readonly newKeys: NewKeyListInstance; + readonly newSigningKeys: NewSigningKeyListInstance; + readonly notifications: NotificationListInstance; + readonly outgoingCallerIds: OutgoingCallerIdListInstance; + readonly queues: QueueListInstance; + readonly recordings: RecordingListInstance; + readonly shortCodes: ShortCodeListInstance; + readonly signingKeys: SigningKeyListInstance; + readonly sip: SipListInstance; + readonly tokens: TokenListInstance; + readonly transcriptions: TranscriptionListInstance; + readonly usage: UsageListInstance; + readonly validationRequests: ValidationRequestListInstance; +} + +export = V2010; diff --git a/lib/rest/api/v2010/account.js b/lib/rest/api/v2010/account.js index 5d68e2a9a1..f64f06f90a 100644 --- a/lib/rest/api/v2010/account.js +++ b/lib/rest/api/v2010/account.js @@ -139,7 +139,7 @@ AccountList = function AccountList(version) { * * @param {object|function} opts - ... * @param {string} [opts.friendlyName] - FriendlyName to filter on - * @param {string} [opts.status] - Status to filter on + * @param {account.status} [opts.status] - Status to filter on * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -229,7 +229,7 @@ AccountList = function AccountList(version) { * * @param {object|function} opts - ... * @param {string} [opts.friendlyName] - FriendlyName to filter on - * @param {string} [opts.status] - Status to filter on + * @param {account.status} [opts.status] - Status to filter on * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -290,7 +290,7 @@ AccountList = function AccountList(version) { * * @param {object|function} opts - ... * @param {string} [opts.friendlyName] - FriendlyName to filter on - * @param {string} [opts.status] - Status to filter on + * @param {account.status} [opts.status] - Status to filter on * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -345,7 +345,7 @@ AccountList = function AccountList(version) { * @instance * * @param {string} [opts.friendlyName] - FriendlyName to filter on - * @param {string} [opts.status] - Status to filter on + * @param {account.status} [opts.status] - Status to filter on * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -447,7 +447,7 @@ AccountPage.prototype.getInstance = function getInstance(payload) { * The unique 34 character id representing the parent of this account * @property {string} sid - * A 34 character string that uniquely identifies this resource. - * @property {string} status - The status of this account + * @property {account.status} status - The status of this account * @property {string} subresourceUris - Account Instance Subresources * @property {account.type} type - The type of this account * @property {string} uri - @@ -516,7 +516,7 @@ AccountInstance.prototype.fetch = function fetch(callback) { * * @param {object|function} opts - ... * @param {string} [opts.friendlyName] - FriendlyName to update - * @param {string} [opts.status] - Status to update the Account with + * @param {account.status} [opts.status] - Status to update the Account with * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AccountInstance @@ -1024,7 +1024,7 @@ AccountContext.prototype.fetch = function fetch(callback) { * * @param {object|function} opts - ... * @param {string} [opts.friendlyName] - FriendlyName to update - * @param {string} [opts.status] - Status to update the Account with + * @param {account.status} [opts.status] - Status to update the Account with * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed AccountInstance diff --git a/lib/rest/api/v2010/account/availablePhoneNumber.js b/lib/rest/api/v2010/account/availablePhoneNumber.js index 881bb66b47..1618eb36d0 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber.js @@ -375,7 +375,7 @@ AvailablePhoneNumberCountryPage.prototype.getInstance = function * The ISO Country code to lookup phone numbers for. * @property {string} country - The country * @property {string} uri - The uri - * @property {boolean} beta - The beta + * @property {boolean} beta - True if new to Twilio platform. * @property {string} subresourceUris - The subresource_uris * * @param {Twilio.Api.V2010} version - Version of the resource diff --git a/lib/rest/api/v2010/account/availablePhoneNumber/local.js b/lib/rest/api/v2010/account/availablePhoneNumber/local.js index 06158da4c6..3318dd5ae7 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber/local.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber/local.js @@ -87,18 +87,21 @@ LocalList = function LocalList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. - * @param {string} [opts.inLocality] - Limit results to a particular locality. + * Limit results to a specific Local access and transport area. (US/Canada only) + * @param {string} [opts.inLocality] - + * Limit results to a particular locality. (US/Canada only) * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. * @param {number} [opts.limit] - @@ -205,18 +208,21 @@ LocalList = function LocalList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. - * @param {string} [opts.inLocality] - Limit results to a particular locality. + * Limit results to a specific Local access and transport area. (US/Canada only) + * @param {string} [opts.inLocality] - + * Limit results to a particular locality. (US/Canada only) * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. * @param {number} [opts.limit] - @@ -294,18 +300,21 @@ LocalList = function LocalList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. - * @param {string} [opts.inLocality] - Limit results to a particular locality. + * Limit results to a specific Local access and transport area. (US/Canada only) + * @param {string} [opts.inLocality] - + * Limit results to a particular locality. (US/Canada only) * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. * @param {string} [opts.pageToken] - PageToken provided by the API @@ -393,18 +402,21 @@ LocalList = function LocalList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. - * @param {string} [opts.inLocality] - Limit results to a particular locality. + * Limit results to a specific Local access and transport area. (US/Canada only) + * @param {string} [opts.inLocality] - + * Limit results to a particular locality. (US/Canada only) * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. * @param {string} [targetUrl] - API-generated URL for the requested results page diff --git a/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js b/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js index 87bf864993..2d2c5a5761 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js @@ -87,17 +87,19 @@ MobileList = function MobileList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -205,17 +207,19 @@ MobileList = function MobileList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -294,17 +298,19 @@ MobileList = function MobileList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -393,17 +399,19 @@ MobileList = function MobileList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -490,7 +498,7 @@ MobilePage.prototype.getInstance = function getInstance(payload) { * * @property {string} friendlyName - * A nicely-formatted version of the phone number. - * @property {string} phoneNumber - The phone number, in E. + * @property {string} phoneNumber - The phone number, in E.164 format. * @property {string} lata - The LATA of this phone number. * @property {string} locality - The locality/city of this phone number. * @property {string} rateCenter - The rate center of this phone number. diff --git a/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js b/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js index 7037a903ff..4319908f14 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js @@ -87,17 +87,19 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -205,17 +207,19 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -294,17 +298,19 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. @@ -393,17 +399,19 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { * Indicates whether the response includes phone numbers which require a foreign Address. * @param {boolean} [opts.beta] - Include phone numbers new to the Twilio platform. * @param {string} [opts.nearNumber] - - * Given a phone number, find a geographically close number within Distance miles. + * Given a phone number, find a geographically close number within Distance miles. (US/Canada only) * @param {string} [opts.nearLatLong] - - * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. + * Given a latitude/longitude pair lat,long find geographically close numbers within Distance miles. (US/Canada only) * @param {number} [opts.distance] - - * Specifies the search radius for a Near- query in miles. - * @param {string} [opts.inPostalCode] - Limit results to a particular postal code. - * @param {string} [opts.inRegion] - Limit results to a particular region. + * Specifies the search radius for a Near- query in miles. (US/Canada only) + * @param {string} [opts.inPostalCode] - + * Limit results to a particular postal code. (US/Canada only) + * @param {string} [opts.inRegion] - + * Limit results to a particular region. (US/Canada only) * @param {string} [opts.inRateCenter] - - * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. (US/Canada only) * @param {string} [opts.inLata] - - * Limit results to a specific Local access and transport area. + * Limit results to a specific Local access and transport area. (US/Canada only) * @param {string} [opts.inLocality] - Limit results to a particular locality. * @param {boolean} [opts.faxEnabled] - * This indicates whether the phone numbers can receive faxes. diff --git a/lib/rest/api/v2010/account/call/feedback.js b/lib/rest/api/v2010/account/call/feedback.js index 973bd4e5d1..35c48a8e36 100644 --- a/lib/rest/api/v2010/account/call/feedback.js +++ b/lib/rest/api/v2010/account/call/feedback.js @@ -177,8 +177,8 @@ Object.defineProperty(FeedbackInstance.prototype, * @instance * * @param {object} opts - ... - * @param {number} opts.qualityScore - The quality_score - * @param {feedback.issues|list} [opts.issue] - The issue + * @param {number} opts.qualityScore - An integer from 1 to 5 + * @param {feedback.issues|list} [opts.issue] - Issues experienced during the call * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed FeedbackInstance @@ -277,8 +277,8 @@ FeedbackContext = function FeedbackContext(version, accountSid, callSid) { * @instance * * @param {object} opts - ... - * @param {number} opts.qualityScore - The quality_score - * @param {feedback.issues|list} [opts.issue] - The issue + * @param {number} opts.qualityScore - An integer from 1 to 5 + * @param {feedback.issues|list} [opts.issue] - Issues experienced during the call * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed FeedbackInstance diff --git a/lib/rest/api/v2010/account/key.js b/lib/rest/api/v2010/account/key.js index fa7dc48c68..e64a4e60f5 100644 --- a/lib/rest/api/v2010/account/key.js +++ b/lib/rest/api/v2010/account/key.js @@ -422,8 +422,7 @@ KeyInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - - * A descriptive string for this resource, chosen by your application, up to 64 characters long. + * @param {string} [opts.friendlyName] - The friendly_name * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed KeyInstance @@ -539,8 +538,7 @@ KeyContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - - * A descriptive string for this resource, chosen by your application, up to 64 characters long. + * @param {string} [opts.friendlyName] - The friendly_name * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed KeyInstance diff --git a/lib/rest/api/v2010/account/message/feedback.js b/lib/rest/api/v2010/account/message/feedback.js index c6196bf316..deb3a8aead 100644 --- a/lib/rest/api/v2010/account/message/feedback.js +++ b/lib/rest/api/v2010/account/message/feedback.js @@ -153,7 +153,8 @@ FeedbackPage.prototype.getInstance = function getInstance(payload) { * * @property {string} accountSid - The account_sid * @property {string} messageSid - The message_sid - * @property {feedback.outcome} outcome - The outcome + * @property {feedback.outcome} outcome - + * unconfirmed or confirmed. If ProvideFeedback=true in the initial HTTP POST, this value will default to unconfirmed. Make an HTTP POST to update this value to confirmed after the message arrives. * @property {Date} dateCreated - The date_created * @property {Date} dateUpdated - The date_updated * @property {string} uri - The uri diff --git a/lib/rest/api/v2010/account/newKey.js b/lib/rest/api/v2010/account/newKey.js index 30bd149972..533f8bf897 100644 --- a/lib/rest/api/v2010/account/newKey.js +++ b/lib/rest/api/v2010/account/newKey.js @@ -62,8 +62,7 @@ NewKeyList = function NewKeyList(version, accountSid) { * * @param {object|function} opts - ... * @param {string} opts.accountSid - The account_sid - * @param {string} [opts.friendlyName] - - * A descriptive string for this resource, chosen by your application, up to 64 characters long. + * @param {string} [opts.friendlyName] - The friendly_name * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed NewKeyInstance @@ -146,16 +145,11 @@ NewKeyPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Api.V2010.AccountContext.NewKeyInstance * @description Initialize the NewKeyContext * - * @property {string} sid - - * A 34 character string that uniquely identifies this API Key. - * @property {string} friendlyName - - * A descriptive string for this resource, chosen by your application, up to 64 characters long. - * @property {Date} dateCreated - - * The date-time this API Key was created, given as a RFC 2822 Timestamp. - * @property {Date} dateUpdated - - * The date-time this API Key was most recently updated, given as a RFC 2822 Timestamp. - * @property {string} secret - - * The secret your application uses to sign Access Tokens and to authenticate to the REST API. + * @property {string} sid - The sid + * @property {string} friendlyName - The friendly_name + * @property {Date} dateCreated - The date_created + * @property {Date} dateUpdated - The date_updated + * @property {string} secret - The secret * * @param {Twilio.Api.V2010} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/api/v2010/account/recording/addOnResult.js b/lib/rest/api/v2010/account/recording/addOnResult.js index fc536395a0..959bf4bb4b 100644 --- a/lib/rest/api/v2010/account/recording/addOnResult.js +++ b/lib/rest/api/v2010/account/recording/addOnResult.js @@ -378,7 +378,7 @@ AddOnResultPage.prototype.getInstance = function getInstance(payload) { * @property {Date} dateCompleted - The date this result was completed. * @property {string} referenceSid - * A string that uniquely identifies the recording. - * @property {string} subresourceUris - The subresource_uris + * @property {string} subresourceUris - A dictionary of URIs for related resources * * @param {Twilio.Api.V2010} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/api/v2010/account/recording/addOnResult/payload.js b/lib/rest/api/v2010/account/recording/addOnResult/payload.js index 96174c0cde..477c9b87ee 100644 --- a/lib/rest/api/v2010/account/recording/addOnResult/payload.js +++ b/lib/rest/api/v2010/account/recording/addOnResult/payload.js @@ -386,7 +386,7 @@ PayloadPage.prototype.getInstance = function getInstance(payload) { * @property {Date} dateUpdated - The date this resource was last updated * @property {string} referenceSid - * A string that uniquely identifies the recording. - * @property {string} subresourceUris - The subresource_uris + * @property {string} subresourceUris - A dictionary of URIs for related resources * * @param {Twilio.Api.V2010} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/api/v2010/account/sip/credentialList.js b/lib/rest/api/v2010/account/sip/credentialList.js index 570925ba44..25b467f117 100644 --- a/lib/rest/api/v2010/account/sip/credentialList.js +++ b/lib/rest/api/v2010/account/sip/credentialList.js @@ -299,7 +299,7 @@ CredentialListList = function CredentialListList(version, accountSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - Human readable descriptive text * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialListInstance @@ -346,7 +346,7 @@ CredentialListList = function CredentialListList(version, accountSid) { * @memberof Twilio.Api.V2010.AccountContext.SipContext.CredentialListList * @instance * - * @param {string} sid - Fetch by unique credential Sid + * @param {string} sid - Fetch by unique credential list Sid * * @returns {Twilio.Api.V2010.AccountContext.SipContext.CredentialListContext} */ @@ -408,7 +408,7 @@ CredentialListPage.prototype.getInstance = function getInstance(payload) { * @property {string} accountSid - The unique sid that identifies this account * @property {Date} dateCreated - The date this resource was created * @property {Date} dateUpdated - The date this resource was last updated - * @property {string} friendlyName - The friendly_name + * @property {string} friendlyName - Human readable descriptive text * @property {string} sid - A string that uniquely identifies this credential * @property {string} subresourceUris - The subresource_uris * @property {string} uri - The URI for this resource @@ -416,7 +416,7 @@ CredentialListPage.prototype.getInstance = function getInstance(payload) { * @param {Twilio.Api.V2010} version - Version of the resource * @param {object} payload - The instance payload * @param {sid} accountSid - The account_sid - * @param {sid} sid - Fetch by unique credential Sid + * @param {sid} sid - Fetch by unique credential list Sid */ /* jshint ignore:end */ CredentialListInstance = function CredentialListInstance(version, payload, @@ -478,7 +478,7 @@ CredentialListInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - Human readable descriptive text * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialListInstance @@ -553,7 +553,7 @@ CredentialListInstance.prototype.toJSON = function toJSON() { * * @param {Twilio.Api.V2010} version - Version of the resource * @param {sid} accountSid - The account_sid - * @param {sid} sid - Fetch by unique credential Sid + * @param {sid} sid - Fetch by unique credential list Sid */ /* jshint ignore:end */ CredentialListContext = function CredentialListContext(version, accountSid, sid) @@ -616,7 +616,7 @@ CredentialListContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - Human readable descriptive text * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialListInstance diff --git a/lib/rest/api/v2010/account/sip/credentialList/credential.js b/lib/rest/api/v2010/account/sip/credentialList/credential.js index 2ce369446f..c61f41da78 100644 --- a/lib/rest/api/v2010/account/sip/credentialList/credential.js +++ b/lib/rest/api/v2010/account/sip/credentialList/credential.js @@ -505,7 +505,8 @@ CredentialInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.password] - The password + * @param {string} [opts.password] - + * The password will not be returned in the response. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -624,7 +625,8 @@ CredentialContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.password] - The password + * @param {string} [opts.password] - + * The password will not be returned in the response. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance diff --git a/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js b/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js index b5a9a2c025..5132c15a9c 100644 --- a/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js @@ -27,7 +27,8 @@ var CredentialListMappingContext; * @description Initialize the CredentialListMappingList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The account_sid + * @param {string} accountSid - + * The unique id of the Account that responsible for this resource. * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ @@ -419,12 +420,18 @@ CredentialListMappingPage.prototype.getInstance = function getInstance(payload) * @constructor Twilio.Api.V2010.AccountContext.SipContext.DomainContext.CredentialListMappingInstance * @description Initialize the CredentialListMappingContext * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} friendlyName - The friendly_name - * @property {string} sid - The sid - * @property {string} uri - The uri + * @property {string} accountSid - + * The unique id of the Account that responsible for this resource. + * @property {Date} dateCreated - + * The date that this resource was created, given as GMT in RFC 2822 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated, given as GMT in RFC 2822 format. + * @property {string} friendlyName - + * A human readable descriptive text for this resource, up to 64 characters long. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uri - + * The URI for this resource, relative to https://api.twilio.com * @property {string} subresourceUris - The subresource_uris * * @param {Twilio.Api.V2010} version - Version of the resource diff --git a/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js b/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js index e971534167..2589fe793a 100644 --- a/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js @@ -27,7 +27,8 @@ var IpAccessControlListMappingContext; * @description Initialize the IpAccessControlListMappingList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The account_sid + * @param {string} accountSid - + * The unique id of the Account that responsible for this resource. * @param {string} domainSid - A string that uniquely identifies the SIP Domain */ /* jshint ignore:end */ @@ -420,12 +421,18 @@ IpAccessControlListMappingPage.prototype.getInstance = function * @constructor Twilio.Api.V2010.AccountContext.SipContext.DomainContext.IpAccessControlListMappingInstance * @description Initialize the IpAccessControlListMappingContext * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} friendlyName - The friendly_name - * @property {string} sid - The sid - * @property {string} uri - The uri + * @property {string} accountSid - + * The unique id of the Account that responsible for this resource. + * @property {Date} dateCreated - + * The date that this resource was created, given as GMT in RFC 2822 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated, given as GMT in RFC 2822 format. + * @property {string} friendlyName - + * A human readable descriptive text for this resource, up to 64 characters long. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uri - + * The URI for this resource, relative to https://api.twilio.com * @property {string} subresourceUris - The subresource_uris * * @param {Twilio.Api.V2010} version - Version of the resource diff --git a/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js b/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js index 53119a63d8..03ddf0ecec 100644 --- a/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js +++ b/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js @@ -27,7 +27,8 @@ var IpAddressContext; * @description Initialize the IpAddressList * * @param {Twilio.Api.V2010} version - Version of the resource - * @param {string} accountSid - The account_sid + * @param {string} accountSid - + * The unique id of the Account that responsible for this resource. * @param {string} ipAccessControlListSid - The ip_access_control_list_sid */ /* jshint ignore:end */ @@ -426,14 +427,21 @@ IpAddressPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Api.V2010.AccountContext.SipContext.IpAccessControlListContext.IpAddressInstance * @description Initialize the IpAddressContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {string} ipAddress - The ip_address + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account that responsible for this resource. + * @property {string} friendlyName - + * A human readable descriptive text for this resource, up to 64 characters long. + * @property {string} ipAddress - + * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @property {string} ipAccessControlListSid - The ip_access_control_list_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} uri - The uri + * @property {Date} dateCreated - + * The date that this resource was created, given as GMT in RFC 2822 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated, given as GMT in RFC 2822 format. + * @property {string} uri - + * The URI for this resource, relative to https://api.twilio.com * * @param {Twilio.Api.V2010} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/api/v2010/account/usage/record.js b/lib/rest/api/v2010/account/usage/record.js index f055855a24..8b1415d909 100644 --- a/lib/rest/api/v2010/account/usage/record.js +++ b/lib/rest/api/v2010/account/usage/record.js @@ -93,6 +93,7 @@ RecordList = function RecordList(version, accountSid) { * Only include usage of a given category * @param {Date} [opts.startDate] - Filter by start date * @param {Date} [opts.endDate] - Filter by end date + * @param {boolean} [opts.includeSubaccounts] - The include_subaccounts * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -185,6 +186,7 @@ RecordList = function RecordList(version, accountSid) { * Only include usage of a given category * @param {Date} [opts.startDate] - Filter by start date * @param {Date} [opts.endDate] - Filter by end date + * @param {boolean} [opts.includeSubaccounts] - The include_subaccounts * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -248,6 +250,7 @@ RecordList = function RecordList(version, accountSid) { * Only include usage of a given category * @param {Date} [opts.startDate] - Filter by start date * @param {Date} [opts.endDate] - Filter by end date + * @param {boolean} [opts.includeSubaccounts] - The include_subaccounts * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -269,6 +272,7 @@ RecordList = function RecordList(version, accountSid) { 'Category': _.get(opts, 'category'), 'StartDate': serialize.iso8601Date(_.get(opts, 'startDate')), 'EndDate': serialize.iso8601Date(_.get(opts, 'endDate')), + 'IncludeSubaccounts': serialize.bool(_.get(opts, 'includeSubaccounts')), 'PageToken': opts.pageToken, 'Page': opts.pageNumber, 'PageSize': opts.pageSize @@ -306,6 +310,7 @@ RecordList = function RecordList(version, accountSid) { * Only include usage of a given category * @param {Date} [opts.startDate] - Filter by start date * @param {Date} [opts.endDate] - Filter by end date + * @param {boolean} [opts.includeSubaccounts] - The include_subaccounts * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * diff --git a/lib/rest/chat/V1.d.ts b/lib/rest/chat/V1.d.ts new file mode 100644 index 0000000000..0ad5347b86 --- /dev/null +++ b/lib/rest/chat/V1.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CredentialListInstance } from './v1/credential'; +import { ServiceListInstance } from './v1/service'; + + +/** + * Initialize the V1 version of Chat + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Chat + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly credentials: CredentialListInstance; + readonly services: ServiceListInstance; +} + +export = V1; diff --git a/lib/rest/chat/V2.d.ts b/lib/rest/chat/V2.d.ts new file mode 100644 index 0000000000..aa7f71b83b --- /dev/null +++ b/lib/rest/chat/V2.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CredentialListInstance } from './v2/credential'; +import { ServiceListInstance } from './v2/service'; + + +/** + * Initialize the V2 version of Chat + */ +declare class V2 extends Version { + /** + * Initialize the V2 version of Chat + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly credentials: CredentialListInstance; + readonly services: ServiceListInstance; +} + +export = V2; diff --git a/lib/rest/chat/v1/credential.js b/lib/rest/chat/v1/credential.js index ac93f15700..1b4f00891a 100644 --- a/lib/rest/chat/v1/credential.js +++ b/lib/rest/chat/v1/credential.js @@ -297,12 +297,17 @@ CredentialList = function CredentialList(version) { * @instance * * @param {object} opts - ... - * @param {credential.push_service} opts.type - The type - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key + * @param {credential.push_service} opts.type - + * Credential type, one of "gcm" or "apn" + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential * @param {string} [opts.secret] - The secret * @param {function} [callback] - Callback to handle processed record * @@ -412,14 +417,18 @@ CredentialPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.CredentialInstance * @description Initialize the CredentialContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {credential.push_service} type - The type - * @property {string} sandbox - The sandbox - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account[/console] responsible for this resource. + * @property {string} friendlyName - The human-readable name of this resource. + * @property {credential.push_service} type - + * Indicates which push notifications service this credential is for - either gcm or apn + * @property {string} sandbox - + * [APN only] true when this resource should use the sandbox APN service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} url - An absolute URL for this credential resource. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -481,11 +490,15 @@ CredentialInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential * @param {string} [opts.secret] - The secret * @param {function} [callback] - Callback to handle processed record * @@ -596,11 +609,15 @@ CredentialContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential * @param {string} [opts.secret] - The secret * @param {function} [callback] - Callback to handle processed record * diff --git a/lib/rest/chat/v1/service.js b/lib/rest/chat/v1/service.js index ff32c0d3fb..0c2184c00f 100644 --- a/lib/rest/chat/v1/service.js +++ b/lib/rest/chat/v1/service.js @@ -64,7 +64,8 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - + * Human-readable name for this service instance * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -401,28 +402,39 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceInstance * @description Initialize the ServiceContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} defaultServiceRoleSid - The default_service_role_sid - * @property {string} defaultChannelRoleSid - The default_channel_role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this service. + * @property {string} friendlyName - The human-readable name of this service. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} defaultServiceRoleSid - + * The service role assigned to users when they are added to the service. + * @property {string} defaultChannelRoleSid - + * The channel role assigned to users when they are added to a channel. * @property {string} defaultChannelCreatorRoleSid - - * The default_channel_creator_role_sid - * @property {boolean} readStatusEnabled - The read_status_enabled - * @property {boolean} reachabilityEnabled - The reachability_enabled - * @property {number} typingIndicatorTimeout - The typing_indicator_timeout - * @property {number} consumptionReportInterval - The consumption_report_interval + * The channel role assigned to a channel creator when joining a new channel. + * @property {boolean} readStatusEnabled - + * Enable the Message Constumption Horizon feature. + * @property {boolean} reachabilityEnabled - + * Indicates whether the the Reachability feature is enabled for this Service instance. + * @property {number} typingIndicatorTimeout - + * The amount of time after a "started typing" event when clients should assume that user is no longer typing, even if no "ended typing" message was received. + * @property {number} consumptionReportInterval - + * The interval between consumption reports submission batches from client endpoints. * @property {string} limits - The limits * @property {string} webhooks - The webhooks - * @property {string} preWebhookUrl - The pre_webhook_url - * @property {string} postWebhookUrl - The post_webhook_url - * @property {string} webhookMethod - The webhook_method - * @property {string} webhookFilters - The webhook_filters - * @property {string} notifications - The notifications - * @property {string} url - The url - * @property {string} links - The links + * @property {string} preWebhookUrl - The webhook URL for PRE-Event webhooks. + * @property {string} postWebhookUrl - The webhook URL for POST-Event webhooks. + * @property {string} webhookMethod - The webhook request format to use. + * @property {string} webhookFilters - + * The list of WebHook events that are enabled for this Service instance. + * @property {string} notifications - + * Notification configuration for the Service instance. + * @property {string} url - An absolute URL for this service. + * @property {string} links - + * URLs to access the Channels, Roles, and Users for this service. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -514,16 +526,21 @@ ServiceInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * ISO 8601 duration indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - - * The consumption_report_interval + * ISO 8601 duration indicating the interval between consumption reports sent from client endpoints. * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled * @param {string} [opts."notifications.newMessage.template"] - @@ -540,10 +557,11 @@ ServiceInstance.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.enabled * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url * @param {string} [opts."webhooks.onMessageSend.method"] - @@ -821,16 +839,21 @@ ServiceContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * ISO 8601 duration indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - - * The consumption_report_interval + * ISO 8601 duration indicating the interval between consumption reports sent from client endpoints. * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled * @param {string} [opts."notifications.newMessage.template"] - @@ -847,10 +870,11 @@ ServiceContext.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.enabled * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url * @param {string} [opts."webhooks.onMessageSend.method"] - diff --git a/lib/rest/chat/v1/service/channel.js b/lib/rest/chat/v1/service/channel.js index d0c5eaaa95..26e8348d99 100644 --- a/lib/rest/chat/v1/service/channel.js +++ b/lib/rest/chat/v1/service/channel.js @@ -31,7 +31,8 @@ var ChannelContext; * @description Initialize the ChannelList * * @param {Twilio.Chat.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the [Service][service] this channel belongs to. */ /* jshint ignore:end */ ChannelList = function ChannelList(version, serviceSid) { @@ -65,10 +66,12 @@ ChannelList = function ChannelList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {channel.channel_type} [opts.type] - The type + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {channel.channel_type} [opts.type] - + * The visibility of the channel - public or private. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -423,20 +426,26 @@ ChannelPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceContext.ChannelInstance * @description Initialize the ChannelContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {string} uniqueName - The unique_name - * @property {string} attributes - The attributes - * @property {channel.channel_type} type - The type - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} createdBy - The created_by + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the [Account][/console] responsible for this channel. + * @property {string} serviceSid - + * The unique id of the [Service][service] this channel belongs to. + * @property {string} friendlyName - The human-readable name of this channel. + * @property {string} uniqueName - The unique, addressable name of this channel. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {channel.channel_type} type - + * The visibility of this channel - either public or private + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} createdBy - Identity of the channel's creator. * @property {number} membersCount - The members_count * @property {number} messagesCount - The messages_count - * @property {string} url - The url - * @property {string} links - The links + * @property {string} url - An absolute URL for this channel. + * @property {string} links - + * Absolute URLs to access the [Members][members] and [Messages][messages] for this channel. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -522,9 +531,10 @@ ChannelInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -712,9 +722,10 @@ ChannelContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance diff --git a/lib/rest/chat/v1/service/channel/invite.js b/lib/rest/chat/v1/service/channel/invite.js index 80e389d9d6..0e28100522 100644 --- a/lib/rest/chat/v1/service/channel/invite.js +++ b/lib/rest/chat/v1/service/channel/invite.js @@ -29,8 +29,9 @@ var InviteContext; * @description Initialize the InviteList * * @param {Twilio.Chat.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ InviteList = function InviteList(version, serviceSid, channelSid) { @@ -64,8 +65,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid + * @param {string} opts.identity - + * A unique string identifier for this User in this Service. + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed InviteInstance @@ -121,7 +123,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -210,7 +213,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -270,7 +274,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -323,7 +328,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @memberof Twilio.Chat.V1.ServiceContext.ChannelContext.InviteList * @instance * - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -422,16 +428,20 @@ InvitePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceContext.ChannelContext.InviteInstance * @description Initialize the InviteContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account[/console] responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. * @property {string} createdBy - The created_by - * @property {string} url - The url + * @property {string} url - An absolute URL for this member. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/chat/v1/service/channel/member.js b/lib/rest/chat/v1/service/channel/member.js index fd862a7162..4da25385b8 100644 --- a/lib/rest/chat/v1/service/channel/member.js +++ b/lib/rest/chat/v1/service/channel/member.js @@ -29,8 +29,9 @@ var MemberContext; * @description Initialize the MemberList * * @param {Twilio.Chat.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ MemberList = function MemberList(version, serviceSid, channelSid) { @@ -64,8 +65,9 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid + * @param {string} opts.identity - + * A unique string identifier for this User in this Service. + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance @@ -121,7 +123,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -210,7 +213,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -270,7 +274,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -323,7 +328,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @memberof Twilio.Chat.V1.ServiceContext.ChannelContext.MemberList * @instance * - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -422,17 +428,23 @@ MemberPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceContext.ChannelContext.MemberInstance * @description Initialize the MemberContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid - * @property {number} lastConsumedMessageIndex - The last_consumed_message_index - * @property {Date} lastConsumptionTimestamp - The last_consumption_timestamp - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. + * @property {number} lastConsumedMessageIndex - + * An Integer representing index of the last Message this Member has read within this Channel + * @property {Date} lastConsumptionTimestamp - + * An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel + * @property {string} url - An absolute URL for this member. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -522,9 +534,9 @@ MemberInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index + * An Integer representing index of the last Message this Member has read within this Channel * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance @@ -657,9 +669,9 @@ MemberContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index + * An Integer representing index of the last Message this Member has read within this Channel * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance diff --git a/lib/rest/chat/v1/service/channel/message.js b/lib/rest/chat/v1/service/channel/message.js index 6fd3ca096b..217037648a 100644 --- a/lib/rest/chat/v1/service/channel/message.js +++ b/lib/rest/chat/v1/service/channel/message.js @@ -27,7 +27,8 @@ var MessageContext; * @description Initialize the MessageList * * @param {Twilio.Chat.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the Service this message belongs to. * @param {string} channelSid - The channel_sid */ /* jshint ignore:end */ @@ -425,19 +426,24 @@ MessagePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceContext.ChannelContext.MessageInstance * @description Initialize the MessageContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} attributes - The attributes - * @property {string} serviceSid - The service_sid - * @property {string} to - The to + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this message. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} serviceSid - + * The unique id of the Service this message belongs to. + * @property {string} to - The unique id of the Channel this message was sent to. * @property {string} channelSid - The channel_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {boolean} wasEdited - The was_edited - * @property {string} from - The from - * @property {string} body - The body - * @property {number} index - The index - * @property {string} url - The url + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {boolean} wasEdited - + * true if the message has been updated since it was created. + * @property {string} from - The identity of the message's author. + * @property {string} body - The contents of the message. + * @property {number} index - The index of the message within the Channel + * @property {string} url - An absolute URL for this message. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -529,8 +535,9 @@ MessageInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.body] - The new message body string. + * @param {string} [opts.attributes] - + * The new attributes metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance @@ -663,8 +670,9 @@ MessageContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.body] - The new message body string. + * @param {string} [opts.attributes] - + * The new attributes metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance diff --git a/lib/rest/chat/v1/service/role.js b/lib/rest/chat/v1/service/role.js index 81259d3efc..85b5d46e69 100644 --- a/lib/rest/chat/v1/service/role.js +++ b/lib/rest/chat/v1/service/role.js @@ -28,7 +28,7 @@ var RoleContext; * @description Initialize the RoleList * * @param {Twilio.Chat.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this role belongs to. */ /* jshint ignore:end */ RoleList = function RoleList(version, serviceSid) { @@ -62,9 +62,9 @@ RoleList = function RoleList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name - * @param {role.role_type} opts.type - The type - * @param {string|list} opts.permission - The permission + * @param {string} opts.friendlyName - The human-readable name of this role. + * @param {role.role_type} opts.type - What kind of role this is. + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -416,15 +416,20 @@ RolePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceContext.RoleInstance * @description Initialize the RoleContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {role.role_type} type - The type - * @property {string} permissions - The permissions - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this role. + * @property {string} serviceSid - + * The unique id of the Service this role belongs to. + * @property {string} friendlyName - The human-readable name of this role. + * @property {role.role_type} type - What kind of role this is. + * @property {string} permissions - A JSON array of the permissions this role has. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. + * @property {string} url - An absolute URL for this role. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -505,7 +510,7 @@ RoleInstance.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -636,7 +641,7 @@ RoleContext.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance diff --git a/lib/rest/chat/v1/service/user.js b/lib/rest/chat/v1/service/user.js index 7b77946bb3..fe097a64f4 100644 --- a/lib/rest/chat/v1/service/user.js +++ b/lib/rest/chat/v1/service/user.js @@ -28,7 +28,7 @@ var UserContext; * @description Initialize the UserList * * @param {Twilio.Chat.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this user belongs to. */ /* jshint ignore:end */ UserList = function UserList(version, serviceSid) { @@ -62,10 +62,14 @@ UserList = function UserList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} opts.identity - + * A unique string that identifies the user within this service - often a username or email address. + * @param {string} [opts.roleSid] - + * The unique id of the Role assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -412,20 +416,30 @@ UserPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V1.ServiceContext.UserInstance * @description Initialize the UserContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} attributes - The attributes - * @property {string} friendlyName - The friendly_name - * @property {string} roleSid - The role_sid - * @property {string} identity - The identity - * @property {boolean} isOnline - The is_online - * @property {boolean} isNotifiable - The is_notifiable - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this user. + * @property {string} serviceSid - + * The unique id of the Service this user belongs to. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} friendlyName - The human-readable name of this user. + * @property {string} roleSid - + * The unique id of the [Role][role] assigned to this user. + * @property {string} identity - + * A unique string that identifies the user within this service - often a username or email address. + * @property {boolean} isOnline - + * Indicates whether the User is actively connected to the Service instance and online. + * @property {boolean} isNotifiable - + * Indicates whether the User has a potentially valid Push Notification registration for the Service instance. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. * @property {number} joinedChannelsCount - The joined_channels_count * @property {string} links - The links - * @property {string} url - The url + * @property {string} url - An absolute URL for this user. * * @param {Twilio.Chat.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -511,9 +525,12 @@ UserInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -665,9 +682,12 @@ UserContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance diff --git a/lib/rest/chat/v1/service/user/userChannel.js b/lib/rest/chat/v1/service/user/userChannel.js index 684b3a7562..b010c45e52 100644 --- a/lib/rest/chat/v1/service/user/userChannel.js +++ b/lib/rest/chat/v1/service/user/userChannel.js @@ -27,7 +27,8 @@ var UserChannelInstance; * * @param {Twilio.Chat.V1} version - Version of the resource * @param {string} serviceSid - The service_sid - * @param {string} userSid - The sid + * @param {string} userSid - + * A 34 character string that uniquely identifies this resource. */ /* jshint ignore:end */ UserChannelList = function UserChannelList(version, serviceSid, userSid) { diff --git a/lib/rest/chat/v2/credential.js b/lib/rest/chat/v2/credential.js index 717fa54196..8f959bf71c 100644 --- a/lib/rest/chat/v2/credential.js +++ b/lib/rest/chat/v2/credential.js @@ -297,13 +297,19 @@ CredentialList = function CredentialList(version) { * @instance * * @param {object} opts - ... - * @param {credential.push_service} opts.type - The type - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {credential.push_service} opts.type - + * Credential type, one of "gcm", "fcm", or "apn" + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -412,14 +418,18 @@ CredentialPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.CredentialInstance * @description Initialize the CredentialContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {credential.push_service} type - The type - * @property {string} sandbox - The sandbox - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this resource. + * @property {string} friendlyName - The human-readable name of this resource. + * @property {credential.push_service} type - + * Indicates which push notifications service this credential is for - either gcm, fcm, or apn + * @property {string} sandbox - + * [APN only] true when this resource should use the sandbox APN service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} url - An absolute URL for this credential resource. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -481,12 +491,17 @@ CredentialInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -596,12 +611,17 @@ CredentialContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance diff --git a/lib/rest/chat/v2/service.js b/lib/rest/chat/v2/service.js index 5cb4997c00..f25ecdccae 100644 --- a/lib/rest/chat/v2/service.js +++ b/lib/rest/chat/v2/service.js @@ -65,7 +65,8 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - + * Human-readable name for this service instance * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -402,30 +403,43 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceInstance * @description Initialize the ServiceContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} defaultServiceRoleSid - The default_service_role_sid - * @property {string} defaultChannelRoleSid - The default_channel_role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this service. + * @property {string} friendlyName - The human-readable name of this service. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} defaultServiceRoleSid - + * The service role assigned to users when they are added to the service. + * @property {string} defaultChannelRoleSid - + * The channel role assigned to users when they are added to a channel. * @property {string} defaultChannelCreatorRoleSid - - * The default_channel_creator_role_sid - * @property {boolean} readStatusEnabled - The read_status_enabled - * @property {boolean} reachabilityEnabled - The reachability_enabled - * @property {number} typingIndicatorTimeout - The typing_indicator_timeout - * @property {number} consumptionReportInterval - The consumption_report_interval - * @property {string} limits - The limits - * @property {string} preWebhookUrl - The pre_webhook_url - * @property {string} postWebhookUrl - The post_webhook_url - * @property {string} webhookMethod - The webhook_method - * @property {string} webhookFilters - The webhook_filters - * @property {number} preWebhookRetryCount - The pre_webhook_retry_count - * @property {number} postWebhookRetryCount - The post_webhook_retry_count - * @property {string} notifications - The notifications + * The channel role assigned to a channel creator when joining a new channel. + * @property {boolean} readStatusEnabled - + * Enable the Message Constumption Horizon feature. + * @property {boolean} reachabilityEnabled - + * Indicates whether the the Reachability feature is enabled for this Service instance. + * @property {number} 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 {number} consumptionReportInterval - DEPRECATED. + * @property {string} limits - Configuration for service instance level limits. + * @property {string} preWebhookUrl - The webhook URL for PRE-Event webhooks. + * @property {string} postWebhookUrl - The webhook URL for POST-Event webhooks. + * @property {string} webhookMethod - + * The webhook request format to use for both PRE and POST webhooks. + * @property {string} webhookFilters - + * The list of WebHook events that are enabled for this Service instance. + * @property {number} preWebhookRetryCount - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @property {number} postWebhookRetryCount - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @property {string} notifications - + * Notification configuration for the Service instance. * @property {string} media - The media - * @property {string} url - The url - * @property {string} links - The links + * @property {string} url - An absolute URL for this service. + * @property {string} links - + * URLs to access the Channels, Roles, and Users for this service. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -519,14 +533,19 @@ ServiceInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * The duration in seconds indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval * @param {boolean} [opts."notifications.newMessage.enabled"] - @@ -555,16 +574,21 @@ ServiceInstance.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.template * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts."limits.channelMembers"] - The limits.channel_members - * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. + * @param {number} [opts."limits.channelMembers"] - + * The maximum number of Members that can be added to Channels within this Service. + * @param {number} [opts."limits.userChannels"] - + * The maximum number of Channels Users can be a Member of within this Service. * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message - * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count - * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count + * @param {number} [opts.preWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @param {number} [opts.postWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. * @param {boolean} [opts."notifications.logEnabled"] - * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record @@ -764,14 +788,19 @@ ServiceContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * The duration in seconds indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval * @param {boolean} [opts."notifications.newMessage.enabled"] - @@ -800,16 +829,21 @@ ServiceContext.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.template * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts."limits.channelMembers"] - The limits.channel_members - * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. + * @param {number} [opts."limits.channelMembers"] - + * The maximum number of Members that can be added to Channels within this Service. + * @param {number} [opts."limits.userChannels"] - + * The maximum number of Channels Users can be a Member of within this Service. * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message - * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count - * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count + * @param {number} [opts.preWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @param {number} [opts.postWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. * @param {boolean} [opts."notifications.logEnabled"] - * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record diff --git a/lib/rest/chat/v2/service/channel.js b/lib/rest/chat/v2/service/channel.js index 4054a8b5da..5cd40cc2fb 100644 --- a/lib/rest/chat/v2/service/channel.js +++ b/lib/rest/chat/v2/service/channel.js @@ -15,6 +15,7 @@ var InviteList = require('./channel/invite').InviteList; var MemberList = require('./channel/member').MemberList; var MessageList = require('./channel/message').MessageList; var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var WebhookList = require('./channel/webhook').WebhookList; var deserialize = require( '../../../../base/deserialize'); /* jshint ignore:line */ var serialize = require('../../../../base/serialize'); /* jshint ignore:line */ @@ -31,7 +32,8 @@ var ChannelContext; * @description Initialize the ChannelList * * @param {Twilio.Chat.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the Service this channel belongs to. */ /* jshint ignore:end */ ChannelList = function ChannelList(version, serviceSid) { @@ -65,13 +67,18 @@ ChannelList = function ChannelList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {channel.channel_type} [opts.type] - The type - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.createdBy] - The created_by + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {channel.channel_type} [opts.type] - + * The visibility of the channel - public or private. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated. + * @param {string} [opts.createdBy] - + * Optional field to specify the Identity of the User that created the Channel. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -429,20 +436,26 @@ ChannelPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceContext.ChannelInstance * @description Initialize the ChannelContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {string} uniqueName - The unique_name - * @property {string} attributes - The attributes - * @property {channel.channel_type} type - The type - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} createdBy - The created_by - * @property {number} membersCount - The members_count - * @property {number} messagesCount - The messages_count - * @property {string} url - The url - * @property {string} links - The links + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this channel. + * @property {string} serviceSid - + * The unique id of the Service this channel belongs to. + * @property {string} friendlyName - The human-readable name of this channel. + * @property {string} uniqueName - The unique, addressable name of this channel. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {channel.channel_type} type - + * The visibility of this channel - either public or private + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} createdBy - Identity of the channel's creator. + * @property {number} membersCount - The number of Members in the Channel + * @property {number} messagesCount - The number of Messages in the Channel + * @property {string} url - An absolute URL for this channel. + * @property {string} links - + * Absolute URLs to access the Members, Messages , Invites and, if it exists the last Message for this Channel. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -528,12 +541,16 @@ ChannelInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.createdBy] - The created_by + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated. + * @param {string} [opts.createdBy] - + * Optional field to specify the Identity of the User that created the Channel. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -588,6 +605,21 @@ ChannelInstance.prototype.invites = function invites() { return this._proxy.invites; }; +/* jshint ignore:start */ +/** + * Access the webhooks + * + * @function webhooks + * @memberof Twilio.Chat.V2.ServiceContext.ChannelInstance + * @instance + * + * @returns {Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList} + */ +/* jshint ignore:end */ +ChannelInstance.prototype.webhooks = function webhooks() { + return this._proxy.webhooks; +}; + /* jshint ignore:start */ /** * Produce a plain JSON object version of the ChannelInstance for serialization. @@ -622,6 +654,8 @@ ChannelInstance.prototype.toJSON = function toJSON() { * messages resource * @property {Twilio.Chat.V2.ServiceContext.ChannelContext.InviteList} invites - * invites resource + * @property {Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList} webhooks - + * webhooks resource * * @param {Twilio.Chat.V2} version - Version of the resource * @param {sid} serviceSid - The service_sid @@ -641,6 +675,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { this._members = undefined; this._messages = undefined; this._invites = undefined; + this._webhooks = undefined; }; /* jshint ignore:start */ @@ -721,12 +756,16 @@ ChannelContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.createdBy] - The created_by + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated. + * @param {string} [opts.createdBy] - + * Optional field to specify the Identity of the User that created the Channel. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -801,6 +840,16 @@ Object.defineProperty(ChannelContext.prototype, } }); +Object.defineProperty(ChannelContext.prototype, + 'webhooks', { + get: function() { + if (!this._webhooks) { + this._webhooks = new WebhookList(this._version, this._solution.serviceSid, this._solution.sid); + } + return this._webhooks; + } +}); + module.exports = { ChannelList: ChannelList, ChannelPage: ChannelPage, diff --git a/lib/rest/chat/v2/service/channel/invite.js b/lib/rest/chat/v2/service/channel/invite.js index 4da1558d3b..6c117e15b3 100644 --- a/lib/rest/chat/v2/service/channel/invite.js +++ b/lib/rest/chat/v2/service/channel/invite.js @@ -29,8 +29,9 @@ var InviteContext; * @description Initialize the InviteList * * @param {Twilio.Chat.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ InviteList = function InviteList(version, serviceSid, channelSid) { @@ -64,8 +65,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid + * @param {string} opts.identity - + * A unique string identifier for this User in this Service. + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed InviteInstance @@ -121,7 +123,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -210,7 +213,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -270,7 +274,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -323,7 +328,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.InviteList * @instance * - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -422,16 +428,20 @@ InvitePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.InviteInstance * @description Initialize the InviteContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. * @property {string} createdBy - The created_by - * @property {string} url - The url + * @property {string} url - An absolute URL for this member. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/chat/v2/service/channel/member.js b/lib/rest/chat/v2/service/channel/member.js index e9ca5461e2..0526114b6e 100644 --- a/lib/rest/chat/v2/service/channel/member.js +++ b/lib/rest/chat/v2/service/channel/member.js @@ -29,8 +29,9 @@ var MemberContext; * @description Initialize the MemberList * * @param {Twilio.Chat.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ MemberList = function MemberList(version, serviceSid, channelSid) { @@ -434,17 +435,23 @@ MemberPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.MemberInstance * @description Initialize the MemberContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid - * @property {number} lastConsumedMessageIndex - The last_consumed_message_index - * @property {Date} lastConsumptionTimestamp - The last_consumption_timestamp - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. + * @property {number} lastConsumedMessageIndex - + * An Integer representing index of the last Message this Member has read within this Channel + * @property {Date} lastConsumptionTimestamp - + * An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel + * @property {string} url - An absolute URL for this member. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -534,12 +541,15 @@ MemberInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The role to be assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index - * @param {Date} [opts.lastConsumptionTimestamp] - The last_consumption_timestamp - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated + * Optional field used to specify the last consumed Message index for the Channel for this Member. + * @param {Date} [opts.lastConsumptionTimestamp] - + * Optional ISO8601 time indicating the last datetime the Member consumed a Message in the Channel. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Members should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Member should be set as having been last updated. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance @@ -672,12 +682,15 @@ MemberContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The role to be assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index - * @param {Date} [opts.lastConsumptionTimestamp] - The last_consumption_timestamp - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated + * Optional field used to specify the last consumed Message index for the Channel for this Member. + * @param {Date} [opts.lastConsumptionTimestamp] - + * Optional ISO8601 time indicating the last datetime the Member consumed a Message in the Channel. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Members should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Member should be set as having been last updated. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance diff --git a/lib/rest/chat/v2/service/channel/message.js b/lib/rest/chat/v2/service/channel/message.js index fbcdb680a2..fe6043e6d9 100644 --- a/lib/rest/chat/v2/service/channel/message.js +++ b/lib/rest/chat/v2/service/channel/message.js @@ -29,7 +29,8 @@ var MessageContext; * @description Initialize the MessageList * * @param {Twilio.Chat.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the Service this message belongs to. * @param {string} channelSid - The channel_sid */ /* jshint ignore:end */ @@ -64,13 +65,18 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.from] - The from - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.lastUpdatedBy] - The last_updated_by - * @param {string} [opts.body] - The body - * @param {string} [opts.mediaSid] - The media_sid + * @param {string} [opts.from] - + * The identity of the message's author. Defaults to system if not specified. + * @param {string} [opts.attributes] - + * The optional attributes metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The ISO8601 time specifying the datetime the Message should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The ISO8601 time specifying the datetime the Message should be set as having been last updated. + * @param {string} [opts.lastUpdatedBy] - + * Specify the Identity of the User that last updated the Message + * @param {string} [opts.body] - The optional message body string. + * @param {string} [opts.mediaSid] - The Media Sid to be attached to this Message. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance @@ -133,7 +139,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -222,7 +229,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -282,7 +290,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -335,7 +344,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.MessageList * @instance * - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -434,22 +444,29 @@ MessagePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.MessageInstance * @description Initialize the MessageContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} attributes - The attributes - * @property {string} serviceSid - The service_sid - * @property {string} to - The to + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this message. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} serviceSid - + * The unique id of the Service this message belongs to. + * @property {string} to - The unique id of the Channel this message was sent to. * @property {string} channelSid - The channel_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} lastUpdatedBy - The last_updated_by - * @property {boolean} wasEdited - The was_edited - * @property {string} from - The from - * @property {string} body - The body - * @property {number} index - The index - * @property {string} type - The type - * @property {string} media - The media - * @property {string} url - The url + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} lastUpdatedBy - + * Optional field to specify the Identity of the User that last updated the Message + * @property {boolean} wasEdited - + * true if the message has been updated since it was created. + * @property {string} from - The identity of the message's author. + * @property {string} body - Optional — the contents of the message. + * @property {number} index - The index of the message within the Channel + * @property {string} type - Message type. + * @property {string} media - + * Optional — if a Media resource instance is attached to the Message, this will contain the Media object for the attached Media. + * @property {string} url - An absolute URL for this message. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -544,11 +561,15 @@ MessageInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.lastUpdatedBy] - The last_updated_by + * @param {string} [opts.body] - The message body string. + * @param {string} [opts.attributes] - + * The attributes metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The ISO8601 time specifying the datetime the Message should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The ISO8601 time specifying the datetime the Message should be set as having been last updated. + * @param {string} [opts.lastUpdatedBy] - + * Specify the Identity of the User that last updated the Message * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance @@ -681,11 +702,15 @@ MessageContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.lastUpdatedBy] - The last_updated_by + * @param {string} [opts.body] - The message body string. + * @param {string} [opts.attributes] - + * The attributes metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The ISO8601 time specifying the datetime the Message should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The ISO8601 time specifying the datetime the Message should be set as having been last updated. + * @param {string} [opts.lastUpdatedBy] - + * Specify the Identity of the User that last updated the Message * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance diff --git a/lib/rest/chat/v2/service/channel/webhook.js b/lib/rest/chat/v2/service/channel/webhook.js new file mode 100644 index 0000000000..95c0f84e96 --- /dev/null +++ b/lib/rest/chat/v2/service/channel/webhook.js @@ -0,0 +1,725 @@ +'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 deserialize = require( + '../../../../../base/deserialize'); /* jshint ignore:line */ +var serialize = require( + '../../../../../base/serialize'); /* jshint ignore:line */ +var values = require('../../../../../base/values'); /* jshint ignore:line */ + +var WebhookList; +var WebhookPage; +var WebhookInstance; +var WebhookContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @description Initialize the WebhookList + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {string} serviceSid - The service_sid + * @param {string} channelSid - The channel_sid + */ +/* jshint ignore:end */ +WebhookList = function WebhookList(version, serviceSid, channelSid) { + /* jshint ignore:start */ + /** + * @function webhooks + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookContext} + */ + /* jshint ignore:end */ + function WebhookListInstance(sid) { + return WebhookListInstance.get(sid); + } + + WebhookListInstance._version = version; + // Path Solution + WebhookListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; + WebhookListInstance._uri = _.template( + '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks' // jshint ignore:line + )(WebhookListInstance._solution); + /* jshint ignore:start */ + /** + * Streams WebhookInstance 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. + * + * @function each + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object|function} opts - ... + * @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=50] - + * 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 */ + WebhookListInstance.each = function each(opts, callback) { + opts = opts || {}; + if (_.isFunction(opts)) { + opts = { callback: opts }; + } else if (_.isFunction(callback) && !_.isFunction(opts.callback)) { + opts.callback = callback; + } + + if (_.isUndefined(opts.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++; + opts.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 */ + /** + * @description Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @function list + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object|function} opts - ... + * @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 */ + WebhookListInstance.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 WebhookInstance 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. + * + * @function page + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object|function} opts - ... + * @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 */ + WebhookListInstance.page = function page(opts, callback) { + 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 WebhookPage(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 WebhookInstance 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. + * + * @function getPage + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @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 */ + WebhookListInstance.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 WebhookPage(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 */ + /** + * create a WebhookInstance + * + * @function create + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object} opts - ... + * @param {webhook.type} opts.type - The type + * @param {string} [opts."configuration.url"] - The configuration.url + * @param {webhook.method} [opts."configuration.method"] - The configuration.method + * @param {string|list} [opts."configuration.filters"] - The configuration.filters + * @param {string|list} [opts."configuration.triggers"] - + * The configuration.triggers + * @param {string} [opts."configuration.flowSid"] - The configuration.flow_sid + * @param {number} [opts."configuration.retryCount"] - + * The configuration.retry_count + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ + /* jshint ignore:end */ + WebhookListInstance.create = function create(opts, callback) { + if (_.isUndefined(opts)) { + throw new Error('Required parameter "opts" missing.'); + } + if (_.isUndefined(opts.type)) { + throw new Error('Required parameter "opts.type" missing.'); + } + + var deferred = Q.defer(); + var data = values.of({ + 'Type': _.get(opts, 'type'), + 'Configuration.Url': _.get(opts, '"configuration.url"'), + 'Configuration.Method': _.get(opts, '"configuration.method"'), + 'Configuration.Filters': serialize.map(_.get(opts, '"configuration.filters"'), function(e) { return e; }), + 'Configuration.Triggers': serialize.map(_.get(opts, '"configuration.triggers"'), function(e) { return e; }), + 'Configuration.FlowSid': _.get(opts, '"configuration.flowSid"'), + 'Configuration.RetryCount': _.get(opts, '"configuration.retryCount"') + }); + + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a webhook + * + * @function get + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {string} sid - The sid + * + * @returns {Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookContext} + */ + /* jshint ignore:end */ + WebhookListInstance.get = function get(sid) { + return new WebhookContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); + }; + + return WebhookListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookPage + * @augments Page + * @description Initialize the WebhookPage + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns WebhookPage + */ +/* jshint ignore:end */ +WebhookPage = function WebhookPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(WebhookPage.prototype, Page.prototype); +WebhookPage.prototype.constructor = WebhookPage; + +/* jshint ignore:start */ +/** + * Build an instance of WebhookInstance + * + * @function getInstance + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns WebhookInstance + */ +/* jshint ignore:end */ +WebhookPage.prototype.getInstance = function getInstance(payload) { + return new WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid + ); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookInstance + * @description Initialize the WebhookContext + * + * @property {string} sid - The sid + * @property {string} accountSid - The account_sid + * @property {string} serviceSid - The service_sid + * @property {string} channelSid - The channel_sid + * @property {string} type - The type + * @property {string} url - The url + * @property {string} configuration - The configuration + * @property {Date} dateCreated - The date_created + * @property {Date} dateUpdated - The date_updated + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} serviceSid - The service_sid + * @param {sid_like} channelSid - The channel_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +WebhookInstance = function WebhookInstance(version, payload, serviceSid, + channelSid, sid) { + this._version = version; + + // Marshaled Properties + this.sid = payload.sid; // jshint ignore:line + this.accountSid = payload.account_sid; // jshint ignore:line + this.serviceSid = payload.service_sid; // jshint ignore:line + this.channelSid = payload.channel_sid; // jshint ignore:line + this.type = payload.type; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.configuration = payload.configuration; // jshint ignore:line + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid, }; +}; + +Object.defineProperty(WebhookInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new WebhookContext( + this._version, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a WebhookInstance + * + * @function fetch + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * update a WebhookInstance + * + * @function update + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @param {object|function} opts - ... + * @param {string} [opts."configuration.url"] - The configuration.url + * @param {webhook.method} [opts."configuration.method"] - The configuration.method + * @param {string|list} [opts."configuration.filters"] - The configuration.filters + * @param {string|list} [opts."configuration.triggers"] - + * The configuration.triggers + * @param {string} [opts."configuration.flowSid"] - The configuration.flow_sid + * @param {number} [opts."configuration.retryCount"] - + * The configuration.retry_count + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookInstance.prototype.update = function update(opts, callback) { + return this._proxy.update(opts, callback); +}; + +/* jshint ignore:start */ +/** + * remove a WebhookInstance + * + * @function remove + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookInstance.prototype.remove = function remove(callback) { + return this._proxy.remove(callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the WebhookInstance for serialization. + * Removes any circular references in the object. + * + * @function toJSON + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @returns Object + */ +/* jshint ignore:end */ +WebhookInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookContext + * @description Initialize the WebhookContext + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {sid} serviceSid - The service_sid + * @param {sid_like} channelSid - The channel_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +WebhookContext = function WebhookContext(version, serviceSid, channelSid, sid) { + this._version = version; + + // Path Solution + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid, }; + this._uri = _.template( + '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a WebhookInstance + * + * @function fetch + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookContext.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 WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a WebhookInstance + * + * @function update + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookContext + * @instance + * + * @param {object|function} opts - ... + * @param {string} [opts."configuration.url"] - The configuration.url + * @param {webhook.method} [opts."configuration.method"] - The configuration.method + * @param {string|list} [opts."configuration.filters"] - The configuration.filters + * @param {string|list} [opts."configuration.triggers"] - + * The configuration.triggers + * @param {string} [opts."configuration.flowSid"] - The configuration.flow_sid + * @param {number} [opts."configuration.retryCount"] - + * The configuration.retry_count + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookContext.prototype.update = function update(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'Configuration.Url': _.get(opts, '"configuration.url"'), + 'Configuration.Method': _.get(opts, '"configuration.method"'), + 'Configuration.Filters': serialize.map(_.get(opts, '"configuration.filters"'), function(e) { return e; }), + 'Configuration.Triggers': serialize.map(_.get(opts, '"configuration.triggers"'), function(e) { return e; }), + 'Configuration.FlowSid': _.get(opts, '"configuration.flowSid"'), + 'Configuration.RetryCount': _.get(opts, '"configuration.retryCount"') + }); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * remove a WebhookInstance + * + * @function remove + * @memberof Twilio.Chat.V2.ServiceContext.ChannelContext.WebhookContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookContext.prototype.remove = function remove(callback) { + var deferred = Q.defer(); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); + + promise = promise.then(function(payload) { + deferred.resolve(payload); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + WebhookList: WebhookList, + WebhookPage: WebhookPage, + WebhookInstance: WebhookInstance, + WebhookContext: WebhookContext +}; diff --git a/lib/rest/chat/v2/service/role.js b/lib/rest/chat/v2/service/role.js index 37b78e8f44..e750bb84e4 100644 --- a/lib/rest/chat/v2/service/role.js +++ b/lib/rest/chat/v2/service/role.js @@ -28,7 +28,7 @@ var RoleContext; * @description Initialize the RoleList * * @param {Twilio.Chat.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this role belongs to. */ /* jshint ignore:end */ RoleList = function RoleList(version, serviceSid) { @@ -62,9 +62,9 @@ RoleList = function RoleList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name - * @param {role.role_type} opts.type - The type - * @param {string|list} opts.permission - The permission + * @param {string} opts.friendlyName - The human-readable name of this role. + * @param {role.role_type} opts.type - What kind of role this is. + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -416,15 +416,20 @@ RolePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceContext.RoleInstance * @description Initialize the RoleContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {role.role_type} type - The type - * @property {string} permissions - The permissions - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this role. + * @property {string} serviceSid - + * The unique id of the Service this role belongs to. + * @property {string} friendlyName - The human-readable name of this role. + * @property {role.role_type} type - What kind of role this is. + * @property {string} permissions - A JSON array of the permissions this role has. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. + * @property {string} url - An absolute URL for this role. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -505,7 +510,7 @@ RoleInstance.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -636,7 +641,7 @@ RoleContext.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance diff --git a/lib/rest/chat/v2/service/user.js b/lib/rest/chat/v2/service/user.js index f2f3767df5..071f941433 100644 --- a/lib/rest/chat/v2/service/user.js +++ b/lib/rest/chat/v2/service/user.js @@ -29,7 +29,7 @@ var UserContext; * @description Initialize the UserList * * @param {Twilio.Chat.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this user belongs to. */ /* jshint ignore:end */ UserList = function UserList(version, serviceSid) { @@ -63,10 +63,14 @@ UserList = function UserList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} opts.identity - + * A unique string that identifies the user within this service - often a username or email address. + * @param {string} [opts.roleSid] - + * The unique id of the Role assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -413,20 +417,31 @@ UserPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Chat.V2.ServiceContext.UserInstance * @description Initialize the UserContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} attributes - The attributes - * @property {string} friendlyName - The friendly_name - * @property {string} roleSid - The role_sid - * @property {string} identity - The identity - * @property {boolean} isOnline - The is_online - * @property {boolean} isNotifiable - The is_notifiable - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {number} joinedChannelsCount - The joined_channels_count + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this user. + * @property {string} serviceSid - + * The unique id of the Service this user belongs to. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} friendlyName - The human-readable name of this user. + * @property {string} roleSid - + * The unique id of the [Role][role] assigned to this user. + * @property {string} identity - + * A unique string that identifies the user within this service - often a username or email address. + * @property {boolean} isOnline - + * Indicates whether the User is actively connected to the Service instance and online. + * @property {boolean} isNotifiable - + * Indicates whether the User has a potentially valid Push Notification registration for the Service instance. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. + * @property {number} joinedChannelsCount - + * The number of Channels this User is a Member of. * @property {string} links - The links - * @property {string} url - The url + * @property {string} url - An absolute URL for this user. * * @param {Twilio.Chat.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -512,9 +527,12 @@ UserInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -684,9 +702,12 @@ UserContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance diff --git a/lib/rest/chat/v2/service/user/userChannel.js b/lib/rest/chat/v2/service/user/userChannel.js index 1fbea2201b..9b05a37f3f 100644 --- a/lib/rest/chat/v2/service/user/userChannel.js +++ b/lib/rest/chat/v2/service/user/userChannel.js @@ -27,7 +27,8 @@ var UserChannelInstance; * * @param {Twilio.Chat.V2} version - Version of the resource * @param {string} serviceSid - The service_sid - * @param {string} userSid - The sid + * @param {string} userSid - + * A 34 character string that uniquely identifies this resource. */ /* jshint ignore:end */ UserChannelList = function UserChannelList(version, serviceSid, userSid) { diff --git a/lib/rest/fax/V1.d.ts b/lib/rest/fax/V1.d.ts new file mode 100644 index 0000000000..dce50c3fb4 --- /dev/null +++ b/lib/rest/fax/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { FaxListInstance } from './v1/fax'; + + +/** + * Initialize the V1 version of Fax + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Fax + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly faxes: FaxListInstance; +} + +export = V1; diff --git a/lib/rest/ipMessaging/V1.d.ts b/lib/rest/ipMessaging/V1.d.ts new file mode 100644 index 0000000000..01b23d7cdf --- /dev/null +++ b/lib/rest/ipMessaging/V1.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CredentialListInstance } from './v1/credential'; +import { ServiceListInstance } from './v1/service'; + + +/** + * Initialize the V1 version of IpMessaging + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of IpMessaging + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly credentials: CredentialListInstance; + readonly services: ServiceListInstance; +} + +export = V1; diff --git a/lib/rest/ipMessaging/V2.d.ts b/lib/rest/ipMessaging/V2.d.ts new file mode 100644 index 0000000000..f08c927aa3 --- /dev/null +++ b/lib/rest/ipMessaging/V2.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CredentialListInstance } from './v2/credential'; +import { ServiceListInstance } from './v2/service'; + + +/** + * Initialize the V2 version of IpMessaging + */ +declare class V2 extends Version { + /** + * Initialize the V2 version of IpMessaging + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly credentials: CredentialListInstance; + readonly services: ServiceListInstance; +} + +export = V2; diff --git a/lib/rest/ipMessaging/v1/credential.js b/lib/rest/ipMessaging/v1/credential.js index 0952486cf8..14f45c42c9 100644 --- a/lib/rest/ipMessaging/v1/credential.js +++ b/lib/rest/ipMessaging/v1/credential.js @@ -297,12 +297,17 @@ CredentialList = function CredentialList(version) { * @instance * * @param {object} opts - ... - * @param {credential.push_service} opts.type - The type - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key + * @param {credential.push_service} opts.type - + * Credential type, one of "gcm" or "apn" + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential * @param {string} [opts.secret] - The secret * @param {function} [callback] - Callback to handle processed record * @@ -412,14 +417,18 @@ CredentialPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.CredentialInstance * @description Initialize the CredentialContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {credential.push_service} type - The type - * @property {string} sandbox - The sandbox - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account[/console] responsible for this resource. + * @property {string} friendlyName - The human-readable name of this resource. + * @property {credential.push_service} type - + * Indicates which push notifications service this credential is for - either gcm or apn + * @property {string} sandbox - + * [APN only] true when this resource should use the sandbox APN service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} url - An absolute URL for this credential resource. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -481,11 +490,15 @@ CredentialInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential * @param {string} [opts.secret] - The secret * @param {function} [callback] - Callback to handle processed record * @@ -596,11 +609,15 @@ CredentialContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential * @param {string} [opts.secret] - The secret * @param {function} [callback] - Callback to handle processed record * diff --git a/lib/rest/ipMessaging/v1/service.js b/lib/rest/ipMessaging/v1/service.js index cb105f427f..7427446521 100644 --- a/lib/rest/ipMessaging/v1/service.js +++ b/lib/rest/ipMessaging/v1/service.js @@ -64,7 +64,8 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - + * Human-readable name for this service instance * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -401,28 +402,39 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceInstance * @description Initialize the ServiceContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} defaultServiceRoleSid - The default_service_role_sid - * @property {string} defaultChannelRoleSid - The default_channel_role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this service. + * @property {string} friendlyName - The human-readable name of this service. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} defaultServiceRoleSid - + * The service role assigned to users when they are added to the service. + * @property {string} defaultChannelRoleSid - + * The channel role assigned to users when they are added to a channel. * @property {string} defaultChannelCreatorRoleSid - - * The default_channel_creator_role_sid - * @property {boolean} readStatusEnabled - The read_status_enabled - * @property {boolean} reachabilityEnabled - The reachability_enabled - * @property {number} typingIndicatorTimeout - The typing_indicator_timeout - * @property {number} consumptionReportInterval - The consumption_report_interval + * The channel role assigned to a channel creator when joining a new channel. + * @property {boolean} readStatusEnabled - + * Enable the Message Constumption Horizon feature. + * @property {boolean} reachabilityEnabled - + * Indicates whether the the Reachability feature is enabled for this Service instance. + * @property {number} typingIndicatorTimeout - + * The amount of time after a "started typing" event when clients should assume that user is no longer typing, even if no "ended typing" message was received. + * @property {number} consumptionReportInterval - + * The interval between consumption reports submission batches from client endpoints. * @property {string} limits - The limits * @property {string} webhooks - The webhooks - * @property {string} preWebhookUrl - The pre_webhook_url - * @property {string} postWebhookUrl - The post_webhook_url - * @property {string} webhookMethod - The webhook_method - * @property {string} webhookFilters - The webhook_filters - * @property {string} notifications - The notifications - * @property {string} url - The url - * @property {string} links - The links + * @property {string} preWebhookUrl - The webhook URL for PRE-Event webhooks. + * @property {string} postWebhookUrl - The webhook URL for POST-Event webhooks. + * @property {string} webhookMethod - The webhook request format to use. + * @property {string} webhookFilters - + * The list of WebHook events that are enabled for this Service instance. + * @property {string} notifications - + * Notification configuration for the Service instance. + * @property {string} url - An absolute URL for this service. + * @property {string} links - + * URLs to access the Channels, Roles, and Users for this service. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -514,16 +526,21 @@ ServiceInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * ISO 8601 duration indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - - * The consumption_report_interval + * ISO 8601 duration indicating the interval between consumption reports sent from client endpoints. * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled * @param {string} [opts."notifications.newMessage.template"] - @@ -540,10 +557,11 @@ ServiceInstance.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.enabled * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url * @param {string} [opts."webhooks.onMessageSend.method"] - @@ -821,16 +839,21 @@ ServiceContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * ISO 8601 duration indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - - * The consumption_report_interval + * ISO 8601 duration indicating the interval between consumption reports sent from client endpoints. * @param {boolean} [opts."notifications.newMessage.enabled"] - * The notifications.new_message.enabled * @param {string} [opts."notifications.newMessage.template"] - @@ -847,10 +870,11 @@ ServiceContext.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.enabled * @param {string} [opts."notifications.invitedToChannel.template"] - * The notifications.invited_to_channel.template - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. * @param {string} [opts."webhooks.onMessageSend.url"] - * The webhooks.on_message_send.url * @param {string} [opts."webhooks.onMessageSend.method"] - diff --git a/lib/rest/ipMessaging/v1/service/channel.js b/lib/rest/ipMessaging/v1/service/channel.js index 6119de2cd9..92f57e0a86 100644 --- a/lib/rest/ipMessaging/v1/service/channel.js +++ b/lib/rest/ipMessaging/v1/service/channel.js @@ -31,7 +31,8 @@ var ChannelContext; * @description Initialize the ChannelList * * @param {Twilio.IpMessaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the [Service][service] this channel belongs to. */ /* jshint ignore:end */ ChannelList = function ChannelList(version, serviceSid) { @@ -65,10 +66,12 @@ ChannelList = function ChannelList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {channel.channel_type} [opts.type] - The type + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {channel.channel_type} [opts.type] - + * The visibility of the channel - public or private. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -423,20 +426,26 @@ ChannelPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceContext.ChannelInstance * @description Initialize the ChannelContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {string} uniqueName - The unique_name - * @property {string} attributes - The attributes - * @property {channel.channel_type} type - The type - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} createdBy - The created_by + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the [Account][/console] responsible for this channel. + * @property {string} serviceSid - + * The unique id of the [Service][service] this channel belongs to. + * @property {string} friendlyName - The human-readable name of this channel. + * @property {string} uniqueName - The unique, addressable name of this channel. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {channel.channel_type} type - + * The visibility of this channel - either public or private + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} createdBy - Identity of the channel's creator. * @property {number} membersCount - The members_count * @property {number} messagesCount - The messages_count - * @property {string} url - The url - * @property {string} links - The links + * @property {string} url - An absolute URL for this channel. + * @property {string} links - + * Absolute URLs to access the [Members][members] and [Messages][messages] for this channel. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -522,9 +531,10 @@ ChannelInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -712,9 +722,10 @@ ChannelContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance diff --git a/lib/rest/ipMessaging/v1/service/channel/invite.js b/lib/rest/ipMessaging/v1/service/channel/invite.js index 11bc5fc78f..c162ce16fd 100644 --- a/lib/rest/ipMessaging/v1/service/channel/invite.js +++ b/lib/rest/ipMessaging/v1/service/channel/invite.js @@ -29,8 +29,9 @@ var InviteContext; * @description Initialize the InviteList * * @param {Twilio.IpMessaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ InviteList = function InviteList(version, serviceSid, channelSid) { @@ -64,8 +65,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid + * @param {string} opts.identity - + * A unique string identifier for this User in this Service. + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed InviteInstance @@ -121,7 +123,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -210,7 +213,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -270,7 +274,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -323,7 +328,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @memberof Twilio.IpMessaging.V1.ServiceContext.ChannelContext.InviteList * @instance * - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -422,16 +428,20 @@ InvitePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceContext.ChannelContext.InviteInstance * @description Initialize the InviteContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account[/console] responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. * @property {string} createdBy - The created_by - * @property {string} url - The url + * @property {string} url - An absolute URL for this member. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/ipMessaging/v1/service/channel/member.js b/lib/rest/ipMessaging/v1/service/channel/member.js index 5c60e661b6..e4cb98229d 100644 --- a/lib/rest/ipMessaging/v1/service/channel/member.js +++ b/lib/rest/ipMessaging/v1/service/channel/member.js @@ -29,8 +29,9 @@ var MemberContext; * @description Initialize the MemberList * * @param {Twilio.IpMessaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ MemberList = function MemberList(version, serviceSid, channelSid) { @@ -64,8 +65,9 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid + * @param {string} opts.identity - + * A unique string identifier for this User in this Service. + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance @@ -121,7 +123,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -210,7 +213,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -270,7 +274,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -323,7 +328,8 @@ MemberList = function MemberList(version, serviceSid, channelSid) { * @memberof Twilio.IpMessaging.V1.ServiceContext.ChannelContext.MemberList * @instance * - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -422,17 +428,23 @@ MemberPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceContext.ChannelContext.MemberInstance * @description Initialize the MemberContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid - * @property {number} lastConsumedMessageIndex - The last_consumed_message_index - * @property {Date} lastConsumptionTimestamp - The last_consumption_timestamp - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. + * @property {number} lastConsumedMessageIndex - + * An Integer representing index of the last Message this Member has read within this Channel + * @property {Date} lastConsumptionTimestamp - + * An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel + * @property {string} url - An absolute URL for this member. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -522,9 +534,9 @@ MemberInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index + * An Integer representing index of the last Message this Member has read within this Channel * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance @@ -657,9 +669,9 @@ MemberContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index + * An Integer representing index of the last Message this Member has read within this Channel * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance diff --git a/lib/rest/ipMessaging/v1/service/channel/message.js b/lib/rest/ipMessaging/v1/service/channel/message.js index ced18e768f..b77d8218e5 100644 --- a/lib/rest/ipMessaging/v1/service/channel/message.js +++ b/lib/rest/ipMessaging/v1/service/channel/message.js @@ -27,7 +27,8 @@ var MessageContext; * @description Initialize the MessageList * * @param {Twilio.IpMessaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the Service this message belongs to. * @param {string} channelSid - The channel_sid */ /* jshint ignore:end */ @@ -425,19 +426,24 @@ MessagePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceContext.ChannelContext.MessageInstance * @description Initialize the MessageContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} attributes - The attributes - * @property {string} serviceSid - The service_sid - * @property {string} to - The to + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this message. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} serviceSid - + * The unique id of the Service this message belongs to. + * @property {string} to - The unique id of the Channel this message was sent to. * @property {string} channelSid - The channel_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {boolean} wasEdited - The was_edited - * @property {string} from - The from - * @property {string} body - The body - * @property {number} index - The index - * @property {string} url - The url + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {boolean} wasEdited - + * true if the message has been updated since it was created. + * @property {string} from - The identity of the message's author. + * @property {string} body - The contents of the message. + * @property {number} index - The index of the message within the Channel + * @property {string} url - An absolute URL for this message. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -529,8 +535,9 @@ MessageInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.body] - The new message body string. + * @param {string} [opts.attributes] - + * The new attributes metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance @@ -663,8 +670,9 @@ MessageContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes + * @param {string} [opts.body] - The new message body string. + * @param {string} [opts.attributes] - + * The new attributes metadata field you can use to store any data you wish. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance diff --git a/lib/rest/ipMessaging/v1/service/role.js b/lib/rest/ipMessaging/v1/service/role.js index f80837f25e..ffded1026a 100644 --- a/lib/rest/ipMessaging/v1/service/role.js +++ b/lib/rest/ipMessaging/v1/service/role.js @@ -28,7 +28,7 @@ var RoleContext; * @description Initialize the RoleList * * @param {Twilio.IpMessaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this role belongs to. */ /* jshint ignore:end */ RoleList = function RoleList(version, serviceSid) { @@ -62,9 +62,9 @@ RoleList = function RoleList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name - * @param {role.role_type} opts.type - The type - * @param {string|list} opts.permission - The permission + * @param {string} opts.friendlyName - The human-readable name of this role. + * @param {role.role_type} opts.type - What kind of role this is. + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -416,15 +416,20 @@ RolePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceContext.RoleInstance * @description Initialize the RoleContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {role.role_type} type - The type - * @property {string} permissions - The permissions - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this role. + * @property {string} serviceSid - + * The unique id of the Service this role belongs to. + * @property {string} friendlyName - The human-readable name of this role. + * @property {role.role_type} type - What kind of role this is. + * @property {string} permissions - A JSON array of the permissions this role has. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. + * @property {string} url - An absolute URL for this role. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -505,7 +510,7 @@ RoleInstance.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -636,7 +641,7 @@ RoleContext.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance diff --git a/lib/rest/ipMessaging/v1/service/user.js b/lib/rest/ipMessaging/v1/service/user.js index 435305f499..d73a3727f1 100644 --- a/lib/rest/ipMessaging/v1/service/user.js +++ b/lib/rest/ipMessaging/v1/service/user.js @@ -28,7 +28,7 @@ var UserContext; * @description Initialize the UserList * * @param {Twilio.IpMessaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this user belongs to. */ /* jshint ignore:end */ UserList = function UserList(version, serviceSid) { @@ -62,10 +62,14 @@ UserList = function UserList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} opts.identity - + * A unique string that identifies the user within this service - often a username or email address. + * @param {string} [opts.roleSid] - + * The unique id of the Role assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -412,20 +416,30 @@ UserPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V1.ServiceContext.UserInstance * @description Initialize the UserContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} attributes - The attributes - * @property {string} friendlyName - The friendly_name - * @property {string} roleSid - The role_sid - * @property {string} identity - The identity - * @property {boolean} isOnline - The is_online - * @property {boolean} isNotifiable - The is_notifiable - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this user. + * @property {string} serviceSid - + * The unique id of the Service this user belongs to. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} friendlyName - The human-readable name of this user. + * @property {string} roleSid - + * The unique id of the [Role][role] assigned to this user. + * @property {string} identity - + * A unique string that identifies the user within this service - often a username or email address. + * @property {boolean} isOnline - + * Indicates whether the User is actively connected to the Service instance and online. + * @property {boolean} isNotifiable - + * Indicates whether the User has a potentially valid Push Notification registration for the Service instance. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. * @property {number} joinedChannelsCount - The joined_channels_count * @property {string} links - The links - * @property {string} url - The url + * @property {string} url - An absolute URL for this user. * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -511,9 +525,12 @@ UserInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -665,9 +682,12 @@ UserContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance diff --git a/lib/rest/ipMessaging/v1/service/user/userChannel.js b/lib/rest/ipMessaging/v1/service/user/userChannel.js index 0ea41fb428..1871c57303 100644 --- a/lib/rest/ipMessaging/v1/service/user/userChannel.js +++ b/lib/rest/ipMessaging/v1/service/user/userChannel.js @@ -27,7 +27,8 @@ var UserChannelInstance; * * @param {Twilio.IpMessaging.V1} version - Version of the resource * @param {string} serviceSid - The service_sid - * @param {string} userSid - The sid + * @param {string} userSid - + * A 34 character string that uniquely identifies this resource. */ /* jshint ignore:end */ UserChannelList = function UserChannelList(version, serviceSid, userSid) { diff --git a/lib/rest/ipMessaging/v2/credential.js b/lib/rest/ipMessaging/v2/credential.js index 9d70778853..2c309cb30f 100644 --- a/lib/rest/ipMessaging/v2/credential.js +++ b/lib/rest/ipMessaging/v2/credential.js @@ -297,13 +297,19 @@ CredentialList = function CredentialList(version) { * @instance * * @param {object} opts - ... - * @param {credential.push_service} opts.type - The type - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {credential.push_service} opts.type - + * Credential type, one of "gcm", "fcm", or "apn" + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -412,14 +418,18 @@ CredentialPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.CredentialInstance * @description Initialize the CredentialContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {credential.push_service} type - The type - * @property {string} sandbox - The sandbox - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this resource. + * @property {string} friendlyName - The human-readable name of this resource. + * @property {credential.push_service} type - + * Indicates which push notifications service this credential is for - either gcm, fcm, or apn + * @property {string} sandbox - + * [APN only] true when this resource should use the sandbox APN service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} url - An absolute URL for this credential resource. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -481,12 +491,17 @@ CredentialInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -596,12 +611,17 @@ CredentialContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate, e. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key, e. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "API key" for project from Google Developer console for your GCM Service application credential + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance diff --git a/lib/rest/ipMessaging/v2/service.js b/lib/rest/ipMessaging/v2/service.js index e292167b0d..4e521440cf 100644 --- a/lib/rest/ipMessaging/v2/service.js +++ b/lib/rest/ipMessaging/v2/service.js @@ -65,7 +65,8 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name + * @param {string} opts.friendlyName - + * Human-readable name for this service instance * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ServiceInstance @@ -402,30 +403,43 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceInstance * @description Initialize the ServiceContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} defaultServiceRoleSid - The default_service_role_sid - * @property {string} defaultChannelRoleSid - The default_channel_role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this service. + * @property {string} friendlyName - The human-readable name of this service. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} defaultServiceRoleSid - + * The service role assigned to users when they are added to the service. + * @property {string} defaultChannelRoleSid - + * The channel role assigned to users when they are added to a channel. * @property {string} defaultChannelCreatorRoleSid - - * The default_channel_creator_role_sid - * @property {boolean} readStatusEnabled - The read_status_enabled - * @property {boolean} reachabilityEnabled - The reachability_enabled - * @property {number} typingIndicatorTimeout - The typing_indicator_timeout - * @property {number} consumptionReportInterval - The consumption_report_interval - * @property {string} limits - The limits - * @property {string} preWebhookUrl - The pre_webhook_url - * @property {string} postWebhookUrl - The post_webhook_url - * @property {string} webhookMethod - The webhook_method - * @property {string} webhookFilters - The webhook_filters - * @property {number} preWebhookRetryCount - The pre_webhook_retry_count - * @property {number} postWebhookRetryCount - The post_webhook_retry_count - * @property {string} notifications - The notifications + * The channel role assigned to a channel creator when joining a new channel. + * @property {boolean} readStatusEnabled - + * Enable the Message Constumption Horizon feature. + * @property {boolean} reachabilityEnabled - + * Indicates whether the the Reachability feature is enabled for this Service instance. + * @property {number} 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 {number} consumptionReportInterval - DEPRECATED. + * @property {string} limits - Configuration for service instance level limits. + * @property {string} preWebhookUrl - The webhook URL for PRE-Event webhooks. + * @property {string} postWebhookUrl - The webhook URL for POST-Event webhooks. + * @property {string} webhookMethod - + * The webhook request format to use for both PRE and POST webhooks. + * @property {string} webhookFilters - + * The list of WebHook events that are enabled for this Service instance. + * @property {number} preWebhookRetryCount - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @property {number} postWebhookRetryCount - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @property {string} notifications - + * Notification configuration for the Service instance. * @property {string} media - The media - * @property {string} url - The url - * @property {string} links - The links + * @property {string} url - An absolute URL for this service. + * @property {string} links - + * URLs to access the Channels, Roles, and Users for this service. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -519,14 +533,19 @@ ServiceInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * The duration in seconds indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval * @param {boolean} [opts."notifications.newMessage.enabled"] - @@ -555,16 +574,21 @@ ServiceInstance.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.template * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts."limits.channelMembers"] - The limits.channel_members - * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. + * @param {number} [opts."limits.channelMembers"] - + * The maximum number of Members that can be added to Channels within this Service. + * @param {number} [opts."limits.userChannels"] - + * The maximum number of Channels Users can be a Member of within this Service. * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message - * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count - * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count + * @param {number} [opts.preWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @param {number} [opts.postWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. * @param {boolean} [opts."notifications.logEnabled"] - * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record @@ -764,14 +788,19 @@ ServiceContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance * @param {string} [opts.defaultServiceRoleSid] - The default_service_role_sid - * @param {string} [opts.defaultChannelRoleSid] - The default_channel_role_sid + * @param {string} [opts.defaultChannelRoleSid] - + * Channel role assigned on channel join * @param {string} [opts.defaultChannelCreatorRoleSid] - - * The default_channel_creator_role_sid - * @param {boolean} [opts.readStatusEnabled] - The read_status_enabled - * @param {boolean} [opts.reachabilityEnabled] - The reachability_enabled - * @param {number} [opts.typingIndicatorTimeout] - The typing_indicator_timeout + * Channel role assigned to creator of channel when joining for first time + * @param {boolean} [opts.readStatusEnabled] - + * true if the member read status feature is enabled, false if not. + * @param {boolean} [opts.reachabilityEnabled] - + * true if the reachability feature should be enabled. + * @param {number} [opts.typingIndicatorTimeout] - + * The duration in seconds indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received * @param {number} [opts.consumptionReportInterval] - * The consumption_report_interval * @param {boolean} [opts."notifications.newMessage.enabled"] - @@ -800,16 +829,21 @@ ServiceContext.prototype.remove = function remove(callback) { * The notifications.invited_to_channel.template * @param {string} [opts."notifications.invitedToChannel.sound"] - * The notifications.invited_to_channel.sound - * @param {string} [opts.preWebhookUrl] - The pre_webhook_url - * @param {string} [opts.postWebhookUrl] - The post_webhook_url - * @param {string} [opts.webhookMethod] - The webhook_method - * @param {string|list} [opts.webhookFilters] - The webhook_filters - * @param {number} [opts."limits.channelMembers"] - The limits.channel_members - * @param {number} [opts."limits.userChannels"] - The limits.user_channels + * @param {string} [opts.preWebhookUrl] - The webhook URL for PRE-Event webhooks. + * @param {string} [opts.postWebhookUrl] - The webhook URL for POST-Event webhooks. + * @param {string} [opts.webhookMethod] - The webhook request format to use. + * @param {string|list} [opts.webhookFilters] - + * The list of WebHook events that are enabled for this Service instance. + * @param {number} [opts."limits.channelMembers"] - + * The maximum number of Members that can be added to Channels within this Service. + * @param {number} [opts."limits.userChannels"] - + * The maximum number of Channels Users can be a Member of within this Service. * @param {string} [opts."media.compatibilityMessage"] - * The media.compatibility_message - * @param {number} [opts.preWebhookRetryCount] - The pre_webhook_retry_count - * @param {number} [opts.postWebhookRetryCount] - The post_webhook_retry_count + * @param {number} [opts.preWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. + * @param {number} [opts.postWebhookRetryCount] - + * Count of times webhook will be retried in case of timeout or 429/503/504 HTTP responses. * @param {boolean} [opts."notifications.logEnabled"] - * The notifications.log_enabled * @param {function} [callback] - Callback to handle processed record diff --git a/lib/rest/ipMessaging/v2/service/channel.js b/lib/rest/ipMessaging/v2/service/channel.js index d371726f33..99cc9d78d8 100644 --- a/lib/rest/ipMessaging/v2/service/channel.js +++ b/lib/rest/ipMessaging/v2/service/channel.js @@ -15,6 +15,7 @@ var InviteList = require('./channel/invite').InviteList; var MemberList = require('./channel/member').MemberList; var MessageList = require('./channel/message').MessageList; var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var WebhookList = require('./channel/webhook').WebhookList; var deserialize = require( '../../../../base/deserialize'); /* jshint ignore:line */ var serialize = require('../../../../base/serialize'); /* jshint ignore:line */ @@ -31,7 +32,8 @@ var ChannelContext; * @description Initialize the ChannelList * * @param {Twilio.IpMessaging.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the Service this channel belongs to. */ /* jshint ignore:end */ ChannelList = function ChannelList(version, serviceSid) { @@ -65,13 +67,18 @@ ChannelList = function ChannelList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {channel.channel_type} [opts.type] - The type - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.createdBy] - The created_by + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {channel.channel_type} [opts.type] - + * The visibility of the channel - public or private. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated. + * @param {string} [opts.createdBy] - + * Optional field to specify the Identity of the User that created the Channel. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -429,20 +436,26 @@ ChannelPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelInstance * @description Initialize the ChannelContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {string} uniqueName - The unique_name - * @property {string} attributes - The attributes - * @property {channel.channel_type} type - The type - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} createdBy - The created_by - * @property {number} membersCount - The members_count - * @property {number} messagesCount - The messages_count - * @property {string} url - The url - * @property {string} links - The links + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this channel. + * @property {string} serviceSid - + * The unique id of the Service this channel belongs to. + * @property {string} friendlyName - The human-readable name of this channel. + * @property {string} uniqueName - The unique, addressable name of this channel. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {channel.channel_type} type - + * The visibility of this channel - either public or private + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} createdBy - Identity of the channel's creator. + * @property {number} membersCount - The number of Members in the Channel + * @property {number} messagesCount - The number of Messages in the Channel + * @property {string} url - An absolute URL for this channel. + * @property {string} links - + * Absolute URLs to access the Members, Messages , Invites and, if it exists the last Message for this Channel. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -528,12 +541,16 @@ ChannelInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.createdBy] - The created_by + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated. + * @param {string} [opts.createdBy] - + * Optional field to specify the Identity of the User that created the Channel. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -588,6 +605,21 @@ ChannelInstance.prototype.invites = function invites() { return this._proxy.invites; }; +/* jshint ignore:start */ +/** + * Access the webhooks + * + * @function webhooks + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelInstance + * @instance + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList} + */ +/* jshint ignore:end */ +ChannelInstance.prototype.webhooks = function webhooks() { + return this._proxy.webhooks; +}; + /* jshint ignore:start */ /** * Produce a plain JSON object version of the ChannelInstance for serialization. @@ -622,6 +654,8 @@ ChannelInstance.prototype.toJSON = function toJSON() { * messages resource * @property {Twilio.IpMessaging.V2.ServiceContext.ChannelContext.InviteList} invites - * invites resource + * @property {Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList} webhooks - + * webhooks resource * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {sid} serviceSid - The service_sid @@ -641,6 +675,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { this._members = undefined; this._messages = undefined; this._invites = undefined; + this._webhooks = undefined; }; /* jshint ignore:start */ @@ -721,12 +756,16 @@ ChannelContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.createdBy] - The created_by + * @param {string} [opts.friendlyName] - A human-readable name for the Channel. + * @param {string} [opts.uniqueName] - A unique, addressable name for the Channel. + * @param {string} [opts.attributes] - + * An optional metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated. + * @param {string} [opts.createdBy] - + * Optional field to specify the Identity of the User that created the Channel. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ChannelInstance @@ -801,6 +840,16 @@ Object.defineProperty(ChannelContext.prototype, } }); +Object.defineProperty(ChannelContext.prototype, + 'webhooks', { + get: function() { + if (!this._webhooks) { + this._webhooks = new WebhookList(this._version, this._solution.serviceSid, this._solution.sid); + } + return this._webhooks; + } +}); + module.exports = { ChannelList: ChannelList, ChannelPage: ChannelPage, diff --git a/lib/rest/ipMessaging/v2/service/channel/invite.js b/lib/rest/ipMessaging/v2/service/channel/invite.js index 5cfeb952a2..762f0633e3 100644 --- a/lib/rest/ipMessaging/v2/service/channel/invite.js +++ b/lib/rest/ipMessaging/v2/service/channel/invite.js @@ -29,8 +29,9 @@ var InviteContext; * @description Initialize the InviteList * * @param {Twilio.IpMessaging.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ InviteList = function InviteList(version, serviceSid, channelSid) { @@ -64,8 +65,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid + * @param {string} opts.identity - + * A unique string identifier for this User in this Service. + * @param {string} [opts.roleSid] - The Role assigned to this member. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed InviteInstance @@ -121,7 +123,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -210,7 +213,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -270,7 +274,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -323,7 +328,8 @@ InviteList = function InviteList(version, serviceSid, channelSid) { * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.InviteList * @instance * - * @param {string|list} [opts.identity] - The identity + * @param {string|list} [opts.identity] - + * A unique string identifier for this User in this Service. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -422,16 +428,20 @@ InvitePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.InviteInstance * @description Initialize the InviteContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. * @property {string} createdBy - The created_by - * @property {string} url - The url + * @property {string} url - An absolute URL for this member. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/ipMessaging/v2/service/channel/member.js b/lib/rest/ipMessaging/v2/service/channel/member.js index 805552f18d..3e1e37dfb1 100644 --- a/lib/rest/ipMessaging/v2/service/channel/member.js +++ b/lib/rest/ipMessaging/v2/service/channel/member.js @@ -29,8 +29,9 @@ var MemberContext; * @description Initialize the MemberList * * @param {Twilio.IpMessaging.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid - * @param {string} channelSid - The channel_sid + * @param {string} serviceSid - + * The unique id of the Service this member belongs to. + * @param {string} channelSid - The unique id of the Channel for this member. */ /* jshint ignore:end */ MemberList = function MemberList(version, serviceSid, channelSid) { @@ -434,17 +435,23 @@ MemberPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.MemberInstance * @description Initialize the MemberContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} channelSid - The channel_sid - * @property {string} serviceSid - The service_sid - * @property {string} identity - The identity - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} roleSid - The role_sid - * @property {number} lastConsumedMessageIndex - The last_consumed_message_index - * @property {Date} lastConsumptionTimestamp - The last_consumption_timestamp - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this member. + * @property {string} channelSid - The unique id of the Channel for this member. + * @property {string} serviceSid - + * The unique id of the Service this member belongs to. + * @property {string} identity - + * A unique string identifier for this User in this Service. + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} roleSid - The Role assigned to this member. + * @property {number} lastConsumedMessageIndex - + * An Integer representing index of the last Message this Member has read within this Channel + * @property {Date} lastConsumptionTimestamp - + * An ISO8601 based timestamp string representing the datetime of the last Message read event for this Member within this Channel + * @property {string} url - An absolute URL for this member. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -534,12 +541,15 @@ MemberInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The role to be assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index - * @param {Date} [opts.lastConsumptionTimestamp] - The last_consumption_timestamp - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated + * Optional field used to specify the last consumed Message index for the Channel for this Member. + * @param {Date} [opts.lastConsumptionTimestamp] - + * Optional ISO8601 time indicating the last datetime the Member consumed a Message in the Channel. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Members should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Member should be set as having been last updated. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance @@ -672,12 +682,15 @@ MemberContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid + * @param {string} [opts.roleSid] - The role to be assigned to this member. * @param {number} [opts.lastConsumedMessageIndex] - - * The last_consumed_message_index - * @param {Date} [opts.lastConsumptionTimestamp] - The last_consumption_timestamp - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated + * Optional field used to specify the last consumed Message index for the Channel for this Member. + * @param {Date} [opts.lastConsumptionTimestamp] - + * Optional ISO8601 time indicating the last datetime the Member consumed a Message in the Channel. + * @param {Date} [opts.dateCreated] - + * The optional ISO8601 time specifying the datetime the Members should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The optional ISO8601 time specifying the datetime the Member should be set as having been last updated. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MemberInstance diff --git a/lib/rest/ipMessaging/v2/service/channel/message.js b/lib/rest/ipMessaging/v2/service/channel/message.js index 42ea9cb6b4..78421caa52 100644 --- a/lib/rest/ipMessaging/v2/service/channel/message.js +++ b/lib/rest/ipMessaging/v2/service/channel/message.js @@ -29,7 +29,8 @@ var MessageContext; * @description Initialize the MessageList * * @param {Twilio.IpMessaging.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - + * The unique id of the Service this message belongs to. * @param {string} channelSid - The channel_sid */ /* jshint ignore:end */ @@ -64,13 +65,18 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.from] - The from - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.lastUpdatedBy] - The last_updated_by - * @param {string} [opts.body] - The body - * @param {string} [opts.mediaSid] - The media_sid + * @param {string} [opts.from] - + * The identity of the message's author. Defaults to system if not specified. + * @param {string} [opts.attributes] - + * The optional attributes metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The ISO8601 time specifying the datetime the Message should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The ISO8601 time specifying the datetime the Message should be set as having been last updated. + * @param {string} [opts.lastUpdatedBy] - + * Specify the Identity of the User that last updated the Message + * @param {string} [opts.body] - The optional message body string. + * @param {string} [opts.mediaSid] - The Media Sid to be attached to this Message. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance @@ -133,7 +139,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -222,7 +229,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -282,7 +290,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @instance * * @param {object|function} opts - ... - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -335,7 +344,8 @@ MessageList = function MessageList(version, serviceSid, channelSid) { * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.MessageList * @instance * - * @param {message.order_type} [opts.order] - The order + * @param {message.order_type} [opts.order] - + * Specifies sorting order for messages list, possible values are: `asc` or `desc`. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -434,22 +444,29 @@ MessagePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.MessageInstance * @description Initialize the MessageContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} attributes - The attributes - * @property {string} serviceSid - The service_sid - * @property {string} to - The to + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this message. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} serviceSid - + * The unique id of the Service this message belongs to. + * @property {string} to - The unique id of the Channel this message was sent to. * @property {string} channelSid - The channel_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} lastUpdatedBy - The last_updated_by - * @property {boolean} wasEdited - The was_edited - * @property {string} from - The from - * @property {string} body - The body - * @property {number} index - The index - * @property {string} type - The type - * @property {string} media - The media - * @property {string} url - The url + * @property {Date} dateCreated - The date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} lastUpdatedBy - + * Optional field to specify the Identity of the User that last updated the Message + * @property {boolean} wasEdited - + * true if the message has been updated since it was created. + * @property {string} from - The identity of the message's author. + * @property {string} body - Optional — the contents of the message. + * @property {number} index - The index of the message within the Channel + * @property {string} type - Message type. + * @property {string} media - + * Optional — if a Media resource instance is attached to the Message, this will contain the Media object for the attached Media. + * @property {string} url - An absolute URL for this message. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -544,11 +561,15 @@ MessageInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.lastUpdatedBy] - The last_updated_by + * @param {string} [opts.body] - The message body string. + * @param {string} [opts.attributes] - + * The attributes metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The ISO8601 time specifying the datetime the Message should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The ISO8601 time specifying the datetime the Message should be set as having been last updated. + * @param {string} [opts.lastUpdatedBy] - + * Specify the Identity of the User that last updated the Message * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance @@ -681,11 +702,15 @@ MessageContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.body] - The body - * @param {string} [opts.attributes] - The attributes - * @param {Date} [opts.dateCreated] - The date_created - * @param {Date} [opts.dateUpdated] - The date_updated - * @param {string} [opts.lastUpdatedBy] - The last_updated_by + * @param {string} [opts.body] - The message body string. + * @param {string} [opts.attributes] - + * The attributes metadata field you can use to store any data you wish. + * @param {Date} [opts.dateCreated] - + * The ISO8601 time specifying the datetime the Message should be set as being created. + * @param {Date} [opts.dateUpdated] - + * The ISO8601 time specifying the datetime the Message should be set as having been last updated. + * @param {string} [opts.lastUpdatedBy] - + * Specify the Identity of the User that last updated the Message * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed MessageInstance diff --git a/lib/rest/ipMessaging/v2/service/channel/webhook.js b/lib/rest/ipMessaging/v2/service/channel/webhook.js new file mode 100644 index 0000000000..1304c3992b --- /dev/null +++ b/lib/rest/ipMessaging/v2/service/channel/webhook.js @@ -0,0 +1,725 @@ +'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 deserialize = require( + '../../../../../base/deserialize'); /* jshint ignore:line */ +var serialize = require( + '../../../../../base/serialize'); /* jshint ignore:line */ +var values = require('../../../../../base/values'); /* jshint ignore:line */ + +var WebhookList; +var WebhookPage; +var WebhookInstance; +var WebhookContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @description Initialize the WebhookList + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {string} serviceSid - The service_sid + * @param {string} channelSid - The channel_sid + */ +/* jshint ignore:end */ +WebhookList = function WebhookList(version, serviceSid, channelSid) { + /* jshint ignore:start */ + /** + * @function webhooks + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookContext} + */ + /* jshint ignore:end */ + function WebhookListInstance(sid) { + return WebhookListInstance.get(sid); + } + + WebhookListInstance._version = version; + // Path Solution + WebhookListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; + WebhookListInstance._uri = _.template( + '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks' // jshint ignore:line + )(WebhookListInstance._solution); + /* jshint ignore:start */ + /** + * Streams WebhookInstance 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. + * + * @function each + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object|function} opts - ... + * @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=50] - + * 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 */ + WebhookListInstance.each = function each(opts, callback) { + opts = opts || {}; + if (_.isFunction(opts)) { + opts = { callback: opts }; + } else if (_.isFunction(callback) && !_.isFunction(opts.callback)) { + opts.callback = callback; + } + + if (_.isUndefined(opts.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++; + opts.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 */ + /** + * @description Lists WebhookInstance records from the API as a list. + * + * If a function is passed as the first argument, it will be used as the callback function. + * + * @function list + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object|function} opts - ... + * @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 */ + WebhookListInstance.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 WebhookInstance 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. + * + * @function page + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object|function} opts - ... + * @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 */ + WebhookListInstance.page = function page(opts, callback) { + 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 WebhookPage(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 WebhookInstance 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. + * + * @function getPage + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @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 */ + WebhookListInstance.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 WebhookPage(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 */ + /** + * create a WebhookInstance + * + * @function create + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {object} opts - ... + * @param {webhook.type} opts.type - The type + * @param {string} [opts."configuration.url"] - The configuration.url + * @param {webhook.method} [opts."configuration.method"] - The configuration.method + * @param {string|list} [opts."configuration.filters"] - The configuration.filters + * @param {string|list} [opts."configuration.triggers"] - + * The configuration.triggers + * @param {string} [opts."configuration.flowSid"] - The configuration.flow_sid + * @param {number} [opts."configuration.retryCount"] - + * The configuration.retry_count + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ + /* jshint ignore:end */ + WebhookListInstance.create = function create(opts, callback) { + if (_.isUndefined(opts)) { + throw new Error('Required parameter "opts" missing.'); + } + if (_.isUndefined(opts.type)) { + throw new Error('Required parameter "opts.type" missing.'); + } + + var deferred = Q.defer(); + var data = values.of({ + 'Type': _.get(opts, 'type'), + 'Configuration.Url': _.get(opts, '"configuration.url"'), + 'Configuration.Method': _.get(opts, '"configuration.method"'), + 'Configuration.Filters': serialize.map(_.get(opts, '"configuration.filters"'), function(e) { return e; }), + 'Configuration.Triggers': serialize.map(_.get(opts, '"configuration.triggers"'), function(e) { return e; }), + 'Configuration.FlowSid': _.get(opts, '"configuration.flowSid"'), + 'Configuration.RetryCount': _.get(opts, '"configuration.retryCount"') + }); + + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a webhook + * + * @function get + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookList + * @instance + * + * @param {string} sid - The sid + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookContext} + */ + /* jshint ignore:end */ + WebhookListInstance.get = function get(sid) { + return new WebhookContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); + }; + + return WebhookListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookPage + * @augments Page + * @description Initialize the WebhookPage + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns WebhookPage + */ +/* jshint ignore:end */ +WebhookPage = function WebhookPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(WebhookPage.prototype, Page.prototype); +WebhookPage.prototype.constructor = WebhookPage; + +/* jshint ignore:start */ +/** + * Build an instance of WebhookInstance + * + * @function getInstance + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns WebhookInstance + */ +/* jshint ignore:end */ +WebhookPage.prototype.getInstance = function getInstance(payload) { + return new WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid + ); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookInstance + * @description Initialize the WebhookContext + * + * @property {string} sid - The sid + * @property {string} accountSid - The account_sid + * @property {string} serviceSid - The service_sid + * @property {string} channelSid - The channel_sid + * @property {string} type - The type + * @property {string} url - The url + * @property {string} configuration - The configuration + * @property {Date} dateCreated - The date_created + * @property {Date} dateUpdated - The date_updated + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} serviceSid - The service_sid + * @param {sid_like} channelSid - The channel_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +WebhookInstance = function WebhookInstance(version, payload, serviceSid, + channelSid, sid) { + this._version = version; + + // Marshaled Properties + this.sid = payload.sid; // jshint ignore:line + this.accountSid = payload.account_sid; // jshint ignore:line + this.serviceSid = payload.service_sid; // jshint ignore:line + this.channelSid = payload.channel_sid; // jshint ignore:line + this.type = payload.type; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.configuration = payload.configuration; // jshint ignore:line + this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid, }; +}; + +Object.defineProperty(WebhookInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new WebhookContext( + this._version, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a WebhookInstance + * + * @function fetch + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * update a WebhookInstance + * + * @function update + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @param {object|function} opts - ... + * @param {string} [opts."configuration.url"] - The configuration.url + * @param {webhook.method} [opts."configuration.method"] - The configuration.method + * @param {string|list} [opts."configuration.filters"] - The configuration.filters + * @param {string|list} [opts."configuration.triggers"] - + * The configuration.triggers + * @param {string} [opts."configuration.flowSid"] - The configuration.flow_sid + * @param {number} [opts."configuration.retryCount"] - + * The configuration.retry_count + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookInstance.prototype.update = function update(opts, callback) { + return this._proxy.update(opts, callback); +}; + +/* jshint ignore:start */ +/** + * remove a WebhookInstance + * + * @function remove + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookInstance.prototype.remove = function remove(callback) { + return this._proxy.remove(callback); +}; + +/* jshint ignore:start */ +/** + * Produce a plain JSON object version of the WebhookInstance for serialization. + * Removes any circular references in the object. + * + * @function toJSON + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookInstance + * @instance + * + * @returns Object + */ +/* jshint ignore:end */ +WebhookInstance.prototype.toJSON = function toJSON() { + let clone = {}; + _.forOwn(this, function(value, key) { + if (!_.startsWith(key, '_') && ! _.isFunction(value)) { + clone[key] = value; + } + }); + return clone; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookContext + * @description Initialize the WebhookContext + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {sid} serviceSid - The service_sid + * @param {sid_like} channelSid - The channel_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +WebhookContext = function WebhookContext(version, serviceSid, channelSid, sid) { + this._version = version; + + // Path Solution + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid, }; + this._uri = _.template( + '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a WebhookInstance + * + * @function fetch + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookContext.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 WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * update a WebhookInstance + * + * @function update + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookContext + * @instance + * + * @param {object|function} opts - ... + * @param {string} [opts."configuration.url"] - The configuration.url + * @param {webhook.method} [opts."configuration.method"] - The configuration.method + * @param {string|list} [opts."configuration.filters"] - The configuration.filters + * @param {string|list} [opts."configuration.triggers"] - + * The configuration.triggers + * @param {string} [opts."configuration.flowSid"] - The configuration.flow_sid + * @param {number} [opts."configuration.retryCount"] - + * The configuration.retry_count + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookContext.prototype.update = function update(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'Configuration.Url': _.get(opts, '"configuration.url"'), + 'Configuration.Method': _.get(opts, '"configuration.method"'), + 'Configuration.Filters': serialize.map(_.get(opts, '"configuration.filters"'), function(e) { return e; }), + 'Configuration.Triggers': serialize.map(_.get(opts, '"configuration.triggers"'), function(e) { return e; }), + 'Configuration.FlowSid': _.get(opts, '"configuration.flowSid"'), + 'Configuration.RetryCount': _.get(opts, '"configuration.retryCount"') + }); + + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); + + promise = promise.then(function(payload) { + deferred.resolve(new WebhookInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.channelSid, + this._solution.sid + )); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +/* jshint ignore:start */ +/** + * remove a WebhookInstance + * + * @function remove + * @memberof Twilio.IpMessaging.V2.ServiceContext.ChannelContext.WebhookContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed WebhookInstance + */ +/* jshint ignore:end */ +WebhookContext.prototype.remove = function remove(callback) { + var deferred = Q.defer(); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); + + promise = promise.then(function(payload) { + deferred.resolve(payload); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; +}; + +module.exports = { + WebhookList: WebhookList, + WebhookPage: WebhookPage, + WebhookInstance: WebhookInstance, + WebhookContext: WebhookContext +}; diff --git a/lib/rest/ipMessaging/v2/service/role.js b/lib/rest/ipMessaging/v2/service/role.js index 91f3806a55..72fc2ee4e7 100644 --- a/lib/rest/ipMessaging/v2/service/role.js +++ b/lib/rest/ipMessaging/v2/service/role.js @@ -28,7 +28,7 @@ var RoleContext; * @description Initialize the RoleList * * @param {Twilio.IpMessaging.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this role belongs to. */ /* jshint ignore:end */ RoleList = function RoleList(version, serviceSid) { @@ -62,9 +62,9 @@ RoleList = function RoleList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.friendlyName - The friendly_name - * @param {role.role_type} opts.type - The type - * @param {string|list} opts.permission - The permission + * @param {string} opts.friendlyName - The human-readable name of this role. + * @param {role.role_type} opts.type - What kind of role this is. + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -416,15 +416,20 @@ RolePage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceContext.RoleInstance * @description Initialize the RoleContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} friendlyName - The friendly_name - * @property {role.role_type} type - The type - * @property {string} permissions - The permissions - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this role. + * @property {string} serviceSid - + * The unique id of the Service this role belongs to. + * @property {string} friendlyName - The human-readable name of this role. + * @property {role.role_type} type - What kind of role this is. + * @property {string} permissions - A JSON array of the permissions this role has. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. + * @property {string} url - An absolute URL for this role. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -505,7 +510,7 @@ RoleInstance.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance @@ -636,7 +641,7 @@ RoleContext.prototype.remove = function remove(callback) { * @instance * * @param {object} opts - ... - * @param {string|list} opts.permission - The permission + * @param {string|list} opts.permission - A permission this role should have. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RoleInstance diff --git a/lib/rest/ipMessaging/v2/service/user.js b/lib/rest/ipMessaging/v2/service/user.js index c2ba6a5680..14f1406559 100644 --- a/lib/rest/ipMessaging/v2/service/user.js +++ b/lib/rest/ipMessaging/v2/service/user.js @@ -29,7 +29,7 @@ var UserContext; * @description Initialize the UserList * * @param {Twilio.IpMessaging.V2} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The unique id of the Service this user belongs to. */ /* jshint ignore:end */ UserList = function UserList(version, serviceSid) { @@ -63,10 +63,14 @@ UserList = function UserList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} opts.identity - + * A unique string that identifies the user within this service - often a username or email address. + * @param {string} [opts.roleSid] - + * The unique id of the Role assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -413,20 +417,31 @@ UserPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.IpMessaging.V2.ServiceContext.UserInstance * @description Initialize the UserContext * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {string} attributes - The attributes - * @property {string} friendlyName - The friendly_name - * @property {string} roleSid - The role_sid - * @property {string} identity - The identity - * @property {boolean} isOnline - The is_online - * @property {boolean} isNotifiable - The is_notifiable - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {number} joinedChannelsCount - The joined_channels_count + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account responsible for this user. + * @property {string} serviceSid - + * The unique id of the Service this user belongs to. + * @property {string} attributes - + * An optional string metadata field you can use to store any data you wish. + * @property {string} friendlyName - The human-readable name of this user. + * @property {string} roleSid - + * The unique id of the [Role][role] assigned to this user. + * @property {string} identity - + * A unique string that identifies the user within this service - often a username or email address. + * @property {boolean} isOnline - + * Indicates whether the User is actively connected to the Service instance and online. + * @property {boolean} isNotifiable - + * Indicates whether the User has a potentially valid Push Notification registration for the Service instance. + * @property {Date} dateCreated - + * The date that this resource was created in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated in ISO 8601 format. + * @property {number} joinedChannelsCount - + * The number of Channels this User is a Member of. * @property {string} links - The links - * @property {string} url - The url + * @property {string} url - An absolute URL for this user. * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {object} payload - The instance payload @@ -512,9 +527,12 @@ UserInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance @@ -684,9 +702,12 @@ UserContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.roleSid] - The role_sid - * @param {string} [opts.attributes] - The attributes - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.roleSid] - + * The unique id of the [Role][role] assigned to this user. + * @param {string} [opts.attributes] - + * An optional string used to contain any metadata or other information for the User. + * @param {string} [opts.friendlyName] - + * An optional human readable string representing the user. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed UserInstance diff --git a/lib/rest/ipMessaging/v2/service/user/userChannel.js b/lib/rest/ipMessaging/v2/service/user/userChannel.js index c379df1311..a79cf01023 100644 --- a/lib/rest/ipMessaging/v2/service/user/userChannel.js +++ b/lib/rest/ipMessaging/v2/service/user/userChannel.js @@ -27,7 +27,8 @@ var UserChannelInstance; * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {string} serviceSid - The service_sid - * @param {string} userSid - The sid + * @param {string} userSid - + * A 34 character string that uniquely identifies this resource. */ /* jshint ignore:end */ UserChannelList = function UserChannelList(version, serviceSid, userSid) { diff --git a/lib/rest/lookups/V1.d.ts b/lib/rest/lookups/V1.d.ts new file mode 100644 index 0000000000..902b5f1810 --- /dev/null +++ b/lib/rest/lookups/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { PhoneNumberListInstance } from './v1/phoneNumber'; + + +/** + * Initialize the V1 version of Lookups + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Lookups + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly phoneNumbers: PhoneNumberListInstance; +} + +export = V1; diff --git a/lib/rest/messaging/V1.d.ts b/lib/rest/messaging/V1.d.ts new file mode 100644 index 0000000000..f0259fba4b --- /dev/null +++ b/lib/rest/messaging/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ServiceListInstance } from './v1/service'; + + +/** + * Initialize the V1 version of Messaging + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Messaging + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly services: ServiceListInstance; +} + +export = V1; diff --git a/lib/rest/messaging/v1/service/shortCode.js b/lib/rest/messaging/v1/service/shortCode.js index 662e356668..21991e89ec 100644 --- a/lib/rest/messaging/v1/service/shortCode.js +++ b/lib/rest/messaging/v1/service/shortCode.js @@ -28,7 +28,7 @@ var ShortCodeContext; * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Messaging.V1} version - Version of the resource - * @param {string} serviceSid - The service_sid + * @param {string} serviceSid - The 34 character unique sid of the Service. */ /* jshint ignore:end */ ShortCodeList = function ShortCodeList(version, serviceSid) { @@ -62,7 +62,8 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.shortCodeSid - The short_code_sid + * @param {string} opts.shortCodeSid - + * ShortCodeSid for the Shortcode being added to the Service. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ShortCodeInstance @@ -406,14 +407,15 @@ ShortCodePage.prototype.getInstance = function getInstance(payload) { * @description Initialize the ShortCodeContext * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} serviceSid - The service_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} shortCode - The short_code - * @property {string} countryCode - The country_code - * @property {string} capabilities - The capabilities + * @property {string} sid - The 34 character unique sid of the Short Code + * @property {string} accountSid - The 34 character unique sid of the Account. + * @property {string} serviceSid - The 34 character unique sid of the Service. + * @property {Date} dateCreated - he date that this resource was created. + * @property {Date} dateUpdated - The date that this resource was last updated. + * @property {string} shortCode - The E.164 format of the short code. + * @property {string} countryCode - The 2 character ISO Country Code of the number. + * @property {string} capabilities - + * Any array of values that indicate whether the number can receive calls or messages. * @property {string} url - The url * * @param {Twilio.Messaging.V1} version - Version of the resource diff --git a/lib/rest/monitor/V1.d.ts b/lib/rest/monitor/V1.d.ts new file mode 100644 index 0000000000..047d506aac --- /dev/null +++ b/lib/rest/monitor/V1.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { AlertListInstance } from './v1/alert'; +import { EventListInstance } from './v1/event'; + + +/** + * Initialize the V1 version of Monitor + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Monitor + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly alerts: AlertListInstance; + readonly events: EventListInstance; +} + +export = V1; diff --git a/lib/rest/monitor/v1/event.js b/lib/rest/monitor/v1/event.js index 1487cb69f1..edfacbdcca 100644 --- a/lib/rest/monitor/v1/event.js +++ b/lib/rest/monitor/v1/event.js @@ -255,8 +255,8 @@ EventList = function EventList(version) { 'EventType': _.get(opts, 'eventType'), 'ResourceSid': _.get(opts, 'resourceSid'), 'SourceIpAddress': _.get(opts, 'sourceIpAddress'), - 'StartDate': serialize.iso8601Date(_.get(opts, 'startDate')), - 'EndDate': serialize.iso8601Date(_.get(opts, 'endDate')), + 'StartDate': serialize.iso8601DateTime(_.get(opts, 'startDate')), + 'EndDate': serialize.iso8601DateTime(_.get(opts, 'endDate')), 'PageToken': opts.pageToken, 'Page': opts.pageNumber, 'PageSize': opts.pageSize @@ -392,14 +392,17 @@ EventPage.prototype.getInstance = function getInstance(payload) { * @property {string} accountSid - The account_sid * @property {string} actorSid - The actor_sid * @property {string} actorType - The actor_type - * @property {string} description - The description + * @property {string} description - + * A human-readable description of the event. May be null. * @property {string} eventData - The event_data * @property {Date} eventDate - The event_date * @property {string} eventType - The event_type * @property {string} resourceSid - The resource_sid * @property {string} resourceType - The resource_type - * @property {string} sid - The sid - * @property {string} source - The source + * @property {string} sid - + * A 34 character string that uniquely identifies this event. + * @property {string} source - + * The originating system or interface that caused the event. web for events caused by user action in the Twilio Console. api for events caused through a request to the REST API. twilio for events caused by an automated or internal Twilio system. * @property {string} sourceIpAddress - The source_ip_address * @property {string} url - The url * @property {string} links - The links diff --git a/lib/rest/notify/V1.d.ts b/lib/rest/notify/V1.d.ts new file mode 100644 index 0000000000..fb93790c99 --- /dev/null +++ b/lib/rest/notify/V1.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CredentialListInstance } from './v1/credential'; +import { ServiceListInstance } from './v1/service'; + + +/** + * Initialize the V1 version of Notify + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Notify + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly credentials: CredentialListInstance; + readonly services: ServiceListInstance; +} + +export = V1; diff --git a/lib/rest/notify/v1/credential.js b/lib/rest/notify/v1/credential.js index b532d1554e..45fc5ca097 100644 --- a/lib/rest/notify/v1/credential.js +++ b/lib/rest/notify/v1/credential.js @@ -298,13 +298,19 @@ CredentialList = function CredentialList(version) { * @instance * * @param {object} opts - ... - * @param {credential.push_service} opts.type - The type - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {credential.push_service} opts.type - + * Credential type, one of "gcm", "fcm", or "apn" + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -417,9 +423,11 @@ CredentialPage.prototype.getInstance = function getInstance(payload) { * * @property {string} sid - The sid * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {credential.push_service} type - The type - * @property {string} sandbox - The sandbox + * @property {string} friendlyName - Friendly name for stored credential + * @property {credential.push_service} type - + * Credential type, one of "gcm", "fcm", or "apn" + * @property {string} sandbox - + * [APN only] use this credential for sending to production or sandbox APNs * @property {Date} dateCreated - The date_created * @property {Date} dateUpdated - The date_updated * @property {string} url - The url @@ -484,12 +492,17 @@ CredentialInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance @@ -600,12 +613,17 @@ CredentialContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.certificate] - The certificate - * @param {string} [opts.privateKey] - The private_key - * @param {boolean} [opts.sandbox] - The sandbox - * @param {string} [opts.apiKey] - The api_key - * @param {string} [opts.secret] - The secret + * @param {string} [opts.friendlyName] - Friendly name for stored credential + * @param {string} [opts.certificate] - + * [APN only] URL encoded representation of the certificate. + * @param {string} [opts.privateKey] - + * [APN only] URL encoded representation of the private key. + * @param {boolean} [opts.sandbox] - + * [APN only] use this credential for sending to production or sandbox APNs + * @param {string} [opts.apiKey] - + * [GCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. + * @param {string} [opts.secret] - + * [FCM only] This is the "Server key" of your project from Firebase console under Settings / Cloud messaging. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CredentialInstance diff --git a/lib/rest/notify/v1/service.js b/lib/rest/notify/v1/service.js index 90a54ccbec..e45f2b5db1 100644 --- a/lib/rest/notify/v1/service.js +++ b/lib/rest/notify/v1/service.js @@ -66,18 +66,24 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.apnCredentialSid] - The apn_credential_sid - * @param {string} [opts.gcmCredentialSid] - The gcm_credential_sid - * @param {string} [opts.messagingServiceSid] - The messaging_service_sid - * @param {string} [opts.facebookMessengerPageId] - The facebook_messenger_page_id + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance + * @param {string} [opts.apnCredentialSid] - + * The SID of the Credential to be used for APN Bindings. + * @param {string} [opts.gcmCredentialSid] - + * The SID of the Credential to be used for GCM Bindings. + * @param {string} [opts.messagingServiceSid] - + * The SID of the Messaging Service to be used for SMS Bindings. + * @param {string} [opts.facebookMessengerPageId] - + * The Page ID to be used to send for Facebook Messenger Bindings. * @param {string} [opts.defaultApnNotificationProtocolVersion] - - * The default_apn_notification_protocol_version + * The version of the protocol to be used for sending APNS notifications. * @param {string} [opts.defaultGcmNotificationProtocolVersion] - - * The default_gcm_notification_protocol_version - * @param {string} [opts.fcmCredentialSid] - The fcm_credential_sid + * The version of the protocol to be used for sending GCM notifications. + * @param {string} [opts.fcmCredentialSid] - + * The SID of the Credential to be used for FCM Bindings. * @param {string} [opts.defaultFcmNotificationProtocolVersion] - - * The default_fcm_notification_protocol_version + * The version of the protocol to be used for sending FCM notifications. * @param {boolean} [opts.logEnabled] - The log_enabled * @param {string} [opts.alexaSkillId] - The alexa_skill_id * @param {string} [opts.defaultAlexaNotificationProtocolVersion] - @@ -143,7 +149,7 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - Filter services by FriendlyName * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -232,7 +238,7 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - Filter services by FriendlyName * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -292,7 +298,7 @@ ServiceList = function ServiceList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - Filter services by FriendlyName * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -345,7 +351,7 @@ ServiceList = function ServiceList(version) { * @memberof Twilio.Notify.V1.ServiceList * @instance * - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.friendlyName] - Filter services by FriendlyName * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -443,20 +449,25 @@ ServicePage.prototype.getInstance = function getInstance(payload) { * * @property {string} sid - The sid * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name + * @property {string} friendlyName - Human-readable name for this service instance * @property {Date} dateCreated - The date_created * @property {Date} dateUpdated - The date_updated - * @property {string} apnCredentialSid - The apn_credential_sid - * @property {string} gcmCredentialSid - The gcm_credential_sid - * @property {string} fcmCredentialSid - The fcm_credential_sid - * @property {string} messagingServiceSid - The messaging_service_sid - * @property {string} facebookMessengerPageId - The facebook_messenger_page_id + * @property {string} apnCredentialSid - + * The SID of the Credential to be used for APN Bindings. + * @property {string} gcmCredentialSid - + * The SID of the Credential to be used for GCM Bindings. + * @property {string} fcmCredentialSid - + * The SID of the Credential to be used for FCM Bindings. + * @property {string} messagingServiceSid - + * The SID of the Messaging Service to be used for SMS Bindings. + * @property {string} facebookMessengerPageId - + * The Page ID to be used to send for Facebook Messenger Bindings. * @property {string} defaultApnNotificationProtocolVersion - - * The default_apn_notification_protocol_version + * The version of the protocol to be used for sending APNS notifications. * @property {string} defaultGcmNotificationProtocolVersion - - * The default_gcm_notification_protocol_version + * The version of the protocol to be used for sending GCM notifications. * @property {string} defaultFcmNotificationProtocolVersion - - * The default_fcm_notification_protocol_version + * The version of the protocol to be used for sending FCM notifications. * @property {boolean} logEnabled - The log_enabled * @property {string} url - The url * @property {string} links - The links @@ -551,18 +562,24 @@ ServiceInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.apnCredentialSid] - The apn_credential_sid - * @param {string} [opts.gcmCredentialSid] - The gcm_credential_sid - * @param {string} [opts.messagingServiceSid] - The messaging_service_sid - * @param {string} [opts.facebookMessengerPageId] - The facebook_messenger_page_id + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance + * @param {string} [opts.apnCredentialSid] - + * The SID of the default Credential to be used for APN Bindings + * @param {string} [opts.gcmCredentialSid] - + * The SID of the default Credential to be used for GCM Bindings + * @param {string} [opts.messagingServiceSid] - + * The SID of the Messaging Service to be used for SMS Bindings. + * @param {string} [opts.facebookMessengerPageId] - + * The Page ID to be used to send for Facebook Messenger Bindings. * @param {string} [opts.defaultApnNotificationProtocolVersion] - - * The default_apn_notification_protocol_version + * The version of the protocol to be used for sending APNS notifications. * @param {string} [opts.defaultGcmNotificationProtocolVersion] - - * The default_gcm_notification_protocol_version - * @param {string} [opts.fcmCredentialSid] - The fcm_credential_sid + * The version of the protocol to be used for sending GCM notifications. + * @param {string} [opts.fcmCredentialSid] - + * The SID of the default Credential to be used for FCM Bindings * @param {string} [opts.defaultFcmNotificationProtocolVersion] - - * The default_fcm_notification_protocol_version + * The version of the protocol to be used for sending FCM notifications. * @param {boolean} [opts.logEnabled] - The log_enabled * @param {string} [opts.alexaSkillId] - The alexa_skill_id * @param {string} [opts.defaultAlexaNotificationProtocolVersion] - @@ -766,18 +783,24 @@ ServiceContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.apnCredentialSid] - The apn_credential_sid - * @param {string} [opts.gcmCredentialSid] - The gcm_credential_sid - * @param {string} [opts.messagingServiceSid] - The messaging_service_sid - * @param {string} [opts.facebookMessengerPageId] - The facebook_messenger_page_id + * @param {string} [opts.friendlyName] - + * Human-readable name for this service instance + * @param {string} [opts.apnCredentialSid] - + * The SID of the default Credential to be used for APN Bindings + * @param {string} [opts.gcmCredentialSid] - + * The SID of the default Credential to be used for GCM Bindings + * @param {string} [opts.messagingServiceSid] - + * The SID of the Messaging Service to be used for SMS Bindings. + * @param {string} [opts.facebookMessengerPageId] - + * The Page ID to be used to send for Facebook Messenger Bindings. * @param {string} [opts.defaultApnNotificationProtocolVersion] - - * The default_apn_notification_protocol_version + * The version of the protocol to be used for sending APNS notifications. * @param {string} [opts.defaultGcmNotificationProtocolVersion] - - * The default_gcm_notification_protocol_version - * @param {string} [opts.fcmCredentialSid] - The fcm_credential_sid + * The version of the protocol to be used for sending GCM notifications. + * @param {string} [opts.fcmCredentialSid] - + * The SID of the default Credential to be used for FCM Bindings * @param {string} [opts.defaultFcmNotificationProtocolVersion] - - * The default_fcm_notification_protocol_version + * The version of the protocol to be used for sending FCM notifications. * @param {boolean} [opts.logEnabled] - The log_enabled * @param {string} [opts.alexaSkillId] - The alexa_skill_id * @param {string} [opts.defaultAlexaNotificationProtocolVersion] - diff --git a/lib/rest/notify/v1/service/binding.js b/lib/rest/notify/v1/service/binding.js index 314cb32b5c..0c29a6575d 100644 --- a/lib/rest/notify/v1/service/binding.js +++ b/lib/rest/notify/v1/service/binding.js @@ -63,14 +63,15 @@ BindingList = function BindingList(version, serviceSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.identity - The identity - * @param {binding.binding_type} opts.bindingType - The binding_type - * @param {string} opts.address - The address - * @param {string|list} [opts.tag] - The tag + * @param {string} opts.identity - The Identity to which this Binding belongs to. + * @param {binding.binding_type} opts.bindingType - The type of the Binding. + * @param {string} opts.address - The address specific to the channel. + * @param {string|list} [opts.tag] - The list of tags associated with this Binding. * @param {string} [opts.notificationProtocolVersion] - - * The notification_protocol_version - * @param {string} [opts.credentialSid] - The credential_sid - * @param {string} [opts.endpoint] - The endpoint + * The version of the protocol used to send the notification. + * @param {string} [opts.credentialSid] - + * The unique identifier of the Credential resource to be used to send notifications to this Binding. + * @param {string} [opts.endpoint] - DEPRECATED* * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed BindingInstance @@ -139,10 +140,14 @@ BindingList = function BindingList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {Date} [opts.startDate] - The start_date - * @param {Date} [opts.endDate] - The end_date - * @param {string|list} [opts.identity] - The identity - * @param {string|list} [opts.tag] - The tag + * @param {Date} [opts.startDate] - + * Only list Bindings created on or after the given date. + * @param {Date} [opts.endDate] - + * Only list Bindings created on or before the given date. + * @param {string|list} [opts.identity] - + * Only list Bindings that have any of the specified Identities. + * @param {string|list} [opts.tag] - + * Only list Bindings that have all of the specified Tags. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -231,10 +236,14 @@ BindingList = function BindingList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {Date} [opts.startDate] - The start_date - * @param {Date} [opts.endDate] - The end_date - * @param {string|list} [opts.identity] - The identity - * @param {string|list} [opts.tag] - The tag + * @param {Date} [opts.startDate] - + * Only list Bindings created on or after the given date. + * @param {Date} [opts.endDate] - + * Only list Bindings created on or before the given date. + * @param {string|list} [opts.identity] - + * Only list Bindings that have any of the specified Identities. + * @param {string|list} [opts.tag] - + * Only list Bindings that have all of the specified Tags. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -294,10 +303,14 @@ BindingList = function BindingList(version, serviceSid) { * @instance * * @param {object|function} opts - ... - * @param {Date} [opts.startDate] - The start_date - * @param {Date} [opts.endDate] - The end_date - * @param {string|list} [opts.identity] - The identity - * @param {string|list} [opts.tag] - The tag + * @param {Date} [opts.startDate] - + * Only list Bindings created on or after the given date. + * @param {Date} [opts.endDate] - + * Only list Bindings created on or before the given date. + * @param {string|list} [opts.identity] - + * Only list Bindings that have any of the specified Identities. + * @param {string|list} [opts.tag] - + * Only list Bindings that have all of the specified Tags. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -353,10 +366,14 @@ BindingList = function BindingList(version, serviceSid) { * @memberof Twilio.Notify.V1.ServiceContext.BindingList * @instance * - * @param {Date} [opts.startDate] - The start_date - * @param {Date} [opts.endDate] - The end_date - * @param {string|list} [opts.identity] - The identity - * @param {string|list} [opts.tag] - The tag + * @param {Date} [opts.startDate] - + * Only list Bindings created on or after the given date. + * @param {Date} [opts.endDate] - + * Only list Bindings created on or before the given date. + * @param {string|list} [opts.identity] - + * Only list Bindings that have any of the specified Identities. + * @param {string|list} [opts.tag] - + * Only list Bindings that have all of the specified Tags. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -455,16 +472,17 @@ BindingPage.prototype.getInstance = function getInstance(payload) { * @property {string} sid - The sid * @property {string} accountSid - The account_sid * @property {string} serviceSid - The service_sid - * @property {string} credentialSid - The credential_sid + * @property {string} credentialSid - + * The unique identifier of the Credential resource to be used to send notifications to this Binding. * @property {Date} dateCreated - The date_created * @property {Date} dateUpdated - The date_updated * @property {string} notificationProtocolVersion - - * The notification_protocol_version - * @property {string} endpoint - The endpoint - * @property {string} identity - The identity - * @property {string} bindingType - The binding_type - * @property {string} address - The address - * @property {string} tags - The tags + * The version of the protocol used to send the notification. + * @property {string} endpoint - DEPRECATED* + * @property {string} identity - The Identity to which this Binding belongs to. + * @property {string} bindingType - The type of the Binding. + * @property {string} address - The address specific to the channel. + * @property {string} tags - The list of tags associated with this Binding. * @property {string} url - The url * @property {string} links - The links * diff --git a/lib/rest/notify/v1/service/notification.js b/lib/rest/notify/v1/service/notification.js index 72707d5d8e..41ba5f1080 100644 --- a/lib/rest/notify/v1/service/notification.js +++ b/lib/rest/notify/v1/service/notification.js @@ -63,23 +63,35 @@ NotificationList = function NotificationList(version, serviceSid) { * * @param {object|function} opts - ... * @param {string} opts.serviceSid - The service_sid - * @param {string} [opts.body] - The body - * @param {notification.priority} [opts.priority] - The priority - * @param {number} [opts.ttl] - The ttl - * @param {string} [opts.title] - The title - * @param {string} [opts.sound] - The sound - * @param {string} [opts.action] - The action - * @param {string} [opts.data] - The data - * @param {string} [opts.apn] - The apn - * @param {string} [opts.gcm] - The gcm - * @param {string} [opts.sms] - The sms - * @param {string} [opts.facebookMessenger] - The facebook_messenger - * @param {string} [opts.fcm] - The fcm + * @param {string} [opts.body] - Indicates the notification body text. + * @param {notification.priority} [opts.priority] - + * Two priorities defined: low and high. + * @param {number} [opts.ttl] - + * This parameter specifies how long the notification is valid. + * @param {string} [opts.title] - Indicates the notification title. + * @param {string} [opts.sound] - Indicates a sound to be played. + * @param {string} [opts.action] - + * Specifies the actions to be displayed for the notification. + * @param {string} [opts.data] - + * This parameter specifies the custom key-value pairs of the notification’s payload. + * @param {string} [opts.apn] - + * APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType. + * @param {string} [opts.gcm] - + * GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType. + * @param {string} [opts.sms] - + * SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType. + * @param {string} [opts.facebookMessenger] - + * Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType. + * @param {string} [opts.fcm] - + * FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType. * @param {string|list} [opts.segment] - The segment * @param {string} [opts.alexa] - The alexa - * @param {string|list} [opts.toBinding] - The to_binding - * @param {string|list} [opts.identity] - The identity - * @param {string|list} [opts.tag] - The tag + * @param {string|list} [opts.toBinding] - + * The destination address in a JSON object. + * @param {string|list} [opts.identity] - + * Delivery will be attempted only to Bindings with an Identity in this list. + * @param {string|list} [opts.tag] - + * Delivery will be attempted only to Bindings that have all of the Tags in this list. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed NotificationInstance @@ -186,21 +198,30 @@ NotificationPage.prototype.getInstance = function getInstance(payload) { * @property {string} accountSid - The account_sid * @property {string} serviceSid - The service_sid * @property {Date} dateCreated - The date_created - * @property {string} identities - The identities - * @property {string} tags - The tags + * @property {string} identities - List of Identities. + * @property {string} tags - List of Tags * @property {string} segments - The segments - * @property {notification.priority} priority - The priority - * @property {number} ttl - The ttl - * @property {string} title - The title - * @property {string} body - The body - * @property {string} sound - The sound - * @property {string} action - The action - * @property {string} data - The data - * @property {string} apn - The apn - * @property {string} gcm - The gcm - * @property {string} fcm - The fcm - * @property {string} sms - The sms - * @property {string} facebookMessenger - The facebook_messenger + * @property {notification.priority} priority - + * Two priorities defined: low and high. + * @property {number} ttl - + * This parameter specifies how long the notification is valid. + * @property {string} title - Indicates the notification title. + * @property {string} body - Indicates the notification body text. + * @property {string} sound - Indicates a sound to be played. + * @property {string} action - + * Specifies the actions to be displayed for the notification. + * @property {string} data - + * This parameter specifies the custom key-value pairs of the notification’s payload. + * @property {string} apn - + * APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType. + * @property {string} gcm - + * GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType. + * @property {string} fcm - + * FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType. + * @property {string} sms - + * SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType. + * @property {string} facebookMessenger - + * Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType. * @property {string} alexa - The alexa * * @param {Twilio.Notify.V1} version - Version of the resource diff --git a/lib/rest/preview/AccSecurity.d.ts b/lib/rest/preview/AccSecurity.d.ts new file mode 100644 index 0000000000..1a9a265b01 --- /dev/null +++ b/lib/rest/preview/AccSecurity.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ServiceListInstance } from './acc_security/service'; + + +/** + * Initialize the AccSecurity version of Preview + */ +declare class AccSecurity extends Version { + /** + * Initialize the AccSecurity version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly services: ServiceListInstance; +} + +export = AccSecurity; diff --git a/lib/rest/preview/BulkExports.d.ts b/lib/rest/preview/BulkExports.d.ts new file mode 100644 index 0000000000..14bc6d661f --- /dev/null +++ b/lib/rest/preview/BulkExports.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ExportConfigurationListInstance } from './bulk_exports/exportConfiguration'; +import { ExportListInstance } from './bulk_exports/export'; + + +/** + * Initialize the BulkExports version of Preview + */ +declare class BulkExports extends Version { + /** + * Initialize the BulkExports version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly exportConfiguration: ExportConfigurationListInstance; + readonly exports: ExportListInstance; +} + +export = BulkExports; diff --git a/lib/rest/preview/DeployedDevices.d.ts b/lib/rest/preview/DeployedDevices.d.ts new file mode 100644 index 0000000000..1618d53d66 --- /dev/null +++ b/lib/rest/preview/DeployedDevices.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { FleetListInstance } from './deployed_devices/fleet'; + + +/** + * Initialize the DeployedDevices version of Preview + */ +declare class DeployedDevices extends Version { + /** + * Initialize the DeployedDevices version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly fleets: FleetListInstance; +} + +export = DeployedDevices; diff --git a/lib/rest/preview/HostedNumbers.d.ts b/lib/rest/preview/HostedNumbers.d.ts new file mode 100644 index 0000000000..327a695cd8 --- /dev/null +++ b/lib/rest/preview/HostedNumbers.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { AuthorizationDocumentListInstance } from './hosted_numbers/authorizationDocument'; +import { HostedNumberOrderListInstance } from './hosted_numbers/hostedNumberOrder'; + + +/** + * Initialize the HostedNumbers version of Preview + */ +declare class HostedNumbers extends Version { + /** + * Initialize the HostedNumbers version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly authorizationDocuments: AuthorizationDocumentListInstance; + readonly hostedNumberOrders: HostedNumberOrderListInstance; +} + +export = HostedNumbers; diff --git a/lib/rest/preview/Marketplace.d.ts b/lib/rest/preview/Marketplace.d.ts new file mode 100644 index 0000000000..8560e1c304 --- /dev/null +++ b/lib/rest/preview/Marketplace.d.ts @@ -0,0 +1,28 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { AvailableAddOnListInstance } from './marketplace/availableAddOn'; +import { InstalledAddOnListInstance } from './marketplace/installedAddOn'; + + +/** + * Initialize the Marketplace version of Preview + */ +declare class Marketplace extends Version { + /** + * Initialize the Marketplace version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly availableAddOns: AvailableAddOnListInstance; + readonly installedAddOns: InstalledAddOnListInstance; +} + +export = Marketplace; diff --git a/lib/rest/preview/Marketplace.js b/lib/rest/preview/Marketplace.js index 58fb2a01e7..119a0ed791 100644 --- a/lib/rest/preview/Marketplace.js +++ b/lib/rest/preview/Marketplace.js @@ -23,10 +23,10 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * * @constructor Twilio.Preview.Marketplace * - * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - - * availableAddOns resource * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns - * installedAddOns resource + * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - + * availableAddOns resource * * @param {Twilio.Preview} domain - The twilio domain */ @@ -35,26 +35,26 @@ function Marketplace(domain) { Version.prototype.constructor.call(this, domain, 'marketplace'); // Resources - this._availableAddOns = undefined; this._installedAddOns = undefined; + this._availableAddOns = undefined; } _.extend(Marketplace.prototype, Version.prototype); Marketplace.prototype.constructor = Marketplace; Object.defineProperty(Marketplace.prototype, - 'availableAddOns', { + 'installedAddOns', { get: function() { - this._availableAddOns = this._availableAddOns || new AvailableAddOnList(this); - return this._availableAddOns; + this._installedAddOns = this._installedAddOns || new InstalledAddOnList(this); + return this._installedAddOns; } }); Object.defineProperty(Marketplace.prototype, - 'installedAddOns', { + 'availableAddOns', { get: function() { - this._installedAddOns = this._installedAddOns || new InstalledAddOnList(this); - return this._installedAddOns; + this._availableAddOns = this._availableAddOns || new AvailableAddOnList(this); + return this._availableAddOns; } }); diff --git a/lib/rest/preview/Proxy.d.ts b/lib/rest/preview/Proxy.d.ts new file mode 100644 index 0000000000..58e1de6ca4 --- /dev/null +++ b/lib/rest/preview/Proxy.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ServiceListInstance } from './proxy/service'; + + +/** + * Initialize the Proxy version of Preview + */ +declare class Proxy extends Version { + /** + * Initialize the Proxy version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly services: ServiceListInstance; +} + +export = Proxy; diff --git a/lib/rest/preview/Studio.d.ts b/lib/rest/preview/Studio.d.ts new file mode 100644 index 0000000000..f07df3f103 --- /dev/null +++ b/lib/rest/preview/Studio.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { FlowListInstance } from './studio/flow'; + + +/** + * Initialize the Studio version of Preview + */ +declare class Studio extends Version { + /** + * Initialize the Studio version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly flows: FlowListInstance; +} + +export = Studio; diff --git a/lib/rest/preview/Sync.d.ts b/lib/rest/preview/Sync.d.ts new file mode 100644 index 0000000000..880252cf97 --- /dev/null +++ b/lib/rest/preview/Sync.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ServiceListInstance } from './sync/service'; + + +/** + * Initialize the Sync version of Preview + */ +declare class Sync extends Version { + /** + * Initialize the Sync version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly services: ServiceListInstance; +} + +export = Sync; diff --git a/lib/rest/preview/Understand.d.ts b/lib/rest/preview/Understand.d.ts new file mode 100644 index 0000000000..bee83ec387 --- /dev/null +++ b/lib/rest/preview/Understand.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { AssistantListInstance } from './understand/assistant'; + + +/** + * Initialize the Understand version of Preview + */ +declare class Understand extends Version { + /** + * Initialize the Understand version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly assistants: AssistantListInstance; +} + +export = Understand; diff --git a/lib/rest/preview/Wireless.d.ts b/lib/rest/preview/Wireless.d.ts new file mode 100644 index 0000000000..67a0c9e90d --- /dev/null +++ b/lib/rest/preview/Wireless.d.ts @@ -0,0 +1,30 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CommandListInstance } from './wireless/command'; +import { RatePlanListInstance } from './wireless/ratePlan'; +import { SimListInstance } from './wireless/sim'; + + +/** + * Initialize the Wireless version of Preview + */ +declare class Wireless extends Version { + /** + * Initialize the Wireless version of Preview + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly commands: CommandListInstance; + readonly ratePlans: RatePlanListInstance; + readonly sims: SimListInstance; +} + +export = Wireless; diff --git a/lib/rest/preview/understand/assistant.js b/lib/rest/preview/understand/assistant.js index 4919f9462d..551093cbfa 100644 --- a/lib/rest/preview/understand/assistant.js +++ b/lib/rest/preview/understand/assistant.js @@ -302,11 +302,15 @@ AssistantList = function AssistantList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {boolean} [opts.logQueries] - The log_queries + * @param {string} [opts.friendlyName] - + * A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @param {boolean} [opts.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. * @param {number} [opts.ttl] - The ttl - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.responseUrl] - The response_url + * @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 {function} [callback] - Callback to handle processed record @@ -418,18 +422,25 @@ AssistantPage.prototype.getInstance = function getInstance(payload) { * @description Initialize the AssistantContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} friendlyName - The friendly_name - * @property {string} latestModelBuildSid - The latest_model_build_sid + * @property {string} accountSid - + * The unique ID of the Account that created this Assistant. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} friendlyName - + * A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @property {string} latestModelBuildSid - + * The unique ID (Sid) of the latest model build. Null if no model has been built. * @property {string} links - The links - * @property {boolean} logQueries - The log_queries - * @property {string} sid - The sid + * @property {boolean} 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. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. * @property {number} ttl - The ttl - * @property {string} uniqueName - The unique_name + * @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 response_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 * @@ -499,11 +510,15 @@ AssistantInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {boolean} [opts.logQueries] - The log_queries + * @param {string} [opts.friendlyName] - + * A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @param {boolean} [opts.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. * @param {number} [opts.ttl] - The ttl - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.responseUrl] - The response_url + * @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 {function} [callback] - Callback to handle processed record @@ -691,11 +706,15 @@ AssistantContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {boolean} [opts.logQueries] - The log_queries + * @param {string} [opts.friendlyName] - + * A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @param {boolean} [opts.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. * @param {number} [opts.ttl] - The ttl - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.responseUrl] - The response_url + * @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 {function} [callback] - Callback to handle processed record diff --git a/lib/rest/preview/understand/assistant/fieldType.js b/lib/rest/preview/understand/assistant/fieldType.js index edf4c8452f..7c28eda0b0 100644 --- a/lib/rest/preview/understand/assistant/fieldType.js +++ b/lib/rest/preview/understand/assistant/fieldType.js @@ -29,7 +29,7 @@ var FieldTypeContext; * 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} assistantSid - The unique ID of the Assistant. */ /* jshint ignore:end */ FieldTypeList = function FieldTypeList(version, assistantSid) { @@ -299,8 +299,10 @@ FieldTypeList = function FieldTypeList(version, assistantSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.uniqueName - The unique_name - * @param {string} [opts.friendlyName] - The friendly_name + * @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.friendlyName] - + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed FieldTypeInstance @@ -411,14 +413,18 @@ FieldTypePage.prototype.getInstance = function getInstance(payload) { * @description Initialize the FieldTypeContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} friendlyName - The friendly_name + * @property {string} accountSid - + * The unique ID of the Account that created this Field Type. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} friendlyName - + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @property {string} links - The links - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid - * @property {string} uniqueName - The unique_name + * @property {string} assistantSid - The unique ID of the Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uniqueName - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @property {string} url - The url * * @param {Twilio.Preview.Understand} version - Version of the resource @@ -488,8 +494,10 @@ FieldTypeInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name + * @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.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed FieldTypeInstance @@ -627,8 +635,10 @@ FieldTypeContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name + * @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.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed FieldTypeInstance diff --git a/lib/rest/preview/understand/assistant/fieldType/fieldValue.js b/lib/rest/preview/understand/assistant/fieldType/fieldValue.js index f29172e518..8d754cb335 100644 --- a/lib/rest/preview/understand/assistant/fieldType/fieldValue.js +++ b/lib/rest/preview/understand/assistant/fieldType/fieldValue.js @@ -28,8 +28,9 @@ var FieldValueContext; * 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} fieldTypeSid - The field_type_sid + * @param {string} assistantSid - The unique ID of the Assistant. + * @param {string} fieldTypeSid - + * The unique ID of the Field Type associated with this Field Value. */ /* jshint ignore:end */ FieldValueList = function FieldValueList(version, assistantSid, fieldTypeSid) { @@ -70,7 +71,8 @@ FieldValueList = function FieldValueList(version, assistantSid, fieldTypeSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - + * An ISO language-country string of the value. For example: en-US * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -159,7 +161,8 @@ FieldValueList = function FieldValueList(version, assistantSid, fieldTypeSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - + * An ISO language-country string of the value. For example: en-US * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -219,7 +222,8 @@ FieldValueList = function FieldValueList(version, assistantSid, fieldTypeSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - + * An ISO language-country string of the value. For example: en-US * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -272,7 +276,8 @@ FieldValueList = function FieldValueList(version, assistantSid, fieldTypeSid) { * @memberof Twilio.Preview.Understand.AssistantContext.FieldTypeContext.FieldValueList * @instance * - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - + * An ISO language-country string of the value. For example: en-US * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -308,8 +313,9 @@ FieldValueList = function FieldValueList(version, assistantSid, fieldTypeSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.language - The language - * @param {string} opts.value - The value + * @param {string} opts.language - An ISO language-country string of the value. + * @param {string} opts.value - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @param {string} [opts.synonymOf] - The synonym_of * @param {function} [callback] - Callback to handle processed record * @@ -436,13 +442,16 @@ FieldValuePage.prototype.getInstance = function getInstance(payload) { * @description Initialize the FieldValueContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} fieldTypeSid - The field_type_sid - * @property {string} language - The language - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid + * @property {string} accountSid - + * The unique ID of the Account that created this Field Value. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} fieldTypeSid - + * The unique ID of the Field Type associated with this Field Value. + * @property {string} language - An ISO language-country string of the value. + * @property {string} assistantSid - The unique ID of the Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. * @property {string} value - The value * @property {string} url - The url * @property {string} synonymOf - The synonym_of diff --git a/lib/rest/preview/understand/assistant/intent.js b/lib/rest/preview/understand/assistant/intent.js index 71cd51c3e1..37b24762ba 100644 --- a/lib/rest/preview/understand/assistant/intent.js +++ b/lib/rest/preview/understand/assistant/intent.js @@ -30,7 +30,7 @@ var IntentContext; * 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} assistantSid - The unique ID of the Assistant. */ /* jshint ignore:end */ IntentList = function IntentList(version, assistantSid) { @@ -300,8 +300,10 @@ IntentList = function IntentList(version, assistantSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.uniqueName - The unique_name - * @param {string} [opts.friendlyName] - The friendly_name + * @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.friendlyName] - + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed IntentInstance @@ -412,14 +414,18 @@ IntentPage.prototype.getInstance = function getInstance(payload) { * @description Initialize the IntentContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} friendlyName - The friendly_name + * @property {string} accountSid - + * The unique ID of the Account that created this Intent. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} friendlyName - + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * @property {string} links - The links - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid - * @property {string} uniqueName - The unique_name + * @property {string} assistantSid - The unique ID of the Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uniqueName - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @property {string} url - The url * * @param {Twilio.Preview.Understand} version - Version of the resource @@ -484,8 +490,10 @@ IntentInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name + * @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.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed IntentInstance @@ -641,8 +649,10 @@ IntentContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.uniqueName] - The unique_name + * @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.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed IntentInstance diff --git a/lib/rest/preview/understand/assistant/intent/field.js b/lib/rest/preview/understand/assistant/intent/field.js index c20efb637c..2af7776db1 100644 --- a/lib/rest/preview/understand/assistant/intent/field.js +++ b/lib/rest/preview/understand/assistant/intent/field.js @@ -28,8 +28,9 @@ var FieldContext; * 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 + * @param {string} assistantSid - The unique ID of the parent Assistant. + * @param {string} intentSid - + * The unique ID of the Intent associated with this Field. */ /* jshint ignore:end */ FieldList = function FieldList(version, assistantSid, intentSid) { @@ -299,8 +300,9 @@ FieldList = function FieldList(version, assistantSid, intentSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.fieldType - The field_type - * @param {string} opts.uniqueName - The unique_name + * @param {string} opts.fieldType - The unique name or sid of the FieldType + * @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 {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed FieldInstance @@ -420,14 +422,19 @@ FieldPage.prototype.getInstance = function getInstance(payload) { * @description Initialize the FieldContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} fieldType - The field_type - * @property {string} intentSid - The intent_sid - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid - * @property {string} uniqueName - The unique_name + * @property {string} accountSid - + * The unique ID of the Account that created this Field. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} fieldType - + * The Field Type of this field. Can be the Field Type unique_name or the Field Type sid. + * @property {string} intentSid - + * The unique ID of the Intent associated with this Field. + * @property {string} assistantSid - The unique ID of the parent Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uniqueName - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @property {string} url - The url * * @param {Twilio.Preview.Understand} version - Version of the resource diff --git a/lib/rest/preview/understand/assistant/intent/sample.js b/lib/rest/preview/understand/assistant/intent/sample.js index 12c8230382..4e3cc56b69 100644 --- a/lib/rest/preview/understand/assistant/intent/sample.js +++ b/lib/rest/preview/understand/assistant/intent/sample.js @@ -28,8 +28,9 @@ var SampleContext; * 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 + * @param {string} assistantSid - The unique ID of the Assistant. + * @param {string} intentSid - + * The unique ID of the Intent associated with this Sample. */ /* jshint ignore:end */ SampleList = function SampleList(version, assistantSid, intentSid) { @@ -70,7 +71,7 @@ SampleList = function SampleList(version, assistantSid, intentSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - An ISO language-country string of the sample. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -159,7 +160,7 @@ SampleList = function SampleList(version, assistantSid, intentSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - An ISO language-country string of the sample. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -219,7 +220,7 @@ SampleList = function SampleList(version, assistantSid, intentSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - An ISO language-country string of the sample. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -272,7 +273,7 @@ SampleList = function SampleList(version, assistantSid, intentSid) { * @memberof Twilio.Preview.Understand.AssistantContext.IntentContext.SampleList * @instance * - * @param {string} [opts.language] - The language + * @param {string} [opts.language] - An ISO language-country string of the sample. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -308,9 +309,11 @@ SampleList = function SampleList(version, assistantSid, intentSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.language - The language - * @param {string} opts.taggedText - The tagged_text - * @param {string} [opts.sourceChannel] - The source_channel + * @param {string} opts.language - An ISO language-country string of the sample. + * @param {string} opts.taggedText - + * The text example of how end-users may express this intent. The sample may contain Field tag blocks. + * @param {string} [opts.sourceChannel] - + * The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SampleInstance @@ -431,16 +434,21 @@ SamplePage.prototype.getInstance = function getInstance(payload) { * @description Initialize the SampleContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} intentSid - The intent_sid - * @property {string} language - The language - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid - * @property {string} taggedText - The tagged_text + * @property {string} accountSid - + * The unique ID of the Account that created this Sample. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} intentSid - + * The unique ID of the Intent associated with this Sample. + * @property {string} language - An ISO language-country string of the sample. + * @property {string} assistantSid - The unique ID of the Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} taggedText - + * The text example of how end-users may express this intent. The sample may contain Field tag blocks. * @property {string} url - The url - * @property {string} sourceChannel - The source_channel + * @property {string} sourceChannel - + * The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null * * @param {Twilio.Preview.Understand} version - Version of the resource * @param {object} payload - The instance payload @@ -512,9 +520,11 @@ SampleInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language - * @param {string} [opts.taggedText] - The tagged_text - * @param {string} [opts.sourceChannel] - The source_channel + * @param {string} [opts.language] - An ISO language-country string of the sample. + * @param {string} [opts.taggedText] - + * The text example of how end-users may express this intent. The sample may contain Field tag blocks. + * @param {string} [opts.sourceChannel] - + * The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SampleInstance @@ -633,9 +643,11 @@ SampleContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language - * @param {string} [opts.taggedText] - The tagged_text - * @param {string} [opts.sourceChannel] - The source_channel + * @param {string} [opts.language] - An ISO language-country string of the sample. + * @param {string} [opts.taggedText] - + * The text example of how end-users may express this intent. The sample may contain Field tag blocks. + * @param {string} [opts.sourceChannel] - + * The communication channel the sample was captured. It can be: voice, sms, chat, alexa, google-assistant, or slack. If not included the value will be null * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SampleInstance diff --git a/lib/rest/preview/understand/assistant/modelBuild.js b/lib/rest/preview/understand/assistant/modelBuild.js index 7f42805051..4e380e0434 100644 --- a/lib/rest/preview/understand/assistant/modelBuild.js +++ b/lib/rest/preview/understand/assistant/modelBuild.js @@ -28,7 +28,7 @@ var ModelBuildContext; * 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} assistantSid - The unique ID of the parent Assistant. */ /* jshint ignore:end */ ModelBuildList = function ModelBuildList(version, assistantSid) { @@ -299,7 +299,8 @@ ModelBuildList = function ModelBuildList(version, assistantSid) { * * @param {object|function} opts - ... * @param {string} [opts.statusCallback] - The status_callback - * @param {string} [opts.uniqueName] - The unique_name + * @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. For example: v0.1 * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ModelBuildInstance @@ -409,15 +410,20 @@ ModelBuildPage.prototype.getInstance = function getInstance(payload) { * @description Initialize the ModelBuildContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid - * @property {model_build.status} status - The status - * @property {string} uniqueName - The unique_name + * @property {string} accountSid - + * The unique ID of the Account that created this Model Build. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} assistantSid - The unique ID of the parent Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {model_build.status} status - + * A string that described the model build status. The values can be: enqueued, building, completed, failed + * @property {string} uniqueName - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * @property {string} url - The url - * @property {number} buildDuration - The build_duration + * @property {number} buildDuration - + * The time in seconds it took to build the model. * @property {number} errorCode - The error_code * * @param {Twilio.Preview.Understand} version - Version of the resource @@ -488,7 +494,8 @@ ModelBuildInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name + * @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. For example: v0.1 * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ModelBuildInstance @@ -605,7 +612,8 @@ ModelBuildContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name + * @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. For example: v0.1 * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed ModelBuildInstance diff --git a/lib/rest/preview/understand/assistant/query.js b/lib/rest/preview/understand/assistant/query.js index cbc3c9fe2b..e481a167c4 100644 --- a/lib/rest/preview/understand/assistant/query.js +++ b/lib/rest/preview/understand/assistant/query.js @@ -28,7 +28,7 @@ var QueryContext; * 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} assistantSid - The unique ID of the parent Assistant. */ /* jshint ignore:end */ QueryList = function QueryList(version, assistantSid) { @@ -69,9 +69,11 @@ QueryList = function QueryList(version, assistantSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language - * @param {string} [opts.modelBuild] - The model_build - * @param {string} [opts.status] - The status + * @param {string} [opts.language] - An ISO language-country string of the sample. + * @param {string} [opts.modelBuild] - + * The Model Build Sid or unique name of the Model Build to be queried. + * @param {string} [opts.status] - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -160,9 +162,11 @@ QueryList = function QueryList(version, assistantSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language - * @param {string} [opts.modelBuild] - The model_build - * @param {string} [opts.status] - The status + * @param {string} [opts.language] - An ISO language-country string of the sample. + * @param {string} [opts.modelBuild] - + * The Model Build Sid or unique name of the Model Build to be queried. + * @param {string} [opts.status] - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -222,9 +226,11 @@ QueryList = function QueryList(version, assistantSid) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.language] - The language - * @param {string} [opts.modelBuild] - The model_build - * @param {string} [opts.status] - The status + * @param {string} [opts.language] - An ISO language-country string of the sample. + * @param {string} [opts.modelBuild] - + * The Model Build Sid or unique name of the Model Build to be queried. + * @param {string} [opts.status] - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -279,9 +285,11 @@ QueryList = function QueryList(version, assistantSid) { * @memberof Twilio.Preview.Understand.AssistantContext.QueryList * @instance * - * @param {string} [opts.language] - The language - * @param {string} [opts.modelBuild] - The model_build - * @param {string} [opts.status] - The status + * @param {string} [opts.language] - An ISO language-country string of the sample. + * @param {string} [opts.modelBuild] - + * The Model Build Sid or unique name of the Model Build to be queried. + * @param {string} [opts.status] - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -317,11 +325,15 @@ QueryList = function QueryList(version, assistantSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.language - The language - * @param {string} opts.query - The query - * @param {string} [opts.intents] - The intents - * @param {string} [opts.modelBuild] - The model_build - * @param {string} [opts.field] - The field + * @param {string} opts.language - An ISO language-country string of the sample. + * @param {string} opts.query - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. + * @param {string} [opts.intents] - + * Constraints the query to a set of intents. Useful when you need to constrain the paths the user can take. Intents should be comma separated intent-unique-name-1, intent-unique-name-2 + * @param {string} [opts.modelBuild] - + * The Model Build Sid or unique name of the Model Build to be queried. + * @param {string} [opts.field] - + * Constraints the query to a given Field with an intent. Useful when you know the Field you are expecting. It accepts one field in the format intent-unique-name-1:field-unique-name * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed QueryInstance @@ -438,17 +450,22 @@ QueryPage.prototype.getInstance = function getInstance(payload) { * @description Initialize the QueryContext * 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. * - * @property {string} accountSid - The account_sid - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} results - The results - * @property {string} language - The language - * @property {string} modelBuildSid - The model_build_sid + * @property {string} accountSid - + * The unique ID of the Account that created this Query. + * @property {Date} dateCreated - The date that this resource was created + * @property {Date} dateUpdated - The date that this resource was last updated + * @property {string} results - + * The natural language analysis results which include the Intent recognized, the confidence score and a list of identified Fields. + * @property {string} language - An ISO language-country string of the sample. + * @property {string} modelBuildSid - The unique ID of the Model Build queried. * @property {string} query - The query - * @property {string} sampleSid - The sample_sid - * @property {string} assistantSid - The assistant_sid - * @property {string} sid - The sid - * @property {string} status - The status + * @property {string} sampleSid - + * An optional reference to the Sample created from this query. + * @property {string} assistantSid - The unique ID of the parent Assistant. + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} status - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @property {string} url - The url * @property {string} sourceChannel - The source_channel * @@ -519,7 +536,8 @@ QueryInstance.prototype.fetch = function fetch(callback) { * * @param {object|function} opts - ... * @param {string} [opts.sampleSid] - The sample_sid - * @param {string} [opts.status] - The status + * @param {string} [opts.status] - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed QueryInstance @@ -637,7 +655,8 @@ QueryContext.prototype.fetch = function fetch(callback) { * * @param {object|function} opts - ... * @param {string} [opts.sampleSid] - The sample_sid - * @param {string} [opts.status] - The status + * @param {string} [opts.status] - + * A string that described the query status. The values can be: to_review, reviewed, discarded * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed QueryInstance diff --git a/lib/rest/pricing/V1.d.ts b/lib/rest/pricing/V1.d.ts new file mode 100644 index 0000000000..7575da6387 --- /dev/null +++ b/lib/rest/pricing/V1.d.ts @@ -0,0 +1,30 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { MessagingListInstance } from './v1/messaging'; +import { PhoneNumberListInstance } from './v1/phoneNumber'; +import { VoiceListInstance } from './v1/voice'; + + +/** + * Initialize the V1 version of Pricing + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Pricing + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly messaging: MessagingListInstance; + readonly phoneNumbers: PhoneNumberListInstance; + readonly voice: VoiceListInstance; +} + +export = V1; diff --git a/lib/rest/pricing/v1/messaging/country.js b/lib/rest/pricing/v1/messaging/country.js index 14451d5e65..f737ee8af1 100644 --- a/lib/rest/pricing/v1/messaging/country.js +++ b/lib/rest/pricing/v1/messaging/country.js @@ -352,11 +352,12 @@ CountryPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Pricing.V1.MessagingContext.CountryInstance * @description Initialize the CountryContext * - * @property {string} country - The country - * @property {string} isoCountry - The iso_country - * @property {string} outboundSmsPrices - The outbound_sms_prices - * @property {string} inboundSmsPrices - The inbound_sms_prices - * @property {string} priceUnit - The price_unit + * @property {string} country - Name of the country + * @property {string} isoCountry - The ISO country code + * @property {string} outboundSmsPrices - List of OutboundSMSPrice records + * @property {string} inboundSmsPrices - List of InboundPrice 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 * * @param {Twilio.Pricing.V1} version - Version of the resource diff --git a/lib/rest/pricing/v1/phoneNumber/country.js b/lib/rest/pricing/v1/phoneNumber/country.js index 6825ee1f8f..377fb21192 100644 --- a/lib/rest/pricing/v1/phoneNumber/country.js +++ b/lib/rest/pricing/v1/phoneNumber/country.js @@ -352,10 +352,11 @@ CountryPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Pricing.V1.PhoneNumberContext.CountryInstance * @description Initialize the CountryContext * - * @property {string} country - The country - * @property {string} isoCountry - The iso_country - * @property {string} phoneNumberPrices - The phone_number_prices - * @property {string} priceUnit - The price_unit + * @property {string} country - Name of the country + * @property {string} isoCountry - The ISO country code of this number + * @property {string} phoneNumberPrices - List of PhoneNumberPrices 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 * * @param {Twilio.Pricing.V1} version - Version of the resource diff --git a/lib/rest/pricing/v1/voice/country.js b/lib/rest/pricing/v1/voice/country.js index 3f3359f867..85aa9bf437 100644 --- a/lib/rest/pricing/v1/voice/country.js +++ b/lib/rest/pricing/v1/voice/country.js @@ -352,11 +352,12 @@ CountryPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Pricing.V1.VoiceContext.CountryInstance * @description Initialize the CountryContext * - * @property {string} country - The country - * @property {string} isoCountry - The iso_country + * @property {string} country - Name of the country + * @property {string} isoCountry - The ISO country code * @property {string} outboundPrefixPrices - The outbound_prefix_prices * @property {string} inboundCallPrices - The inbound_call_prices - * @property {string} priceUnit - The price_unit + * @property {string} priceUnit - + * The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy). * @property {string} url - The url * * @param {Twilio.Pricing.V1} version - Version of the resource diff --git a/lib/rest/pricing/v1/voice/number.js b/lib/rest/pricing/v1/voice/number.js index d474ea8dfe..16656fc80c 100644 --- a/lib/rest/pricing/v1/voice/number.js +++ b/lib/rest/pricing/v1/voice/number.js @@ -114,11 +114,13 @@ NumberPage.prototype.getInstance = function getInstance(payload) { * @description Initialize the NumberContext * * @property {string} number - The number - * @property {string} country - The country - * @property {string} isoCountry - The iso_country - * @property {string} outboundCallPrice - The outbound_call_price - * @property {string} inboundCallPrice - The inbound_call_price - * @property {string} priceUnit - The price_unit + * @property {string} country - Name of the country + * @property {string} isoCountry - The ISO country code + * @property {string} outboundCallPrice - See OutboundCallPrice record + * @property {string} inboundCallPrice - + * See InboundCallPrice record (returned as null if the Phone Number provided is not a Twilio number owned by this account) + * @property {string} priceUnit - + * The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy). * @property {string} url - The url * * @param {Twilio.Pricing.V1} version - Version of the resource diff --git a/lib/rest/proxy/V1.d.ts b/lib/rest/proxy/V1.d.ts new file mode 100644 index 0000000000..31f62ac035 --- /dev/null +++ b/lib/rest/proxy/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ServiceListInstance } from './v1/service'; + + +/** + * Initialize the V1 version of Proxy + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Proxy + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly services: ServiceListInstance; +} + +export = V1; diff --git a/lib/rest/studio/V1.d.ts b/lib/rest/studio/V1.d.ts new file mode 100644 index 0000000000..07d4a3ce9f --- /dev/null +++ b/lib/rest/studio/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { FlowListInstance } from './v1/flow'; + + +/** + * Initialize the V1 version of Studio + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Studio + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly flows: FlowListInstance; +} + +export = V1; diff --git a/lib/rest/sync/V1.d.ts b/lib/rest/sync/V1.d.ts new file mode 100644 index 0000000000..d97e62bfe8 --- /dev/null +++ b/lib/rest/sync/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { ServiceListInstance } from './v1/service'; + + +/** + * Initialize the V1 version of Sync + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Sync + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly services: ServiceListInstance; +} + +export = V1; diff --git a/lib/rest/sync/v1/service/syncList.js b/lib/rest/sync/v1/service/syncList.js index 1c924f1ac8..07b5af9f39 100644 --- a/lib/rest/sync/v1/service/syncList.js +++ b/lib/rest/sync/v1/service/syncList.js @@ -511,7 +511,8 @@ SyncListInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {number} [opts.ttl] - The ttl + * @param {number} [opts.ttl] - + * Time-to-live of this List in seconds, defaults to no expiration. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SyncListInstance @@ -683,7 +684,8 @@ SyncListContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {number} [opts.ttl] - The ttl + * @param {number} [opts.ttl] - + * Time-to-live of this List in seconds, defaults to no expiration. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SyncListInstance diff --git a/lib/rest/sync/v1/service/syncList/syncListItem.js b/lib/rest/sync/v1/service/syncList/syncListItem.js index 9523a17c86..8c6958d859 100644 --- a/lib/rest/sync/v1/service/syncList/syncListItem.js +++ b/lib/rest/sync/v1/service/syncList/syncListItem.js @@ -67,7 +67,8 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.data - The data + * @param {string} opts.data - + * Contains arbitrary user-defined, schema-less data that this List Item stores, represented by a JSON object, up to 16KB. * @param {number} [opts.ttl] - * Time-to-live of this item in seconds, defaults to no expiration. * @param {function} [callback] - Callback to handle processed record @@ -551,8 +552,10 @@ SyncListItemInstance.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.data] - The data - * @param {number} [opts.ttl] - The ttl + * @param {string} [opts.data] - + * Contains arbitrary user-defined, schema-less data that this List Item stores, represented by a JSON object, up to 16KB. + * @param {number} [opts.ttl] - + * Time-to-live of this item in seconds, defaults to no expiration. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SyncListItemInstance @@ -687,8 +690,10 @@ SyncListItemContext.prototype.remove = function remove(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.data] - The data - * @param {number} [opts.ttl] - The ttl + * @param {string} [opts.data] - + * Contains arbitrary user-defined, schema-less data that this List Item stores, represented by a JSON object, up to 16KB. + * @param {number} [opts.ttl] - + * Time-to-live of this item in seconds, defaults to no expiration. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SyncListItemInstance diff --git a/lib/rest/sync/v1/service/syncMap/syncMapItem.js b/lib/rest/sync/v1/service/syncMap/syncMapItem.js index 562cf13690..1e7c0f4c27 100644 --- a/lib/rest/sync/v1/service/syncMap/syncMapItem.js +++ b/lib/rest/sync/v1/service/syncMap/syncMapItem.js @@ -67,7 +67,8 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { * @instance * * @param {object} opts - ... - * @param {string} opts.data - The data + * @param {string} opts.data - + * Contains arbitrary user-defined, schema-less data that this Map Item stores, represented by a JSON object, up to 16KB. * @param {number} [opts.ttl] - * Time-to-live of this Map in seconds, defaults to no expiration. * @param {function} [callback] - Callback to handle processed record @@ -132,8 +133,9 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { * @instance * * @param {object|function} opts - ... - * @param {sync_map_item.query_result_order} [opts.order] - The order - * @param {string} [opts.from] - The from + * @param {sync_map_item.query_result_order} [opts.order] - + * A string; asc or desc. Map Items are ordered lexicographically by Item key. + * @param {string} [opts.from] - The Item key offset (including the specified key). * @param {sync_map_item.query_from_bound_type} [opts.bounds] - The bounds * @param {number} [opts.limit] - * Upper limit for the number of records to return. @@ -223,8 +225,9 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { * @instance * * @param {object|function} opts - ... - * @param {sync_map_item.query_result_order} [opts.order] - The order - * @param {string} [opts.from] - The from + * @param {sync_map_item.query_result_order} [opts.order] - + * A string; asc or desc. Map Items are ordered lexicographically by Item key. + * @param {string} [opts.from] - The Item key offset (including the specified key). * @param {sync_map_item.query_from_bound_type} [opts.bounds] - The bounds * @param {number} [opts.limit] - * Upper limit for the number of records to return. @@ -285,8 +288,9 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { * @instance * * @param {object|function} opts - ... - * @param {sync_map_item.query_result_order} [opts.order] - The order - * @param {string} [opts.from] - The from + * @param {sync_map_item.query_result_order} [opts.order] - + * A string; asc or desc. Map Items are ordered lexicographically by Item key. + * @param {string} [opts.from] - The Item key offset (including the specified key). * @param {sync_map_item.query_from_bound_type} [opts.bounds] - The bounds * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - @@ -342,8 +346,9 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { * @memberof Twilio.Sync.V1.ServiceContext.SyncMapContext.SyncMapItemList * @instance * - * @param {sync_map_item.query_result_order} [opts.order] - The order - * @param {string} [opts.from] - The from + * @param {sync_map_item.query_result_order} [opts.order] - + * A string; asc or desc. Map Items are ordered lexicographically by Item key. + * @param {string} [opts.from] - The Item key offset (including the specified key). * @param {sync_map_item.query_from_bound_type} [opts.bounds] - The bounds * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records diff --git a/lib/rest/taskrouter/V1.d.ts b/lib/rest/taskrouter/V1.d.ts new file mode 100644 index 0000000000..0f17e313cc --- /dev/null +++ b/lib/rest/taskrouter/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { WorkspaceListInstance } from './v1/workspace'; + + +/** + * Initialize the V1 version of Taskrouter + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Taskrouter + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly workspaces: WorkspaceListInstance; +} + +export = V1; diff --git a/lib/rest/trunking/V1.d.ts b/lib/rest/trunking/V1.d.ts new file mode 100644 index 0000000000..a60c7b84fe --- /dev/null +++ b/lib/rest/trunking/V1.d.ts @@ -0,0 +1,26 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { TrunkListInstance } from './v1/trunk'; + + +/** + * Initialize the V1 version of Trunking + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Trunking + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly trunks: TrunkListInstance; +} + +export = V1; diff --git a/lib/rest/video/V1.d.ts b/lib/rest/video/V1.d.ts new file mode 100644 index 0000000000..fea5528831 --- /dev/null +++ b/lib/rest/video/V1.d.ts @@ -0,0 +1,30 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CompositionListInstance } from './v1/composition'; +import { RecordingListInstance } from './v1/recording'; +import { RoomListInstance } from './v1/room'; + + +/** + * Initialize the V1 version of Video + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Video + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly compositions: CompositionListInstance; + readonly recordings: RecordingListInstance; + readonly rooms: RoomListInstance; +} + +export = V1; diff --git a/lib/rest/video/V1.js b/lib/rest/video/V1.js index df95f66098..b70907ed30 100644 --- a/lib/rest/video/V1.js +++ b/lib/rest/video/V1.js @@ -22,8 +22,8 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * * @constructor Twilio.Video.V1 * - * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.RecordingList} recordings - recordings resource + * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.RoomList} rooms - rooms resource * * @param {Twilio.Video} domain - The twilio domain @@ -33,8 +33,8 @@ function V1(domain) { Version.prototype.constructor.call(this, domain, 'v1'); // Resources - this._compositions = undefined; this._recordings = undefined; + this._compositions = undefined; this._rooms = undefined; } @@ -42,18 +42,18 @@ _.extend(V1.prototype, Version.prototype); V1.prototype.constructor = V1; Object.defineProperty(V1.prototype, - 'compositions', { + 'recordings', { get: function() { - this._compositions = this._compositions || new CompositionList(this); - return this._compositions; + this._recordings = this._recordings || new RecordingList(this); + return this._recordings; } }); Object.defineProperty(V1.prototype, - 'recordings', { + 'compositions', { get: function() { - this._recordings = this._recordings || new RecordingList(this); - return this._recordings; + this._compositions = this._compositions || new CompositionList(this); + return this._compositions; } }); diff --git a/lib/rest/video/v1/composition.js b/lib/rest/video/v1/composition.js index e7ea82e11d..fa9562aba3 100644 --- a/lib/rest/video/v1/composition.js +++ b/lib/rest/video/v1/composition.js @@ -456,7 +456,7 @@ CompositionPage.prototype.getInstance = function getInstance(payload) { * @property {boolean} trim - The trim * @property {composition.format} format - The format * @property {number} bitrate - The bitrate - * @property {string} size - The size + * @property {number} size - The size * @property {number} duration - The duration * @property {string} url - The url * @property {string} links - The links @@ -484,7 +484,7 @@ CompositionInstance = function CompositionInstance(version, payload, sid) { this.trim = payload.trim; // jshint ignore:line this.format = payload.format; // jshint ignore:line this.bitrate = deserialize.integer(payload.bitrate); // jshint ignore:line - this.size = payload.size; // jshint ignore:line + this.size = deserialize.integer(payload.size); // jshint ignore:line this.duration = deserialize.integer(payload.duration); // jshint ignore:line this.url = payload.url; // jshint ignore:line this.links = payload.links; // jshint ignore:line diff --git a/lib/rest/video/v1/recording.js b/lib/rest/video/v1/recording.js index bbb79d3675..755461a779 100644 --- a/lib/rest/video/v1/recording.js +++ b/lib/rest/video/v1/recording.js @@ -68,11 +68,16 @@ RecordingList = function RecordingList(version) { * @instance * * @param {object|function} opts - ... - * @param {recording.status} [opts.status] - The status - * @param {string} [opts.sourceSid] - The source_sid - * @param {string|list} [opts.groupingSid] - The grouping_sid - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {recording.status} [opts.status] - + * Only show Recordings with the given status. + * @param {string} [opts.sourceSid] - + * Only show the Recordings with the given source Sid. + * @param {string|list} [opts.groupingSid] - + * Only show Recordings that have this GroupingSid. + * @param {Date} [opts.dateCreatedAfter] - + * Only show Recordings that started on or after this ISO8601 date-time. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Recordings that started before this this ISO8601 date-time. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -161,11 +166,16 @@ RecordingList = function RecordingList(version) { * @instance * * @param {object|function} opts - ... - * @param {recording.status} [opts.status] - The status - * @param {string} [opts.sourceSid] - The source_sid - * @param {string|list} [opts.groupingSid] - The grouping_sid - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {recording.status} [opts.status] - + * Only show Recordings with the given status. + * @param {string} [opts.sourceSid] - + * Only show the Recordings with the given source Sid. + * @param {string|list} [opts.groupingSid] - + * Only show Recordings that have this GroupingSid. + * @param {Date} [opts.dateCreatedAfter] - + * Only show Recordings that started on or after this ISO8601 date-time. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Recordings that started before this this ISO8601 date-time. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -225,11 +235,16 @@ RecordingList = function RecordingList(version) { * @instance * * @param {object|function} opts - ... - * @param {recording.status} [opts.status] - The status - * @param {string} [opts.sourceSid] - The source_sid - * @param {string|list} [opts.groupingSid] - The grouping_sid - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {recording.status} [opts.status] - + * Only show Recordings with the given status. + * @param {string} [opts.sourceSid] - + * Only show the Recordings with the given source Sid. + * @param {string|list} [opts.groupingSid] - + * Only show Recordings that have this GroupingSid. + * @param {Date} [opts.dateCreatedAfter] - + * Only show Recordings that started on or after this ISO8601 date-time. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Recordings that started before this this ISO8601 date-time. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -286,11 +301,16 @@ RecordingList = function RecordingList(version) { * @memberof Twilio.Video.V1.RecordingList * @instance * - * @param {recording.status} [opts.status] - The status - * @param {string} [opts.sourceSid] - The source_sid - * @param {string|list} [opts.groupingSid] - The grouping_sid - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {recording.status} [opts.status] - + * Only show Recordings with the given status. + * @param {string} [opts.sourceSid] - + * Only show the Recordings with the given source Sid. + * @param {string|list} [opts.groupingSid] - + * Only show Recordings that have this GroupingSid. + * @param {Date} [opts.dateCreatedAfter] - + * Only show Recordings that started on or after this ISO8601 date-time. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Recordings that started before this this ISO8601 date-time. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -325,7 +345,8 @@ RecordingList = function RecordingList(version) { * @memberof Twilio.Video.V1.RecordingList * @instance * - * @param {string} sid - The sid + * @param {string} sid - + * The Recording Sid that uniquely identifies the Recording to fetch. * * @returns {Twilio.Video.V1.RecordingContext} */ @@ -384,24 +405,29 @@ RecordingPage.prototype.getInstance = function getInstance(payload) { * @constructor Twilio.Video.V1.RecordingInstance * @description Initialize the RecordingContext * - * @property {string} accountSid - The account_sid - * @property {recording.status} status - The status - * @property {Date} dateCreated - The date_created - * @property {string} sid - The sid - * @property {string} sourceSid - The source_sid - * @property {string} size - The size - * @property {string} url - The url - * @property {recording.type} type - The type - * @property {number} duration - The duration - * @property {recording.format} containerFormat - The container_format - * @property {recording.codec} codec - The codec - * @property {string} groupingSids - The grouping_sids - * @property {string} trackName - The track_name + * @property {string} accountSid - Twilio Account SID. + * @property {recording.status} status - The status of the Recording. + * @property {Date} dateCreated - Date when the media recording began writing. + * @property {string} sid - + * A 34-character string that uniquely identifies this Recording. + * @property {string} sourceSid - + * A 34-character string that uniquely identifies the source of this Recording. + * @property {number} size - Size of the recorded track, in bytes. + * @property {string} url - The absolute URL for this resource. + * @property {recording.type} type - Indicates the media type for this recording. + * @property {number} duration - Duration of the Recording in seconds. + * @property {recording.format} containerFormat - + * The file format for this Recording. + * @property {recording.codec} codec - The codec used to encode the track. + * @property {string} groupingSids - A list of Sids related to this Recording. + * @property {string} trackName - + * The name that was given to the source track of this recording. * @property {string} links - The links * * @param {Twilio.Video.V1} version - Version of the resource * @param {object} payload - The instance payload - * @param {sid} sid - The sid + * @param {sid} sid - + * The Recording Sid that uniquely identifies the Recording to fetch. */ /* jshint ignore:end */ RecordingInstance = function RecordingInstance(version, payload, sid) { @@ -413,7 +439,7 @@ RecordingInstance = function RecordingInstance(version, payload, sid) { this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line this.sid = payload.sid; // jshint ignore:line this.sourceSid = payload.source_sid; // jshint ignore:line - this.size = payload.size; // jshint ignore:line + this.size = deserialize.integer(payload.size); // jshint ignore:line this.url = payload.url; // jshint ignore:line this.type = payload.type; // jshint ignore:line this.duration = deserialize.integer(payload.duration); // jshint ignore:line @@ -502,7 +528,8 @@ RecordingInstance.prototype.toJSON = function toJSON() { * @description Initialize the RecordingContext * * @param {Twilio.Video.V1} version - Version of the resource - * @param {sid} sid - The sid + * @param {sid} sid - + * The Recording Sid that uniquely identifies the Recording to fetch. */ /* jshint ignore:end */ RecordingContext = function RecordingContext(version, sid) { diff --git a/lib/rest/video/v1/room/recording.js b/lib/rest/video/v1/room/recording.js index 36efee5e5b..fe2b790471 100644 --- a/lib/rest/video/v1/room/recording.js +++ b/lib/rest/video/v1/room/recording.js @@ -385,7 +385,7 @@ RoomRecordingPage.prototype.getInstance = function getInstance(payload) { * @property {Date} dateCreated - The date_created * @property {string} sid - The sid * @property {string} sourceSid - The source_sid - * @property {string} size - The size + * @property {number} size - The size * @property {string} url - The url * @property {room_recording.type} type - The type * @property {number} duration - The duration @@ -412,7 +412,7 @@ RoomRecordingInstance = function RoomRecordingInstance(version, payload, this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line this.sid = payload.sid; // jshint ignore:line this.sourceSid = payload.source_sid; // jshint ignore:line - this.size = payload.size; // jshint ignore:line + this.size = deserialize.integer(payload.size); // jshint ignore:line this.url = payload.url; // jshint ignore:line this.type = payload.type; // jshint ignore:line this.duration = deserialize.integer(payload.duration); // jshint ignore:line diff --git a/lib/rest/video/v1/room/roomParticipant.js b/lib/rest/video/v1/room/roomParticipant.js index 4abe9ecf86..e408fc1002 100644 --- a/lib/rest/video/v1/room/roomParticipant.js +++ b/lib/rest/video/v1/room/roomParticipant.js @@ -78,8 +78,10 @@ ParticipantList = function ParticipantList(version, roomSid) { * Only show Participants with the given Status. * @param {string} [opts.identity] - * Only show Participants that connected to the Room using the provided Identity. - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {Date} [opts.dateCreatedAfter] - + * Only show Participants that started after this date, given as an UTC ISO 8601 Timestamp. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Participants that started before this date, given as an UTC ISO 8601 Timestamp. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -172,8 +174,10 @@ ParticipantList = function ParticipantList(version, roomSid) { * Only show Participants with the given Status. * @param {string} [opts.identity] - * Only show Participants that connected to the Room using the provided Identity. - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {Date} [opts.dateCreatedAfter] - + * Only show Participants that started after this date, given as an UTC ISO 8601 Timestamp. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Participants that started before this date, given as an UTC ISO 8601 Timestamp. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -237,8 +241,10 @@ ParticipantList = function ParticipantList(version, roomSid) { * Only show Participants with the given Status. * @param {string} [opts.identity] - * Only show Participants that connected to the Room using the provided Identity. - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {Date} [opts.dateCreatedAfter] - + * Only show Participants that started after this date, given as an UTC ISO 8601 Timestamp. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Participants that started before this date, given as an UTC ISO 8601 Timestamp. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -298,8 +304,10 @@ ParticipantList = function ParticipantList(version, roomSid) { * Only show Participants with the given Status. * @param {string} [opts.identity] - * Only show Participants that connected to the Room using the provided Identity. - * @param {Date} [opts.dateCreatedAfter] - The date_created_after - * @param {Date} [opts.dateCreatedBefore] - The date_created_before + * @param {Date} [opts.dateCreatedAfter] - + * Only show Participants that started after this date, given as an UTC ISO 8601 Timestamp. + * @param {Date} [opts.dateCreatedBefore] - + * Only show Participants that started before this date, given as an UTC ISO 8601 Timestamp. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * diff --git a/lib/rest/wireless/V1.d.ts b/lib/rest/wireless/V1.d.ts new file mode 100644 index 0000000000..cd9f8f2da2 --- /dev/null +++ b/lib/rest/wireless/V1.d.ts @@ -0,0 +1,30 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import Version = require('../../base/Version'); +import { CommandListInstance } from './v1/command'; +import { RatePlanListInstance } from './v1/ratePlan'; +import { SimListInstance } from './v1/sim'; + + +/** + * Initialize the V1 version of Wireless + */ +declare class V1 extends Version { + /** + * Initialize the V1 version of Wireless + * + * @param domain - The twilio domain + */ + constructor(domain: any); + + readonly commands: CommandListInstance; + readonly ratePlans: RatePlanListInstance; + readonly sims: SimListInstance; +} + +export = V1; diff --git a/lib/rest/wireless/v1/command.js b/lib/rest/wireless/v1/command.js index fdd8791389..2189b9132b 100644 --- a/lib/rest/wireless/v1/command.js +++ b/lib/rest/wireless/v1/command.js @@ -25,7 +25,6 @@ var CommandContext; /** * @constructor Twilio.Wireless.V1.CommandList * @description Initialize the CommandList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource */ @@ -68,9 +67,11 @@ CommandList = function CommandList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.sim] - The sim - * @param {command.status} [opts.status] - The status - * @param {command.direction} [opts.direction] - The direction + * @param {string} [opts.sim] - Only return Commands to or from this SIM. + * @param {command.status} [opts.status] - + * Only return Commands with this status value. + * @param {command.direction} [opts.direction] - + * Only return Commands with this direction value. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -159,9 +160,11 @@ CommandList = function CommandList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.sim] - The sim - * @param {command.status} [opts.status] - The status - * @param {command.direction} [opts.direction] - The direction + * @param {string} [opts.sim] - Only return Commands to or from this SIM. + * @param {command.status} [opts.status] - + * Only return Commands with this status value. + * @param {command.direction} [opts.direction] - + * Only return Commands with this direction value. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -221,9 +224,11 @@ CommandList = function CommandList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.sim] - The sim - * @param {command.status} [opts.status] - The status - * @param {command.direction} [opts.direction] - The direction + * @param {string} [opts.sim] - Only return Commands to or from this SIM. + * @param {command.status} [opts.status] - + * Only return Commands with this status value. + * @param {command.direction} [opts.direction] - + * Only return Commands with this direction value. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -278,9 +283,11 @@ CommandList = function CommandList(version) { * @memberof Twilio.Wireless.V1.CommandList * @instance * - * @param {string} [opts.sim] - The sim - * @param {command.status} [opts.status] - The status - * @param {command.direction} [opts.direction] - The direction + * @param {string} [opts.sim] - Only return Commands to or from this SIM. + * @param {command.status} [opts.status] - + * Only return Commands with this status value. + * @param {command.direction} [opts.direction] - + * Only return Commands with this direction value. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -316,12 +323,18 @@ CommandList = function CommandList(version) { * @instance * * @param {object} opts - ... - * @param {string} opts.command - The command - * @param {string} [opts.sim] - The sim - * @param {string} [opts.callbackMethod] - The callback_method - * @param {string} [opts.callbackUrl] - The callback_url - * @param {command.command_mode} [opts.commandMode] - The command_mode - * @param {string} [opts.includeSid] - The include_sid + * @param {string} opts.command - + * The message body of the Command or a Base64 encoded byte string in binary mode. + * @param {string} [opts.sim] - + * The Sid or UniqueName of the SIM to send the Command to. + * @param {string} [opts.callbackMethod] - + * The HTTP method Twilio will use when making a request to the callback URL. + * @param {string} [opts.callbackUrl] - + * Twilio will make a request to this URL when the Command has finished sending. + * @param {command.command_mode} [opts.commandMode] - + * A string representing which mode to send the SMS message using. + * @param {string} [opts.includeSid] - + * When sending a Command to a SIM in text mode, Twilio can automatically include the Sid of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed CommandInstance @@ -388,7 +401,6 @@ CommandList = function CommandList(version) { * @constructor Twilio.Wireless.V1.CommandPage * @augments Page * @description Initialize the CommandPage - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} response - Response from the API @@ -429,18 +441,24 @@ CommandPage.prototype.getInstance = function getInstance(payload) { /** * @constructor Twilio.Wireless.V1.CommandInstance * @description Initialize the CommandContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * - * @property {string} sid - The sid - * @property {string} accountSid - The account_sid - * @property {string} simSid - The sim_sid - * @property {string} command - The command - * @property {command.command_mode} commandMode - The command_mode - * @property {command.status} status - The status - * @property {command.direction} direction - The direction - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} accountSid - + * The unique id of the Account that this Command belongs to. + * @property {string} simSid - + * The unique ID of the SIM that this Command was sent to or from. + * @property {string} command - The message being sent to or from the SIM. + * @property {command.command_mode} commandMode - + * A string representing which mode the SMS was sent or received using. + * @property {command.status} status - + * A string representing the status of the Command. + * @property {command.direction} direction - The direction of the Command. + * @property {Date} dateCreated - + * The date that this resource was created, given as GMT in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated, given as GMT in ISO 8601 format. + * @property {string} url - The URL for this resource. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -522,7 +540,6 @@ CommandInstance.prototype.toJSON = function toJSON() { /** * @constructor Twilio.Wireless.V1.CommandContext * @description Initialize the CommandContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {sid} sid - The sid diff --git a/lib/rest/wireless/v1/ratePlan.js b/lib/rest/wireless/v1/ratePlan.js index a0195e6db9..fd07035f66 100644 --- a/lib/rest/wireless/v1/ratePlan.js +++ b/lib/rest/wireless/v1/ratePlan.js @@ -26,7 +26,6 @@ var RatePlanContext; /** * @constructor Twilio.Wireless.V1.RatePlanList * @description Initialize the RatePlanList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource */ @@ -298,17 +297,25 @@ RatePlanList = function RatePlanList(version) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.friendlyName] - The friendly_name - * @param {boolean} [opts.dataEnabled] - The data_enabled - * @param {number} [opts.dataLimit] - The data_limit - * @param {string} [opts.dataMetering] - The data_metering - * @param {boolean} [opts.messagingEnabled] - The messaging_enabled - * @param {boolean} [opts.voiceEnabled] - The voice_enabled - * @param {boolean} [opts.nationalRoamingEnabled] - The national_roaming_enabled + * @param {string} [opts.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the Sid. + * @param {string} [opts.friendlyName] - + * A user-provided string that identifies this resource. + * @param {boolean} [opts.dataEnabled] - + * Defines whether SIMs are capable of using GPRS/3G/LTE data connectivity. + * @param {number} [opts.dataLimit] - + * Network-enforced limit specifying the total Megabytes of data usage allowed during one month on the home network. + * @param {string} [opts.dataMetering] - + * The model by which to meter data usage, in accordance with the two available data metering models. + * @param {boolean} [opts.messagingEnabled] - + * Defines whether SIMs are capable of making and sending and receiving SMS messages via either Commands or Programmable SMS APIs. + * @param {boolean} [opts.voiceEnabled] - + * Defines whether SIMs are capable of making and receiving voice calls. + * @param {boolean} [opts.nationalRoamingEnabled] - + * Defines whether SIMs can roam onto other networks in the SIM's home country. * @param {string|list} [opts.internationalRoaming] - The international_roaming * @param {number} [opts.nationalRoamingDataLimit] - - * The national_roaming_data_limit + * Network-enforced limit specifying the total Megabytes of national roaming data usage allowed during one month. * @param {number} [opts.internationalRoamingDataLimit] - * The international_roaming_data_limit * @param {function} [callback] - Callback to handle processed record @@ -381,7 +388,6 @@ RatePlanList = function RatePlanList(version) { * @constructor Twilio.Wireless.V1.RatePlanPage * @augments Page * @description Initialize the RatePlanPage - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} response - Response from the API @@ -422,25 +428,37 @@ RatePlanPage.prototype.getInstance = function getInstance(payload) { /** * @constructor Twilio.Wireless.V1.RatePlanInstance * @description Initialize the RatePlanContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * - * @property {string} sid - The sid - * @property {string} uniqueName - The unique_name - * @property {string} accountSid - The account_sid - * @property {string} friendlyName - The friendly_name - * @property {boolean} dataEnabled - The data_enabled - * @property {string} dataMetering - The data_metering - * @property {number} dataLimit - The data_limit - * @property {boolean} messagingEnabled - The messaging_enabled - * @property {boolean} voiceEnabled - The voice_enabled - * @property {boolean} nationalRoamingEnabled - The national_roaming_enabled - * @property {number} nationalRoamingDataLimit - The national_roaming_data_limit + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uniqueName - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. + * @property {string} accountSid - + * The unique id of the Account that this Rate Plan belongs to. + * @property {string} friendlyName - + * A user-provided string that identifies this resource. + * @property {boolean} dataEnabled - + * Defines whether SIMs are capable of using GPRS/3G/4G/LTE data connectivity. + * @property {string} dataMetering - + * The model by which to meter data usage, in accordance with the two available data metering models. + * @property {number} dataLimit - + * Network-enforced limit specifying the total Megabytes of data usage allowed during one month on the home network. + * @property {boolean} messagingEnabled - + * Defines whether SIMs are capable of making and sending and receiving SMS via Commands. + * @property {boolean} voiceEnabled - + * Defines whether SIMs are capable of making and receiving voice calls. + * @property {boolean} nationalRoamingEnabled - + * Defines whether SIMs can roam onto other networks in the SIM's home country. + * @property {number} nationalRoamingDataLimit - + * Network-enforced limit specifying the total Megabytes of national roaming data usage allowed during one month. * @property {string} internationalRoaming - The international_roaming * @property {number} internationalRoamingDataLimit - * The international_roaming_data_limit - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url + * @property {Date} dateCreated - + * The date that this resource was created, given as GMT in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated, given as GMT in ISO 8601 format. + * @property {string} url - The URL for this resource. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} payload - The instance payload @@ -510,8 +528,10 @@ RatePlanInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the Sid. + * @param {string} [opts.friendlyName] - + * A user-provided string that identifies this resource. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RatePlanInstance @@ -565,7 +585,6 @@ RatePlanInstance.prototype.toJSON = function toJSON() { /** * @constructor Twilio.Wireless.V1.RatePlanContext * @description Initialize the RatePlanContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {sid_like} sid - The sid @@ -622,8 +641,10 @@ RatePlanContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.friendlyName] - The friendly_name + * @param {string} [opts.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the Sid. + * @param {string} [opts.friendlyName] - + * A user-provided string that identifies this resource. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed RatePlanInstance diff --git a/lib/rest/wireless/v1/sim.js b/lib/rest/wireless/v1/sim.js index 5ce7eff7d3..742a195c24 100644 --- a/lib/rest/wireless/v1/sim.js +++ b/lib/rest/wireless/v1/sim.js @@ -27,7 +27,6 @@ var SimContext; /** * @constructor Twilio.Wireless.V1.SimList * @description Initialize the SimList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource */ @@ -70,9 +69,9 @@ SimList = function SimList(version) { * @instance * * @param {object|function} opts - ... - * @param {sim.status} [opts.status] - The status - * @param {string} [opts.iccid] - The iccid - * @param {string} [opts.ratePlan] - The rate_plan + * @param {sim.status} [opts.status] - Only return Sims with this status. + * @param {string} [opts.iccid] - Return Sims with this Iccid. + * @param {string} [opts.ratePlan] - Only return Sims with this Rate Plan. * @param {string} [opts.eId] - The e_id * @param {string} [opts.simRegistrationCode] - The sim_registration_code * @param {number} [opts.limit] - @@ -163,9 +162,9 @@ SimList = function SimList(version) { * @instance * * @param {object|function} opts - ... - * @param {sim.status} [opts.status] - The status - * @param {string} [opts.iccid] - The iccid - * @param {string} [opts.ratePlan] - The rate_plan + * @param {sim.status} [opts.status] - Only return Sims with this status. + * @param {string} [opts.iccid] - Return Sims with this Iccid. + * @param {string} [opts.ratePlan] - Only return Sims with this Rate Plan. * @param {string} [opts.eId] - The e_id * @param {string} [opts.simRegistrationCode] - The sim_registration_code * @param {number} [opts.limit] - @@ -227,9 +226,9 @@ SimList = function SimList(version) { * @instance * * @param {object|function} opts - ... - * @param {sim.status} [opts.status] - The status - * @param {string} [opts.iccid] - The iccid - * @param {string} [opts.ratePlan] - The rate_plan + * @param {sim.status} [opts.status] - Only return Sims with this status. + * @param {string} [opts.iccid] - Return Sims with this Iccid. + * @param {string} [opts.ratePlan] - Only return Sims with this Rate Plan. * @param {string} [opts.eId] - The e_id * @param {string} [opts.simRegistrationCode] - The sim_registration_code * @param {string} [opts.pageToken] - PageToken provided by the API @@ -288,9 +287,9 @@ SimList = function SimList(version) { * @memberof Twilio.Wireless.V1.SimList * @instance * - * @param {sim.status} [opts.status] - The status - * @param {string} [opts.iccid] - The iccid - * @param {string} [opts.ratePlan] - The rate_plan + * @param {sim.status} [opts.status] - Only return Sims with this status. + * @param {string} [opts.iccid] - Return Sims with this Iccid. + * @param {string} [opts.ratePlan] - Only return Sims with this Rate Plan. * @param {string} [opts.eId] - The e_id * @param {string} [opts.simRegistrationCode] - The sim_registration_code * @param {string} [targetUrl] - API-generated URL for the requested results page @@ -345,7 +344,6 @@ SimList = function SimList(version) { * @constructor Twilio.Wireless.V1.SimPage * @augments Page * @description Initialize the SimPage - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} response - Response from the API @@ -386,30 +384,47 @@ SimPage.prototype.getInstance = function getInstance(payload) { /** * @constructor Twilio.Wireless.V1.SimInstance * @description Initialize the SimContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * - * @property {string} sid - The sid - * @property {string} uniqueName - The unique_name - * @property {string} accountSid - The account_sid - * @property {string} ratePlanSid - The rate_plan_sid - * @property {string} friendlyName - The friendly_name - * @property {string} iccid - The iccid + * @property {string} sid - + * A 34 character string that uniquely identifies this resource. + * @property {string} uniqueName - + * A user-provided string that uniquely identifies this resource as an alternative to the sid. + * @property {string} accountSid - + * The unique id of the Account that this Sim belongs to. + * @property {string} ratePlanSid - + * The unique ID of the Rate Plan configured for this Sim. + * @property {string} friendlyName - + * A user-provided string that identifies this resource. + * @property {string} iccid - The ICCID associated with the SIM. * @property {string} eId - The e_id - * @property {sim.status} status - The status - * @property {string} commandsCallbackUrl - The commands_callback_url - * @property {string} commandsCallbackMethod - The commands_callback_method - * @property {string} smsFallbackMethod - The sms_fallback_method - * @property {string} smsFallbackUrl - The sms_fallback_url - * @property {string} smsMethod - The sms_method - * @property {string} smsUrl - The sms_url - * @property {string} voiceFallbackMethod - The voice_fallback_method - * @property {string} voiceFallbackUrl - The voice_fallback_url - * @property {string} voiceMethod - The voice_method - * @property {string} voiceUrl - The voice_url - * @property {Date} dateCreated - The date_created - * @property {Date} dateUpdated - The date_updated - * @property {string} url - The url - * @property {string} links - The links + * @property {sim.status} status - A string representing the status of the Sim. + * @property {string} commandsCallbackUrl - + * The URL that will receive a webhook when this Sim originates a machine-to-machine Command. + * @property {string} commandsCallbackMethod - + * A string representing the HTTP method to use when making a request to commands_callback_url. + * @property {string} smsFallbackMethod - + * The HTTP method Twilio will use when requesting the sms_fallback_url. + * @property {string} smsFallbackUrl - + * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by sms_url. + * @property {string} smsMethod - + * The HTTP method Twilio will use when requesting the above Url. + * @property {string} smsUrl - + * The URL Twilio will request when the SIM-connected device send an SMS that is not a Command. + * @property {string} voiceFallbackMethod - + * The HTTP method Twilio will use when requesting the voice_fallback_url. + * @property {string} voiceFallbackUrl - + * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by voice_url. + * @property {string} voiceMethod - + * The HTTP method Twilio will use when requesting the above Url. + * @property {string} voiceUrl - + * The URL Twilio will request when the SIM-connected device makes a call. + * @property {Date} dateCreated - + * The date that this resource was created, given as GMT in ISO 8601 format. + * @property {Date} dateUpdated - + * The date that this resource was last updated, given as GMT in ISO 8601 format. + * @property {string} url - The URL for this resource. + * @property {string} links - + * Each Sim instance resource supports a few subresources, listed here for convenience. * @property {string} ipAddress - The ip_address * * @param {Twilio.Wireless.V1} version - Version of the resource @@ -487,22 +502,37 @@ SimInstance.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.callbackMethod] - The callback_method - * @param {string} [opts.callbackUrl] - The callback_url - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.ratePlan] - The rate_plan - * @param {sim.status} [opts.status] - The status - * @param {string} [opts.commandsCallbackMethod] - The commands_callback_method - * @param {string} [opts.commandsCallbackUrl] - The commands_callback_url - * @param {string} [opts.smsFallbackMethod] - The sms_fallback_method - * @param {string} [opts.smsFallbackUrl] - The sms_fallback_url - * @param {string} [opts.smsMethod] - The sms_method - * @param {string} [opts.smsUrl] - The sms_url - * @param {string} [opts.voiceFallbackMethod] - The voice_fallback_method - * @param {string} [opts.voiceFallbackUrl] - The voice_fallback_url - * @param {string} [opts.voiceMethod] - The voice_method - * @param {string} [opts.voiceUrl] - The voice_url + * @param {string} [opts.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the Sid. + * @param {string} [opts.callbackMethod] - + * The HTTP method Twilio will use when making a request to the callback URL. + * @param {string} [opts.callbackUrl] - + * Twilio will make a request to this URL when the Sim has finished updating. + * @param {string} [opts.friendlyName] - + * A user-provided string that identifies this resource. + * @param {string} [opts.ratePlan] - + * The Sid or UniqueName of the RatePlan that this Sim should use. + * @param {sim.status} [opts.status] - A string representing the status of the Sim. + * @param {string} [opts.commandsCallbackMethod] - + * A string representing the HTTP method to use when making a request to CommandsCallbackUrl. + * @param {string} [opts.commandsCallbackUrl] - + * The URL that will receive a webhook when this Sim originates a Command. + * @param {string} [opts.smsFallbackMethod] - + * The HTTP method Twilio will use when requesting the sms_fallback_url. + * @param {string} [opts.smsFallbackUrl] - + * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by sms_url. + * @param {string} [opts.smsMethod] - + * The HTTP method Twilio will use when requesting the above Url. + * @param {string} [opts.smsUrl] - + * The URL Twilio will request when the SIM-connected device sends an SMS message that is not a Command. + * @param {string} [opts.voiceFallbackMethod] - + * The HTTP method Twilio will use when requesting the voice_fallback_url. + * @param {string} [opts.voiceFallbackUrl] - + * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by voice_url. + * @param {string} [opts.voiceMethod] - + * The HTTP method Twilio will use when requesting the above Url. + * @param {string} [opts.voiceUrl] - + * The URL Twilio will request when the SIM-connected device makes a call. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SimInstance @@ -569,7 +599,6 @@ SimInstance.prototype.toJSON = function toJSON() { /** * @constructor Twilio.Wireless.V1.SimContext * @description Initialize the SimContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property {Twilio.Wireless.V1.SimContext.UsageRecordList} usageRecords - * usageRecords resource @@ -635,22 +664,37 @@ SimContext.prototype.fetch = function fetch(callback) { * @instance * * @param {object|function} opts - ... - * @param {string} [opts.uniqueName] - The unique_name - * @param {string} [opts.callbackMethod] - The callback_method - * @param {string} [opts.callbackUrl] - The callback_url - * @param {string} [opts.friendlyName] - The friendly_name - * @param {string} [opts.ratePlan] - The rate_plan - * @param {sim.status} [opts.status] - The status - * @param {string} [opts.commandsCallbackMethod] - The commands_callback_method - * @param {string} [opts.commandsCallbackUrl] - The commands_callback_url - * @param {string} [opts.smsFallbackMethod] - The sms_fallback_method - * @param {string} [opts.smsFallbackUrl] - The sms_fallback_url - * @param {string} [opts.smsMethod] - The sms_method - * @param {string} [opts.smsUrl] - The sms_url - * @param {string} [opts.voiceFallbackMethod] - The voice_fallback_method - * @param {string} [opts.voiceFallbackUrl] - The voice_fallback_url - * @param {string} [opts.voiceMethod] - The voice_method - * @param {string} [opts.voiceUrl] - The voice_url + * @param {string} [opts.uniqueName] - + * A user-provided string that uniquely identifies this resource as an alternative to the Sid. + * @param {string} [opts.callbackMethod] - + * The HTTP method Twilio will use when making a request to the callback URL. + * @param {string} [opts.callbackUrl] - + * Twilio will make a request to this URL when the Sim has finished updating. + * @param {string} [opts.friendlyName] - + * A user-provided string that identifies this resource. + * @param {string} [opts.ratePlan] - + * The Sid or UniqueName of the RatePlan that this Sim should use. + * @param {sim.status} [opts.status] - A string representing the status of the Sim. + * @param {string} [opts.commandsCallbackMethod] - + * A string representing the HTTP method to use when making a request to CommandsCallbackUrl. + * @param {string} [opts.commandsCallbackUrl] - + * The URL that will receive a webhook when this Sim originates a Command. + * @param {string} [opts.smsFallbackMethod] - + * The HTTP method Twilio will use when requesting the sms_fallback_url. + * @param {string} [opts.smsFallbackUrl] - + * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by sms_url. + * @param {string} [opts.smsMethod] - + * The HTTP method Twilio will use when requesting the above Url. + * @param {string} [opts.smsUrl] - + * The URL Twilio will request when the SIM-connected device sends an SMS message that is not a Command. + * @param {string} [opts.voiceFallbackMethod] - + * The HTTP method Twilio will use when requesting the voice_fallback_url. + * @param {string} [opts.voiceFallbackUrl] - + * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by voice_url. + * @param {string} [opts.voiceMethod] - + * The HTTP method Twilio will use when requesting the above Url. + * @param {string} [opts.voiceUrl] - + * The URL Twilio will request when the SIM-connected device makes a call. * @param {function} [callback] - Callback to handle processed record * * @returns {Promise} Resolves to processed SimInstance diff --git a/lib/rest/wireless/v1/sim/dataSession.js b/lib/rest/wireless/v1/sim/dataSession.js index a58eb96343..c89886b1c9 100644 --- a/lib/rest/wireless/v1/sim/dataSession.js +++ b/lib/rest/wireless/v1/sim/dataSession.js @@ -25,10 +25,10 @@ var DataSessionInstance; /** * @constructor Twilio.Wireless.V1.SimContext.DataSessionList * @description Initialize the DataSessionList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource - * @param {string} simSid - The sim_sid + * @param {string} simSid - + * The unique id of the SIM resource that this Data Session is for. */ /* jshint ignore:end */ DataSessionList = function DataSessionList(version, simSid) { @@ -312,7 +312,6 @@ DataSessionList = function DataSessionList(version, simSid) { * @constructor Twilio.Wireless.V1.SimContext.DataSessionPage * @augments Page * @description Initialize the DataSessionPage - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} response - Response from the API @@ -353,23 +352,37 @@ DataSessionPage.prototype.getInstance = function getInstance(payload) { /** * @constructor Twilio.Wireless.V1.SimContext.DataSessionInstance * @description Initialize the DataSessionContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * - * @property {string} sid - The sid - * @property {string} simSid - The sim_sid - * @property {string} accountSid - The account_sid - * @property {string} radioLink - The radio_link - * @property {string} operatorMcc - The operator_mcc - * @property {string} operatorMnc - The operator_mnc - * @property {string} operatorCountry - The operator_country - * @property {string} operatorName - The operator_name - * @property {string} cellId - The cell_id - * @property {string} cellLocationEstimate - The cell_location_estimate - * @property {number} packetsUploaded - The packets_uploaded - * @property {number} packetsDownloaded - The packets_downloaded - * @property {Date} lastUpdated - The last_updated - * @property {Date} start - The start - * @property {Date} end - The end + * @property {string} sid - + * The unique id of the Data Session resource that this Data Record is for. + * @property {string} simSid - + * The unique id of the SIM resource that this Data Session is for. + * @property {string} accountSid - + * The unique id of the Account that the SIM belongs to. + * @property {string} radioLink - + * The generation of wireless technology that the device was attached to the cellular tower using. + * @property {string} operatorMcc - + * The 'mobile country code' is the unique id of the home country where the Data Session took place. + * @property {string} operatorMnc - + * The 'mobile network code' is the unique id specific to the mobile operator network where the Data Session took place. + * @property {string} operatorCountry - + * The three letter country code representing where the device's Data Session took place. + * @property {string} operatorName - + * The friendly name of the mobile operator network that the SIM-connected device is attached to. + * @property {string} cellId - + * The unique id of the cellular tower that the device was attached to at the moment when the Data Session was last updated. + * @property {string} cellLocationEstimate - + * An object representing the estimated location where the device's Data Session took place. + * @property {number} packetsUploaded - + * The number of packets uploaded by the device between the start time and when the Data Session was last updated. + * @property {number} packetsDownloaded - + * The number of packets downloaded by the device between the start time and when the Data Session was last updated. + * @property {Date} lastUpdated - + * The date that this resource was last updated, given as GMT in ISO 8601 format. + * @property {Date} start - + * The date that this Data Session started, given as GMT in ISO 8601 format. + * @property {Date} end - + * The date that this record ended, given as GMT in ISO 8601 format. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/rest/wireless/v1/sim/usageRecord.js b/lib/rest/wireless/v1/sim/usageRecord.js index ae45750de9..7ec9edca08 100644 --- a/lib/rest/wireless/v1/sim/usageRecord.js +++ b/lib/rest/wireless/v1/sim/usageRecord.js @@ -23,10 +23,10 @@ var UsageRecordInstance; /** * @constructor Twilio.Wireless.V1.SimContext.UsageRecordList * @description Initialize the UsageRecordList - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource - * @param {string} simSid - The sim_sid + * @param {string} simSid - + * The unique id of the SIM resource that this Usage Record is for. */ /* jshint ignore:end */ UsageRecordList = function UsageRecordList(version, simSid) { @@ -67,9 +67,12 @@ UsageRecordList = function UsageRecordList(version, simSid) { * @instance * * @param {object|function} opts - ... - * @param {Date} [opts.end] - The end - * @param {Date} [opts.start] - The start - * @param {usage_record.granularity} [opts.granularity] - The granularity + * @param {Date} [opts.end] - + * Only include usage that has occurred on or before this date. + * @param {Date} [opts.start] - + * Only include usage that has occurred on or after this date. + * @param {usage_record.granularity} [opts.granularity] - + * The time-based grouping that results are aggregated by. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * each() guarantees never to return more than limit. @@ -158,9 +161,12 @@ UsageRecordList = function UsageRecordList(version, simSid) { * @instance * * @param {object|function} opts - ... - * @param {Date} [opts.end] - The end - * @param {Date} [opts.start] - The start - * @param {usage_record.granularity} [opts.granularity] - The granularity + * @param {Date} [opts.end] - + * Only include usage that has occurred on or before this date. + * @param {Date} [opts.start] - + * Only include usage that has occurred on or after this date. + * @param {usage_record.granularity} [opts.granularity] - + * The time-based grouping that results are aggregated by. * @param {number} [opts.limit] - * Upper limit for the number of records to return. * list() guarantees never to return more than limit. @@ -220,9 +226,12 @@ UsageRecordList = function UsageRecordList(version, simSid) { * @instance * * @param {object|function} opts - ... - * @param {Date} [opts.end] - The end - * @param {Date} [opts.start] - The start - * @param {usage_record.granularity} [opts.granularity] - The granularity + * @param {Date} [opts.end] - + * Only include usage that has occurred on or before this date. + * @param {Date} [opts.start] - + * Only include usage that has occurred on or after this date. + * @param {usage_record.granularity} [opts.granularity] - + * The time-based grouping that results are aggregated by. * @param {string} [opts.pageToken] - PageToken provided by the API * @param {number} [opts.pageNumber] - * Page Number, this value is simply for client state @@ -277,9 +286,12 @@ UsageRecordList = function UsageRecordList(version, simSid) { * @memberof Twilio.Wireless.V1.SimContext.UsageRecordList * @instance * - * @param {Date} [opts.end] - The end - * @param {Date} [opts.start] - The start - * @param {usage_record.granularity} [opts.granularity] - The granularity + * @param {Date} [opts.end] - + * Only include usage that has occurred on or before this date. + * @param {Date} [opts.start] - + * Only include usage that has occurred on or after this date. + * @param {usage_record.granularity} [opts.granularity] - + * The time-based grouping that results are aggregated by. * @param {string} [targetUrl] - API-generated URL for the requested results page * @param {function} [callback] - Callback to handle list of records * @@ -315,7 +327,6 @@ UsageRecordList = function UsageRecordList(version, simSid) { * @constructor Twilio.Wireless.V1.SimContext.UsageRecordPage * @augments Page * @description Initialize the UsageRecordPage - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} response - Response from the API @@ -356,13 +367,16 @@ UsageRecordPage.prototype.getInstance = function getInstance(payload) { /** * @constructor Twilio.Wireless.V1.SimContext.UsageRecordInstance * @description Initialize the UsageRecordContext - * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * - * @property {string} simSid - The sim_sid - * @property {string} accountSid - The account_sid - * @property {string} period - The period - * @property {string} commands - The commands - * @property {string} data - The data + * @property {string} simSid - + * The unique id of the SIM resource that this Usage Record is for. + * @property {string} accountSid - + * The unique id of the Account that the SIM belongs to. + * @property {string} period - The time period for which usage is reported. + * @property {string} commands - + * An object representing the Commands usage for the SIM over the period. + * @property {string} data - + * An object representing the Data usage for the SIM over the period. * * @param {Twilio.Wireless.V1} version - Version of the resource * @param {object} payload - The instance payload diff --git a/lib/twiml/FaxResponse.d.ts b/lib/twiml/FaxResponse.d.ts new file mode 100644 index 0000000000..f8f244150c --- /dev/null +++ b/lib/twiml/FaxResponse.d.ts @@ -0,0 +1,70 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import { HttpMethod, Url, PhoneNumber, Sid } from '../interfaces'; + +/** + * TwiML for Faxes + */ +declare class FaxResponse { + /** + * TwiML for Faxes + */ + constructor(); + + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + receive(attributes?: FaxResponse.ReceiveAttributes): void; + /** + * Convert to TwiML + * + * @returns TwiML XML + */ + toString(): any; +} + +declare namespace FaxResponse { + + /** + * Attributes for TwiML for Faxes + */ + export interface FaxResponseAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface ReceiveAttributes { + /** + * Receive action URL + */ + action?: string; + /** + * Receive action URL method + */ + method?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface ReceiveAttributes { + /** + * Receive action URL + */ + action?: string; + /** + * Receive action URL method + */ + method?: string; + } + +} +export = FaxResponse; diff --git a/lib/twiml/MessagingResponse.d.ts b/lib/twiml/MessagingResponse.d.ts new file mode 100644 index 0000000000..edb8e54d5c --- /dev/null +++ b/lib/twiml/MessagingResponse.d.ts @@ -0,0 +1,175 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import { HttpMethod, Url, PhoneNumber, Sid } from '../interfaces'; + +/** + * TwiML for Messages + */ +declare class MessagingResponse { + /** + * TwiML for Messages + */ + constructor(); + + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param body - Message Body + * + * @returns Message + */ + message(attributes?: MessagingResponse.MessageAttributes, body?: string): MessagingResponse.Message; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Redirect URL + */ + redirect(attributes: MessagingResponse.RedirectAttributes, url: string): void; + /** + * Convert to TwiML + * + * @returns TwiML XML + */ + toString(): any; +} + +declare namespace MessagingResponse { + + /** + * Attributes for TwiML for Messages + */ + export interface MessagingResponseAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface MessageAttributes { + /** + * Action URL + */ + action?: string; + /** + * Phone Number to send Message from + */ + from?: string; + /** + * Action URL Method + */ + method?: string; + /** + * Status callback URL. Deprecated in favor of action. + */ + statusCallback?: string; + /** + * Phone Number to send Message to + */ + to?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface RedirectAttributes { + /** + * Redirect URL method + */ + method?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface MessageAttributes { + /** + * Action URL + */ + action?: string; + /** + * Phone Number to send Message from + */ + from?: string; + /** + * Action URL Method + */ + method?: string; + /** + * Status callback URL. Deprecated in favor of action. + */ + statusCallback?: string; + /** + * Phone Number to send Message to + */ + to?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface RedirectAttributes { + /** + * Redirect URL method + */ + method?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface BodyAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface MediaAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface BodyAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface MediaAttributes { + } + + /** + * TwiML Verb + */ + export class Message { + /** + * TwiML Verb + * + * @param message - TwiML Verb + */ + constructor(message: any); + + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param message - Message Body + */ + body(attributes: MessagingResponse.BodyAttributes, message: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + media(attributes: MessagingResponse.MediaAttributes, url: string): void; + } + +} +export = MessagingResponse; diff --git a/lib/twiml/VoiceResponse.d.ts b/lib/twiml/VoiceResponse.d.ts new file mode 100644 index 0000000000..38a5090d4f --- /dev/null +++ b/lib/twiml/VoiceResponse.d.ts @@ -0,0 +1,1431 @@ +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +import { HttpMethod, Url, PhoneNumber, Sid } from '../interfaces'; + +/** + * TwiML for Voice + */ +declare class VoiceResponse { + /** + * TwiML for Voice + */ + constructor(); + + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param number - Phone number to dial + * + * @returns Dial + */ + dial(attributes?: VoiceResponse.DialAttributes, number?: string): VoiceResponse.Dial; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + echo(attributes?: VoiceResponse.EchoAttributes): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Friendly name + * + * @returns Enqueue + */ + enqueue(attributes?: VoiceResponse.EnqueueAttributes, name?: string): VoiceResponse.Enqueue; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * + * @returns Gather + */ + gather(attributes?: VoiceResponse.GatherAttributes): VoiceResponse.Gather; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + hangup(attributes?: VoiceResponse.HangupAttributes): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + leave(attributes?: VoiceResponse.LeaveAttributes): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes?: VoiceResponse.PauseAttributes): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + play(attributes?: VoiceResponse.PlayAttributes, url?: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Queue name + */ + queue(attributes: VoiceResponse.QueueAttributes, name: string): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + record(attributes?: VoiceResponse.RecordAttributes): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Redirect URL + */ + redirect(attributes: VoiceResponse.RedirectAttributes, url: string): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + reject(attributes?: VoiceResponse.RejectAttributes): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param message - Message to say + */ + say(attributes: VoiceResponse.SayAttributes, message: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param message - Message body + */ + sms(attributes: VoiceResponse.SmsAttributes, message: string): void; + /** + * Convert to TwiML + * + * @returns TwiML XML + */ + toString(): any; +} + +declare namespace VoiceResponse { + + type ConferenceTrim = 'trim-silence'|'do-not-trim'; + + type GatherLanguage = 'af-ZA'|'id-ID'|'ms-MY'|'ca-ES'|'cs-CZ'|'da-DK'|'de-DE'|'en-AU'|'en-CA'|'en-GB'|'en-IN'|'en-IE'|'en-NZ'|'en-PH'|'en-ZA'|'en-US'|'es-AR'|'es-BO'|'es-CL'|'es-CO'|'es-CR'|'es-EC'|'es-SV'|'es-ES'|'es-US'|'es-GT'|'es-HN'|'es-MX'|'es-NI'|'es-PA'|'es-PY'|'es-PE'|'es-PR'|'es-DO'|'es-UY'|'es-VE'|'eu-ES'|'il-PH'|'fr-CA'|'fr-FR'|'gl-ES'|'hr-HR'|'zu-ZA'|'is-IS'|'it-IT'|'lt-LT'|'hu-HU'|'nl-NL'|'nb-NO'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'sk-SK'|'sl-SI'|'fi-FI'|'sv-SE'|'vi-VN'|'tr-TR'|'el-GR'|'bg-BG'|'ru-RU'|'sr-RS'|'uk-UA'|'he-IL'|'ar-IL'|'ar-JO'|'ar-AE'|'ar-BH'|'ar-DZ'|'ar-SA'|'ar-IQ'|'ar-KW'|'ar-MA'|'ar-TN'|'ar-OM'|'ar-PS'|'ar-QA'|'ar-LB'|'ar-EG'|'fa-IR'|'hi-IN'|'th-TH'|'ko-KR'|'cmn-Hant-TW'|'yue-Hant-HK'|'ja-JP'|'cmn-Hans-HK'|'cmn-Hans-CN'; + + type SipEvent = 'initiated'|'ringing'|'answered'|'completed'; + + type RejectReason = 'rejected'|'busy'; + + type ConferenceBeep = 'true'|'false'|'onEnter'|'onExit'; + + type ConferenceEvent = 'start'|'end'|'join'|'leave'|'mute'|'hold'|'speaker'; + + type ConferenceRecord = 'do-not-record'|'record-from-start'; + + type SayVoice = 'man'|'woman'|'alice'; + + type NumberEvent = 'initiated'|'ringing'|'answered'|'completed'; + + type RecordTrim = 'trim-silence'|'do-not-trim'; + + type ConferenceRecordingEvent = 'started'|'stopped'|'paused'|'resumed'|'completed'|'failed'; + + type SayLanguage = 'da-DK'|'de-DE'|'en-AU'|'en-CA'|'en-GB'|'en-IN'|'en-US'|'ca-ES'|'es-ES'|'es-MX'|'fi-FI'|'fr-CA'|'fr-FR'|'it-IT'|'ja-JP'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ru-RU'|'sv-SE'|'zh-CN'|'zh-HK'|'zh-TW'; + + type DialRingTone = 'at'|'au'|'bg'|'br'|'be'|'ch'|'cl'|'cn'|'cz'|'de'|'dk'|'ee'|'es'|'fi'|'fr'|'gr'|'hu'|'il'|'in'|'it'|'lt'|'jp'|'mx'|'my'|'nl'|'no'|'nz'|'ph'|'pl'|'pt'|'ru'|'se'|'sg'|'th'|'uk'|'us'|'us-old'|'tw'|'ve'|'za'; + + type DialRecordingEvent = 'in-progress'|'completed'|'failed'; + + type DialRecord = 'do-not-record'|'record-from-answer'|'record-from-ringing'|'record-from-answer-dual'|'record-from-ringing-dual'; + + type ClientEvent = 'initiated'|'ringing'|'answered'|'completed'; + + type GatherInput = 'dtmf'|'speech'; + + type ConferenceRegion = 'us1'|'ie1'|'sg1'|'br1'|'au1'|'jp1'; + + type DialTrim = 'trim-silence'|'do-not-trim'; + + /** + * Attributes for TwiML for Voice + */ + export interface VoiceResponseAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface DialAttributes { + /** + * Action URL + */ + action?: string; + /** + * Preserve the ringing behavior of the inbound call until the Dialed call picks up + */ + answerOnBridge?: boolean; + /** + * Caller ID to display + */ + callerId?: string; + /** + * Hangup call on star press + */ + hangupOnStar?: boolean; + /** + * Action URL method + */ + method?: string; + /** + * Record the call + */ + record?: DialRecord; + /** + * Recording status callback URL + */ + recordingStatusCallback?: string; + /** + * Recording status callback events + */ + recordingStatusCallbackEvent?: DialRecordingEvent; + /** + * Recording status callback URL method + */ + recordingStatusCallbackMethod?: string; + /** + * Ringtone allows you to override the ringback tone that Twilio will play back to the caller while executing the Dial + */ + ringTone?: DialRingTone; + /** + * Max time length + */ + timeLimit?: number; + /** + * Time to wait for answer + */ + timeout?: number; + /** + * Trim the recording + */ + trim?: DialTrim; + } + + /** + * Attributes for TwiML Verb + */ + export interface EchoAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface EnqueueAttributes { + /** + * Action URL + */ + action?: string; + /** + * Action URL method + */ + method?: string; + /** + * Wait URL + */ + waitUrl?: string; + /** + * Wait URL method + */ + waitUrlMethod?: string; + /** + * TaskRouter Workflow SID + */ + workflowSid?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface GatherAttributes { + /** + * Action URL + */ + action?: string; + /** + * Stop playing media upon speech + */ + bargeIn?: boolean; + /** + * Finish gather on key + */ + finishOnKey?: string; + /** + * Speech recognition hints + */ + hints?: string; + /** + * Input type Twilio should accept + */ + input?: GatherInput; + /** + * Language to use + */ + language?: GatherLanguage; + /** + * Max allowed time for speech input + */ + maxSpeechTime?: number; + /** + * Action URL method + */ + method?: string; + /** + * Number of digits to collect + */ + numDigits?: number; + /** + * Partial result callback URL + */ + partialResultCallback?: string; + /** + * Partial result callback URL method + */ + partialResultCallbackMethod?: string; + /** + * Profanity Filter on speech + */ + profanityFilter?: boolean; + /** + * Time to wait to gather speech input and it should be either auto or a positive integer. + */ + speechTimeout?: string; + /** + * Time to wait to gather input + */ + timeout?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface HangupAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface LeaveAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface PauseAttributes { + /** + * Length in seconds to pause + */ + length?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface PlayAttributes { + /** + * Play DTMF tones for digits + */ + digits?: string; + /** + * Times to loop media + */ + loop?: number; + } + + /** + * Attributes for TwiML Noun + */ + export interface QueueAttributes { + /** + * Action URL method + */ + method?: string; + /** + * TaskRouter Activity SID + */ + postWorkActivitySid?: string; + /** + * TaskRouter Reservation SID + */ + reservationSid?: string; + /** + * Action URL + */ + url?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface RecordAttributes { + /** + * Action URL + */ + action?: string; + /** + * Finish recording on key + */ + finishOnKey?: string; + /** + * Max time to record in seconds + */ + maxLength?: number; + /** + * Action URL method + */ + method?: string; + /** + * Play beep + */ + playBeep?: boolean; + /** + * Status callback URL + */ + recordingStatusCallback?: string; + /** + * Status callback URL method + */ + recordingStatusCallbackMethod?: string; + /** + * Timeout to begin recording + */ + timeout?: number; + /** + * Transcribe the recording + */ + transcribe?: boolean; + /** + * Transcribe callback URL + */ + transcribeCallback?: string; + /** + * Trim the recording + */ + trim?: RecordTrim; + } + + /** + * Attributes for TwiML Verb + */ + export interface RedirectAttributes { + /** + * Redirect URL method + */ + method?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface RejectAttributes { + /** + * Rejection reason + */ + reason?: RejectReason; + } + + /** + * Attributes for TwiML Verb + */ + export interface SayAttributes { + /** + * Message langauge + */ + language?: SayLanguage; + /** + * Times to loop message + */ + loop?: number; + /** + * Voice to use + */ + voice?: SayVoice; + } + + /** + * Attributes for TwiML Noun + */ + export interface SmsAttributes { + /** + * Action URL + */ + action?: string; + /** + * Number to send message from + */ + from?: string; + /** + * Action URL method + */ + method?: string; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Number to send message to + */ + to?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface DialAttributes { + /** + * Action URL + */ + action?: string; + /** + * Preserve the ringing behavior of the inbound call until the Dialed call picks up + */ + answerOnBridge?: boolean; + /** + * Caller ID to display + */ + callerId?: string; + /** + * Hangup call on star press + */ + hangupOnStar?: boolean; + /** + * Action URL method + */ + method?: string; + /** + * Record the call + */ + record?: DialRecord; + /** + * Recording status callback URL + */ + recordingStatusCallback?: string; + /** + * Recording status callback events + */ + recordingStatusCallbackEvent?: DialRecordingEvent; + /** + * Recording status callback URL method + */ + recordingStatusCallbackMethod?: string; + /** + * Ringtone allows you to override the ringback tone that Twilio will play back to the caller while executing the Dial + */ + ringTone?: DialRingTone; + /** + * Max time length + */ + timeLimit?: number; + /** + * Time to wait for answer + */ + timeout?: number; + /** + * Trim the recording + */ + trim?: DialTrim; + } + + /** + * Attributes for TwiML Verb + */ + export interface EchoAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface EnqueueAttributes { + /** + * Action URL + */ + action?: string; + /** + * Action URL method + */ + method?: string; + /** + * Wait URL + */ + waitUrl?: string; + /** + * Wait URL method + */ + waitUrlMethod?: string; + /** + * TaskRouter Workflow SID + */ + workflowSid?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface GatherAttributes { + /** + * Action URL + */ + action?: string; + /** + * Stop playing media upon speech + */ + bargeIn?: boolean; + /** + * Finish gather on key + */ + finishOnKey?: string; + /** + * Speech recognition hints + */ + hints?: string; + /** + * Input type Twilio should accept + */ + input?: GatherInput; + /** + * Language to use + */ + language?: GatherLanguage; + /** + * Max allowed time for speech input + */ + maxSpeechTime?: number; + /** + * Action URL method + */ + method?: string; + /** + * Number of digits to collect + */ + numDigits?: number; + /** + * Partial result callback URL + */ + partialResultCallback?: string; + /** + * Partial result callback URL method + */ + partialResultCallbackMethod?: string; + /** + * Profanity Filter on speech + */ + profanityFilter?: boolean; + /** + * Time to wait to gather speech input and it should be either auto or a positive integer. + */ + speechTimeout?: string; + /** + * Time to wait to gather input + */ + timeout?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface HangupAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface LeaveAttributes { + } + + /** + * Attributes for TwiML Verb + */ + export interface PauseAttributes { + /** + * Length in seconds to pause + */ + length?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface PlayAttributes { + /** + * Play DTMF tones for digits + */ + digits?: string; + /** + * Times to loop media + */ + loop?: number; + } + + /** + * Attributes for TwiML Noun + */ + export interface QueueAttributes { + /** + * Action URL method + */ + method?: string; + /** + * TaskRouter Activity SID + */ + postWorkActivitySid?: string; + /** + * TaskRouter Reservation SID + */ + reservationSid?: string; + /** + * Action URL + */ + url?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface RecordAttributes { + /** + * Action URL + */ + action?: string; + /** + * Finish recording on key + */ + finishOnKey?: string; + /** + * Max time to record in seconds + */ + maxLength?: number; + /** + * Action URL method + */ + method?: string; + /** + * Play beep + */ + playBeep?: boolean; + /** + * Status callback URL + */ + recordingStatusCallback?: string; + /** + * Status callback URL method + */ + recordingStatusCallbackMethod?: string; + /** + * Timeout to begin recording + */ + timeout?: number; + /** + * Transcribe the recording + */ + transcribe?: boolean; + /** + * Transcribe callback URL + */ + transcribeCallback?: string; + /** + * Trim the recording + */ + trim?: RecordTrim; + } + + /** + * Attributes for TwiML Verb + */ + export interface RedirectAttributes { + /** + * Redirect URL method + */ + method?: string; + } + + /** + * Attributes for TwiML Verb + */ + export interface RejectAttributes { + /** + * Rejection reason + */ + reason?: RejectReason; + } + + /** + * Attributes for TwiML Verb + */ + export interface SayAttributes { + /** + * Message langauge + */ + language?: SayLanguage; + /** + * Times to loop message + */ + loop?: number; + /** + * Voice to use + */ + voice?: SayVoice; + } + + /** + * Attributes for TwiML Noun + */ + export interface SmsAttributes { + /** + * Action URL + */ + action?: string; + /** + * Number to send message from + */ + from?: string; + /** + * Action URL method + */ + method?: string; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Number to send message to + */ + to?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface ClientAttributes { + /** + * Client URL Method + */ + method?: string; + /** + * Status Callback URL + */ + statusCallback?: string; + /** + * Events to trigger status callback + */ + statusCallbackEvent?: ClientEvent; + /** + * Status Callback URL Method + */ + statusCallbackMethod?: string; + /** + * Client URL + */ + url?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface ConferenceAttributes { + /** + * Play beep when joining + */ + beep?: ConferenceBeep; + /** + * End the conferenceon exit + */ + endConferenceOnExit?: boolean; + /** + * Event callback URL + */ + eventCallbackUrl?: string; + /** + * Maximum number of participants + */ + maxParticipants?: number; + /** + * Join the conference muted + */ + muted?: boolean; + /** + * Record the conference + */ + record?: ConferenceRecord; + /** + * Recording status callback URL + */ + recordingStatusCallback?: string; + /** + * Recording status callback events + */ + recordingStatusCallbackEvent?: ConferenceRecordingEvent; + /** + * Recording status callback URL method + */ + recordingStatusCallbackMethod?: string; + /** + * Conference region + */ + region?: ConferenceRegion; + /** + * Start the conference on enter + */ + startConferenceOnEnter?: boolean; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Events to call status callback URL + */ + statusCallbackEvent?: ConferenceEvent; + /** + * Status callback URL method + */ + statusCallbackMethod?: string; + /** + * Trim the conference recording + */ + trim?: ConferenceTrim; + /** + * Wait URL method + */ + waitMethod?: string; + /** + * Wait URL + */ + waitUrl?: string; + /** + * Call whisper + */ + whisper?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface NumberAttributes { + /** + * TwiML URL method + */ + method?: string; + /** + * DTMF tones to play when the call is answered + */ + sendDigits?: string; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Events to call status callback + */ + statusCallbackEvent?: NumberEvent; + /** + * Status callback URL method + */ + statusCallbackMethod?: string; + /** + * TwiML URL + */ + url?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface QueueAttributes { + /** + * Action URL method + */ + method?: string; + /** + * TaskRouter Activity SID + */ + postWorkActivitySid?: string; + /** + * TaskRouter Reservation SID + */ + reservationSid?: string; + /** + * Action URL + */ + url?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface SimAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface SipAttributes { + /** + * Action URL method + */ + method?: string; + /** + * SIP Password + */ + password?: string; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Status callback events + */ + statusCallbackEvent?: SipEvent; + /** + * Status callback URL method + */ + statusCallbackMethod?: string; + /** + * Action URL + */ + url?: string; + /** + * SIP Username + */ + username?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface TaskAttributes { + /** + * Task priority + */ + priority?: number; + /** + * Timeout associated with task + */ + timeout?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface SayAttributes { + /** + * Message langauge + */ + language?: SayLanguage; + /** + * Times to loop message + */ + loop?: number; + /** + * Voice to use + */ + voice?: SayVoice; + } + + /** + * Attributes for TwiML Verb + */ + export interface PauseAttributes { + /** + * Length in seconds to pause + */ + length?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface PlayAttributes { + /** + * Play DTMF tones for digits + */ + digits?: string; + /** + * Times to loop media + */ + loop?: number; + } + + /** + * Attributes for TwiML Noun + */ + export interface ClientAttributes { + /** + * Client URL Method + */ + method?: string; + /** + * Status Callback URL + */ + statusCallback?: string; + /** + * Events to trigger status callback + */ + statusCallbackEvent?: ClientEvent; + /** + * Status Callback URL Method + */ + statusCallbackMethod?: string; + /** + * Client URL + */ + url?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface ConferenceAttributes { + /** + * Play beep when joining + */ + beep?: ConferenceBeep; + /** + * End the conferenceon exit + */ + endConferenceOnExit?: boolean; + /** + * Event callback URL + */ + eventCallbackUrl?: string; + /** + * Maximum number of participants + */ + maxParticipants?: number; + /** + * Join the conference muted + */ + muted?: boolean; + /** + * Record the conference + */ + record?: ConferenceRecord; + /** + * Recording status callback URL + */ + recordingStatusCallback?: string; + /** + * Recording status callback events + */ + recordingStatusCallbackEvent?: ConferenceRecordingEvent; + /** + * Recording status callback URL method + */ + recordingStatusCallbackMethod?: string; + /** + * Conference region + */ + region?: ConferenceRegion; + /** + * Start the conference on enter + */ + startConferenceOnEnter?: boolean; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Events to call status callback URL + */ + statusCallbackEvent?: ConferenceEvent; + /** + * Status callback URL method + */ + statusCallbackMethod?: string; + /** + * Trim the conference recording + */ + trim?: ConferenceTrim; + /** + * Wait URL method + */ + waitMethod?: string; + /** + * Wait URL + */ + waitUrl?: string; + /** + * Call whisper + */ + whisper?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface NumberAttributes { + /** + * TwiML URL method + */ + method?: string; + /** + * DTMF tones to play when the call is answered + */ + sendDigits?: string; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Events to call status callback + */ + statusCallbackEvent?: NumberEvent; + /** + * Status callback URL method + */ + statusCallbackMethod?: string; + /** + * TwiML URL + */ + url?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface QueueAttributes { + /** + * Action URL method + */ + method?: string; + /** + * TaskRouter Activity SID + */ + postWorkActivitySid?: string; + /** + * TaskRouter Reservation SID + */ + reservationSid?: string; + /** + * Action URL + */ + url?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface SimAttributes { + } + + /** + * Attributes for TwiML Noun + */ + export interface SipAttributes { + /** + * Action URL method + */ + method?: string; + /** + * SIP Password + */ + password?: string; + /** + * Status callback URL + */ + statusCallback?: string; + /** + * Status callback events + */ + statusCallbackEvent?: SipEvent; + /** + * Status callback URL method + */ + statusCallbackMethod?: string; + /** + * Action URL + */ + url?: string; + /** + * SIP Username + */ + username?: string; + } + + /** + * Attributes for TwiML Noun + */ + export interface TaskAttributes { + /** + * Task priority + */ + priority?: number; + /** + * Timeout associated with task + */ + timeout?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface SayAttributes { + /** + * Message langauge + */ + language?: SayLanguage; + /** + * Times to loop message + */ + loop?: number; + /** + * Voice to use + */ + voice?: SayVoice; + } + + /** + * Attributes for TwiML Verb + */ + export interface PauseAttributes { + /** + * Length in seconds to pause + */ + length?: number; + } + + /** + * Attributes for TwiML Verb + */ + export interface PlayAttributes { + /** + * Play DTMF tones for digits + */ + digits?: string; + /** + * Times to loop media + */ + loop?: number; + } + + /** + * TwiML Verb + */ + export class Gather { + /** + * TwiML Verb + * + * @param gather - TwiML Verb + */ + constructor(gather: any); + + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + */ + pause(attributes?: VoiceResponse.PauseAttributes): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param url - Media URL + */ + play(attributes?: VoiceResponse.PlayAttributes, url?: string): void; + /** + * TwiML Verb + * + * @param attributes - TwiML attributes + * @param message - Message to say + */ + say(attributes: VoiceResponse.SayAttributes, message: string): void; + } + + /** + * TwiML Noun + */ + export class Enqueue { + /** + * TwiML Noun + * + * @param enqueue - TwiML Noun + */ + constructor(enqueue: any); + + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param body - TaskRouter task attributes + */ + task(attributes: VoiceResponse.TaskAttributes, body: string): void; + } + + /** + * TwiML Verb + */ + export class Dial { + /** + * TwiML Verb + * + * @param dial - TwiML Verb + */ + constructor(dial: any); + + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Client name + */ + client(attributes: VoiceResponse.ClientAttributes, name: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Conference name + */ + conference(attributes: VoiceResponse.ConferenceAttributes, name: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param phoneNumber - Phone Number to dial + */ + number(attributes: VoiceResponse.NumberAttributes, phoneNumber: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param name - Queue name + */ + queue(attributes: VoiceResponse.QueueAttributes, name: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param simSid - SIM SID + */ + sim(attributes: VoiceResponse.SimAttributes, simSid: string): void; + /** + * TwiML Noun + * + * @param attributes - TwiML attributes + * @param sipUrl - SIP URL + */ + sip(attributes: VoiceResponse.SipAttributes, sipUrl: string): void; + } + +} +export = VoiceResponse; diff --git a/spec/integration/rest/chat/v2/service/channel.spec.js b/spec/integration/rest/chat/v2/service/channel.spec.js index 236a374ea7..ed3329f0ba 100644 --- a/spec/integration/rest/chat/v2/service/channel.spec.js +++ b/spec/integration/rest/chat/v2/service/channel.spec.js @@ -75,6 +75,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } }); @@ -176,6 +177,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } }); @@ -237,6 +239,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } } @@ -338,6 +341,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } }); diff --git a/spec/integration/rest/chat/v2/service/channel/webhook.spec.js b/spec/integration/rest/chat/v2/service/channel/webhook.spec.js new file mode 100644 index 0000000000..7fc264e99d --- /dev/null +++ b/spec/integration/rest/chat/v2/service/channel/webhook.spec.js @@ -0,0 +1,401 @@ +'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('Webhook', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid read_full response', + function() { + var body = JSON.stringify({ + 'meta': { + 'page': 0, + 'page_size': 5, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'next_page_url': null, + 'key': 'webhooks' + }, + 'webhooks': [ + { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'webhook', + 'configuration': { + 'url': 'dummy', + 'method': 'GET', + 'filters': [ + 'onMessageSent', + 'onChannelDestroyed' + ], + 'retry_count': 2 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'trigger', + 'configuration': { + 'url': 'dummy', + 'method': 'POST', + 'filters': [ + 'keyword1', + 'keyword2' + ], + 'retry_count': 3 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'studio', + 'configuration': { + 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + ] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.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({ + 'meta': { + 'page': 0, + 'page_size': 5, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'previous_page_url': null, + 'next_page_url': null, + 'key': 'webhooks' + }, + 'webhooks': [] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.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.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + sid: 'WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>')(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', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'studio', + 'configuration': { + 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid create request', + function() { + holodeck.mock(new Response(500, '{}')); + + var opts = {type: 'webhook'}; + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.create(opts); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks')(solution); + + var values = {Type: 'webhook', }; + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url, + data: values + })); + } + ); + it('should generate valid create response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'webhook', + 'configuration': { + 'url': 'dummy', + 'method': 'GET', + 'filters': [ + 'onMessageSent', + 'onChannelDestroyed' + ], + 'retry_count': 2 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(201, body)); + + var opts = {type: 'webhook'}; + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.create(opts); + 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.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + sid: 'WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'trigger', + 'configuration': { + 'url': 'dummy', + 'method': 'POST', + 'filters': [ + 'keyword1', + 'keyword2' + ], + 'retry_count': 3 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:51Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid remove request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + sid: 'WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'DELETE', + url: url + })); + } + ); + it('should generate valid delete response', + function() { + var body = JSON.stringify(null); + + holodeck.mock(new Response(204, body)); + + var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); + promise = promise.then(function(response) { + expect(response).toBe(true); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); + diff --git a/spec/integration/rest/ipMessaging/v2/service/channel.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel.spec.js index 0466651f81..2e1955196d 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel.spec.js @@ -75,6 +75,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } }); @@ -176,6 +177,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } }); @@ -237,6 +239,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } } @@ -338,6 +341,7 @@ describe('Channel', function() { 'members': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', 'messages': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'invites': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', + 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } }); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js new file mode 100644 index 0000000000..d11e48029b --- /dev/null +++ b/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js @@ -0,0 +1,401 @@ +'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('Webhook', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid read_full response', + function() { + var body = JSON.stringify({ + 'meta': { + 'page': 0, + 'page_size': 5, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'next_page_url': null, + 'key': 'webhooks' + }, + 'webhooks': [ + { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'webhook', + 'configuration': { + 'url': 'dummy', + 'method': 'GET', + 'filters': [ + 'onMessageSent', + 'onChannelDestroyed' + ], + 'retry_count': 2 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'trigger', + 'configuration': { + 'url': 'dummy', + 'method': 'POST', + 'filters': [ + 'keyword1', + 'keyword2' + ], + 'retry_count': 3 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + { + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'studio', + 'configuration': { + 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + ] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.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({ + 'meta': { + 'page': 0, + 'page_size': 5, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks?PageSize=5&Page=0', + 'previous_page_url': null, + 'next_page_url': null, + 'key': 'webhooks' + }, + 'webhooks': [] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.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.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + sid: 'WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>')(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', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'studio', + 'configuration': { + 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid create request', + function() { + holodeck.mock(new Response(500, '{}')); + + var opts = {type: 'webhook'}; + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.create(opts); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks')(solution); + + var values = {Type: 'webhook', }; + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url, + data: values + })); + } + ); + it('should generate valid create response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'webhook', + 'configuration': { + 'url': 'dummy', + 'method': 'GET', + 'filters': [ + 'onMessageSent', + 'onChannelDestroyed' + ], + 'retry_count': 2 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:50Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(201, body)); + + var opts = {type: 'webhook'}; + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks.create(opts); + 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.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + sid: 'WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'POST', + url: url + })); + } + ); + it('should generate valid update response', + function() { + var body = JSON.stringify({ + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'type': 'trigger', + 'configuration': { + 'url': 'dummy', + 'method': 'POST', + 'filters': [ + 'keyword1', + 'keyword2' + ], + 'retry_count': 3 + }, + 'date_created': '2016-03-24T21:05:50Z', + 'date_updated': '2016-03-24T21:05:51Z', + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); + promise = promise.then(function(response) { + expect(response).toBeDefined(); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); + it('should generate valid remove request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + channelSid: 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', + sid: 'WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Webhooks/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'DELETE', + url: url + })); + } + ); + it('should generate valid delete response', + function() { + var body = JSON.stringify(null); + + holodeck.mock(new Response(204, body)); + + var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); + promise = promise.then(function(response) { + expect(response).toBe(true); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); +