diff --git a/lib/rest/Authy.js b/lib/rest/Authy.js index 6746b07f4e..68e9e8159d 100644 --- a/lib/rest/Authy.js +++ b/lib/rest/Authy.js @@ -21,8 +21,8 @@ var V1 = require('./authy/V1'); /* jshint ignore:line */ * @constructor Twilio.Authy * * @property {Twilio.Authy.V1} v1 - v1 version - * @property {Twilio.Authy.V1.ServiceList} services - services resource * @property {Twilio.Authy.V1.FormList} forms - forms resource + * @property {Twilio.Authy.V1.ServiceList} services - services resource * * @param {Twilio} twilio - The twilio client */ @@ -46,16 +46,16 @@ Object.defineProperty(Authy.prototype, }); Object.defineProperty(Authy.prototype, - 'services', { + 'forms', { get: function() { - return this.v1.services; + return this.v1.forms; } }); Object.defineProperty(Authy.prototype, - 'forms', { + 'services', { get: function() { - return this.v1.forms; + return this.v1.services; } }); diff --git a/lib/rest/FlexApi.js b/lib/rest/FlexApi.js index bfa307887b..2d52bc966d 100644 --- a/lib/rest/FlexApi.js +++ b/lib/rest/FlexApi.js @@ -21,11 +21,11 @@ var V1 = require('./flexApi/V1'); /* jshint ignore:line */ * @constructor Twilio.FlexApi * * @property {Twilio.FlexApi.V1} v1 - v1 version - * @property {Twilio.FlexApi.V1.FlexFlowList} flexFlow - flexFlow resource * @property {Twilio.FlexApi.V1.ChannelList} channel - channel resource - * @property {Twilio.FlexApi.V1.WebChannelList} webChannel - webChannel resource * @property {Twilio.FlexApi.V1.ConfigurationList} configuration - * configuration resource + * @property {Twilio.FlexApi.V1.FlexFlowList} flexFlow - flexFlow resource + * @property {Twilio.FlexApi.V1.WebChannelList} webChannel - webChannel resource * * @param {Twilio} twilio - The twilio client */ @@ -49,30 +49,30 @@ Object.defineProperty(FlexApi.prototype, }); Object.defineProperty(FlexApi.prototype, - 'flexFlow', { + 'channel', { get: function() { - return this.v1.flexFlow; + return this.v1.channel; } }); Object.defineProperty(FlexApi.prototype, - 'channel', { + 'configuration', { get: function() { - return this.v1.channel; + return this.v1.configuration; } }); Object.defineProperty(FlexApi.prototype, - 'webChannel', { + 'flexFlow', { get: function() { - return this.v1.webChannel; + return this.v1.flexFlow; } }); Object.defineProperty(FlexApi.prototype, - 'configuration', { + 'webChannel', { get: function() { - return this.v1.configuration; + return this.v1.webChannel; } }); diff --git a/lib/rest/Messaging.js b/lib/rest/Messaging.js index 2231493fa8..b32b5ade83 100644 --- a/lib/rest/Messaging.js +++ b/lib/rest/Messaging.js @@ -21,8 +21,8 @@ var V1 = require('./messaging/V1'); /* jshint ignore:line */ * @constructor Twilio.Messaging * * @property {Twilio.Messaging.V1} v1 - v1 version - * @property {Twilio.Messaging.V1.SessionList} sessions - sessions resource * @property {Twilio.Messaging.V1.ServiceList} services - services resource + * @property {Twilio.Messaging.V1.SessionList} sessions - sessions resource * @property {Twilio.Messaging.V1.WebhookList} webhooks - webhooks resource * * @param {Twilio} twilio - The twilio client @@ -47,16 +47,16 @@ Object.defineProperty(Messaging.prototype, }); Object.defineProperty(Messaging.prototype, - 'sessions', { + 'services', { get: function() { - return this.v1.sessions; + return this.v1.services; } }); Object.defineProperty(Messaging.prototype, - 'services', { + 'sessions', { get: function() { - return this.v1.services; + return this.v1.sessions; } }); diff --git a/lib/rest/Preview.js b/lib/rest/Preview.js index 5fcbe5c700..b2d87009e9 100644 --- a/lib/rest/Preview.js +++ b/lib/rest/Preview.js @@ -48,10 +48,10 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */ * authorizationDocuments resource * @property {Twilio.Preview.HostedNumbers.HostedNumberOrderList} hostedNumberOrders - * hostedNumberOrders resource - * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns - - * installedAddOns resource * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - * availableAddOns resource + * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns - + * installedAddOns resource * @property {Twilio.Preview.Sync.ServiceList} services - services resource * @property {Twilio.Preview.Understand.AssistantList} assistants - * assistants resource @@ -60,12 +60,12 @@ var Wireless = require('./preview/Wireless'); /* jshint ignore:line */ * @property {Twilio.Preview.Wireless.SimList} sims - sims resource * @property {Twilio.Preview.TrustedComms.BrandedCallList} brandedCalls - * brandedCalls resource + * @property {Twilio.Preview.TrustedComms.CpsList} cps - cps resource + * @property {Twilio.Preview.TrustedComms.CurrentCallList} currentCalls - + * currentCalls resource * @property {Twilio.Preview.TrustedComms.DeviceList} devices - devices resource * @property {Twilio.Preview.TrustedComms.PhoneCallList} phoneCalls - * phoneCalls resource - * @property {Twilio.Preview.TrustedComms.CurrentCallList} currentCalls - - * currentCalls resource - * @property {Twilio.Preview.TrustedComms.CpsList} cps - cps resource * * @param {Twilio} twilio - The twilio client */ @@ -196,16 +196,16 @@ Object.defineProperty(Preview.prototype, }); Object.defineProperty(Preview.prototype, - 'installedAddOns', { + 'availableAddOns', { get: function() { - return this.marketplace.installedAddOns; + return this.marketplace.availableAddOns; } }); Object.defineProperty(Preview.prototype, - 'availableAddOns', { + 'installedAddOns', { get: function() { - return this.marketplace.availableAddOns; + return this.marketplace.installedAddOns; } }); @@ -252,30 +252,30 @@ Object.defineProperty(Preview.prototype, }); Object.defineProperty(Preview.prototype, - 'devices', { + 'cps', { get: function() { - return this.trusted_comms.devices; + return this.trusted_comms.cps; } }); Object.defineProperty(Preview.prototype, - 'phoneCalls', { + 'currentCalls', { get: function() { - return this.trusted_comms.phoneCalls; + return this.trusted_comms.currentCalls; } }); Object.defineProperty(Preview.prototype, - 'currentCalls', { + 'devices', { get: function() { - return this.trusted_comms.currentCalls; + return this.trusted_comms.devices; } }); Object.defineProperty(Preview.prototype, - 'cps', { + 'phoneCalls', { get: function() { - return this.trusted_comms.cps; + return this.trusted_comms.phoneCalls; } }); diff --git a/lib/rest/Video.js b/lib/rest/Video.js index 1bf78ee9a2..48a04f9a17 100644 --- a/lib/rest/Video.js +++ b/lib/rest/Video.js @@ -21,6 +21,7 @@ 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.CompositionHookList} compositionHooks - * compositionHooks resource * @property {Twilio.Video.V1.CompositionSettingsList} compositionSettings - @@ -28,7 +29,6 @@ var V1 = require('./video/V1'); /* jshint ignore:line */ * @property {Twilio.Video.V1.RecordingList} recordings - recordings resource * @property {Twilio.Video.V1.RecordingSettingsList} recordingSettings - * recordingSettings resource - * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.RoomList} rooms - rooms resource * * @param {Twilio} twilio - The twilio client @@ -52,6 +52,13 @@ Object.defineProperty(Video.prototype, } }); +Object.defineProperty(Video.prototype, + 'compositions', { + get: function() { + return this.v1.compositions; + } +}); + Object.defineProperty(Video.prototype, 'compositionHooks', { get: function() { @@ -80,13 +87,6 @@ Object.defineProperty(Video.prototype, } }); -Object.defineProperty(Video.prototype, - 'compositions', { - get: function() { - return this.v1.compositions; - } -}); - Object.defineProperty(Video.prototype, 'rooms', { get: function() { diff --git a/lib/rest/Wireless.js b/lib/rest/Wireless.js index 3b3aaadae3..c0b43fe249 100644 --- a/lib/rest/Wireless.js +++ b/lib/rest/Wireless.js @@ -21,10 +21,10 @@ var V1 = require('./wireless/V1'); /* jshint ignore:line */ * @constructor Twilio.Wireless * * @property {Twilio.Wireless.V1} v1 - v1 version - * @property {Twilio.Wireless.V1.CommandList} commands - commands resource - * @property {Twilio.Wireless.V1.RatePlanList} ratePlans - ratePlans resource * @property {Twilio.Wireless.V1.UsageRecordList} usageRecords - * usageRecords resource + * @property {Twilio.Wireless.V1.CommandList} commands - commands resource + * @property {Twilio.Wireless.V1.RatePlanList} ratePlans - ratePlans resource * @property {Twilio.Wireless.V1.SimList} sims - sims resource * * @param {Twilio} twilio - The twilio client @@ -49,23 +49,23 @@ Object.defineProperty(Wireless.prototype, }); Object.defineProperty(Wireless.prototype, - 'commands', { + 'usageRecords', { get: function() { - return this.v1.commands; + return this.v1.usageRecords; } }); Object.defineProperty(Wireless.prototype, - 'ratePlans', { + 'commands', { get: function() { - return this.v1.ratePlans; + return this.v1.commands; } }); Object.defineProperty(Wireless.prototype, - 'usageRecords', { + 'ratePlans', { get: function() { - return this.v1.usageRecords; + return this.v1.ratePlans; } }); diff --git a/lib/rest/authy/V1.js b/lib/rest/authy/V1.js index 5e384777c0..a68077a558 100644 --- a/lib/rest/authy/V1.js +++ b/lib/rest/authy/V1.js @@ -21,8 +21,8 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * * @constructor Twilio.Authy.V1 * - * @property {Twilio.Authy.V1.ServiceList} services - services resource * @property {Twilio.Authy.V1.FormList} forms - forms resource + * @property {Twilio.Authy.V1.ServiceList} services - services resource * * @param {Twilio.Authy} domain - The twilio domain */ @@ -31,26 +31,26 @@ function V1(domain) { Version.prototype.constructor.call(this, domain, 'v1'); // Resources - this._services = undefined; this._forms = undefined; + this._services = undefined; } _.extend(V1.prototype, Version.prototype); V1.prototype.constructor = V1; Object.defineProperty(V1.prototype, - 'services', { + 'forms', { get: function() { - this._services = this._services || new ServiceList(this); - return this._services; + this._forms = this._forms || new FormList(this); + return this._forms; } }); Object.defineProperty(V1.prototype, - 'forms', { + 'services', { get: function() { - this._forms = this._forms || new FormList(this); - return this._forms; + this._services = this._services || new ServiceList(this); + return this._services; } }); diff --git a/lib/rest/flexApi/V1.js b/lib/rest/flexApi/V1.js index bb583506bc..f8f94c3890 100644 --- a/lib/rest/flexApi/V1.js +++ b/lib/rest/flexApi/V1.js @@ -23,11 +23,11 @@ var WebChannelList = require('./v1/webChannel').WebChannelList; * * @constructor Twilio.FlexApi.V1 * - * @property {Twilio.FlexApi.V1.FlexFlowList} flexFlow - flexFlow resource * @property {Twilio.FlexApi.V1.ChannelList} channel - channel resource - * @property {Twilio.FlexApi.V1.WebChannelList} webChannel - webChannel resource * @property {Twilio.FlexApi.V1.ConfigurationList} configuration - * configuration resource + * @property {Twilio.FlexApi.V1.FlexFlowList} flexFlow - flexFlow resource + * @property {Twilio.FlexApi.V1.WebChannelList} webChannel - webChannel resource * * @param {Twilio.FlexApi} domain - The twilio domain */ @@ -36,44 +36,44 @@ function V1(domain) { Version.prototype.constructor.call(this, domain, 'v1'); // Resources - this._flexFlow = undefined; this._channel = undefined; - this._webChannel = undefined; this._configuration = undefined; + this._flexFlow = undefined; + this._webChannel = undefined; } _.extend(V1.prototype, Version.prototype); V1.prototype.constructor = V1; Object.defineProperty(V1.prototype, - 'flexFlow', { + 'channel', { get: function() { - this._flexFlow = this._flexFlow || new FlexFlowList(this); - return this._flexFlow; + this._channel = this._channel || new ChannelList(this); + return this._channel; } }); Object.defineProperty(V1.prototype, - 'channel', { + 'configuration', { get: function() { - this._channel = this._channel || new ChannelList(this); - return this._channel; + this._configuration = this._configuration || new ConfigurationList(this); + return this._configuration; } }); Object.defineProperty(V1.prototype, - 'webChannel', { + 'flexFlow', { get: function() { - this._webChannel = this._webChannel || new WebChannelList(this); - return this._webChannel; + this._flexFlow = this._flexFlow || new FlexFlowList(this); + return this._flexFlow; } }); Object.defineProperty(V1.prototype, - 'configuration', { + 'webChannel', { get: function() { - this._configuration = this._configuration || new ConfigurationList(this); - return this._configuration; + this._webChannel = this._webChannel || new WebChannelList(this); + return this._webChannel; } }); diff --git a/lib/rest/messaging/V1.js b/lib/rest/messaging/V1.js index 1feb2bc743..e1c75f0b88 100644 --- a/lib/rest/messaging/V1.js +++ b/lib/rest/messaging/V1.js @@ -22,8 +22,8 @@ var WebhookList = require('./v1/webhook').WebhookList; * * @constructor Twilio.Messaging.V1 * - * @property {Twilio.Messaging.V1.SessionList} sessions - sessions resource * @property {Twilio.Messaging.V1.ServiceList} services - services resource + * @property {Twilio.Messaging.V1.SessionList} sessions - sessions resource * @property {Twilio.Messaging.V1.WebhookList} webhooks - webhooks resource * * @param {Twilio.Messaging} domain - The twilio domain @@ -33,8 +33,8 @@ function V1(domain) { Version.prototype.constructor.call(this, domain, 'v1'); // Resources - this._sessions = undefined; this._services = undefined; + this._sessions = undefined; this._webhooks = undefined; } @@ -42,18 +42,18 @@ _.extend(V1.prototype, Version.prototype); V1.prototype.constructor = V1; Object.defineProperty(V1.prototype, - 'sessions', { + 'services', { get: function() { - this._sessions = this._sessions || new SessionList(this); - return this._sessions; + this._services = this._services || new ServiceList(this); + return this._services; } }); Object.defineProperty(V1.prototype, - 'services', { + 'sessions', { get: function() { - this._services = this._services || new ServiceList(this); - return this._services; + this._sessions = this._sessions || new SessionList(this); + return this._sessions; } }); diff --git a/lib/rest/preview/Marketplace.js b/lib/rest/preview/Marketplace.js index 119a0ed791..58fb2a01e7 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.InstalledAddOnList} installedAddOns - - * installedAddOns resource * @property {Twilio.Preview.Marketplace.AvailableAddOnList} availableAddOns - * availableAddOns resource + * @property {Twilio.Preview.Marketplace.InstalledAddOnList} installedAddOns - + * installedAddOns resource * * @param {Twilio.Preview} domain - The twilio domain */ @@ -35,26 +35,26 @@ function Marketplace(domain) { Version.prototype.constructor.call(this, domain, 'marketplace'); // Resources - this._installedAddOns = undefined; this._availableAddOns = undefined; + this._installedAddOns = undefined; } _.extend(Marketplace.prototype, Version.prototype); Marketplace.prototype.constructor = Marketplace; 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; } }); 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; } }); diff --git a/lib/rest/preview/TrustedComms.js b/lib/rest/preview/TrustedComms.js index e232b5a581..3cf23f702b 100644 --- a/lib/rest/preview/TrustedComms.js +++ b/lib/rest/preview/TrustedComms.js @@ -26,12 +26,12 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * * @property {Twilio.Preview.TrustedComms.BrandedCallList} brandedCalls - * brandedCalls resource + * @property {Twilio.Preview.TrustedComms.CpsList} cps - cps resource + * @property {Twilio.Preview.TrustedComms.CurrentCallList} currentCalls - + * currentCalls resource * @property {Twilio.Preview.TrustedComms.DeviceList} devices - devices resource * @property {Twilio.Preview.TrustedComms.PhoneCallList} phoneCalls - * phoneCalls resource - * @property {Twilio.Preview.TrustedComms.CurrentCallList} currentCalls - - * currentCalls resource - * @property {Twilio.Preview.TrustedComms.CpsList} cps - cps resource * * @param {Twilio.Preview} domain - The twilio domain */ @@ -41,10 +41,10 @@ function TrustedComms(domain) { // Resources this._brandedCalls = undefined; + this._cps = undefined; + this._currentCalls = undefined; this._devices = undefined; this._phoneCalls = undefined; - this._currentCalls = undefined; - this._cps = undefined; } _.extend(TrustedComms.prototype, Version.prototype); @@ -59,34 +59,34 @@ Object.defineProperty(TrustedComms.prototype, }); Object.defineProperty(TrustedComms.prototype, - 'devices', { + 'cps', { get: function() { - this._devices = this._devices || new DeviceList(this); - return this._devices; + this._cps = this._cps || new CpsList(this); + return this._cps; } }); Object.defineProperty(TrustedComms.prototype, - 'phoneCalls', { + 'currentCalls', { get: function() { - this._phoneCalls = this._phoneCalls || new PhoneCallList(this); - return this._phoneCalls; + this._currentCalls = this._currentCalls || new CurrentCallList(this); + return this._currentCalls; } }); Object.defineProperty(TrustedComms.prototype, - 'currentCalls', { + 'devices', { get: function() { - this._currentCalls = this._currentCalls || new CurrentCallList(this); - return this._currentCalls; + this._devices = this._devices || new DeviceList(this); + return this._devices; } }); Object.defineProperty(TrustedComms.prototype, - 'cps', { + 'phoneCalls', { get: function() { - this._cps = this._cps || new CpsList(this); - return this._cps; + this._phoneCalls = this._phoneCalls || new PhoneCallList(this); + return this._phoneCalls; } }); diff --git a/lib/rest/video/V1.js b/lib/rest/video/V1.js index 89d0e698f9..943fbc784f 100644 --- a/lib/rest/video/V1.js +++ b/lib/rest/video/V1.js @@ -27,6 +27,7 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * * @constructor Twilio.Video.V1 * + * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.CompositionHookList} compositionHooks - * compositionHooks resource * @property {Twilio.Video.V1.CompositionSettingsList} compositionSettings - @@ -34,7 +35,6 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * @property {Twilio.Video.V1.RecordingList} recordings - recordings resource * @property {Twilio.Video.V1.RecordingSettingsList} recordingSettings - * recordingSettings resource - * @property {Twilio.Video.V1.CompositionList} compositions - compositions resource * @property {Twilio.Video.V1.RoomList} rooms - rooms resource * * @param {Twilio.Video} domain - The twilio domain @@ -44,17 +44,25 @@ function V1(domain) { Version.prototype.constructor.call(this, domain, 'v1'); // Resources + this._compositions = undefined; this._compositionHooks = undefined; this._compositionSettings = undefined; this._recordings = undefined; this._recordingSettings = undefined; - this._compositions = undefined; this._rooms = undefined; } _.extend(V1.prototype, Version.prototype); V1.prototype.constructor = V1; +Object.defineProperty(V1.prototype, + 'compositions', { + get: function() { + this._compositions = this._compositions || new CompositionList(this); + return this._compositions; + } +}); + Object.defineProperty(V1.prototype, 'compositionHooks', { get: function() { @@ -87,14 +95,6 @@ Object.defineProperty(V1.prototype, } }); -Object.defineProperty(V1.prototype, - 'compositions', { - get: function() { - this._compositions = this._compositions || new CompositionList(this); - return this._compositions; - } -}); - Object.defineProperty(V1.prototype, 'rooms', { get: function() { diff --git a/lib/rest/wireless/V1.js b/lib/rest/wireless/V1.js index 38a85fb2b3..69573f9be9 100644 --- a/lib/rest/wireless/V1.js +++ b/lib/rest/wireless/V1.js @@ -23,10 +23,10 @@ var Version = require('../../base/Version'); /* jshint ignore:line */ * * @constructor Twilio.Wireless.V1 * - * @property {Twilio.Wireless.V1.CommandList} commands - commands resource - * @property {Twilio.Wireless.V1.RatePlanList} ratePlans - ratePlans resource * @property {Twilio.Wireless.V1.UsageRecordList} usageRecords - * usageRecords resource + * @property {Twilio.Wireless.V1.CommandList} commands - commands resource + * @property {Twilio.Wireless.V1.RatePlanList} ratePlans - ratePlans resource * @property {Twilio.Wireless.V1.SimList} sims - sims resource * * @param {Twilio.Wireless} domain - The twilio domain @@ -36,15 +36,23 @@ function V1(domain) { Version.prototype.constructor.call(this, domain, 'v1'); // Resources + this._usageRecords = undefined; this._commands = undefined; this._ratePlans = undefined; - this._usageRecords = undefined; this._sims = undefined; } _.extend(V1.prototype, Version.prototype); V1.prototype.constructor = V1; +Object.defineProperty(V1.prototype, + 'usageRecords', { + get: function() { + this._usageRecords = this._usageRecords || new UsageRecordList(this); + return this._usageRecords; + } +}); + Object.defineProperty(V1.prototype, 'commands', { get: function() { @@ -61,14 +69,6 @@ Object.defineProperty(V1.prototype, } }); -Object.defineProperty(V1.prototype, - 'usageRecords', { - get: function() { - this._usageRecords = this._usageRecords || new UsageRecordList(this); - return this._usageRecords; - } -}); - Object.defineProperty(V1.prototype, 'sims', { get: function() {