From 405ad2c58200fffe79e859a147c3e578c7ff9756 Mon Sep 17 00:00:00 2001 From: Evan Fossier Date: Fri, 27 Oct 2017 16:55:44 -0700 Subject: [PATCH] [Librarian] Regenerated @ 7a7839b47231760a343c1db31f805001d48237b2 --- CHANGES.md | 7 + lib/rest/accounts/v1/credential.js | 4 +- lib/rest/accounts/v1/credential/publicKey.js | 90 +-- lib/rest/api/v2010/account.js | 205 ++----- lib/rest/api/v2010/account/address.js | 77 +-- .../account/address/dependentPhoneNumber.js | 33 +- lib/rest/api/v2010/account/application.js | 77 +-- .../api/v2010/account/authorizedConnectApp.js | 54 +- .../api/v2010/account/availablePhoneNumber.js | 66 +- .../account/availablePhoneNumber/local.js | 33 +- .../account/availablePhoneNumber/mobile.js | 33 +- .../account/availablePhoneNumber/tollFree.js | 33 +- lib/rest/api/v2010/account/call.js | 94 +-- lib/rest/api/v2010/account/call/feedback.js | 61 +- .../api/v2010/account/call/feedbackSummary.js | 42 +- .../api/v2010/account/call/notification.js | 57 +- lib/rest/api/v2010/account/call/recording.js | 57 +- lib/rest/api/v2010/account/conference.js | 70 +-- .../v2010/account/conference/participant.js | 56 +- lib/rest/api/v2010/account/connectApp.js | 66 +- .../api/v2010/account/incomingPhoneNumber.js | 86 +-- .../incomingPhoneNumber/assignedAddOn.js | 60 +- .../assignedAddOn/assignedAddOnExtension.js | 28 +- .../account/incomingPhoneNumber/local.js | 48 +- .../account/incomingPhoneNumber/mobile.js | 48 +- .../account/incomingPhoneNumber/tollFree.js | 48 +- lib/rest/api/v2010/account/key.js | 75 +-- lib/rest/api/v2010/account/message.js | 93 +-- .../api/v2010/account/message/feedback.js | 25 +- lib/rest/api/v2010/account/message/media.js | 64 +- lib/rest/api/v2010/account/newKey.js | 29 +- lib/rest/api/v2010/account/newSigningKey.js | 29 +- lib/rest/api/v2010/account/notification.js | 65 +- .../api/v2010/account/outgoingCallerId.js | 69 +-- lib/rest/api/v2010/account/queue.js | 83 +-- lib/rest/api/v2010/account/queue/member.js | 70 +-- lib/rest/api/v2010/account/recording.js | 65 +- .../v2010/account/recording/addOnResult.js | 50 +- .../account/recording/addOnResult/payload.js | 33 +- .../v2010/account/recording/transcription.js | 50 +- lib/rest/api/v2010/account/shortCode.js | 66 +- lib/rest/api/v2010/account/signingKey.js | 75 +-- lib/rest/api/v2010/account/sip.js | 19 +- .../api/v2010/account/sip/credentialList.js | 85 +-- .../account/sip/credentialList/credential.js | 71 +-- lib/rest/api/v2010/account/sip/domain.js | 77 +-- .../sip/domain/credentialListMapping.js | 60 +- .../sip/domain/ipAccessControlListMapping.js | 60 +- .../v2010/account/sip/ipAccessControlList.js | 85 +-- .../sip/ipAccessControlList/ipAddress.js | 51 +- lib/rest/api/v2010/account/token.js | 29 +- lib/rest/api/v2010/account/transcription.js | 59 +- lib/rest/api/v2010/account/usage.js | 14 +- lib/rest/api/v2010/account/usage/record.js | 77 +-- .../api/v2010/account/usage/record/allTime.js | 37 +- .../api/v2010/account/usage/record/daily.js | 37 +- .../v2010/account/usage/record/lastMonth.js | 37 +- .../api/v2010/account/usage/record/monthly.js | 37 +- .../v2010/account/usage/record/thisMonth.js | 37 +- .../api/v2010/account/usage/record/today.js | 37 +- .../api/v2010/account/usage/record/yearly.js | 37 +- .../v2010/account/usage/record/yesterday.js | 37 +- lib/rest/api/v2010/account/usage/trigger.js | 77 +-- .../api/v2010/account/validationRequest.js | 25 +- lib/rest/chat/v1/credential.js | 86 +-- lib/rest/chat/v1/service.js | 105 +--- lib/rest/chat/v1/service/channel.js | 95 +-- lib/rest/chat/v1/service/channel/invite.js | 68 +-- lib/rest/chat/v1/service/channel/member.js | 74 +-- lib/rest/chat/v1/service/channel/message.js | 74 +-- lib/rest/chat/v1/service/role.js | 81 +-- lib/rest/chat/v1/service/user.js | 77 +-- lib/rest/chat/v1/service/user/userChannel.js | 33 +- lib/rest/chat/v2/credential.js | 86 +-- lib/rest/chat/v2/service.js | 134 ++--- lib/rest/chat/v2/service/binding.js | 553 +++++++++++++++++ lib/rest/chat/v2/service/channel.js | 95 +-- lib/rest/chat/v2/service/channel/invite.js | 68 +-- lib/rest/chat/v2/service/channel/member.js | 69 +-- lib/rest/chat/v2/service/channel/message.js | 69 +-- lib/rest/chat/v2/service/role.js | 81 +-- lib/rest/chat/v2/service/user.js | 110 ++-- lib/rest/chat/v2/service/user/userBinding.js | 564 ++++++++++++++++++ lib/rest/chat/v2/service/user/userChannel.js | 33 +- lib/rest/fax/v1/fax.js | 95 +-- lib/rest/fax/v1/fax/faxMedia.js | 65 +- lib/rest/ipMessaging/v1/credential.js | 86 +-- lib/rest/ipMessaging/v1/service.js | 105 +--- lib/rest/ipMessaging/v1/service/channel.js | 95 +-- .../ipMessaging/v1/service/channel/invite.js | 68 +-- .../ipMessaging/v1/service/channel/member.js | 74 +-- .../ipMessaging/v1/service/channel/message.js | 74 +-- lib/rest/ipMessaging/v1/service/role.js | 81 +-- lib/rest/ipMessaging/v1/service/user.js | 77 +-- .../v1/service/user/userChannel.js | 33 +- lib/rest/ipMessaging/v2/credential.js | 86 +-- lib/rest/ipMessaging/v2/service.js | 134 ++--- lib/rest/ipMessaging/v2/service/binding.js | 553 +++++++++++++++++ lib/rest/ipMessaging/v2/service/channel.js | 95 +-- .../ipMessaging/v2/service/channel/invite.js | 68 +-- .../ipMessaging/v2/service/channel/member.js | 69 +-- .../ipMessaging/v2/service/channel/message.js | 69 +-- lib/rest/ipMessaging/v2/service/role.js | 81 +-- lib/rest/ipMessaging/v2/service/user.js | 110 ++-- .../v2/service/user/userBinding.js | 564 ++++++++++++++++++ .../v2/service/user/userChannel.js | 33 +- lib/rest/lookups/v1/phoneNumber.js | 35 +- lib/rest/messaging/v1/service.js | 101 +--- lib/rest/messaging/v1/service/alphaSender.js | 75 +-- lib/rest/messaging/v1/service/phoneNumber.js | 75 +-- lib/rest/messaging/v1/service/shortCode.js | 75 +-- lib/rest/monitor/v1/alert.js | 62 +- lib/rest/monitor/v1/event.js | 57 +- lib/rest/notify/v1/credential.js | 86 +-- lib/rest/notify/v1/service.js | 106 +--- lib/rest/notify/v1/service/binding.js | 71 +-- lib/rest/notify/v1/service/notification.js | 25 +- lib/rest/notify/v1/service/segment.js | 37 +- lib/rest/notify/v1/service/user.js | 76 +-- .../v1/service/user/segmentMemberships.js | 37 +- .../notify/v1/service/user/userBinding.js | 63 +- lib/rest/preview/acc_security/service.js | 101 +--- .../acc_security/service/verification.js | 25 +- .../acc_security/service/verificationCheck.js | 30 +- lib/rest/preview/bulk_exports/export.js | 39 +- lib/rest/preview/bulk_exports/export/day.js | 37 +- .../bulk_exports/exportConfiguration.js | 34 +- lib/rest/preview/deployed_devices/fleet.js | 110 +--- .../deployed_devices/fleet/certificate.js | 77 +-- .../deployed_devices/fleet/deployment.js | 77 +-- .../preview/deployed_devices/fleet/device.js | 77 +-- .../preview/deployed_devices/fleet/key.js | 98 +-- .../hosted_numbers/authorizationDocument.js | 81 +-- .../hosted_numbers/hostedNumberOrder.js | 86 +-- .../preview/marketplace/availableAddOn.js | 62 +- .../availableAddOn/availableAddOnExtension.js | 54 +- .../preview/marketplace/installedAddOn.js | 91 +-- .../installedAddOn/installedAddOnExtension.js | 64 +- lib/rest/preview/proxy/service.js | 101 +--- lib/rest/preview/proxy/service/phoneNumber.js | 75 +-- lib/rest/preview/proxy/service/session.js | 77 +-- .../proxy/service/session/interaction.js | 45 +- .../proxy/service/session/participant.js | 62 +- .../session/participant/messageInteraction.js | 39 +- lib/rest/preview/proxy/service/shortCode.js | 75 +-- lib/rest/preview/sync/service.js | 101 +--- lib/rest/preview/sync/service/document.js | 81 +-- .../service/document/documentPermission.js | 50 +- lib/rest/preview/sync/service/syncList.js | 75 +-- .../sync/service/syncList/syncListItem.js | 70 +-- .../service/syncList/syncListPermission.js | 56 +- lib/rest/preview/sync/service/syncMap.js | 75 +-- .../sync/service/syncMap/syncMapItem.js | 78 +-- .../sync/service/syncMap/syncMapPermission.js | 56 +- lib/rest/preview/wireless/command.js | 69 +-- lib/rest/preview/wireless/ratePlan.js | 86 +-- lib/rest/preview/wireless/sim.js | 74 +-- lib/rest/preview/wireless/sim/usage.js | 45 +- lib/rest/pricing/v1/messaging.js | 9 +- lib/rest/pricing/v1/messaging/country.js | 57 +- lib/rest/pricing/v1/phoneNumber.js | 9 +- lib/rest/pricing/v1/phoneNumber/country.js | 57 +- lib/rest/pricing/v1/voice.js | 13 +- lib/rest/pricing/v1/voice/country.js | 57 +- lib/rest/pricing/v1/voice/number.js | 34 +- lib/rest/proxy/v1/service.js | 101 +--- lib/rest/proxy/v1/service/phoneNumber.js | 75 +-- lib/rest/proxy/v1/service/session.js | 77 +-- .../proxy/v1/service/session/interaction.js | 45 +- .../proxy/v1/service/session/participant.js | 62 +- .../session/participant/messageInteraction.js | 39 +- lib/rest/proxy/v1/service/shortCode.js | 75 +-- lib/rest/sync/v1/service.js | 106 +--- lib/rest/sync/v1/service/document.js | 81 +-- .../v1/service/document/documentPermission.js | 50 +- lib/rest/sync/v1/service/syncList.js | 75 +-- .../sync/v1/service/syncList/syncListItem.js | 70 +-- .../v1/service/syncList/syncListPermission.js | 56 +- lib/rest/sync/v1/service/syncMap.js | 75 +-- .../sync/v1/service/syncMap/syncMapItem.js | 78 +-- .../v1/service/syncMap/syncMapPermission.js | 56 +- lib/rest/sync/v1/service/syncStream.js | 75 +-- .../v1/service/syncStream/streamMessage.js | 25 +- lib/rest/taskrouter/v1/workspace.js | 131 +--- lib/rest/taskrouter/v1/workspace/activity.js | 81 +-- lib/rest/taskrouter/v1/workspace/event.js | 60 +- lib/rest/taskrouter/v1/workspace/task.js | 77 +-- .../v1/workspace/task/reservation.js | 58 +- .../taskrouter/v1/workspace/taskChannel.js | 54 +- lib/rest/taskrouter/v1/workspace/taskQueue.js | 82 +-- .../taskQueueCumulativeStatistics.js | 16 +- .../taskQueue/taskQueueRealTimeStatistics.js | 20 +- .../taskQueue/taskQueueStatistics.js | 21 +- .../taskQueue/taskQueuesStatistics.js | 37 +- lib/rest/taskrouter/v1/workspace/worker.js | 82 +-- .../v1/workspace/worker/reservation.js | 51 +- .../v1/workspace/worker/workerChannel.js | 51 +- .../v1/workspace/worker/workerStatistics.js | 21 +- .../worker/workersCumulativeStatistics.js | 34 +- .../worker/workersRealTimeStatistics.js | 38 +- .../v1/workspace/worker/workersStatistics.js | 40 +- lib/rest/taskrouter/v1/workspace/workflow.js | 77 +-- .../workflow/workflowCumulativeStatistics.js | 16 +- .../workflow/workflowRealTimeStatistics.js | 20 +- .../workspace/workflow/workflowStatistics.js | 21 +- .../workspaceCumulativeStatistics.js | 34 +- .../workspace/workspaceRealTimeStatistics.js | 38 +- .../v1/workspace/workspaceStatistics.js | 34 +- lib/rest/trunking/v1/trunk.js | 106 +--- lib/rest/trunking/v1/trunk/credentialList.js | 75 +-- .../trunking/v1/trunk/ipAccessControlList.js | 69 +-- lib/rest/trunking/v1/trunk/originationUrl.js | 77 +-- lib/rest/trunking/v1/trunk/phoneNumber.js | 75 +-- lib/rest/video/v1/recording.js | 62 +- lib/rest/video/v1/room.js | 90 +-- lib/rest/video/v1/room/recording.js | 60 +- lib/rest/wireless/v1/command.js | 69 +-- lib/rest/wireless/v1/ratePlan.js | 86 +-- lib/rest/wireless/v1/sim.js | 79 +-- lib/rest/wireless/v1/sim/dataSession.js | 37 +- lib/rest/wireless/v1/sim/usageRecord.js | 37 +- lib/twiml/MessagingResponse.js | 4 +- lib/twiml/VoiceResponse.js | 38 +- .../accounts/v1/credential/publicKey.spec.js | 24 +- .../rest/api/v2010/account.spec.js | 8 +- .../rest/api/v2010/account/address.spec.js | 8 +- .../api/v2010/account/application.spec.js | 20 +- .../account/authorizedConnectApp.spec.js | 4 +- .../account/availablePhoneNumber.spec.js | 9 +- .../availablePhoneNumber/local.spec.js | 5 +- .../availablePhoneNumber/mobile.spec.js | 5 +- .../availablePhoneNumber/tollFree.spec.js | 5 +- .../rest/api/v2010/account/call.spec.js | 33 +- .../api/v2010/account/call/feedback.spec.js | 24 +- .../account/call/feedbackSummary.spec.js | 14 +- .../rest/api/v2010/account/conference.spec.js | 4 +- .../account/conference/participant.spec.js | 20 +- .../rest/api/v2010/account/connectApp.spec.js | 4 +- .../v2010/account/incomingPhoneNumber.spec.js | 8 +- .../incomingPhoneNumber/assignedAddOn.spec.js | 12 +- .../account/incomingPhoneNumber/local.spec.js | 20 +- .../incomingPhoneNumber/mobile.spec.js | 20 +- .../incomingPhoneNumber/tollFree.spec.js | 20 +- .../rest/api/v2010/account/key.spec.js | 4 +- .../rest/api/v2010/account/message.spec.js | 32 +- .../rest/api/v2010/account/newKey.spec.js | 4 +- .../api/v2010/account/newSigningKey.spec.js | 4 +- .../api/v2010/account/notification.spec.js | 4 +- .../v2010/account/outgoingCallerId.spec.js | 4 +- .../rest/api/v2010/account/queue.spec.js | 20 +- .../api/v2010/account/queue/member.spec.js | 15 +- .../rest/api/v2010/account/recording.spec.js | 4 +- .../rest/api/v2010/account/shortCode.spec.js | 4 +- .../rest/api/v2010/account/signingKey.spec.js | 4 +- .../v2010/account/sip/credentialList.spec.js | 32 +- .../sip/credentialList/credential.spec.js | 15 +- .../rest/api/v2010/account/sip/domain.spec.js | 20 +- .../sip/domain/credentialListMapping.spec.js | 12 +- .../domain/ipAccessControlListMapping.spec.js | 12 +- .../account/sip/ipAccessControlList.spec.js | 32 +- .../sip/ipAccessControlList/ipAddress.spec.js | 15 +- .../rest/api/v2010/account/token.spec.js | 4 +- .../api/v2010/account/transcription.spec.js | 4 +- .../api/v2010/account/usage/record.spec.js | 4 +- .../account/usage/record/allTime.spec.js | 4 +- .../v2010/account/usage/record/daily.spec.js | 4 +- .../account/usage/record/lastMonth.spec.js | 4 +- .../account/usage/record/monthly.spec.js | 4 +- .../account/usage/record/thisMonth.spec.js | 4 +- .../v2010/account/usage/record/today.spec.js | 4 +- .../v2010/account/usage/record/yearly.spec.js | 4 +- .../account/usage/record/yesterday.spec.js | 4 +- .../api/v2010/account/usage/trigger.spec.js | 8 +- .../v2010/account/validationRequest.spec.js | 16 +- .../rest/chat/v1/credential.spec.js | 24 +- spec/integration/rest/chat/v1/service.spec.js | 24 +- .../rest/chat/v1/service/channel.spec.js | 8 +- .../chat/v1/service/channel/invite.spec.js | 12 +- .../chat/v1/service/channel/member.spec.js | 12 +- .../chat/v1/service/channel/message.spec.js | 16 +- .../rest/chat/v1/service/role.spec.js | 38 +- .../rest/chat/v1/service/user.spec.js | 20 +- .../rest/chat/v2/credential.spec.js | 24 +- spec/integration/rest/chat/v2/service.spec.js | 36 +- .../rest/chat/v2/service/binding.spec.js | 238 ++++++++ .../rest/chat/v2/service/channel.spec.js | 8 +- .../chat/v2/service/channel/invite.spec.js | 12 +- .../chat/v2/service/channel/member.spec.js | 12 +- .../rest/chat/v2/service/role.spec.js | 38 +- .../rest/chat/v2/service/user.spec.js | 32 +- .../chat/v2/service/user/userBinding.spec.js | 246 ++++++++ spec/integration/rest/fax/v1/fax.spec.js | 27 +- .../rest/fax/v1/fax/faxMedia.spec.js | 4 +- .../rest/ipMessaging/v1/credential.spec.js | 24 +- .../rest/ipMessaging/v1/service.spec.js | 24 +- .../ipMessaging/v1/service/channel.spec.js | 8 +- .../v1/service/channel/invite.spec.js | 12 +- .../v1/service/channel/member.spec.js | 12 +- .../v1/service/channel/message.spec.js | 16 +- .../rest/ipMessaging/v1/service/role.spec.js | 38 +- .../rest/ipMessaging/v1/service/user.spec.js | 20 +- .../rest/ipMessaging/v2/credential.spec.js | 24 +- .../rest/ipMessaging/v2/service.spec.js | 36 +- .../ipMessaging/v2/service/binding.spec.js | 238 ++++++++ .../ipMessaging/v2/service/channel.spec.js | 8 +- .../v2/service/channel/invite.spec.js | 12 +- .../v2/service/channel/member.spec.js | 12 +- .../rest/ipMessaging/v2/service/role.spec.js | 38 +- .../rest/ipMessaging/v2/service/user.spec.js | 32 +- .../v2/service/user/userBinding.spec.js | 246 ++++++++ .../rest/lookups/v1/phoneNumber.spec.js | 4 +- .../rest/messaging/v1/service.spec.js | 24 +- .../messaging/v1/service/alphaSender.spec.js | 20 +- .../messaging/v1/service/phoneNumber.spec.js | 24 +- .../messaging/v1/service/shortCode.spec.js | 20 +- .../integration/rest/monitor/v1/alert.spec.js | 8 +- .../integration/rest/monitor/v1/event.spec.js | 4 +- .../rest/notify/v1/credential.spec.js | 24 +- .../rest/notify/v1/service.spec.js | 12 +- .../rest/notify/v1/service/binding.spec.js | 26 +- .../notify/v1/service/notification.spec.js | 4 +- .../rest/notify/v1/service/segment.spec.js | 4 +- .../rest/notify/v1/service/user.spec.js | 20 +- .../service/user/segmentMemberships.spec.js | 12 +- .../v1/service/user/userBinding.spec.js | 20 +- .../rest/preview/acc_security/service.spec.js | 20 +- .../acc_security/service/verification.spec.js | 19 +- .../service/verificationCheck.spec.js | 16 +- .../rest/preview/bulk_exports/export.spec.js | 4 +- .../preview/bulk_exports/export/day.spec.js | 4 +- .../bulk_exports/exportConfiguration.spec.js | 8 +- .../preview/deployed_devices/fleet.spec.js | 12 +- .../fleet/certificate.spec.js | 20 +- .../deployed_devices/fleet/deployment.spec.js | 8 +- .../deployed_devices/fleet/device.spec.js | 8 +- .../deployed_devices/fleet/key.spec.js | 8 +- .../authorizationDocument.spec.js | 8 +- .../hosted_numbers/hostedNumberOrder.spec.js | 30 +- .../marketplace/availableAddOn.spec.js | 4 +- .../availableAddOnExtension.spec.js | 4 +- .../marketplace/installedAddOn.spec.js | 22 +- .../installedAddOnExtension.spec.js | 16 +- .../rest/preview/proxy/service.spec.js | 12 +- .../preview/proxy/service/phoneNumber.spec.js | 20 +- .../preview/proxy/service/session.spec.js | 8 +- .../proxy/service/session/participant.spec.js | 12 +- .../preview/proxy/service/shortCode.spec.js | 20 +- .../rest/preview/sync/service.spec.js | 12 +- .../preview/sync/service/document.spec.js | 20 +- .../document/documentPermission.spec.js | 18 +- .../preview/sync/service/syncList.spec.js | 8 +- .../service/syncList/syncListItem.spec.js | 24 +- .../syncList/syncListPermission.spec.js | 18 +- .../rest/preview/sync/service/syncMap.spec.js | 8 +- .../sync/service/syncMap/syncMapItem.spec.js | 27 +- .../service/syncMap/syncMapPermission.spec.js | 18 +- .../rest/preview/wireless/command.spec.js | 16 +- .../rest/preview/wireless/ratePlan.spec.js | 12 +- .../rest/preview/wireless/sim.spec.js | 8 +- .../rest/preview/wireless/sim/usage.spec.js | 4 +- .../rest/pricing/v1/messaging/country.spec.js | 4 +- .../pricing/v1/phoneNumber/country.spec.js | 4 +- .../rest/pricing/v1/voice/country.spec.js | 4 +- .../rest/pricing/v1/voice/number.spec.js | 4 +- .../integration/rest/proxy/v1/service.spec.js | 12 +- .../rest/proxy/v1/service/phoneNumber.spec.js | 20 +- .../rest/proxy/v1/service/session.spec.js | 8 +- .../v1/service/session/participant.spec.js | 12 +- .../rest/proxy/v1/service/shortCode.spec.js | 20 +- spec/integration/rest/sync/v1/service.spec.js | 12 +- .../rest/sync/v1/service/document.spec.js | 20 +- .../document/documentPermission.spec.js | 18 +- .../rest/sync/v1/service/syncList.spec.js | 8 +- .../v1/service/syncList/syncListItem.spec.js | 24 +- .../syncList/syncListPermission.spec.js | 18 +- .../rest/sync/v1/service/syncMap.spec.js | 8 +- .../v1/service/syncMap/syncMapItem.spec.js | 27 +- .../service/syncMap/syncMapPermission.spec.js | 18 +- .../rest/sync/v1/service/syncStream.spec.js | 8 +- .../service/syncStream/streamMessage.spec.js | 12 +- .../rest/taskrouter/v1/workspace.spec.js | 24 +- .../taskrouter/v1/workspace/activity.spec.js | 20 +- .../taskrouter/v1/workspace/event.spec.js | 4 +- .../rest/taskrouter/v1/workspace/task.spec.js | 8 +- .../v1/workspace/taskChannel.spec.js | 4 +- .../taskrouter/v1/workspace/taskQueue.spec.js | 8 +- .../taskQueue/taskQueuesStatistics.spec.js | 4 +- .../taskrouter/v1/workspace/worker.spec.js | 20 +- .../workersCumulativeStatistics.spec.js | 4 +- .../worker/workersRealTimeStatistics.spec.js | 4 +- .../worker/workersStatistics.spec.js | 4 +- .../taskrouter/v1/workspace/workflow.spec.js | 23 +- .../workspaceCumulativeStatistics.spec.js | 4 +- .../workspaceRealTimeStatistics.spec.js | 4 +- .../v1/workspace/workspaceStatistics.spec.js | 4 +- .../rest/trunking/v1/trunk.spec.js | 12 +- .../trunking/v1/trunk/credentialList.spec.js | 20 +- .../v1/trunk/ipAccessControlList.spec.js | 20 +- .../trunking/v1/trunk/originationUrl.spec.js | 8 +- .../trunking/v1/trunk/phoneNumber.spec.js | 20 +- .../rest/video/v1/recording.spec.js | 8 +- spec/integration/rest/video/v1/room.spec.js | 20 +- .../rest/video/v1/room/recording.spec.js | 4 +- .../rest/wireless/v1/command.spec.js | 16 +- .../rest/wireless/v1/ratePlan.spec.js | 12 +- spec/integration/rest/wireless/v1/sim.spec.js | 8 +- .../rest/wireless/v1/sim/dataSession.spec.js | 4 +- .../rest/wireless/v1/sim/usageRecord.spec.js | 4 +- 408 files changed, 6483 insertions(+), 12936 deletions(-) create mode 100644 lib/rest/chat/v2/service/binding.js create mode 100644 lib/rest/chat/v2/service/user/userBinding.js create mode 100644 lib/rest/ipMessaging/v2/service/binding.js create mode 100644 lib/rest/ipMessaging/v2/service/user/userBinding.js create mode 100644 spec/integration/rest/chat/v2/service/binding.spec.js create mode 100644 spec/integration/rest/chat/v2/service/user/userBinding.spec.js create mode 100644 spec/integration/rest/ipMessaging/v2/service/binding.spec.js create mode 100644 spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js diff --git a/CHANGES.md b/CHANGES.md index 0364cd39af..1468bd18a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,13 @@ twilio-node changelog ===================== +[2017-10-27] Version 3.9.1 +--------------------------- +**Chat** +- Add Binding resource +- Add UserBinding resource + + [2017-10-20] Version 3.9.0 --------------------------- **TwiML** diff --git a/lib/rest/accounts/v1/credential.js b/lib/rest/accounts/v1/credential.js index 92eaa475b5..486d64e10d 100644 --- a/lib/rest/accounts/v1/credential.js +++ b/lib/rest/accounts/v1/credential.js @@ -49,9 +49,7 @@ CredentialList = function CredentialList(version) { 'publicKey', { get: function publicKey() { if (!this._publicKey) { - this._publicKey = new PublicKeyList( - this._version - ); + this._publicKey = new PublicKeyList(this._version); } return this._publicKey; diff --git a/lib/rest/accounts/v1/credential/publicKey.js b/lib/rest/accounts/v1/credential/publicKey.js index df9215bcf1..48bc357f6e 100644 --- a/lib/rest/accounts/v1/credential/publicKey.js +++ b/lib/rest/accounts/v1/credential/publicKey.js @@ -233,18 +233,10 @@ PublicKeyList = function PublicKeyList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PublicKeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PublicKeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -278,17 +270,10 @@ PublicKeyList = function PublicKeyList(version) { PublicKeyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new PublicKeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PublicKeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,18 +321,10 @@ PublicKeyList = function PublicKeyList(version) { 'AccountSid': _.get(opts, 'accountSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new PublicKeyInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new PublicKeyInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -375,10 +352,7 @@ PublicKeyList = function PublicKeyList(version) { */ /* jshint ignore:end */ PublicKeyListInstance.get = function get(sid) { - return new PublicKeyContext( - this._version, - sid - ); + return new PublicKeyContext(this._version, sid); }; return PublicKeyListInstance; @@ -422,10 +396,7 @@ PublicKeyPage.prototype.constructor = PublicKeyPage; */ /* jshint ignore:end */ PublicKeyPage.prototype.getInstance = function getInstance(payload) { - return new PublicKeyInstance( - this._version, - payload - ); + return new PublicKeyInstance(this._version, payload); }; @@ -461,19 +432,14 @@ PublicKeyInstance = function PublicKeyInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(PublicKeyInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new PublicKeyContext( - this._version, - this._solution.sid - ); + this._context = new PublicKeyContext(this._version, this._solution.sid); } return this._context; @@ -548,9 +514,7 @@ PublicKeyContext = function PublicKeyContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Credentials/PublicKeys/<%= sid %>' // jshint ignore:line )(this._solution); @@ -571,17 +535,10 @@ PublicKeyContext = function PublicKeyContext(version, sid) { /* jshint ignore:end */ PublicKeyContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new PublicKeyInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new PublicKeyInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -619,22 +576,12 @@ PublicKeyContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new PublicKeyInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new PublicKeyInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -663,10 +610,7 @@ PublicKeyContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ PublicKeyContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account.js b/lib/rest/api/v2010/account.js index b30e730f27..823ecfc007 100644 --- a/lib/rest/api/v2010/account.js +++ b/lib/rest/api/v2010/account.js @@ -103,22 +103,12 @@ AccountList = function AccountList(version) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new AccountInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AccountInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -326,18 +316,10 @@ AccountList = function AccountList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AccountPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AccountPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,17 +355,10 @@ AccountList = function AccountList(version) { AccountListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AccountPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AccountPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -411,10 +386,7 @@ AccountList = function AccountList(version) { */ /* jshint ignore:end */ AccountListInstance.get = function get(sid) { - return new AccountContext( - this._version, - sid - ); + return new AccountContext(this._version, sid); }; return AccountListInstance; @@ -458,10 +430,7 @@ AccountPage.prototype.constructor = AccountPage; */ /* jshint ignore:end */ AccountPage.prototype.getInstance = function getInstance(payload) { - return new AccountInstance( - this._version, - payload - ); + return new AccountInstance(this._version, payload); }; @@ -506,19 +475,14 @@ AccountInstance = function AccountInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(AccountInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new AccountContext( - this._version, - this._solution.sid - ); + this._context = new AccountContext(this._version, this._solution.sid); } return this._context; @@ -965,9 +929,7 @@ AccountContext = function AccountContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Accounts/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -1013,17 +975,10 @@ AccountContext = function AccountContext(version, sid) { /* jshint ignore:end */ AccountContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new AccountInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AccountInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -1061,23 +1016,12 @@ AccountContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName'), - 'Status': _.get(opts, 'status') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName'), 'Status': _.get(opts, 'status')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new AccountInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AccountInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -1095,10 +1039,7 @@ Object.defineProperty(AccountContext.prototype, 'addresses', { get: function() { if (!this._addresses) { - this._addresses = new AddressList( - this._version, - this._solution.sid - ); + this._addresses = new AddressList(this._version, this._solution.sid); } return this._addresses; } @@ -1108,10 +1049,7 @@ Object.defineProperty(AccountContext.prototype, 'applications', { get: function() { if (!this._applications) { - this._applications = new ApplicationList( - this._version, - this._solution.sid - ); + this._applications = new ApplicationList(this._version, this._solution.sid); } return this._applications; } @@ -1121,10 +1059,7 @@ Object.defineProperty(AccountContext.prototype, 'authorizedConnectApps', { get: function() { if (!this._authorizedConnectApps) { - this._authorizedConnectApps = new AuthorizedConnectAppList( - this._version, - this._solution.sid - ); + this._authorizedConnectApps = new AuthorizedConnectAppList(this._version, this._solution.sid); } return this._authorizedConnectApps; } @@ -1134,10 +1069,7 @@ Object.defineProperty(AccountContext.prototype, 'availablePhoneNumbers', { get: function() { if (!this._availablePhoneNumbers) { - this._availablePhoneNumbers = new AvailablePhoneNumberCountryList( - this._version, - this._solution.sid - ); + this._availablePhoneNumbers = new AvailablePhoneNumberCountryList(this._version, this._solution.sid); } return this._availablePhoneNumbers; } @@ -1147,10 +1079,7 @@ Object.defineProperty(AccountContext.prototype, 'calls', { get: function() { if (!this._calls) { - this._calls = new CallList( - this._version, - this._solution.sid - ); + this._calls = new CallList(this._version, this._solution.sid); } return this._calls; } @@ -1160,10 +1089,7 @@ Object.defineProperty(AccountContext.prototype, 'conferences', { get: function() { if (!this._conferences) { - this._conferences = new ConferenceList( - this._version, - this._solution.sid - ); + this._conferences = new ConferenceList(this._version, this._solution.sid); } return this._conferences; } @@ -1173,10 +1099,7 @@ Object.defineProperty(AccountContext.prototype, 'connectApps', { get: function() { if (!this._connectApps) { - this._connectApps = new ConnectAppList( - this._version, - this._solution.sid - ); + this._connectApps = new ConnectAppList(this._version, this._solution.sid); } return this._connectApps; } @@ -1186,10 +1109,7 @@ Object.defineProperty(AccountContext.prototype, 'incomingPhoneNumbers', { get: function() { if (!this._incomingPhoneNumbers) { - this._incomingPhoneNumbers = new IncomingPhoneNumberList( - this._version, - this._solution.sid - ); + this._incomingPhoneNumbers = new IncomingPhoneNumberList(this._version, this._solution.sid); } return this._incomingPhoneNumbers; } @@ -1199,10 +1119,7 @@ Object.defineProperty(AccountContext.prototype, 'keys', { get: function() { if (!this._keys) { - this._keys = new KeyList( - this._version, - this._solution.sid - ); + this._keys = new KeyList(this._version, this._solution.sid); } return this._keys; } @@ -1212,10 +1129,7 @@ Object.defineProperty(AccountContext.prototype, 'messages', { get: function() { if (!this._messages) { - this._messages = new MessageList( - this._version, - this._solution.sid - ); + this._messages = new MessageList(this._version, this._solution.sid); } return this._messages; } @@ -1225,10 +1139,7 @@ Object.defineProperty(AccountContext.prototype, 'newKeys', { get: function() { if (!this._newKeys) { - this._newKeys = new NewKeyList( - this._version, - this._solution.sid - ); + this._newKeys = new NewKeyList(this._version, this._solution.sid); } return this._newKeys; } @@ -1238,10 +1149,7 @@ Object.defineProperty(AccountContext.prototype, 'newSigningKeys', { get: function() { if (!this._newSigningKeys) { - this._newSigningKeys = new NewSigningKeyList( - this._version, - this._solution.sid - ); + this._newSigningKeys = new NewSigningKeyList(this._version, this._solution.sid); } return this._newSigningKeys; } @@ -1251,10 +1159,7 @@ Object.defineProperty(AccountContext.prototype, 'notifications', { get: function() { if (!this._notifications) { - this._notifications = new NotificationList( - this._version, - this._solution.sid - ); + this._notifications = new NotificationList(this._version, this._solution.sid); } return this._notifications; } @@ -1264,10 +1169,7 @@ Object.defineProperty(AccountContext.prototype, 'outgoingCallerIds', { get: function() { if (!this._outgoingCallerIds) { - this._outgoingCallerIds = new OutgoingCallerIdList( - this._version, - this._solution.sid - ); + this._outgoingCallerIds = new OutgoingCallerIdList(this._version, this._solution.sid); } return this._outgoingCallerIds; } @@ -1277,10 +1179,7 @@ Object.defineProperty(AccountContext.prototype, 'queues', { get: function() { if (!this._queues) { - this._queues = new QueueList( - this._version, - this._solution.sid - ); + this._queues = new QueueList(this._version, this._solution.sid); } return this._queues; } @@ -1290,10 +1189,7 @@ Object.defineProperty(AccountContext.prototype, 'recordings', { get: function() { if (!this._recordings) { - this._recordings = new RecordingList( - this._version, - this._solution.sid - ); + this._recordings = new RecordingList(this._version, this._solution.sid); } return this._recordings; } @@ -1303,10 +1199,7 @@ Object.defineProperty(AccountContext.prototype, 'signingKeys', { get: function() { if (!this._signingKeys) { - this._signingKeys = new SigningKeyList( - this._version, - this._solution.sid - ); + this._signingKeys = new SigningKeyList(this._version, this._solution.sid); } return this._signingKeys; } @@ -1316,10 +1209,7 @@ Object.defineProperty(AccountContext.prototype, 'sip', { get: function() { if (!this._sip) { - this._sip = new SipList( - this._version, - this._solution.sid - ); + this._sip = new SipList(this._version, this._solution.sid); } return this._sip; } @@ -1329,10 +1219,7 @@ Object.defineProperty(AccountContext.prototype, 'shortCodes', { get: function() { if (!this._shortCodes) { - this._shortCodes = new ShortCodeList( - this._version, - this._solution.sid - ); + this._shortCodes = new ShortCodeList(this._version, this._solution.sid); } return this._shortCodes; } @@ -1342,10 +1229,7 @@ Object.defineProperty(AccountContext.prototype, 'tokens', { get: function() { if (!this._tokens) { - this._tokens = new TokenList( - this._version, - this._solution.sid - ); + this._tokens = new TokenList(this._version, this._solution.sid); } return this._tokens; } @@ -1355,10 +1239,7 @@ Object.defineProperty(AccountContext.prototype, 'transcriptions', { get: function() { if (!this._transcriptions) { - this._transcriptions = new TranscriptionList( - this._version, - this._solution.sid - ); + this._transcriptions = new TranscriptionList(this._version, this._solution.sid); } return this._transcriptions; } @@ -1368,10 +1249,7 @@ Object.defineProperty(AccountContext.prototype, 'usage', { get: function() { if (!this._usage) { - this._usage = new UsageList( - this._version, - this._solution.sid - ); + this._usage = new UsageList(this._version, this._solution.sid); } return this._usage; } @@ -1381,10 +1259,7 @@ Object.defineProperty(AccountContext.prototype, 'validationRequests', { get: function() { if (!this._validationRequests) { - this._validationRequests = new ValidationRequestList( - this._version, - this._solution.sid - ); + this._validationRequests = new ValidationRequestList(this._version, this._solution.sid); } return this._validationRequests; } diff --git a/lib/rest/api/v2010/account/address.js b/lib/rest/api/v2010/account/address.js index 8edbc7ecef..737d5f4f45 100644 --- a/lib/rest/api/v2010/account/address.js +++ b/lib/rest/api/v2010/account/address.js @@ -51,9 +51,7 @@ AddressList = function AddressList(version, accountSid) { AddressListInstance._version = version; // Path Solution - AddressListInstance._solution = { - accountSid: accountSid - }; + AddressListInstance._solution = {accountSid: accountSid}; AddressListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Addresses.json' // jshint ignore:line )(AddressListInstance._solution); @@ -116,11 +114,7 @@ AddressList = function AddressList(version, accountSid) { 'AutoCorrectAddress': serialize.bool(_.get(opts, 'autoCorrectAddress')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new AddressInstance( @@ -340,18 +334,10 @@ AddressList = function AddressList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AddressPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AddressPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -388,17 +374,10 @@ AddressList = function AddressList(version, accountSid) { AddressListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AddressPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AddressPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -426,11 +405,7 @@ AddressList = function AddressList(version, accountSid) { */ /* jshint ignore:end */ AddressListInstance.get = function get(sid) { - return new AddressContext( - this._version, - this._solution.accountSid, - sid - ); + return new AddressContext(this._version, this._solution.accountSid, sid); }; return AddressListInstance; @@ -474,11 +449,7 @@ AddressPage.prototype.constructor = AddressPage; */ /* jshint ignore:end */ AddressPage.prototype.getInstance = function getInstance(payload) { - return new AddressInstance( - this._version, - payload, - this._solution.accountSid - ); + return new AddressInstance(this._version, payload, this._solution.accountSid); }; @@ -529,21 +500,14 @@ AddressInstance = function AddressInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(AddressInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new AddressContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new AddressContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -644,10 +608,7 @@ AddressContext = function AddressContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Addresses/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -671,10 +632,7 @@ AddressContext = function AddressContext(version, accountSid, sid) { /* jshint ignore:end */ AddressContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -706,10 +664,7 @@ AddressContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ AddressContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AddressInstance( @@ -772,11 +727,7 @@ AddressContext.prototype.update = function update(opts, callback) { 'AutoCorrectAddress': serialize.bool(_.get(opts, 'autoCorrectAddress')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new AddressInstance( diff --git a/lib/rest/api/v2010/account/address/dependentPhoneNumber.js b/lib/rest/api/v2010/account/address/dependentPhoneNumber.js index 4c8f6f4698..d29f708437 100644 --- a/lib/rest/api/v2010/account/address/dependentPhoneNumber.js +++ b/lib/rest/api/v2010/account/address/dependentPhoneNumber.js @@ -49,10 +49,7 @@ DependentPhoneNumberList = function DependentPhoneNumberList(version, DependentPhoneNumberListInstance._version = version; // Path Solution - DependentPhoneNumberListInstance._solution = { - accountSid: accountSid, - addressSid: addressSid - }; + DependentPhoneNumberListInstance._solution = {accountSid: accountSid, addressSid: addressSid}; DependentPhoneNumberListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Addresses/<%= addressSid %>/DependentPhoneNumbers.json' // jshint ignore:line )(DependentPhoneNumberListInstance._solution); @@ -238,18 +235,10 @@ DependentPhoneNumberList = function DependentPhoneNumberList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DependentPhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DependentPhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -284,17 +273,10 @@ DependentPhoneNumberList = function DependentPhoneNumberList(version, { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DependentPhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DependentPhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -399,10 +381,7 @@ DependentPhoneNumberInstance = function DependentPhoneNumberInstance(version, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - addressSid: addressSid, - }; + this._solution = {accountSid: accountSid, addressSid: addressSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/application.js b/lib/rest/api/v2010/account/application.js index 8fc589edf0..f572080d97 100644 --- a/lib/rest/api/v2010/account/application.js +++ b/lib/rest/api/v2010/account/application.js @@ -49,9 +49,7 @@ ApplicationList = function ApplicationList(version, accountSid) { ApplicationListInstance._version = version; // Path Solution - ApplicationListInstance._solution = { - accountSid: accountSid - }; + ApplicationListInstance._solution = {accountSid: accountSid}; ApplicationListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Applications.json' // jshint ignore:line )(ApplicationListInstance._solution); @@ -118,11 +116,7 @@ ApplicationList = function ApplicationList(version, accountSid) { 'MessageStatusCallback': _.get(opts, 'messageStatusCallback') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ApplicationInstance( @@ -334,18 +328,10 @@ ApplicationList = function ApplicationList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ApplicationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ApplicationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,17 +366,10 @@ ApplicationList = function ApplicationList(version, accountSid) { ApplicationListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ApplicationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ApplicationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -418,11 +397,7 @@ ApplicationList = function ApplicationList(version, accountSid) { */ /* jshint ignore:end */ ApplicationListInstance.get = function get(sid) { - return new ApplicationContext( - this._version, - this._solution.accountSid, - sid - ); + return new ApplicationContext(this._version, this._solution.accountSid, sid); }; return ApplicationListInstance; @@ -466,11 +441,7 @@ ApplicationPage.prototype.constructor = ApplicationPage; */ /* jshint ignore:end */ ApplicationPage.prototype.getInstance = function getInstance(payload) { - return new ApplicationInstance( - this._version, - payload, - this._solution.accountSid - ); + return new ApplicationInstance(this._version, payload, this._solution.accountSid); }; @@ -541,21 +512,14 @@ ApplicationInstance = function ApplicationInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(ApplicationInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ApplicationContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new ApplicationContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -652,10 +616,7 @@ ApplicationContext = function ApplicationContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Applications/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -676,10 +637,7 @@ ApplicationContext = function ApplicationContext(version, accountSid, sid) { /* jshint ignore:end */ ApplicationContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -711,10 +669,7 @@ ApplicationContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ ApplicationContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ApplicationInstance( @@ -799,11 +754,7 @@ ApplicationContext.prototype.update = function update(opts, callback) { 'MessageStatusCallback': _.get(opts, 'messageStatusCallback') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ApplicationInstance( diff --git a/lib/rest/api/v2010/account/authorizedConnectApp.js b/lib/rest/api/v2010/account/authorizedConnectApp.js index de0525271e..92f3e2a555 100644 --- a/lib/rest/api/v2010/account/authorizedConnectApp.js +++ b/lib/rest/api/v2010/account/authorizedConnectApp.js @@ -49,9 +49,7 @@ AuthorizedConnectAppList = function AuthorizedConnectAppList(version, AuthorizedConnectAppListInstance._version = version; // Path Solution - AuthorizedConnectAppListInstance._solution = { - accountSid: accountSid - }; + AuthorizedConnectAppListInstance._solution = {accountSid: accountSid}; AuthorizedConnectAppListInstance._uri = _.template( '/Accounts/<%= accountSid %>/AuthorizedConnectApps.json' // jshint ignore:line )(AuthorizedConnectAppListInstance._solution); @@ -237,18 +235,10 @@ AuthorizedConnectAppList = function AuthorizedConnectAppList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizedConnectAppPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AuthorizedConnectAppPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -283,17 +273,10 @@ AuthorizedConnectAppList = function AuthorizedConnectAppList(version, { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizedConnectAppPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AuthorizedConnectAppPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -321,11 +304,7 @@ AuthorizedConnectAppList = function AuthorizedConnectAppList(version, */ /* jshint ignore:end */ AuthorizedConnectAppListInstance.get = function get(connectAppSid) { - return new AuthorizedConnectAppContext( - this._version, - this._solution.accountSid, - connectAppSid - ); + return new AuthorizedConnectAppContext(this._version, this._solution.accountSid, connectAppSid); }; return AuthorizedConnectAppListInstance; @@ -370,11 +349,7 @@ AuthorizedConnectAppPage.prototype.constructor = AuthorizedConnectAppPage; */ /* jshint ignore:end */ AuthorizedConnectAppPage.prototype.getInstance = function getInstance(payload) { - return new AuthorizedConnectAppInstance( - this._version, - payload, - this._solution.accountSid - ); + return new AuthorizedConnectAppInstance(this._version, payload, this._solution.accountSid); }; @@ -421,10 +396,7 @@ AuthorizedConnectAppInstance = function AuthorizedConnectAppInstance(version, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - connectAppSid: connectAppSid || this.connectAppSid, - }; + this._solution = {accountSid: accountSid, connectAppSid: connectAppSid || this.connectAppSid,}; }; Object.defineProperty(AuthorizedConnectAppInstance.prototype, @@ -475,10 +447,7 @@ AuthorizedConnectAppContext = function AuthorizedConnectAppContext(version, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - connectAppSid: connectAppSid, - }; + this._solution = {accountSid: accountSid, connectAppSid: connectAppSid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/AuthorizedConnectApps/<%= connectAppSid %>.json' // jshint ignore:line )(this._solution); @@ -499,10 +468,7 @@ AuthorizedConnectAppContext = function AuthorizedConnectAppContext(version, /* jshint ignore:end */ AuthorizedConnectAppContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AuthorizedConnectAppInstance( diff --git a/lib/rest/api/v2010/account/availablePhoneNumber.js b/lib/rest/api/v2010/account/availablePhoneNumber.js index 5d62aaa630..d34bcf7b1e 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber.js @@ -51,9 +51,7 @@ AvailablePhoneNumberCountryList = function AvailablePhoneNumberCountryListInstance._version = version; // Path Solution - AvailablePhoneNumberCountryListInstance._solution = { - accountSid: accountSid - }; + AvailablePhoneNumberCountryListInstance._solution = {accountSid: accountSid}; AvailablePhoneNumberCountryListInstance._uri = _.template( '/Accounts/<%= accountSid %>/AvailablePhoneNumbers.json' // jshint ignore:line )(AvailablePhoneNumberCountryListInstance._solution); @@ -239,18 +237,10 @@ AvailablePhoneNumberCountryList = function 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AvailablePhoneNumberCountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AvailablePhoneNumberCountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +275,10 @@ AvailablePhoneNumberCountryList = function callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AvailablePhoneNumberCountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AvailablePhoneNumberCountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -323,11 +306,7 @@ AvailablePhoneNumberCountryList = function */ /* jshint ignore:end */ AvailablePhoneNumberCountryListInstance.get = function get(countryCode) { - return new AvailablePhoneNumberCountryContext( - this._version, - this._solution.accountSid, - countryCode - ); + return new AvailablePhoneNumberCountryContext(this._version, this._solution.accountSid, countryCode); }; return AvailablePhoneNumberCountryListInstance; @@ -373,11 +352,7 @@ AvailablePhoneNumberCountryPage.prototype.constructor = AvailablePhoneNumberCoun /* jshint ignore:end */ AvailablePhoneNumberCountryPage.prototype.getInstance = function getInstance(payload) { - return new AvailablePhoneNumberCountryInstance( - this._version, - payload, - this._solution.accountSid - ); + return new AvailablePhoneNumberCountryInstance(this._version, payload, this._solution.accountSid); }; @@ -413,10 +388,7 @@ AvailablePhoneNumberCountryInstance = function // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - countryCode: countryCode || this.countryCode, - }; + this._solution = {accountSid: accountSid, countryCode: countryCode || this.countryCode,}; }; Object.defineProperty(AvailablePhoneNumberCountryInstance.prototype, @@ -519,10 +491,7 @@ AvailablePhoneNumberCountryContext = function this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - countryCode: countryCode, - }; + this._solution = {accountSid: accountSid, countryCode: countryCode,}; this._uri = _.template( '/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>.json' // jshint ignore:line )(this._solution); @@ -548,10 +517,7 @@ AvailablePhoneNumberCountryContext = function /* jshint ignore:end */ AvailablePhoneNumberCountryContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AvailablePhoneNumberCountryInstance( @@ -577,11 +543,7 @@ Object.defineProperty(AvailablePhoneNumberCountryContext.prototype, 'local', { get: function() { if (!this._local) { - this._local = new LocalList( - this._version, - this._solution.accountSid, - this._solution.countryCode - ); + this._local = new LocalList(this._version, this._solution.accountSid, this._solution.countryCode); } return this._local; } @@ -605,11 +567,7 @@ Object.defineProperty(AvailablePhoneNumberCountryContext.prototype, 'mobile', { get: function() { if (!this._mobile) { - this._mobile = new MobileList( - this._version, - this._solution.accountSid, - this._solution.countryCode - ); + this._mobile = new MobileList(this._version, this._solution.accountSid, this._solution.countryCode); } return this._mobile; } diff --git a/lib/rest/api/v2010/account/availablePhoneNumber/local.js b/lib/rest/api/v2010/account/availablePhoneNumber/local.js index c1bbda3941..86f8dce321 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber/local.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber/local.js @@ -51,10 +51,7 @@ LocalList = function LocalList(version, accountSid, countryCode) { LocalListInstance._version = version; // Path Solution - LocalListInstance._solution = { - accountSid: accountSid, - countryCode: countryCode - }; + LocalListInstance._solution = {accountSid: accountSid, countryCode: countryCode}; LocalListInstance._uri = _.template( '/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Local.json' // jshint ignore:line )(LocalListInstance._solution); @@ -325,18 +322,10 @@ LocalList = function LocalList(version, accountSid, countryCode) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new LocalPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new LocalPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -391,17 +380,10 @@ LocalList = function LocalList(version, accountSid, countryCode) { LocalListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new LocalPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new LocalPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -509,10 +491,7 @@ LocalInstance = function LocalInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - countryCode: countryCode, - }; + this._solution = {accountSid: accountSid, countryCode: countryCode,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js b/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js index 84e5196ebf..fcf7dce9f2 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js @@ -51,10 +51,7 @@ MobileList = function MobileList(version, accountSid, countryCode) { MobileListInstance._version = version; // Path Solution - MobileListInstance._solution = { - accountSid: accountSid, - countryCode: countryCode - }; + MobileListInstance._solution = {accountSid: accountSid, countryCode: countryCode}; MobileListInstance._uri = _.template( '/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Mobile.json' // jshint ignore:line )(MobileListInstance._solution); @@ -325,18 +322,10 @@ MobileList = function MobileList(version, accountSid, countryCode) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MobilePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MobilePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -391,17 +380,10 @@ MobileList = function MobileList(version, accountSid, countryCode) { MobileListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MobilePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MobilePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -509,10 +491,7 @@ MobileInstance = function MobileInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - countryCode: countryCode, - }; + this._solution = {accountSid: accountSid, countryCode: countryCode,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js b/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js index 9300c783bc..9d9be5f57d 100644 --- a/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js +++ b/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js @@ -51,10 +51,7 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { TollFreeListInstance._version = version; // Path Solution - TollFreeListInstance._solution = { - accountSid: accountSid, - countryCode: countryCode - }; + TollFreeListInstance._solution = {accountSid: accountSid, countryCode: countryCode}; TollFreeListInstance._uri = _.template( '/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/TollFree.json' // jshint ignore:line )(TollFreeListInstance._solution); @@ -325,18 +322,10 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TollFreePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TollFreePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -391,17 +380,10 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) { TollFreeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TollFreePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TollFreePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -509,10 +491,7 @@ TollFreeInstance = function TollFreeInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - countryCode: countryCode, - }; + this._solution = {accountSid: accountSid, countryCode: countryCode,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/call.js b/lib/rest/api/v2010/account/call.js index eb217d326c..5e64f879e1 100644 --- a/lib/rest/api/v2010/account/call.js +++ b/lib/rest/api/v2010/account/call.js @@ -54,9 +54,7 @@ CallList = function CallList(version, accountSid) { CallListInstance._version = version; // Path Solution - CallListInstance._solution = { - accountSid: accountSid - }; + CallListInstance._solution = {accountSid: accountSid}; CallListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Calls.json' // jshint ignore:line )(CallListInstance._solution); @@ -141,11 +139,7 @@ CallList = function CallList(version, accountSid) { 'MachineDetectionTimeout': _.get(opts, 'machineDetectionTimeout') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CallInstance( @@ -396,18 +390,10 @@ CallList = function CallList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CallPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CallPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -452,17 +438,10 @@ CallList = function CallList(version, accountSid) { CallListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CallPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CallPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -480,10 +459,7 @@ CallList = function CallList(version, accountSid) { 'feedbackSummaries', { get: function feedbackSummaries() { if (!this._feedbackSummaries) { - this._feedbackSummaries = new FeedbackSummaryList( - this._version, - this._solution.accountSid - ); + this._feedbackSummaries = new FeedbackSummaryList(this._version, this._solution.accountSid); } return this._feedbackSummaries; @@ -504,11 +480,7 @@ CallList = function CallList(version, accountSid) { */ /* jshint ignore:end */ CallListInstance.get = function get(sid) { - return new CallContext( - this._version, - this._solution.accountSid, - sid - ); + return new CallContext(this._version, this._solution.accountSid, sid); }; return CallListInstance; @@ -552,11 +524,7 @@ CallPage.prototype.constructor = CallPage; */ /* jshint ignore:end */ CallPage.prototype.getInstance = function getInstance(payload) { - return new CallInstance( - this._version, - payload, - this._solution.accountSid - ); + return new CallInstance(this._version, payload, this._solution.accountSid); }; @@ -646,21 +614,14 @@ CallInstance = function CallInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(CallInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CallContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new CallContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -794,10 +755,7 @@ CallContext = function CallContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Calls/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -823,10 +781,7 @@ CallContext = function CallContext(version, accountSid, sid) { /* jshint ignore:end */ CallContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -858,10 +813,7 @@ CallContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ CallContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new CallInstance( @@ -923,11 +875,7 @@ CallContext.prototype.update = function update(opts, callback) { 'StatusCallbackMethod': _.get(opts, 'statusCallbackMethod') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CallInstance( @@ -953,11 +901,7 @@ Object.defineProperty(CallContext.prototype, 'recordings', { get: function() { if (!this._recordings) { - this._recordings = new RecordingList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._recordings = new RecordingList(this._version, this._solution.accountSid, this._solution.sid); } return this._recordings; } @@ -981,11 +925,7 @@ Object.defineProperty(CallContext.prototype, 'feedback', { get: function() { if (!this._feedback) { - this._feedback = new FeedbackList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._feedback = new FeedbackList(this._version, this._solution.accountSid, this._solution.sid); } return this._feedback; } diff --git a/lib/rest/api/v2010/account/call/feedback.js b/lib/rest/api/v2010/account/call/feedback.js index d4e2269222..c90b6ec4c5 100644 --- a/lib/rest/api/v2010/account/call/feedback.js +++ b/lib/rest/api/v2010/account/call/feedback.js @@ -50,10 +50,7 @@ FeedbackList = function FeedbackList(version, accountSid, callSid) { FeedbackListInstance._version = version; // Path Solution - FeedbackListInstance._solution = { - accountSid: accountSid, - callSid: callSid - }; + FeedbackListInstance._solution = {accountSid: accountSid, callSid: callSid}; /* jshint ignore:start */ /** * Constructs a feedback @@ -66,11 +63,7 @@ FeedbackList = function FeedbackList(version, accountSid, callSid) { */ /* jshint ignore:end */ FeedbackListInstance.get = function get() { - return new FeedbackContext( - this._version, - this._solution.accountSid, - this._solution.callSid - ); + return new FeedbackContext(this._version, this._solution.accountSid, this._solution.callSid); }; return FeedbackListInstance; @@ -114,12 +107,7 @@ FeedbackPage.prototype.constructor = FeedbackPage; */ /* jshint ignore:end */ FeedbackPage.prototype.getInstance = function getInstance(payload) { - return new FeedbackInstance( - this._version, - payload, - this._solution.accountSid, - this._solution.callSid - ); + return new FeedbackInstance(this._version, payload, this._solution.accountSid, this._solution.callSid); }; @@ -155,21 +143,14 @@ FeedbackInstance = function FeedbackInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - callSid: callSid, - }; + this._solution = {accountSid: accountSid, callSid: callSid,}; }; Object.defineProperty(FeedbackInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new FeedbackContext( - this._version, - this._solution.accountSid, - this._solution.callSid - ); + this._context = new FeedbackContext(this._version, this._solution.accountSid, this._solution.callSid); } return this._context; @@ -248,10 +229,7 @@ FeedbackContext = function FeedbackContext(version, accountSid, callSid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - callSid: callSid, - }; + this._solution = {accountSid: accountSid, callSid: callSid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Feedback.json' // jshint ignore:line )(this._solution); @@ -282,16 +260,9 @@ FeedbackContext.prototype.create = function create(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'QualityScore': _.get(opts, 'qualityScore'), - 'Issue': _.get(opts, 'issue') - }); + var data = values.of({'QualityScore': _.get(opts, 'qualityScore'), 'Issue': _.get(opts, 'issue')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new FeedbackInstance( @@ -328,10 +299,7 @@ FeedbackContext.prototype.create = function create(opts, callback) { /* jshint ignore:end */ FeedbackContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new FeedbackInstance( @@ -378,16 +346,9 @@ FeedbackContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'QualityScore': _.get(opts, 'qualityScore'), - 'Issue': _.get(opts, 'issue') - }); + var data = values.of({'QualityScore': _.get(opts, 'qualityScore'), 'Issue': _.get(opts, 'issue')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new FeedbackInstance( diff --git a/lib/rest/api/v2010/account/call/feedbackSummary.js b/lib/rest/api/v2010/account/call/feedbackSummary.js index 2ec2725be9..d4aeab317b 100644 --- a/lib/rest/api/v2010/account/call/feedbackSummary.js +++ b/lib/rest/api/v2010/account/call/feedbackSummary.js @@ -51,9 +51,7 @@ FeedbackSummaryList = function FeedbackSummaryList(version, accountSid) { FeedbackSummaryListInstance._version = version; // Path Solution - FeedbackSummaryListInstance._solution = { - accountSid: accountSid - }; + FeedbackSummaryListInstance._solution = {accountSid: accountSid}; FeedbackSummaryListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Calls/FeedbackSummary.json' // jshint ignore:line )(FeedbackSummaryListInstance._solution); @@ -96,11 +94,7 @@ FeedbackSummaryList = function FeedbackSummaryList(version, accountSid) { 'StatusCallbackMethod': _.get(opts, 'statusCallbackMethod') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new FeedbackSummaryInstance( @@ -136,11 +130,7 @@ FeedbackSummaryList = function FeedbackSummaryList(version, accountSid) { */ /* jshint ignore:end */ FeedbackSummaryListInstance.get = function get(sid) { - return new FeedbackSummaryContext( - this._version, - this._solution.accountSid, - sid - ); + return new FeedbackSummaryContext(this._version, this._solution.accountSid, sid); }; return FeedbackSummaryListInstance; @@ -185,11 +175,7 @@ FeedbackSummaryPage.prototype.constructor = FeedbackSummaryPage; */ /* jshint ignore:end */ FeedbackSummaryPage.prototype.getInstance = function getInstance(payload) { - return new FeedbackSummaryInstance( - this._version, - payload, - this._solution.accountSid - ); + return new FeedbackSummaryInstance(this._version, payload, this._solution.accountSid); }; @@ -242,10 +228,7 @@ FeedbackSummaryInstance = function FeedbackSummaryInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(FeedbackSummaryInstance.prototype, @@ -313,10 +296,7 @@ FeedbackSummaryContext = function FeedbackSummaryContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Calls/FeedbackSummary/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -337,10 +317,7 @@ FeedbackSummaryContext = function FeedbackSummaryContext(version, accountSid, /* jshint ignore:end */ FeedbackSummaryContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new FeedbackSummaryInstance( @@ -377,10 +354,7 @@ FeedbackSummaryContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ FeedbackSummaryContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/call/notification.js b/lib/rest/api/v2010/account/call/notification.js index 4ff18e0b65..68886de813 100644 --- a/lib/rest/api/v2010/account/call/notification.js +++ b/lib/rest/api/v2010/account/call/notification.js @@ -51,10 +51,7 @@ NotificationList = function NotificationList(version, accountSid, callSid) { NotificationListInstance._version = version; // Path Solution - NotificationListInstance._solution = { - accountSid: accountSid, - callSid: callSid - }; + NotificationListInstance._solution = {accountSid: accountSid, callSid: callSid}; NotificationListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Notifications.json' // jshint ignore:line )(NotificationListInstance._solution); @@ -260,18 +257,10 @@ NotificationList = function NotificationList(version, accountSid, callSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new NotificationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new NotificationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -309,17 +298,10 @@ NotificationList = function NotificationList(version, accountSid, callSid) { NotificationListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new NotificationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new NotificationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -347,12 +329,7 @@ NotificationList = function NotificationList(version, accountSid, callSid) { */ /* jshint ignore:end */ NotificationListInstance.get = function get(sid) { - return new NotificationContext( - this._version, - this._solution.accountSid, - this._solution.callSid, - sid - ); + return new NotificationContext(this._version, this._solution.accountSid, this._solution.callSid, sid); }; return NotificationListInstance; @@ -461,11 +438,7 @@ NotificationInstance = function NotificationInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - callSid: callSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, callSid: callSid, sid: sid || this.sid,}; }; Object.defineProperty(NotificationInstance.prototype, @@ -535,11 +508,7 @@ NotificationContext = function NotificationContext(version, accountSid, callSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - callSid: callSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, callSid: callSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Notifications/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -560,10 +529,7 @@ NotificationContext = function NotificationContext(version, accountSid, callSid, /* jshint ignore:end */ NotificationContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new NotificationInstance( @@ -601,10 +567,7 @@ NotificationContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ NotificationContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/call/recording.js b/lib/rest/api/v2010/account/call/recording.js index 00dbab4370..6036879690 100644 --- a/lib/rest/api/v2010/account/call/recording.js +++ b/lib/rest/api/v2010/account/call/recording.js @@ -51,10 +51,7 @@ RecordingList = function RecordingList(version, accountSid, callSid) { RecordingListInstance._version = version; // Path Solution - RecordingListInstance._solution = { - accountSid: accountSid, - callSid: callSid - }; + RecordingListInstance._solution = {accountSid: accountSid, callSid: callSid}; RecordingListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Recordings.json' // jshint ignore:line )(RecordingListInstance._solution); @@ -256,18 +253,10 @@ RecordingList = function RecordingList(version, accountSid, callSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -304,17 +293,10 @@ RecordingList = function RecordingList(version, accountSid, callSid) { RecordingListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,12 +324,7 @@ RecordingList = function RecordingList(version, accountSid, callSid) { */ /* jshint ignore:end */ RecordingListInstance.get = function get(sid) { - return new RecordingContext( - this._version, - this._solution.accountSid, - this._solution.callSid, - sid - ); + return new RecordingContext(this._version, this._solution.accountSid, this._solution.callSid, sid); }; return RecordingListInstance; @@ -443,11 +420,7 @@ RecordingInstance = function RecordingInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - callSid: callSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, callSid: callSid, sid: sid || this.sid,}; }; Object.defineProperty(RecordingInstance.prototype, @@ -517,11 +490,7 @@ RecordingContext = function RecordingContext(version, accountSid, callSid, sid) this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - callSid: callSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, callSid: callSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Recordings/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -542,10 +511,7 @@ RecordingContext = function RecordingContext(version, accountSid, callSid, sid) /* jshint ignore:end */ RecordingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RecordingInstance( @@ -583,10 +549,7 @@ RecordingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RecordingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/conference.js b/lib/rest/api/v2010/account/conference.js index 139f1fbee5..0ce240d90b 100644 --- a/lib/rest/api/v2010/account/conference.js +++ b/lib/rest/api/v2010/account/conference.js @@ -50,9 +50,7 @@ ConferenceList = function ConferenceList(version, accountSid) { ConferenceListInstance._version = version; // Path Solution - ConferenceListInstance._solution = { - accountSid: accountSid - }; + ConferenceListInstance._solution = {accountSid: accountSid}; ConferenceListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Conferences.json' // jshint ignore:line )(ConferenceListInstance._solution); @@ -274,18 +272,10 @@ ConferenceList = function ConferenceList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ConferencePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ConferencePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -327,17 +317,10 @@ ConferenceList = function ConferenceList(version, accountSid) { ConferenceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ConferencePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ConferencePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -365,11 +348,7 @@ ConferenceList = function ConferenceList(version, accountSid) { */ /* jshint ignore:end */ ConferenceListInstance.get = function get(sid) { - return new ConferenceContext( - this._version, - this._solution.accountSid, - sid - ); + return new ConferenceContext(this._version, this._solution.accountSid, sid); }; return ConferenceListInstance; @@ -413,11 +392,7 @@ ConferencePage.prototype.constructor = ConferencePage; */ /* jshint ignore:end */ ConferencePage.prototype.getInstance = function getInstance(payload) { - return new ConferenceInstance( - this._version, - payload, - this._solution.accountSid - ); + return new ConferenceInstance(this._version, payload, this._solution.accountSid); }; @@ -461,21 +436,14 @@ ConferenceInstance = function ConferenceInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(ConferenceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ConferenceContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new ConferenceContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -551,10 +519,7 @@ ConferenceContext = function ConferenceContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Conferences/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -578,10 +543,7 @@ ConferenceContext = function ConferenceContext(version, accountSid, sid) { /* jshint ignore:end */ ConferenceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ConferenceInstance( @@ -626,15 +588,9 @@ ConferenceContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Status': _.get(opts, 'status') - }); + var data = values.of({'Status': _.get(opts, 'status')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ConferenceInstance( diff --git a/lib/rest/api/v2010/account/conference/participant.js b/lib/rest/api/v2010/account/conference/participant.js index a4d8ff7bc3..e48d73bd73 100644 --- a/lib/rest/api/v2010/account/conference/participant.js +++ b/lib/rest/api/v2010/account/conference/participant.js @@ -52,10 +52,7 @@ ParticipantList = function ParticipantList(version, accountSid, conferenceSid) { ParticipantListInstance._version = version; // Path Solution - ParticipantListInstance._solution = { - accountSid: accountSid, - conferenceSid: conferenceSid - }; + ParticipantListInstance._solution = {accountSid: accountSid, conferenceSid: conferenceSid}; ParticipantListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Conferences/<%= conferenceSid %>/Participants.json' // jshint ignore:line )(ParticipantListInstance._solution); @@ -149,11 +146,7 @@ ParticipantList = function ParticipantList(version, accountSid, conferenceSid) { 'ConferenceRecordingStatusCallbackMethod': _.get(opts, 'conferenceRecordingStatusCallbackMethod') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -370,18 +363,10 @@ ParticipantList = function ParticipantList(version, accountSid, conferenceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ParticipantPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ParticipantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -417,17 +402,10 @@ ParticipantList = function ParticipantList(version, accountSid, conferenceSid) { ParticipantListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ParticipantPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ParticipantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -657,11 +635,7 @@ ParticipantContext = function ParticipantContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - conferenceSid: conferenceSid, - callSid: callSid, - }; + this._solution = {accountSid: accountSid, conferenceSid: conferenceSid, callSid: callSid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Conferences/<%= conferenceSid %>/Participants/<%= callSid %>.json' // jshint ignore:line )(this._solution); @@ -682,10 +656,7 @@ ParticipantContext = function ParticipantContext(version, accountSid, /* jshint ignore:end */ ParticipantContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -745,11 +716,7 @@ ParticipantContext.prototype.update = function update(opts, callback) { 'AnnounceMethod': _.get(opts, 'announceMethod') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -787,10 +754,7 @@ ParticipantContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ ParticipantContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/connectApp.js b/lib/rest/api/v2010/account/connectApp.js index 60adc3a5a4..8ec59cc858 100644 --- a/lib/rest/api/v2010/account/connectApp.js +++ b/lib/rest/api/v2010/account/connectApp.js @@ -46,9 +46,7 @@ ConnectAppList = function ConnectAppList(version, accountSid) { ConnectAppListInstance._version = version; // Path Solution - ConnectAppListInstance._solution = { - accountSid: accountSid - }; + ConnectAppListInstance._solution = {accountSid: accountSid}; ConnectAppListInstance._uri = _.template( '/Accounts/<%= accountSid %>/ConnectApps.json' // jshint ignore:line )(ConnectAppListInstance._solution); @@ -234,18 +232,10 @@ ConnectAppList = function ConnectAppList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ConnectAppPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ConnectAppPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -279,17 +269,10 @@ ConnectAppList = function ConnectAppList(version, accountSid) { ConnectAppListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ConnectAppPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ConnectAppPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -317,11 +300,7 @@ ConnectAppList = function ConnectAppList(version, accountSid) { */ /* jshint ignore:end */ ConnectAppListInstance.get = function get(sid) { - return new ConnectAppContext( - this._version, - this._solution.accountSid, - sid - ); + return new ConnectAppContext(this._version, this._solution.accountSid, sid); }; return ConnectAppListInstance; @@ -365,11 +344,7 @@ ConnectAppPage.prototype.constructor = ConnectAppPage; */ /* jshint ignore:end */ ConnectAppPage.prototype.getInstance = function getInstance(payload) { - return new ConnectAppInstance( - this._version, - payload, - this._solution.accountSid - ); + return new ConnectAppInstance(this._version, payload, this._solution.accountSid); }; @@ -419,21 +394,14 @@ ConnectAppInstance = function ConnectAppInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(ConnectAppInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ConnectAppContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new ConnectAppContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -502,10 +470,7 @@ ConnectAppContext = function ConnectAppContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/ConnectApps/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -526,10 +491,7 @@ ConnectAppContext = function ConnectAppContext(version, accountSid, sid) { /* jshint ignore:end */ ConnectAppContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ConnectAppInstance( @@ -596,11 +558,7 @@ ConnectAppContext.prototype.update = function update(opts, callback) { 'Permissions': _.get(opts, 'permissions') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ConnectAppInstance( diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber.js b/lib/rest/api/v2010/account/incomingPhoneNumber.js index 0a32a6bb01..4805bd878e 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber.js +++ b/lib/rest/api/v2010/account/incomingPhoneNumber.js @@ -55,9 +55,7 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) IncomingPhoneNumberListInstance._version = version; // Path Solution - IncomingPhoneNumberListInstance._solution = { - accountSid: accountSid - }; + IncomingPhoneNumberListInstance._solution = {accountSid: accountSid}; IncomingPhoneNumberListInstance._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers.json' // jshint ignore:line )(IncomingPhoneNumberListInstance._solution); @@ -269,18 +267,10 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new IncomingPhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IncomingPhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -319,17 +309,10 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new IncomingPhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IncomingPhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -423,11 +406,7 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) 'AddressSid': _.get(opts, 'addressSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IncomingPhoneNumberInstance( @@ -453,10 +432,7 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) 'local', { get: function local() { if (!this._local) { - this._local = new LocalList( - this._version, - this._solution.accountSid - ); + this._local = new LocalList(this._version, this._solution.accountSid); } return this._local; @@ -467,10 +443,7 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) 'mobile', { get: function mobile() { if (!this._mobile) { - this._mobile = new MobileList( - this._version, - this._solution.accountSid - ); + this._mobile = new MobileList(this._version, this._solution.accountSid); } return this._mobile; @@ -481,10 +454,7 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) 'tollFree', { get: function tollFree() { if (!this._tollFree) { - this._tollFree = new TollFreeList( - this._version, - this._solution.accountSid - ); + this._tollFree = new TollFreeList(this._version, this._solution.accountSid); } return this._tollFree; @@ -505,11 +475,7 @@ IncomingPhoneNumberList = function IncomingPhoneNumberList(version, accountSid) */ /* jshint ignore:end */ IncomingPhoneNumberListInstance.get = function get(sid) { - return new IncomingPhoneNumberContext( - this._version, - this._solution.accountSid, - sid - ); + return new IncomingPhoneNumberContext(this._version, this._solution.accountSid, sid); }; return IncomingPhoneNumberListInstance; @@ -554,11 +520,7 @@ IncomingPhoneNumberPage.prototype.constructor = IncomingPhoneNumberPage; */ /* jshint ignore:end */ IncomingPhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new IncomingPhoneNumberInstance( - this._version, - payload, - this._solution.accountSid - ); + return new IncomingPhoneNumberInstance(this._version, payload, this._solution.accountSid); }; @@ -653,10 +615,7 @@ IncomingPhoneNumberInstance = function IncomingPhoneNumberInstance(version, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(IncomingPhoneNumberInstance.prototype, @@ -795,10 +754,7 @@ IncomingPhoneNumberContext = function IncomingPhoneNumberContext(version, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -888,11 +844,7 @@ IncomingPhoneNumberContext.prototype.update = function update(opts, callback) { 'AddressSid': _.get(opts, 'addressSid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IncomingPhoneNumberInstance( @@ -929,10 +881,7 @@ IncomingPhoneNumberContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ IncomingPhoneNumberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new IncomingPhoneNumberInstance( @@ -969,10 +918,7 @@ IncomingPhoneNumberContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ IncomingPhoneNumberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js b/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js index 395e56edb9..a2bb8346d8 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js +++ b/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js @@ -53,10 +53,7 @@ AssignedAddOnList = function AssignedAddOnList(version, accountSid, resourceSid) AssignedAddOnListInstance._version = version; // Path Solution - AssignedAddOnListInstance._solution = { - accountSid: accountSid, - resourceSid: resourceSid - }; + AssignedAddOnListInstance._solution = {accountSid: accountSid, resourceSid: resourceSid}; AssignedAddOnListInstance._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers/<%= resourceSid %>/AssignedAddOns.json' // jshint ignore:line )(AssignedAddOnListInstance._solution); @@ -242,18 +239,10 @@ AssignedAddOnList = function AssignedAddOnList(version, accountSid, resourceSid) 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AssignedAddOnPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AssignedAddOnPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -287,17 +276,10 @@ AssignedAddOnList = function AssignedAddOnList(version, accountSid, resourceSid) AssignedAddOnListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AssignedAddOnPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AssignedAddOnPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,15 +318,9 @@ AssignedAddOnList = function AssignedAddOnList(version, accountSid, resourceSid) } var deferred = Q.defer(); - var data = values.of({ - 'InstalledAddOnSid': _.get(opts, 'installedAddOnSid') - }); + var data = values.of({'InstalledAddOnSid': _.get(opts, 'installedAddOnSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new AssignedAddOnInstance( @@ -490,11 +466,7 @@ AssignedAddOnInstance = function AssignedAddOnInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - resourceSid: resourceSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, resourceSid: resourceSid, sid: sid || this.sid,}; }; Object.defineProperty(AssignedAddOnInstance.prototype, @@ -583,11 +555,7 @@ AssignedAddOnContext = function AssignedAddOnContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - resourceSid: resourceSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, resourceSid: resourceSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers/<%= resourceSid %>/AssignedAddOns/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -611,10 +579,7 @@ AssignedAddOnContext = function AssignedAddOnContext(version, accountSid, /* jshint ignore:end */ AssignedAddOnContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AssignedAddOnInstance( @@ -652,10 +617,7 @@ AssignedAddOnContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ AssignedAddOnContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js b/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js index 87436b6c15..b11eb8a252 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js +++ b/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js @@ -241,18 +241,10 @@ AssignedAddOnExtensionList = function AssignedAddOnExtensionList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AssignedAddOnExtensionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AssignedAddOnExtensionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -287,17 +279,10 @@ AssignedAddOnExtensionList = function AssignedAddOnExtensionList(version, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AssignedAddOnExtensionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AssignedAddOnExtensionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -522,10 +507,7 @@ AssignedAddOnExtensionContext = function AssignedAddOnExtensionContext(version, /* jshint ignore:end */ AssignedAddOnExtensionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AssignedAddOnExtensionInstance( diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber/local.js b/lib/rest/api/v2010/account/incomingPhoneNumber/local.js index 5d3a5d4a90..2df50df496 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +++ b/lib/rest/api/v2010/account/incomingPhoneNumber/local.js @@ -49,9 +49,7 @@ LocalList = function LocalList(version, accountSid) { LocalListInstance._version = version; // Path Solution - LocalListInstance._solution = { - accountSid: accountSid - }; + LocalListInstance._solution = {accountSid: accountSid}; LocalListInstance._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers/Local.json' // jshint ignore:line )(LocalListInstance._solution); @@ -257,18 +255,10 @@ LocalList = function LocalList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new LocalPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new LocalPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +296,10 @@ LocalList = function LocalList(version, accountSid) { LocalListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new LocalPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new LocalPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -393,17 +376,10 @@ LocalList = function LocalList(version, accountSid) { 'AddressSid': _.get(opts, 'addressSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new LocalInstance( - this._version, - payload - )); + deferred.resolve(new LocalInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -458,11 +434,7 @@ LocalPage.prototype.constructor = LocalPage; */ /* jshint ignore:end */ LocalPage.prototype.getInstance = function getInstance(payload) { - return new LocalInstance( - this._version, - payload, - this._solution.accountSid - ); + return new LocalInstance(this._version, payload, this._solution.accountSid); }; @@ -540,9 +512,7 @@ LocalInstance = function LocalInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js b/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js index f15da0a351..f924e56acd 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +++ b/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js @@ -49,9 +49,7 @@ MobileList = function MobileList(version, accountSid) { MobileListInstance._version = version; // Path Solution - MobileListInstance._solution = { - accountSid: accountSid - }; + MobileListInstance._solution = {accountSid: accountSid}; MobileListInstance._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers/Mobile.json' // jshint ignore:line )(MobileListInstance._solution); @@ -257,18 +255,10 @@ MobileList = function MobileList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MobilePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MobilePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +296,10 @@ MobileList = function MobileList(version, accountSid) { MobileListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MobilePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MobilePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -393,17 +376,10 @@ MobileList = function MobileList(version, accountSid) { 'AddressSid': _.get(opts, 'addressSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new MobileInstance( - this._version, - payload - )); + deferred.resolve(new MobileInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -458,11 +434,7 @@ MobilePage.prototype.constructor = MobilePage; */ /* jshint ignore:end */ MobilePage.prototype.getInstance = function getInstance(payload) { - return new MobileInstance( - this._version, - payload, - this._solution.accountSid - ); + return new MobileInstance(this._version, payload, this._solution.accountSid); }; @@ -540,9 +512,7 @@ MobileInstance = function MobileInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js b/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js index 6ff806388a..cae436fd5c 100644 --- a/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +++ b/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js @@ -49,9 +49,7 @@ TollFreeList = function TollFreeList(version, accountSid) { TollFreeListInstance._version = version; // Path Solution - TollFreeListInstance._solution = { - accountSid: accountSid - }; + TollFreeListInstance._solution = {accountSid: accountSid}; TollFreeListInstance._uri = _.template( '/Accounts/<%= accountSid %>/IncomingPhoneNumbers/TollFree.json' // jshint ignore:line )(TollFreeListInstance._solution); @@ -257,18 +255,10 @@ TollFreeList = function TollFreeList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TollFreePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TollFreePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +296,10 @@ TollFreeList = function TollFreeList(version, accountSid) { TollFreeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TollFreePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TollFreePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -393,17 +376,10 @@ TollFreeList = function TollFreeList(version, accountSid) { 'AddressSid': _.get(opts, 'addressSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new TollFreeInstance( - this._version, - payload - )); + deferred.resolve(new TollFreeInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -458,11 +434,7 @@ TollFreePage.prototype.constructor = TollFreePage; */ /* jshint ignore:end */ TollFreePage.prototype.getInstance = function getInstance(payload) { - return new TollFreeInstance( - this._version, - payload, - this._solution.accountSid - ); + return new TollFreeInstance(this._version, payload, this._solution.accountSid); }; @@ -540,9 +512,7 @@ TollFreeInstance = function TollFreeInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/key.js b/lib/rest/api/v2010/account/key.js index 9ff63120a9..68f1e6ca0f 100644 --- a/lib/rest/api/v2010/account/key.js +++ b/lib/rest/api/v2010/account/key.js @@ -49,9 +49,7 @@ KeyList = function KeyList(version, accountSid) { KeyListInstance._version = version; // Path Solution - KeyListInstance._solution = { - accountSid: accountSid - }; + KeyListInstance._solution = {accountSid: accountSid}; KeyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Keys.json' // jshint ignore:line )(KeyListInstance._solution); @@ -237,18 +235,10 @@ KeyList = function KeyList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new KeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new KeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +272,10 @@ KeyList = function KeyList(version, accountSid) { KeyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new KeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new KeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -320,11 +303,7 @@ KeyList = function KeyList(version, accountSid) { */ /* jshint ignore:end */ KeyListInstance.get = function get(sid) { - return new KeyContext( - this._version, - this._solution.accountSid, - sid - ); + return new KeyContext(this._version, this._solution.accountSid, sid); }; return KeyListInstance; @@ -368,11 +347,7 @@ KeyPage.prototype.constructor = KeyPage; */ /* jshint ignore:end */ KeyPage.prototype.getInstance = function getInstance(payload) { - return new KeyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new KeyInstance(this._version, payload, this._solution.accountSid); }; @@ -403,21 +378,14 @@ KeyInstance = function KeyInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(KeyInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new KeyContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new KeyContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -492,10 +460,7 @@ KeyContext = function KeyContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Keys/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -516,10 +481,7 @@ KeyContext = function KeyContext(version, accountSid, sid) { /* jshint ignore:end */ KeyContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new KeyInstance( @@ -564,15 +526,9 @@ KeyContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new KeyInstance( @@ -609,10 +565,7 @@ KeyContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ KeyContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/message.js b/lib/rest/api/v2010/account/message.js index 18fa9fe30b..02595feaf7 100644 --- a/lib/rest/api/v2010/account/message.js +++ b/lib/rest/api/v2010/account/message.js @@ -51,9 +51,7 @@ MessageList = function MessageList(version, accountSid) { MessageListInstance._version = version; // Path Solution - MessageListInstance._solution = { - accountSid: accountSid - }; + MessageListInstance._solution = {accountSid: accountSid}; MessageListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Messages.json' // jshint ignore:line )(MessageListInstance._solution); @@ -118,11 +116,7 @@ MessageList = function MessageList(version, accountSid) { 'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -350,18 +344,10 @@ MessageList = function MessageList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -400,17 +386,10 @@ MessageList = function MessageList(version, accountSid) { MessageListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -438,11 +417,7 @@ MessageList = function MessageList(version, accountSid) { */ /* jshint ignore:end */ MessageListInstance.get = function get(sid) { - return new MessageContext( - this._version, - this._solution.accountSid, - sid - ); + return new MessageContext(this._version, this._solution.accountSid, sid); }; return MessageListInstance; @@ -486,11 +461,7 @@ MessagePage.prototype.constructor = MessagePage; */ /* jshint ignore:end */ MessagePage.prototype.getInstance = function getInstance(payload) { - return new MessageInstance( - this._version, - payload, - this._solution.accountSid - ); + return new MessageInstance(this._version, payload, this._solution.accountSid); }; @@ -556,21 +527,14 @@ MessageInstance = function MessageInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(MessageInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new MessageContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new MessageContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -680,10 +644,7 @@ MessageContext = function MessageContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Messages/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -708,10 +669,7 @@ MessageContext = function MessageContext(version, accountSid, sid) { /* jshint ignore:end */ MessageContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -743,10 +701,7 @@ MessageContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ MessageContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -792,15 +747,9 @@ MessageContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Body': _.get(opts, 'body') - }); + var data = values.of({'Body': _.get(opts, 'body')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -826,11 +775,7 @@ Object.defineProperty(MessageContext.prototype, 'media', { get: function() { if (!this._media) { - this._media = new MediaList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._media = new MediaList(this._version, this._solution.accountSid, this._solution.sid); } return this._media; } @@ -840,11 +785,7 @@ Object.defineProperty(MessageContext.prototype, 'feedback', { get: function() { if (!this._feedback) { - this._feedback = new FeedbackList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._feedback = new FeedbackList(this._version, this._solution.accountSid, this._solution.sid); } return this._feedback; } diff --git a/lib/rest/api/v2010/account/message/feedback.js b/lib/rest/api/v2010/account/message/feedback.js index 426ae94e82..b9c6fe9402 100644 --- a/lib/rest/api/v2010/account/message/feedback.js +++ b/lib/rest/api/v2010/account/message/feedback.js @@ -48,10 +48,7 @@ FeedbackList = function FeedbackList(version, accountSid, messageSid) { FeedbackListInstance._version = version; // Path Solution - FeedbackListInstance._solution = { - accountSid: accountSid, - messageSid: messageSid - }; + FeedbackListInstance._solution = {accountSid: accountSid, messageSid: messageSid}; FeedbackListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Messages/<%= messageSid %>/Feedback.json' // jshint ignore:line )(FeedbackListInstance._solution); @@ -80,21 +77,12 @@ FeedbackList = function FeedbackList(version, accountSid, messageSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Outcome': _.get(opts, 'outcome') - }); + var data = values.of({'Outcome': _.get(opts, 'outcome')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new FeedbackInstance( - this._version, - payload - )); + deferred.resolve(new FeedbackInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -188,10 +176,7 @@ FeedbackInstance = function FeedbackInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - messageSid: messageSid, - }; + this._solution = {accountSid: accountSid, messageSid: messageSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/message/media.js b/lib/rest/api/v2010/account/message/media.js index 605babe4ad..f1b3a84a7c 100644 --- a/lib/rest/api/v2010/account/message/media.js +++ b/lib/rest/api/v2010/account/message/media.js @@ -51,10 +51,7 @@ MediaList = function MediaList(version, accountSid, messageSid) { MediaListInstance._version = version; // Path Solution - MediaListInstance._solution = { - accountSid: accountSid, - messageSid: messageSid - }; + MediaListInstance._solution = {accountSid: accountSid, messageSid: messageSid}; MediaListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Messages/<%= messageSid %>/Media.json' // jshint ignore:line )(MediaListInstance._solution); @@ -256,18 +253,10 @@ MediaList = function MediaList(version, accountSid, messageSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MediaPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MediaPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -304,17 +293,10 @@ MediaList = function MediaList(version, accountSid, messageSid) { MediaListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MediaPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MediaPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,12 +324,7 @@ MediaList = function MediaList(version, accountSid, messageSid) { */ /* jshint ignore:end */ MediaListInstance.get = function get(sid) { - return new MediaContext( - this._version, - this._solution.accountSid, - this._solution.messageSid, - sid - ); + return new MediaContext(this._version, this._solution.accountSid, this._solution.messageSid, sid); }; return MediaListInstance; @@ -391,12 +368,7 @@ MediaPage.prototype.constructor = MediaPage; */ /* jshint ignore:end */ MediaPage.prototype.getInstance = function getInstance(payload) { - return new MediaInstance( - this._version, - payload, - this._solution.accountSid, - this._solution.messageSid - ); + return new MediaInstance(this._version, payload, this._solution.accountSid, this._solution.messageSid); }; @@ -436,11 +408,7 @@ MediaInstance = function MediaInstance(version, payload, accountSid, messageSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - messageSid: messageSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, messageSid: messageSid, sid: sid || this.sid,}; }; Object.defineProperty(MediaInstance.prototype, @@ -509,11 +477,7 @@ MediaContext = function MediaContext(version, accountSid, messageSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - messageSid: messageSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, messageSid: messageSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Messages/<%= messageSid %>/Media/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -534,10 +498,7 @@ MediaContext = function MediaContext(version, accountSid, messageSid, sid) { /* jshint ignore:end */ MediaContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -569,10 +530,7 @@ MediaContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ MediaContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MediaInstance( diff --git a/lib/rest/api/v2010/account/newKey.js b/lib/rest/api/v2010/account/newKey.js index facb610f0b..e1fd312ce2 100644 --- a/lib/rest/api/v2010/account/newKey.js +++ b/lib/rest/api/v2010/account/newKey.js @@ -48,9 +48,7 @@ NewKeyList = function NewKeyList(version, accountSid) { NewKeyListInstance._version = version; // Path Solution - NewKeyListInstance._solution = { - accountSid: accountSid - }; + NewKeyListInstance._solution = {accountSid: accountSid}; NewKeyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Keys.json' // jshint ignore:line )(NewKeyListInstance._solution); @@ -78,21 +76,12 @@ NewKeyList = function NewKeyList(version, accountSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new NewKeyInstance( - this._version, - payload - )); + deferred.resolve(new NewKeyInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -147,11 +136,7 @@ NewKeyPage.prototype.constructor = NewKeyPage; */ /* jshint ignore:end */ NewKeyPage.prototype.getInstance = function getInstance(payload) { - return new NewKeyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new NewKeyInstance(this._version, payload, this._solution.accountSid); }; @@ -182,9 +167,7 @@ NewKeyInstance = function NewKeyInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/newSigningKey.js b/lib/rest/api/v2010/account/newSigningKey.js index 4de5cfe26f..48887d4456 100644 --- a/lib/rest/api/v2010/account/newSigningKey.js +++ b/lib/rest/api/v2010/account/newSigningKey.js @@ -48,9 +48,7 @@ NewSigningKeyList = function NewSigningKeyList(version, accountSid) { NewSigningKeyListInstance._version = version; // Path Solution - NewSigningKeyListInstance._solution = { - accountSid: accountSid - }; + NewSigningKeyListInstance._solution = {accountSid: accountSid}; NewSigningKeyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SigningKeys.json' // jshint ignore:line )(NewSigningKeyListInstance._solution); @@ -78,21 +76,12 @@ NewSigningKeyList = function NewSigningKeyList(version, accountSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new NewSigningKeyInstance( - this._version, - payload - )); + deferred.resolve(new NewSigningKeyInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -147,11 +136,7 @@ NewSigningKeyPage.prototype.constructor = NewSigningKeyPage; */ /* jshint ignore:end */ NewSigningKeyPage.prototype.getInstance = function getInstance(payload) { - return new NewSigningKeyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new NewSigningKeyInstance(this._version, payload, this._solution.accountSid); }; @@ -183,9 +168,7 @@ NewSigningKeyInstance = function NewSigningKeyInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/notification.js b/lib/rest/api/v2010/account/notification.js index 1a76d2e5e3..ea1afb73ad 100644 --- a/lib/rest/api/v2010/account/notification.js +++ b/lib/rest/api/v2010/account/notification.js @@ -49,9 +49,7 @@ NotificationList = function NotificationList(version, accountSid) { NotificationListInstance._version = version; // Path Solution - NotificationListInstance._solution = { - accountSid: accountSid - }; + NotificationListInstance._solution = {accountSid: accountSid}; NotificationListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Notifications.json' // jshint ignore:line )(NotificationListInstance._solution); @@ -257,18 +255,10 @@ NotificationList = function NotificationList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new NotificationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new NotificationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +296,10 @@ NotificationList = function NotificationList(version, accountSid) { NotificationListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new NotificationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new NotificationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -344,11 +327,7 @@ NotificationList = function NotificationList(version, accountSid) { */ /* jshint ignore:end */ NotificationListInstance.get = function get(sid) { - return new NotificationContext( - this._version, - this._solution.accountSid, - sid - ); + return new NotificationContext(this._version, this._solution.accountSid, sid); }; return NotificationListInstance; @@ -392,11 +371,7 @@ NotificationPage.prototype.constructor = NotificationPage; */ /* jshint ignore:end */ NotificationPage.prototype.getInstance = function getInstance(payload) { - return new NotificationInstance( - this._version, - payload, - this._solution.accountSid - ); + return new NotificationInstance(this._version, payload, this._solution.accountSid); }; @@ -457,21 +432,14 @@ NotificationInstance = function NotificationInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(NotificationInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new NotificationContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new NotificationContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -527,10 +495,7 @@ NotificationContext = function NotificationContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Notifications/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -551,10 +516,7 @@ NotificationContext = function NotificationContext(version, accountSid, sid) { /* jshint ignore:end */ NotificationContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new NotificationInstance( @@ -591,10 +553,7 @@ NotificationContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ NotificationContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/outgoingCallerId.js b/lib/rest/api/v2010/account/outgoingCallerId.js index e9a61f3a55..6502652192 100644 --- a/lib/rest/api/v2010/account/outgoingCallerId.js +++ b/lib/rest/api/v2010/account/outgoingCallerId.js @@ -48,9 +48,7 @@ OutgoingCallerIdList = function OutgoingCallerIdList(version, accountSid) { OutgoingCallerIdListInstance._version = version; // Path Solution - OutgoingCallerIdListInstance._solution = { - accountSid: accountSid - }; + OutgoingCallerIdListInstance._solution = {accountSid: accountSid}; OutgoingCallerIdListInstance._uri = _.template( '/Accounts/<%= accountSid %>/OutgoingCallerIds.json' // jshint ignore:line )(OutgoingCallerIdListInstance._solution); @@ -248,18 +246,10 @@ OutgoingCallerIdList = function OutgoingCallerIdList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new OutgoingCallerIdPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new OutgoingCallerIdPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -295,17 +285,10 @@ OutgoingCallerIdList = function OutgoingCallerIdList(version, accountSid) { OutgoingCallerIdListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new OutgoingCallerIdPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new OutgoingCallerIdPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -333,11 +316,7 @@ OutgoingCallerIdList = function OutgoingCallerIdList(version, accountSid) { */ /* jshint ignore:end */ OutgoingCallerIdListInstance.get = function get(sid) { - return new OutgoingCallerIdContext( - this._version, - this._solution.accountSid, - sid - ); + return new OutgoingCallerIdContext(this._version, this._solution.accountSid, sid); }; return OutgoingCallerIdListInstance; @@ -382,11 +361,7 @@ OutgoingCallerIdPage.prototype.constructor = OutgoingCallerIdPage; */ /* jshint ignore:end */ OutgoingCallerIdPage.prototype.getInstance = function getInstance(payload) { - return new OutgoingCallerIdInstance( - this._version, - payload, - this._solution.accountSid - ); + return new OutgoingCallerIdInstance(this._version, payload, this._solution.accountSid); }; @@ -425,10 +400,7 @@ OutgoingCallerIdInstance = function OutgoingCallerIdInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(OutgoingCallerIdInstance.prototype, @@ -516,10 +488,7 @@ OutgoingCallerIdContext = function OutgoingCallerIdContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/OutgoingCallerIds/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -540,10 +509,7 @@ OutgoingCallerIdContext = function OutgoingCallerIdContext(version, accountSid, /* jshint ignore:end */ OutgoingCallerIdContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new OutgoingCallerIdInstance( @@ -589,15 +555,9 @@ OutgoingCallerIdContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new OutgoingCallerIdInstance( @@ -634,10 +594,7 @@ OutgoingCallerIdContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ OutgoingCallerIdContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/queue.js b/lib/rest/api/v2010/account/queue.js index bab6cec7fc..b4547b8bae 100644 --- a/lib/rest/api/v2010/account/queue.js +++ b/lib/rest/api/v2010/account/queue.js @@ -49,9 +49,7 @@ QueueList = function QueueList(version, accountSid) { QueueListInstance._version = version; // Path Solution - QueueListInstance._solution = { - accountSid: accountSid - }; + QueueListInstance._solution = {accountSid: accountSid}; QueueListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Queues.json' // jshint ignore:line )(QueueListInstance._solution); @@ -237,18 +235,10 @@ QueueList = function QueueList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new QueuePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new QueuePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +272,10 @@ QueueList = function QueueList(version, accountSid) { QueueListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new QueuePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new QueuePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -337,11 +320,7 @@ QueueList = function QueueList(version, accountSid) { 'MaxSize': _.get(opts, 'maxSize') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new QueueInstance( @@ -377,11 +356,7 @@ QueueList = function QueueList(version, accountSid) { */ /* jshint ignore:end */ QueueListInstance.get = function get(sid) { - return new QueueContext( - this._version, - this._solution.accountSid, - sid - ); + return new QueueContext(this._version, this._solution.accountSid, sid); }; return QueueListInstance; @@ -425,11 +400,7 @@ QueuePage.prototype.constructor = QueuePage; */ /* jshint ignore:end */ QueuePage.prototype.getInstance = function getInstance(payload) { - return new QueueInstance( - this._version, - payload, - this._solution.accountSid - ); + return new QueueInstance(this._version, payload, this._solution.accountSid); }; @@ -471,21 +442,14 @@ QueueInstance = function QueueInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(QueueInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new QueueContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new QueueContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -579,10 +543,7 @@ QueueContext = function QueueContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Queues/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -606,10 +567,7 @@ QueueContext = function QueueContext(version, accountSid, sid) { /* jshint ignore:end */ QueueContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new QueueInstance( @@ -660,11 +618,7 @@ QueueContext.prototype.update = function update(opts, callback) { 'MaxSize': _.get(opts, 'maxSize') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new QueueInstance( @@ -701,10 +655,7 @@ QueueContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ QueueContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -725,11 +676,7 @@ Object.defineProperty(QueueContext.prototype, 'members', { get: function() { if (!this._members) { - this._members = new MemberList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._members = new MemberList(this._version, this._solution.accountSid, this._solution.sid); } return this._members; } diff --git a/lib/rest/api/v2010/account/queue/member.js b/lib/rest/api/v2010/account/queue/member.js index 18a1deee46..6c22f110b7 100644 --- a/lib/rest/api/v2010/account/queue/member.js +++ b/lib/rest/api/v2010/account/queue/member.js @@ -49,10 +49,7 @@ MemberList = function MemberList(version, accountSid, queueSid) { MemberListInstance._version = version; // Path Solution - MemberListInstance._solution = { - accountSid: accountSid, - queueSid: queueSid - }; + MemberListInstance._solution = {accountSid: accountSid, queueSid: queueSid}; MemberListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Queues/<%= queueSid %>/Members.json' // jshint ignore:line )(MemberListInstance._solution); @@ -238,18 +235,10 @@ MemberList = function MemberList(version, accountSid, queueSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -283,17 +272,10 @@ MemberList = function MemberList(version, accountSid, queueSid) { MemberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -321,12 +303,7 @@ MemberList = function MemberList(version, accountSid, queueSid) { */ /* jshint ignore:end */ MemberListInstance.get = function get(callSid) { - return new MemberContext( - this._version, - this._solution.accountSid, - this._solution.queueSid, - callSid - ); + return new MemberContext(this._version, this._solution.accountSid, this._solution.queueSid, callSid); }; return MemberListInstance; @@ -370,12 +347,7 @@ MemberPage.prototype.constructor = MemberPage; */ /* jshint ignore:end */ MemberPage.prototype.getInstance = function getInstance(payload) { - return new MemberInstance( - this._version, - payload, - this._solution.accountSid, - this._solution.queueSid - ); + return new MemberInstance(this._version, payload, this._solution.accountSid, this._solution.queueSid); }; @@ -411,11 +383,7 @@ MemberInstance = function MemberInstance(version, payload, accountSid, queueSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - queueSid: queueSid, - callSid: callSid || this.callSid, - }; + this._solution = {accountSid: accountSid, queueSid: queueSid, callSid: callSid || this.callSid,}; }; Object.defineProperty(MemberInstance.prototype, @@ -487,11 +455,7 @@ MemberContext = function MemberContext(version, accountSid, queueSid, callSid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - queueSid: queueSid, - callSid: callSid, - }; + this._solution = {accountSid: accountSid, queueSid: queueSid, callSid: callSid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Queues/<%= queueSid %>/Members/<%= callSid %>.json' // jshint ignore:line )(this._solution); @@ -512,10 +476,7 @@ MemberContext = function MemberContext(version, accountSid, queueSid, callSid) { /* jshint ignore:end */ MemberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -566,16 +527,9 @@ MemberContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Url': _.get(opts, 'url'), - 'Method': _.get(opts, 'method') - }); + var data = values.of({'Url': _.get(opts, 'url'), 'Method': _.get(opts, 'method')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( diff --git a/lib/rest/api/v2010/account/recording.js b/lib/rest/api/v2010/account/recording.js index b196cbda2f..51cf236b1f 100644 --- a/lib/rest/api/v2010/account/recording.js +++ b/lib/rest/api/v2010/account/recording.js @@ -51,9 +51,7 @@ RecordingList = function RecordingList(version, accountSid) { RecordingListInstance._version = version; // Path Solution - RecordingListInstance._solution = { - accountSid: accountSid - }; + RecordingListInstance._solution = {accountSid: accountSid}; RecordingListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Recordings.json' // jshint ignore:line )(RecordingListInstance._solution); @@ -259,18 +257,10 @@ RecordingList = function RecordingList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -308,17 +298,10 @@ RecordingList = function RecordingList(version, accountSid) { RecordingListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -346,11 +329,7 @@ RecordingList = function RecordingList(version, accountSid) { */ /* jshint ignore:end */ RecordingListInstance.get = function get(sid) { - return new RecordingContext( - this._version, - this._solution.accountSid, - sid - ); + return new RecordingContext(this._version, this._solution.accountSid, sid); }; return RecordingListInstance; @@ -394,11 +373,7 @@ RecordingPage.prototype.constructor = RecordingPage; */ /* jshint ignore:end */ RecordingPage.prototype.getInstance = function getInstance(payload) { - return new RecordingInstance( - this._version, - payload, - this._solution.accountSid - ); + return new RecordingInstance(this._version, payload, this._solution.accountSid); }; @@ -454,21 +429,14 @@ RecordingInstance = function RecordingInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(RecordingInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RecordingContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new RecordingContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -559,10 +527,7 @@ RecordingContext = function RecordingContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Recordings/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -587,10 +552,7 @@ RecordingContext = function RecordingContext(version, accountSid, sid) { /* jshint ignore:end */ RecordingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RecordingInstance( @@ -627,10 +589,7 @@ RecordingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RecordingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/recording/addOnResult.js b/lib/rest/api/v2010/account/recording/addOnResult.js index ae5bf0dd4b..424c91e161 100644 --- a/lib/rest/api/v2010/account/recording/addOnResult.js +++ b/lib/rest/api/v2010/account/recording/addOnResult.js @@ -50,10 +50,7 @@ AddOnResultList = function AddOnResultList(version, accountSid, referenceSid) { AddOnResultListInstance._version = version; // Path Solution - AddOnResultListInstance._solution = { - accountSid: accountSid, - referenceSid: referenceSid - }; + AddOnResultListInstance._solution = {accountSid: accountSid, referenceSid: referenceSid}; AddOnResultListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Recordings/<%= referenceSid %>/AddOnResults.json' // jshint ignore:line )(AddOnResultListInstance._solution); @@ -239,18 +236,10 @@ AddOnResultList = function AddOnResultList(version, accountSid, referenceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AddOnResultPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AddOnResultPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -284,17 +273,10 @@ AddOnResultList = function AddOnResultList(version, accountSid, referenceSid) { AddOnResultListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AddOnResultPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AddOnResultPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -423,11 +405,7 @@ AddOnResultInstance = function AddOnResultInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - referenceSid: referenceSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, referenceSid: referenceSid, sid: sid || this.sid,}; }; Object.defineProperty(AddOnResultInstance.prototype, @@ -515,11 +493,7 @@ AddOnResultContext = function AddOnResultContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - referenceSid: referenceSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, referenceSid: referenceSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Recordings/<%= referenceSid %>/AddOnResults/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -543,10 +517,7 @@ AddOnResultContext = function AddOnResultContext(version, accountSid, /* jshint ignore:end */ AddOnResultContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AddOnResultInstance( @@ -584,10 +555,7 @@ AddOnResultContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ AddOnResultContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/recording/addOnResult/payload.js b/lib/rest/api/v2010/account/recording/addOnResult/payload.js index e2bd1ae794..20a5842afe 100644 --- a/lib/rest/api/v2010/account/recording/addOnResult/payload.js +++ b/lib/rest/api/v2010/account/recording/addOnResult/payload.js @@ -241,18 +241,10 @@ PayloadList = function PayloadList(version, accountSid, referenceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PayloadPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PayloadPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -286,17 +278,10 @@ PayloadList = function PayloadList(version, accountSid, referenceSid, PayloadListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new PayloadPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PayloadPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -533,10 +518,7 @@ PayloadContext = function PayloadContext(version, accountSid, referenceSid, /* jshint ignore:end */ PayloadContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new PayloadInstance( @@ -575,10 +557,7 @@ PayloadContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ PayloadContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/recording/transcription.js b/lib/rest/api/v2010/account/recording/transcription.js index 99c8c693be..54bc78ad49 100644 --- a/lib/rest/api/v2010/account/recording/transcription.js +++ b/lib/rest/api/v2010/account/recording/transcription.js @@ -50,10 +50,7 @@ TranscriptionList = function TranscriptionList(version, accountSid, TranscriptionListInstance._version = version; // Path Solution - TranscriptionListInstance._solution = { - accountSid: accountSid, - recordingSid: recordingSid - }; + TranscriptionListInstance._solution = {accountSid: accountSid, recordingSid: recordingSid}; TranscriptionListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Recordings/<%= recordingSid %>/Transcriptions.json' // jshint ignore:line )(TranscriptionListInstance._solution); @@ -239,18 +236,10 @@ TranscriptionList = function TranscriptionList(version, accountSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TranscriptionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TranscriptionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -284,17 +273,10 @@ TranscriptionList = function TranscriptionList(version, accountSid, TranscriptionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TranscriptionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TranscriptionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -428,11 +410,7 @@ TranscriptionInstance = function TranscriptionInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - recordingSid: recordingSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, recordingSid: recordingSid, sid: sid || this.sid,}; }; Object.defineProperty(TranscriptionInstance.prototype, @@ -502,11 +480,7 @@ TranscriptionContext = function TranscriptionContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - recordingSid: recordingSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, recordingSid: recordingSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Recordings/<%= recordingSid %>/Transcriptions/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -527,10 +501,7 @@ TranscriptionContext = function TranscriptionContext(version, accountSid, /* jshint ignore:end */ TranscriptionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new TranscriptionInstance( @@ -568,10 +539,7 @@ TranscriptionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ TranscriptionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/shortCode.js b/lib/rest/api/v2010/account/shortCode.js index 535302f959..7c3ac15ec8 100644 --- a/lib/rest/api/v2010/account/shortCode.js +++ b/lib/rest/api/v2010/account/shortCode.js @@ -48,9 +48,7 @@ ShortCodeList = function ShortCodeList(version, accountSid) { ShortCodeListInstance._version = version; // Path Solution - ShortCodeListInstance._solution = { - accountSid: accountSid - }; + ShortCodeListInstance._solution = {accountSid: accountSid}; ShortCodeListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SMS/ShortCodes.json' // jshint ignore:line )(ShortCodeListInstance._solution); @@ -248,18 +246,10 @@ ShortCodeList = function ShortCodeList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -295,17 +285,10 @@ ShortCodeList = function ShortCodeList(version, accountSid) { ShortCodeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -333,11 +316,7 @@ ShortCodeList = function ShortCodeList(version, accountSid) { */ /* jshint ignore:end */ ShortCodeListInstance.get = function get(sid) { - return new ShortCodeContext( - this._version, - this._solution.accountSid, - sid - ); + return new ShortCodeContext(this._version, this._solution.accountSid, sid); }; return ShortCodeListInstance; @@ -381,11 +360,7 @@ ShortCodePage.prototype.constructor = ShortCodePage; */ /* jshint ignore:end */ ShortCodePage.prototype.getInstance = function getInstance(payload) { - return new ShortCodeInstance( - this._version, - payload, - this._solution.accountSid - ); + return new ShortCodeInstance(this._version, payload, this._solution.accountSid); }; @@ -435,21 +410,14 @@ ShortCodeInstance = function ShortCodeInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(ShortCodeInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ShortCodeContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new ShortCodeContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -516,10 +484,7 @@ ShortCodeContext = function ShortCodeContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SMS/ShortCodes/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -540,10 +505,7 @@ ShortCodeContext = function ShortCodeContext(version, accountSid, sid) { /* jshint ignore:end */ ShortCodeContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( @@ -606,11 +568,7 @@ ShortCodeContext.prototype.update = function update(opts, callback) { 'SmsFallbackMethod': _.get(opts, 'smsFallbackMethod') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( diff --git a/lib/rest/api/v2010/account/signingKey.js b/lib/rest/api/v2010/account/signingKey.js index 0bea5b827b..2a6c680d70 100644 --- a/lib/rest/api/v2010/account/signingKey.js +++ b/lib/rest/api/v2010/account/signingKey.js @@ -49,9 +49,7 @@ SigningKeyList = function SigningKeyList(version, accountSid) { SigningKeyListInstance._version = version; // Path Solution - SigningKeyListInstance._solution = { - accountSid: accountSid - }; + SigningKeyListInstance._solution = {accountSid: accountSid}; SigningKeyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SigningKeys.json' // jshint ignore:line )(SigningKeyListInstance._solution); @@ -237,18 +235,10 @@ SigningKeyList = function SigningKeyList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SigningKeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SigningKeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +272,10 @@ SigningKeyList = function SigningKeyList(version, accountSid) { SigningKeyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SigningKeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SigningKeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -320,11 +303,7 @@ SigningKeyList = function SigningKeyList(version, accountSid) { */ /* jshint ignore:end */ SigningKeyListInstance.get = function get(sid) { - return new SigningKeyContext( - this._version, - this._solution.accountSid, - sid - ); + return new SigningKeyContext(this._version, this._solution.accountSid, sid); }; return SigningKeyListInstance; @@ -368,11 +347,7 @@ SigningKeyPage.prototype.constructor = SigningKeyPage; */ /* jshint ignore:end */ SigningKeyPage.prototype.getInstance = function getInstance(payload) { - return new SigningKeyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new SigningKeyInstance(this._version, payload, this._solution.accountSid); }; @@ -404,21 +379,14 @@ SigningKeyInstance = function SigningKeyInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(SigningKeyInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SigningKeyContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new SigningKeyContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -493,10 +461,7 @@ SigningKeyContext = function SigningKeyContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SigningKeys/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -517,10 +482,7 @@ SigningKeyContext = function SigningKeyContext(version, accountSid, sid) { /* jshint ignore:end */ SigningKeyContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SigningKeyInstance( @@ -565,15 +527,9 @@ SigningKeyContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SigningKeyInstance( @@ -610,10 +566,7 @@ SigningKeyContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ SigningKeyContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/sip.js b/lib/rest/api/v2010/account/sip.js index 4de689a4ea..ded916a3ee 100644 --- a/lib/rest/api/v2010/account/sip.js +++ b/lib/rest/api/v2010/account/sip.js @@ -45,9 +45,7 @@ SipList = function SipList(version, accountSid) { SipListInstance._version = version; // Path Solution - SipListInstance._solution = { - accountSid: accountSid - }; + SipListInstance._solution = {accountSid: accountSid}; // Components SipListInstance._domains = undefined; @@ -59,10 +57,7 @@ SipList = function SipList(version, accountSid) { 'domains', { get: function domains() { if (!this._domains) { - this._domains = new DomainList( - this._version, - this._solution.accountSid - ); + this._domains = new DomainList(this._version, this._solution.accountSid); } return this._domains; @@ -73,10 +68,7 @@ SipList = function SipList(version, accountSid) { 'ipAccessControlLists', { get: function ipAccessControlLists() { if (!this._ipAccessControlLists) { - this._ipAccessControlLists = new IpAccessControlListList( - this._version, - this._solution.accountSid - ); + this._ipAccessControlLists = new IpAccessControlListList(this._version, this._solution.accountSid); } return this._ipAccessControlLists; @@ -87,10 +79,7 @@ SipList = function SipList(version, accountSid) { 'credentialLists', { get: function credentialLists() { if (!this._credentialLists) { - this._credentialLists = new CredentialListList( - this._version, - this._solution.accountSid - ); + this._credentialLists = new CredentialListList(this._version, this._solution.accountSid); } return this._credentialLists; diff --git a/lib/rest/api/v2010/account/sip/credentialList.js b/lib/rest/api/v2010/account/sip/credentialList.js index 08e3a253fa..2863b5cc2a 100644 --- a/lib/rest/api/v2010/account/sip/credentialList.js +++ b/lib/rest/api/v2010/account/sip/credentialList.js @@ -50,9 +50,7 @@ CredentialListList = function CredentialListList(version, accountSid) { CredentialListListInstance._version = version; // Path Solution - CredentialListListInstance._solution = { - accountSid: accountSid - }; + CredentialListListInstance._solution = {accountSid: accountSid}; CredentialListListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SIP/CredentialLists.json' // jshint ignore:line )(CredentialListListInstance._solution); @@ -238,18 +236,10 @@ CredentialListList = function CredentialListList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -283,17 +273,10 @@ CredentialListList = function CredentialListList(version, accountSid) { CredentialListListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -331,15 +314,9 @@ CredentialListList = function CredentialListList(version, accountSid) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListInstance( @@ -375,11 +352,7 @@ CredentialListList = function CredentialListList(version, accountSid) { */ /* jshint ignore:end */ CredentialListListInstance.get = function get(sid) { - return new CredentialListContext( - this._version, - this._solution.accountSid, - sid - ); + return new CredentialListContext(this._version, this._solution.accountSid, sid); }; return CredentialListListInstance; @@ -423,11 +396,7 @@ CredentialListPage.prototype.constructor = CredentialListPage; */ /* jshint ignore:end */ CredentialListPage.prototype.getInstance = function getInstance(payload) { - return new CredentialListInstance( - this._version, - payload, - this._solution.accountSid - ); + return new CredentialListInstance(this._version, payload, this._solution.accountSid); }; @@ -465,10 +434,7 @@ CredentialListInstance = function CredentialListInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(CredentialListInstance.prototype, @@ -573,10 +539,7 @@ CredentialListContext = function CredentialListContext(version, accountSid, sid) this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/CredentialLists/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -600,10 +563,7 @@ CredentialListContext = function CredentialListContext(version, accountSid, sid) /* jshint ignore:end */ CredentialListContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListInstance( @@ -649,15 +609,9 @@ CredentialListContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListInstance( @@ -694,10 +648,7 @@ CredentialListContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialListContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -718,11 +669,7 @@ Object.defineProperty(CredentialListContext.prototype, 'credentials', { get: function() { if (!this._credentials) { - this._credentials = new CredentialList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._credentials = new CredentialList(this._version, this._solution.accountSid, this._solution.sid); } return this._credentials; } diff --git a/lib/rest/api/v2010/account/sip/credentialList/credential.js b/lib/rest/api/v2010/account/sip/credentialList/credential.js index 7fcba3e418..e4cac749ac 100644 --- a/lib/rest/api/v2010/account/sip/credentialList/credential.js +++ b/lib/rest/api/v2010/account/sip/credentialList/credential.js @@ -50,10 +50,7 @@ CredentialList = function CredentialList(version, accountSid, credentialListSid) CredentialListInstance._version = version; // Path Solution - CredentialListInstance._solution = { - accountSid: accountSid, - credentialListSid: credentialListSid - }; + CredentialListInstance._solution = {accountSid: accountSid, credentialListSid: credentialListSid}; CredentialListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SIP/CredentialLists/<%= credentialListSid %>/Credentials.json' // jshint ignore:line )(CredentialListInstance._solution); @@ -239,18 +236,10 @@ CredentialList = function CredentialList(version, accountSid, credentialListSid) 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -284,17 +273,10 @@ CredentialList = function CredentialList(version, accountSid, credentialListSid) CredentialListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,16 +318,9 @@ CredentialList = function CredentialList(version, accountSid, credentialListSid) } var deferred = Q.defer(); - var data = values.of({ - 'Username': _.get(opts, 'username'), - 'Password': _.get(opts, 'password') - }); + var data = values.of({'Username': _.get(opts, 'username'), 'Password': _.get(opts, 'password')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CredentialInstance( @@ -475,11 +450,7 @@ CredentialInstance = function CredentialInstance(version, payload, accountSid, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - credentialListSid: credentialListSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, credentialListSid: credentialListSid, sid: sid || this.sid,}; }; Object.defineProperty(CredentialInstance.prototype, @@ -568,11 +539,7 @@ CredentialContext = function CredentialContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - credentialListSid: credentialListSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, credentialListSid: credentialListSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/CredentialLists/<%= credentialListSid %>/Credentials/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -593,10 +560,7 @@ CredentialContext = function CredentialContext(version, accountSid, /* jshint ignore:end */ CredentialContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new CredentialInstance( @@ -642,15 +606,9 @@ CredentialContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Password': _.get(opts, 'password') - }); + var data = values.of({'Password': _.get(opts, 'password')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CredentialInstance( @@ -688,10 +646,7 @@ CredentialContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/sip/domain.js b/lib/rest/api/v2010/account/sip/domain.js index e4bafbef80..d6180a998d 100644 --- a/lib/rest/api/v2010/account/sip/domain.js +++ b/lib/rest/api/v2010/account/sip/domain.js @@ -55,9 +55,7 @@ DomainList = function DomainList(version, accountSid) { DomainListInstance._version = version; // Path Solution - DomainListInstance._solution = { - accountSid: accountSid - }; + DomainListInstance._solution = {accountSid: accountSid}; DomainListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SIP/Domains.json' // jshint ignore:line )(DomainListInstance._solution); @@ -243,18 +241,10 @@ DomainList = function DomainList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DomainPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DomainPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -288,17 +278,10 @@ DomainList = function DomainList(version, accountSid) { DomainListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DomainPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DomainPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -365,11 +348,7 @@ DomainList = function DomainList(version, accountSid) { 'SipRegistration': serialize.bool(_.get(opts, 'sipRegistration')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DomainInstance( @@ -405,11 +384,7 @@ DomainList = function DomainList(version, accountSid) { */ /* jshint ignore:end */ DomainListInstance.get = function get(sid) { - return new DomainContext( - this._version, - this._solution.accountSid, - sid - ); + return new DomainContext(this._version, this._solution.accountSid, sid); }; return DomainListInstance; @@ -453,11 +428,7 @@ DomainPage.prototype.constructor = DomainPage; */ /* jshint ignore:end */ DomainPage.prototype.getInstance = function getInstance(payload) { - return new DomainInstance( - this._version, - payload, - this._solution.accountSid - ); + return new DomainInstance(this._version, payload, this._solution.accountSid); }; @@ -521,21 +492,14 @@ DomainInstance = function DomainInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(DomainInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new DomainContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new DomainContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -657,10 +621,7 @@ DomainContext = function DomainContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/Domains/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -685,10 +646,7 @@ DomainContext = function DomainContext(version, accountSid, sid) { /* jshint ignore:end */ DomainContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DomainInstance( @@ -755,11 +713,7 @@ DomainContext.prototype.update = function update(opts, callback) { 'SipRegistration': serialize.bool(_.get(opts, 'sipRegistration')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DomainInstance( @@ -796,10 +750,7 @@ DomainContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ DomainContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js b/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js index a137dcbb0f..4319e7fc6f 100644 --- a/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js @@ -50,10 +50,7 @@ CredentialListMappingList = function CredentialListMappingList(version, CredentialListMappingListInstance._version = version; // Path Solution - CredentialListMappingListInstance._solution = { - accountSid: accountSid, - domainSid: domainSid - }; + CredentialListMappingListInstance._solution = {accountSid: accountSid, domainSid: domainSid}; CredentialListMappingListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SIP/Domains/<%= domainSid %>/CredentialListMappings.json' // jshint ignore:line )(CredentialListMappingListInstance._solution); @@ -81,15 +78,9 @@ CredentialListMappingList = function CredentialListMappingList(version, } var deferred = Q.defer(); - var data = values.of({ - 'CredentialListSid': _.get(opts, 'credentialListSid') - }); + var data = values.of({'CredentialListSid': _.get(opts, 'credentialListSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListMappingInstance( @@ -294,18 +285,10 @@ CredentialListMappingList = function CredentialListMappingList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialListMappingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialListMappingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -340,17 +323,10 @@ CredentialListMappingList = function CredentialListMappingList(version, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialListMappingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialListMappingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -473,11 +449,7 @@ CredentialListMappingInstance = function CredentialListMappingInstance(version, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - domainSid: domainSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, domainSid: domainSid, sid: sid || this.sid,}; }; Object.defineProperty(CredentialListMappingInstance.prototype, @@ -547,11 +519,7 @@ CredentialListMappingContext = function CredentialListMappingContext(version, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - domainSid: domainSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, domainSid: domainSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/Domains/<%= domainSid %>/CredentialListMappings/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -572,10 +540,7 @@ CredentialListMappingContext = function CredentialListMappingContext(version, /* jshint ignore:end */ CredentialListMappingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListMappingInstance( @@ -613,10 +578,7 @@ CredentialListMappingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ CredentialListMappingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js b/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js index 3ed4dfbc32..5d57d4f204 100644 --- a/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js +++ b/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js @@ -50,10 +50,7 @@ IpAccessControlListMappingList = function IpAccessControlListMappingListInstance._version = version; // Path Solution - IpAccessControlListMappingListInstance._solution = { - accountSid: accountSid, - domainSid: domainSid - }; + IpAccessControlListMappingListInstance._solution = {accountSid: accountSid, domainSid: domainSid}; IpAccessControlListMappingListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SIP/Domains/<%= domainSid %>/IpAccessControlListMappings.json' // jshint ignore:line )(IpAccessControlListMappingListInstance._solution); @@ -82,15 +79,9 @@ IpAccessControlListMappingList = function } var deferred = Q.defer(); - var data = values.of({ - 'IpAccessControlListSid': _.get(opts, 'ipAccessControlListSid') - }); + var data = values.of({'IpAccessControlListSid': _.get(opts, 'ipAccessControlListSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListMappingInstance( @@ -295,18 +286,10 @@ IpAccessControlListMappingList = function 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new IpAccessControlListMappingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAccessControlListMappingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -341,17 +324,10 @@ IpAccessControlListMappingList = function callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new IpAccessControlListMappingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAccessControlListMappingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -475,11 +451,7 @@ IpAccessControlListMappingInstance = function // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - domainSid: domainSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, domainSid: domainSid, sid: sid || this.sid,}; }; Object.defineProperty(IpAccessControlListMappingInstance.prototype, @@ -550,11 +522,7 @@ IpAccessControlListMappingContext = function this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - domainSid: domainSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, domainSid: domainSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/Domains/<%= domainSid %>/IpAccessControlListMappings/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -575,10 +543,7 @@ IpAccessControlListMappingContext = function /* jshint ignore:end */ IpAccessControlListMappingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListMappingInstance( @@ -616,10 +581,7 @@ IpAccessControlListMappingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ IpAccessControlListMappingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/sip/ipAccessControlList.js b/lib/rest/api/v2010/account/sip/ipAccessControlList.js index 304f724cca..52540cd285 100644 --- a/lib/rest/api/v2010/account/sip/ipAccessControlList.js +++ b/lib/rest/api/v2010/account/sip/ipAccessControlList.js @@ -51,9 +51,7 @@ IpAccessControlListList = function IpAccessControlListList(version, accountSid) IpAccessControlListListInstance._version = version; // Path Solution - IpAccessControlListListInstance._solution = { - accountSid: accountSid - }; + IpAccessControlListListInstance._solution = {accountSid: accountSid}; IpAccessControlListListInstance._uri = _.template( '/Accounts/<%= accountSid %>/SIP/IpAccessControlLists.json' // jshint ignore:line )(IpAccessControlListListInstance._solution); @@ -239,18 +237,10 @@ IpAccessControlListList = function IpAccessControlListList(version, accountSid) 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new IpAccessControlListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAccessControlListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +275,10 @@ IpAccessControlListList = function IpAccessControlListList(version, accountSid) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new IpAccessControlListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAccessControlListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -334,15 +317,9 @@ IpAccessControlListList = function IpAccessControlListList(version, accountSid) } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListInstance( @@ -378,11 +355,7 @@ IpAccessControlListList = function IpAccessControlListList(version, accountSid) */ /* jshint ignore:end */ IpAccessControlListListInstance.get = function get(sid) { - return new IpAccessControlListContext( - this._version, - this._solution.accountSid, - sid - ); + return new IpAccessControlListContext(this._version, this._solution.accountSid, sid); }; return IpAccessControlListListInstance; @@ -427,11 +400,7 @@ IpAccessControlListPage.prototype.constructor = IpAccessControlListPage; */ /* jshint ignore:end */ IpAccessControlListPage.prototype.getInstance = function getInstance(payload) { - return new IpAccessControlListInstance( - this._version, - payload, - this._solution.accountSid - ); + return new IpAccessControlListInstance(this._version, payload, this._solution.accountSid); }; @@ -469,10 +438,7 @@ IpAccessControlListInstance = function IpAccessControlListInstance(version, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(IpAccessControlListInstance.prototype, @@ -578,10 +544,7 @@ IpAccessControlListContext = function IpAccessControlListContext(version, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/IpAccessControlLists/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -605,10 +568,7 @@ IpAccessControlListContext = function IpAccessControlListContext(version, /* jshint ignore:end */ IpAccessControlListContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListInstance( @@ -655,15 +615,9 @@ IpAccessControlListContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListInstance( @@ -700,10 +654,7 @@ IpAccessControlListContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ IpAccessControlListContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -724,11 +675,7 @@ Object.defineProperty(IpAccessControlListContext.prototype, 'ipAddresses', { get: function() { if (!this._ipAddresses) { - this._ipAddresses = new IpAddressList( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._ipAddresses = new IpAddressList(this._version, this._solution.accountSid, this._solution.sid); } return this._ipAddresses; } diff --git a/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js b/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js index 6e22447d2f..d35f5cc8ee 100644 --- a/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js +++ b/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js @@ -239,18 +239,10 @@ IpAddressList = function IpAddressList(version, accountSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new IpAddressPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAddressPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -284,17 +276,10 @@ IpAddressList = function IpAddressList(version, accountSid, IpAddressListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new IpAddressPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAddressPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -341,11 +326,7 @@ IpAddressList = function IpAddressList(version, accountSid, 'IpAddress': _.get(opts, 'ipAddress') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IpAddressInstance( @@ -571,11 +552,7 @@ IpAddressContext = function IpAddressContext(version, accountSid, this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - ipAccessControlListSid: ipAccessControlListSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, ipAccessControlListSid: ipAccessControlListSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/SIP/IpAccessControlLists/<%= ipAccessControlListSid %>/IpAddresses/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -596,10 +573,7 @@ IpAddressContext = function IpAddressContext(version, accountSid, /* jshint ignore:end */ IpAddressContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new IpAddressInstance( @@ -651,11 +625,7 @@ IpAddressContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IpAddressInstance( @@ -693,10 +663,7 @@ IpAddressContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ IpAddressContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/token.js b/lib/rest/api/v2010/account/token.js index 79154b3916..cd5f14552e 100644 --- a/lib/rest/api/v2010/account/token.js +++ b/lib/rest/api/v2010/account/token.js @@ -47,9 +47,7 @@ TokenList = function TokenList(version, accountSid) { TokenListInstance._version = version; // Path Solution - TokenListInstance._solution = { - accountSid: accountSid - }; + TokenListInstance._solution = {accountSid: accountSid}; TokenListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Tokens.json' // jshint ignore:line )(TokenListInstance._solution); @@ -77,21 +75,12 @@ TokenList = function TokenList(version, accountSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Ttl': _.get(opts, 'ttl') - }); + var data = values.of({'Ttl': _.get(opts, 'ttl')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new TokenInstance( - this._version, - payload - )); + deferred.resolve(new TokenInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -146,11 +135,7 @@ TokenPage.prototype.constructor = TokenPage; */ /* jshint ignore:end */ TokenPage.prototype.getInstance = function getInstance(payload) { - return new TokenInstance( - this._version, - payload, - this._solution.accountSid - ); + return new TokenInstance(this._version, payload, this._solution.accountSid); }; @@ -186,9 +171,7 @@ TokenInstance = function TokenInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/transcription.js b/lib/rest/api/v2010/account/transcription.js index 8169b09bc4..a99ff32b1f 100644 --- a/lib/rest/api/v2010/account/transcription.js +++ b/lib/rest/api/v2010/account/transcription.js @@ -48,9 +48,7 @@ TranscriptionList = function TranscriptionList(version, accountSid) { TranscriptionListInstance._version = version; // Path Solution - TranscriptionListInstance._solution = { - accountSid: accountSid - }; + TranscriptionListInstance._solution = {accountSid: accountSid}; TranscriptionListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Transcriptions.json' // jshint ignore:line )(TranscriptionListInstance._solution); @@ -236,18 +234,10 @@ TranscriptionList = function TranscriptionList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TranscriptionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TranscriptionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -281,17 +271,10 @@ TranscriptionList = function TranscriptionList(version, accountSid) { TranscriptionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TranscriptionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TranscriptionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -319,11 +302,7 @@ TranscriptionList = function TranscriptionList(version, accountSid) { */ /* jshint ignore:end */ TranscriptionListInstance.get = function get(sid) { - return new TranscriptionContext( - this._version, - this._solution.accountSid, - sid - ); + return new TranscriptionContext(this._version, this._solution.accountSid, sid); }; return TranscriptionListInstance; @@ -367,11 +346,7 @@ TranscriptionPage.prototype.constructor = TranscriptionPage; */ /* jshint ignore:end */ TranscriptionPage.prototype.getInstance = function getInstance(payload) { - return new TranscriptionInstance( - this._version, - payload, - this._solution.accountSid - ); + return new TranscriptionInstance(this._version, payload, this._solution.accountSid); }; @@ -422,10 +397,7 @@ TranscriptionInstance = function TranscriptionInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(TranscriptionInstance.prototype, @@ -492,10 +464,7 @@ TranscriptionContext = function TranscriptionContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Transcriptions/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -516,10 +485,7 @@ TranscriptionContext = function TranscriptionContext(version, accountSid, sid) { /* jshint ignore:end */ TranscriptionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new TranscriptionInstance( @@ -556,10 +522,7 @@ TranscriptionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ TranscriptionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/usage.js b/lib/rest/api/v2010/account/usage.js index 4e09455d7c..30456d7ffd 100644 --- a/lib/rest/api/v2010/account/usage.js +++ b/lib/rest/api/v2010/account/usage.js @@ -43,9 +43,7 @@ UsageList = function UsageList(version, accountSid) { UsageListInstance._version = version; // Path Solution - UsageListInstance._solution = { - accountSid: accountSid - }; + UsageListInstance._solution = {accountSid: accountSid}; // Components UsageListInstance._records = undefined; @@ -55,10 +53,7 @@ UsageList = function UsageList(version, accountSid) { 'records', { get: function records() { if (!this._records) { - this._records = new RecordList( - this._version, - this._solution.accountSid - ); + this._records = new RecordList(this._version, this._solution.accountSid); } return this._records; @@ -69,10 +64,7 @@ UsageList = function UsageList(version, accountSid) { 'triggers', { get: function triggers() { if (!this._triggers) { - this._triggers = new TriggerList( - this._version, - this._solution.accountSid - ); + this._triggers = new TriggerList(this._version, this._solution.accountSid); } return this._triggers; diff --git a/lib/rest/api/v2010/account/usage/record.js b/lib/rest/api/v2010/account/usage/record.js index c343de4e4a..fd0518047a 100644 --- a/lib/rest/api/v2010/account/usage/record.js +++ b/lib/rest/api/v2010/account/usage/record.js @@ -58,9 +58,7 @@ RecordList = function RecordList(version, accountSid) { RecordListInstance._version = version; // Path Solution - RecordListInstance._solution = { - accountSid: accountSid - }; + RecordListInstance._solution = {accountSid: accountSid}; RecordListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records.json' // jshint ignore:line )(RecordListInstance._solution); @@ -276,18 +274,10 @@ RecordList = function RecordList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RecordPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -325,17 +315,10 @@ RecordList = function RecordList(version, accountSid) { RecordListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RecordPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -353,10 +336,7 @@ RecordList = function RecordList(version, accountSid) { 'allTime', { get: function allTime() { if (!this._allTime) { - this._allTime = new AllTimeList( - this._version, - this._solution.accountSid - ); + this._allTime = new AllTimeList(this._version, this._solution.accountSid); } return this._allTime; @@ -367,10 +347,7 @@ RecordList = function RecordList(version, accountSid) { 'daily', { get: function daily() { if (!this._daily) { - this._daily = new DailyList( - this._version, - this._solution.accountSid - ); + this._daily = new DailyList(this._version, this._solution.accountSid); } return this._daily; @@ -381,10 +358,7 @@ RecordList = function RecordList(version, accountSid) { 'lastMonth', { get: function lastMonth() { if (!this._lastMonth) { - this._lastMonth = new LastMonthList( - this._version, - this._solution.accountSid - ); + this._lastMonth = new LastMonthList(this._version, this._solution.accountSid); } return this._lastMonth; @@ -395,10 +369,7 @@ RecordList = function RecordList(version, accountSid) { 'monthly', { get: function monthly() { if (!this._monthly) { - this._monthly = new MonthlyList( - this._version, - this._solution.accountSid - ); + this._monthly = new MonthlyList(this._version, this._solution.accountSid); } return this._monthly; @@ -409,10 +380,7 @@ RecordList = function RecordList(version, accountSid) { 'thisMonth', { get: function thisMonth() { if (!this._thisMonth) { - this._thisMonth = new ThisMonthList( - this._version, - this._solution.accountSid - ); + this._thisMonth = new ThisMonthList(this._version, this._solution.accountSid); } return this._thisMonth; @@ -423,10 +391,7 @@ RecordList = function RecordList(version, accountSid) { 'today', { get: function today() { if (!this._today) { - this._today = new TodayList( - this._version, - this._solution.accountSid - ); + this._today = new TodayList(this._version, this._solution.accountSid); } return this._today; @@ -437,10 +402,7 @@ RecordList = function RecordList(version, accountSid) { 'yearly', { get: function yearly() { if (!this._yearly) { - this._yearly = new YearlyList( - this._version, - this._solution.accountSid - ); + this._yearly = new YearlyList(this._version, this._solution.accountSid); } return this._yearly; @@ -451,10 +413,7 @@ RecordList = function RecordList(version, accountSid) { 'yesterday', { get: function yesterday() { if (!this._yesterday) { - this._yesterday = new YesterdayList( - this._version, - this._solution.accountSid - ); + this._yesterday = new YesterdayList(this._version, this._solution.accountSid); } return this._yesterday; @@ -502,11 +461,7 @@ RecordPage.prototype.constructor = RecordPage; */ /* jshint ignore:end */ RecordPage.prototype.getInstance = function getInstance(payload) { - return new RecordInstance( - this._version, - payload, - this._solution.accountSid - ); + return new RecordInstance(this._version, payload, this._solution.accountSid); }; @@ -557,9 +512,7 @@ RecordInstance = function RecordInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/allTime.js b/lib/rest/api/v2010/account/usage/record/allTime.js index 2755cf3bdb..6681bb3aed 100644 --- a/lib/rest/api/v2010/account/usage/record/allTime.js +++ b/lib/rest/api/v2010/account/usage/record/allTime.js @@ -50,9 +50,7 @@ AllTimeList = function AllTimeList(version, accountSid) { AllTimeListInstance._version = version; // Path Solution - AllTimeListInstance._solution = { - accountSid: accountSid - }; + AllTimeListInstance._solution = {accountSid: accountSid}; AllTimeListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/AllTime.json' // jshint ignore:line )(AllTimeListInstance._solution); @@ -254,18 +252,10 @@ AllTimeList = function AllTimeList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AllTimePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AllTimePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ AllTimeList = function AllTimeList(version, accountSid) { AllTimeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AllTimePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AllTimePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ AllTimePage.prototype.constructor = AllTimePage; */ /* jshint ignore:end */ AllTimePage.prototype.getInstance = function getInstance(payload) { - return new AllTimeInstance( - this._version, - payload, - this._solution.accountSid - ); + return new AllTimeInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ AllTimeInstance = function AllTimeInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/daily.js b/lib/rest/api/v2010/account/usage/record/daily.js index 061e010eec..a9d020322a 100644 --- a/lib/rest/api/v2010/account/usage/record/daily.js +++ b/lib/rest/api/v2010/account/usage/record/daily.js @@ -50,9 +50,7 @@ DailyList = function DailyList(version, accountSid) { DailyListInstance._version = version; // Path Solution - DailyListInstance._solution = { - accountSid: accountSid - }; + DailyListInstance._solution = {accountSid: accountSid}; DailyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/Daily.json' // jshint ignore:line )(DailyListInstance._solution); @@ -254,18 +252,10 @@ DailyList = function DailyList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DailyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DailyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ DailyList = function DailyList(version, accountSid) { DailyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DailyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DailyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ DailyPage.prototype.constructor = DailyPage; */ /* jshint ignore:end */ DailyPage.prototype.getInstance = function getInstance(payload) { - return new DailyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new DailyInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ DailyInstance = function DailyInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/lastMonth.js b/lib/rest/api/v2010/account/usage/record/lastMonth.js index 9360640402..58c888f151 100644 --- a/lib/rest/api/v2010/account/usage/record/lastMonth.js +++ b/lib/rest/api/v2010/account/usage/record/lastMonth.js @@ -50,9 +50,7 @@ LastMonthList = function LastMonthList(version, accountSid) { LastMonthListInstance._version = version; // Path Solution - LastMonthListInstance._solution = { - accountSid: accountSid - }; + LastMonthListInstance._solution = {accountSid: accountSid}; LastMonthListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/LastMonth.json' // jshint ignore:line )(LastMonthListInstance._solution); @@ -254,18 +252,10 @@ LastMonthList = function LastMonthList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new LastMonthPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new LastMonthPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ LastMonthList = function LastMonthList(version, accountSid) { LastMonthListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new LastMonthPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new LastMonthPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ LastMonthPage.prototype.constructor = LastMonthPage; */ /* jshint ignore:end */ LastMonthPage.prototype.getInstance = function getInstance(payload) { - return new LastMonthInstance( - this._version, - payload, - this._solution.accountSid - ); + return new LastMonthInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ LastMonthInstance = function LastMonthInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/monthly.js b/lib/rest/api/v2010/account/usage/record/monthly.js index 22ec9014d1..4b6f2d21b0 100644 --- a/lib/rest/api/v2010/account/usage/record/monthly.js +++ b/lib/rest/api/v2010/account/usage/record/monthly.js @@ -50,9 +50,7 @@ MonthlyList = function MonthlyList(version, accountSid) { MonthlyListInstance._version = version; // Path Solution - MonthlyListInstance._solution = { - accountSid: accountSid - }; + MonthlyListInstance._solution = {accountSid: accountSid}; MonthlyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/Monthly.json' // jshint ignore:line )(MonthlyListInstance._solution); @@ -254,18 +252,10 @@ MonthlyList = function MonthlyList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MonthlyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MonthlyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ MonthlyList = function MonthlyList(version, accountSid) { MonthlyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MonthlyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MonthlyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ MonthlyPage.prototype.constructor = MonthlyPage; */ /* jshint ignore:end */ MonthlyPage.prototype.getInstance = function getInstance(payload) { - return new MonthlyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new MonthlyInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ MonthlyInstance = function MonthlyInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/thisMonth.js b/lib/rest/api/v2010/account/usage/record/thisMonth.js index 13af80f2f3..781aed83e4 100644 --- a/lib/rest/api/v2010/account/usage/record/thisMonth.js +++ b/lib/rest/api/v2010/account/usage/record/thisMonth.js @@ -50,9 +50,7 @@ ThisMonthList = function ThisMonthList(version, accountSid) { ThisMonthListInstance._version = version; // Path Solution - ThisMonthListInstance._solution = { - accountSid: accountSid - }; + ThisMonthListInstance._solution = {accountSid: accountSid}; ThisMonthListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/ThisMonth.json' // jshint ignore:line )(ThisMonthListInstance._solution); @@ -254,18 +252,10 @@ ThisMonthList = function ThisMonthList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ThisMonthPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ThisMonthPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ ThisMonthList = function ThisMonthList(version, accountSid) { ThisMonthListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ThisMonthPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ThisMonthPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ ThisMonthPage.prototype.constructor = ThisMonthPage; */ /* jshint ignore:end */ ThisMonthPage.prototype.getInstance = function getInstance(payload) { - return new ThisMonthInstance( - this._version, - payload, - this._solution.accountSid - ); + return new ThisMonthInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ ThisMonthInstance = function ThisMonthInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/today.js b/lib/rest/api/v2010/account/usage/record/today.js index 87f6fc0f5d..b21f878c3d 100644 --- a/lib/rest/api/v2010/account/usage/record/today.js +++ b/lib/rest/api/v2010/account/usage/record/today.js @@ -50,9 +50,7 @@ TodayList = function TodayList(version, accountSid) { TodayListInstance._version = version; // Path Solution - TodayListInstance._solution = { - accountSid: accountSid - }; + TodayListInstance._solution = {accountSid: accountSid}; TodayListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/Today.json' // jshint ignore:line )(TodayListInstance._solution); @@ -254,18 +252,10 @@ TodayList = function TodayList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TodayPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TodayPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ TodayList = function TodayList(version, accountSid) { TodayListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TodayPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TodayPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ TodayPage.prototype.constructor = TodayPage; */ /* jshint ignore:end */ TodayPage.prototype.getInstance = function getInstance(payload) { - return new TodayInstance( - this._version, - payload, - this._solution.accountSid - ); + return new TodayInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ TodayInstance = function TodayInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/yearly.js b/lib/rest/api/v2010/account/usage/record/yearly.js index b206c1e399..bd1b404461 100644 --- a/lib/rest/api/v2010/account/usage/record/yearly.js +++ b/lib/rest/api/v2010/account/usage/record/yearly.js @@ -50,9 +50,7 @@ YearlyList = function YearlyList(version, accountSid) { YearlyListInstance._version = version; // Path Solution - YearlyListInstance._solution = { - accountSid: accountSid - }; + YearlyListInstance._solution = {accountSid: accountSid}; YearlyListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/Yearly.json' // jshint ignore:line )(YearlyListInstance._solution); @@ -254,18 +252,10 @@ YearlyList = function YearlyList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new YearlyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new YearlyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ YearlyList = function YearlyList(version, accountSid) { YearlyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new YearlyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new YearlyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ YearlyPage.prototype.constructor = YearlyPage; */ /* jshint ignore:end */ YearlyPage.prototype.getInstance = function getInstance(payload) { - return new YearlyInstance( - this._version, - payload, - this._solution.accountSid - ); + return new YearlyInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ YearlyInstance = function YearlyInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/record/yesterday.js b/lib/rest/api/v2010/account/usage/record/yesterday.js index bf830c00a0..207a549a92 100644 --- a/lib/rest/api/v2010/account/usage/record/yesterday.js +++ b/lib/rest/api/v2010/account/usage/record/yesterday.js @@ -50,9 +50,7 @@ YesterdayList = function YesterdayList(version, accountSid) { YesterdayListInstance._version = version; // Path Solution - YesterdayListInstance._solution = { - accountSid: accountSid - }; + YesterdayListInstance._solution = {accountSid: accountSid}; YesterdayListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Records/Yesterday.json' // jshint ignore:line )(YesterdayListInstance._solution); @@ -254,18 +252,10 @@ YesterdayList = function YesterdayList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new YesterdayPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new YesterdayPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ YesterdayList = function YesterdayList(version, accountSid) { YesterdayListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new YesterdayPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new YesterdayPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +350,7 @@ YesterdayPage.prototype.constructor = YesterdayPage; */ /* jshint ignore:end */ YesterdayPage.prototype.getInstance = function getInstance(payload) { - return new YesterdayInstance( - this._version, - payload, - this._solution.accountSid - ); + return new YesterdayInstance(this._version, payload, this._solution.accountSid); }; @@ -420,9 +399,7 @@ YesterdayInstance = function YesterdayInstance(version, payload, accountSid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/api/v2010/account/usage/trigger.js b/lib/rest/api/v2010/account/usage/trigger.js index 558eabcf9a..24e2e173d1 100644 --- a/lib/rest/api/v2010/account/usage/trigger.js +++ b/lib/rest/api/v2010/account/usage/trigger.js @@ -49,9 +49,7 @@ TriggerList = function TriggerList(version, accountSid) { TriggerListInstance._version = version; // Path Solution - TriggerListInstance._solution = { - accountSid: accountSid - }; + TriggerListInstance._solution = {accountSid: accountSid}; TriggerListInstance._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Triggers.json' // jshint ignore:line )(TriggerListInstance._solution); @@ -105,11 +103,7 @@ TriggerList = function TriggerList(version, accountSid) { 'TriggerBy': _.get(opts, 'triggerBy') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new TriggerInstance( @@ -329,18 +323,10 @@ TriggerList = function TriggerList(version, accountSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TriggerPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TriggerPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -377,17 +363,10 @@ TriggerList = function TriggerList(version, accountSid) { TriggerListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TriggerPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TriggerPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -415,11 +394,7 @@ TriggerList = function TriggerList(version, accountSid) { */ /* jshint ignore:end */ TriggerListInstance.get = function get(sid) { - return new TriggerContext( - this._version, - this._solution.accountSid, - sid - ); + return new TriggerContext(this._version, this._solution.accountSid, sid); }; return TriggerListInstance; @@ -463,11 +438,7 @@ TriggerPage.prototype.constructor = TriggerPage; */ /* jshint ignore:end */ TriggerPage.prototype.getInstance = function getInstance(payload) { - return new TriggerInstance( - this._version, - payload, - this._solution.accountSid - ); + return new TriggerInstance(this._version, payload, this._solution.accountSid); }; @@ -527,21 +498,14 @@ TriggerInstance = function TriggerInstance(version, payload, accountSid, sid) { // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - sid: sid || this.sid, - }; + this._solution = {accountSid: accountSid, sid: sid || this.sid,}; }; Object.defineProperty(TriggerInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new TriggerContext( - this._version, - this._solution.accountSid, - this._solution.sid - ); + this._context = new TriggerContext(this._version, this._solution.accountSid, this._solution.sid); } return this._context; @@ -620,10 +584,7 @@ TriggerContext = function TriggerContext(version, accountSid, sid) { this._version = version; // Path Solution - this._solution = { - accountSid: accountSid, - sid: sid, - }; + this._solution = {accountSid: accountSid, sid: sid,}; this._uri = _.template( '/Accounts/<%= accountSid %>/Usage/Triggers/<%= sid %>.json' // jshint ignore:line )(this._solution); @@ -644,10 +605,7 @@ TriggerContext = function TriggerContext(version, accountSid, sid) { /* jshint ignore:end */ TriggerContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new TriggerInstance( @@ -702,11 +660,7 @@ TriggerContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new TriggerInstance( @@ -743,10 +697,7 @@ TriggerContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ TriggerContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/api/v2010/account/validationRequest.js b/lib/rest/api/v2010/account/validationRequest.js index c257100fe5..81c437239b 100644 --- a/lib/rest/api/v2010/account/validationRequest.js +++ b/lib/rest/api/v2010/account/validationRequest.js @@ -47,9 +47,7 @@ ValidationRequestList = function ValidationRequestList(version, accountSid) { ValidationRequestListInstance._version = version; // Path Solution - ValidationRequestListInstance._solution = { - accountSid: accountSid - }; + ValidationRequestListInstance._solution = {accountSid: accountSid}; ValidationRequestListInstance._uri = _.template( '/Accounts/<%= accountSid %>/OutgoingCallerIds.json' // jshint ignore:line )(ValidationRequestListInstance._solution); @@ -92,17 +90,10 @@ ValidationRequestList = function ValidationRequestList(version, accountSid) { 'StatusCallbackMethod': _.get(opts, 'statusCallbackMethod') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ValidationRequestInstance( - this._version, - payload - )); + deferred.resolve(new ValidationRequestInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -158,11 +149,7 @@ ValidationRequestPage.prototype.constructor = ValidationRequestPage; */ /* jshint ignore:end */ ValidationRequestPage.prototype.getInstance = function getInstance(payload) { - return new ValidationRequestInstance( - this._version, - payload, - this._solution.accountSid - ); + return new ValidationRequestInstance(this._version, payload, this._solution.accountSid); }; @@ -194,9 +181,7 @@ ValidationRequestInstance = function ValidationRequestInstance(version, payload, // Context this._context = undefined; - this._solution = { - accountSid: accountSid, - }; + this._solution = {accountSid: accountSid,}; }; module.exports = { diff --git a/lib/rest/chat/v1/credential.js b/lib/rest/chat/v1/credential.js index 5c6a539bb9..acc46f2fe8 100644 --- a/lib/rest/chat/v1/credential.js +++ b/lib/rest/chat/v1/credential.js @@ -234,18 +234,10 @@ CredentialList = function CredentialList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -279,17 +271,10 @@ CredentialList = function CredentialList(version) { CredentialListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -343,18 +328,10 @@ CredentialList = function CredentialList(version) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -382,10 +359,7 @@ CredentialList = function CredentialList(version) { */ /* jshint ignore:end */ CredentialListInstance.get = function get(sid) { - return new CredentialContext( - this._version, - sid - ); + return new CredentialContext(this._version, sid); }; return CredentialListInstance; @@ -429,10 +403,7 @@ CredentialPage.prototype.constructor = CredentialPage; */ /* jshint ignore:end */ CredentialPage.prototype.getInstance = function getInstance(payload) { - return new CredentialInstance( - this._version, - payload - ); + return new CredentialInstance(this._version, payload); }; @@ -470,19 +441,14 @@ CredentialInstance = function CredentialInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CredentialInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CredentialContext( - this._version, - this._solution.sid - ); + this._context = new CredentialContext(this._version, this._solution.sid); } return this._context; @@ -561,9 +527,7 @@ CredentialContext = function CredentialContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Credentials/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,17 +548,10 @@ CredentialContext = function CredentialContext(version, sid) { /* jshint ignore:end */ CredentialContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -645,18 +602,10 @@ CredentialContext.prototype.update = function update(opts, callback) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -685,10 +634,7 @@ CredentialContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/chat/v1/service.js b/lib/rest/chat/v1/service.js index d2a5e3c9a1..003cecc5f0 100644 --- a/lib/rest/chat/v1/service.js +++ b/lib/rest/chat/v1/service.js @@ -79,22 +79,12 @@ ServiceList = function ServiceList(version) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -290,18 +280,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +317,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,10 +348,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -420,10 +392,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -488,19 +457,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -750,9 +714,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -778,17 +740,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -817,10 +772,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -1059,18 +1011,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'Limits.UserChannels': _.get(opts, 'limits.userChannels') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -1088,10 +1032,7 @@ Object.defineProperty(ServiceContext.prototype, 'channels', { get: function() { if (!this._channels) { - this._channels = new ChannelList( - this._version, - this._solution.sid - ); + this._channels = new ChannelList(this._version, this._solution.sid); } return this._channels; } @@ -1101,10 +1042,7 @@ Object.defineProperty(ServiceContext.prototype, 'roles', { get: function() { if (!this._roles) { - this._roles = new RoleList( - this._version, - this._solution.sid - ); + this._roles = new RoleList(this._version, this._solution.sid); } return this._roles; } @@ -1114,10 +1052,7 @@ Object.defineProperty(ServiceContext.prototype, 'users', { get: function() { if (!this._users) { - this._users = new UserList( - this._version, - this._solution.sid - ); + this._users = new UserList(this._version, this._solution.sid); } return this._users; } diff --git a/lib/rest/chat/v1/service/channel.js b/lib/rest/chat/v1/service/channel.js index 6513208077..e0e36fc190 100644 --- a/lib/rest/chat/v1/service/channel.js +++ b/lib/rest/chat/v1/service/channel.js @@ -51,9 +51,7 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance._version = version; // Path Solution - ChannelListInstance._solution = { - serviceSid: serviceSid - }; + ChannelListInstance._solution = {serviceSid: serviceSid}; ChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels' // jshint ignore:line )(ChannelListInstance._solution); @@ -90,11 +88,7 @@ ChannelList = function ChannelList(version, serviceSid) { 'Type': _.get(opts, 'type') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -306,18 +300,10 @@ ChannelList = function ChannelList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -352,17 +338,10 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,11 +369,7 @@ ChannelList = function ChannelList(version, serviceSid) { */ /* jshint ignore:end */ ChannelListInstance.get = function get(sid) { - return new ChannelContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ChannelContext(this._version, this._solution.serviceSid, sid); }; return ChannelListInstance; @@ -438,11 +413,7 @@ ChannelPage.prototype.constructor = ChannelPage; */ /* jshint ignore:end */ ChannelPage.prototype.getInstance = function getInstance(payload) { - return new ChannelInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ChannelInstance(this._version, payload, this._solution.serviceSid); }; @@ -493,21 +464,14 @@ ChannelInstance = function ChannelInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ChannelInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ChannelContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ChannelContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -636,10 +600,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= sid %>' // jshint ignore:line )(this._solution); @@ -665,10 +626,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { /* jshint ignore:end */ ChannelContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -705,10 +663,7 @@ ChannelContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ChannelContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -756,11 +711,7 @@ ChannelContext.prototype.update = function update(opts, callback) { 'Attributes': _.get(opts, 'attributes') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -786,11 +737,7 @@ Object.defineProperty(ChannelContext.prototype, 'members', { get: function() { if (!this._members) { - this._members = new MemberList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._members = new MemberList(this._version, this._solution.serviceSid, this._solution.sid); } return this._members; } @@ -800,11 +747,7 @@ Object.defineProperty(ChannelContext.prototype, 'messages', { get: function() { if (!this._messages) { - this._messages = new MessageList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._messages = new MessageList(this._version, this._solution.serviceSid, this._solution.sid); } return this._messages; } @@ -814,11 +757,7 @@ Object.defineProperty(ChannelContext.prototype, 'invites', { get: function() { if (!this._invites) { - this._invites = new InviteList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._invites = new InviteList(this._version, this._solution.serviceSid, this._solution.sid); } return this._invites; } diff --git a/lib/rest/chat/v1/service/channel/invite.js b/lib/rest/chat/v1/service/channel/invite.js index 6fa040c4aa..9ea052cd4a 100644 --- a/lib/rest/chat/v1/service/channel/invite.js +++ b/lib/rest/chat/v1/service/channel/invite.js @@ -49,10 +49,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance._version = version; // Path Solution - InviteListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + InviteListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; InviteListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites' // jshint ignore:line )(InviteListInstance._solution); @@ -81,16 +78,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'RoleSid': _.get(opts, 'roleSid') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'RoleSid': _.get(opts, 'roleSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -303,18 +293,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,17 +331,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -387,12 +362,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ InviteListInstance.get = function get(sid) { - return new InviteContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new InviteContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return InviteListInstance; @@ -486,11 +456,7 @@ InviteInstance = function InviteInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(InviteInstance.prototype, @@ -559,11 +525,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,10 +546,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ InviteContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -625,10 +584,7 @@ InviteContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ InviteContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/chat/v1/service/channel/member.js b/lib/rest/chat/v1/service/channel/member.js index c628bbb617..cd35f993e4 100644 --- a/lib/rest/chat/v1/service/channel/member.js +++ b/lib/rest/chat/v1/service/channel/member.js @@ -49,10 +49,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance._version = version; // Path Solution - MemberListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MemberListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MemberListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members' // jshint ignore:line )(MemberListInstance._solution); @@ -81,16 +78,9 @@ MemberList = function MemberList(version, serviceSid, channelSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'RoleSid': _.get(opts, 'roleSid') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'RoleSid': _.get(opts, 'roleSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -303,18 +293,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,17 +331,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -387,12 +362,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MemberListInstance.get = function get(sid) { - return new MemberContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MemberContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MemberListInstance; @@ -488,11 +458,7 @@ MemberInstance = function MemberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MemberInstance.prototype, @@ -582,11 +548,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members/<%= sid %>' // jshint ignore:line )(this._solution); @@ -607,10 +569,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MemberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -648,10 +607,7 @@ MemberContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MemberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -698,11 +654,7 @@ MemberContext.prototype.update = function update(opts, callback) { 'LastConsumedMessageIndex': _.get(opts, 'lastConsumedMessageIndex') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( diff --git a/lib/rest/chat/v1/service/channel/message.js b/lib/rest/chat/v1/service/channel/message.js index 64814dc2bd..5a8b5bae96 100644 --- a/lib/rest/chat/v1/service/channel/message.js +++ b/lib/rest/chat/v1/service/channel/message.js @@ -49,10 +49,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance._version = version; // Path Solution - MessageListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MessageListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MessageListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages' // jshint ignore:line )(MessageListInstance._solution); @@ -88,11 +85,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'Attributes': _.get(opts, 'attributes') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -305,18 +298,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -351,17 +336,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -389,12 +367,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MessageListInstance.get = function get(sid) { - return new MessageContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MessageContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MessageListInstance; @@ -494,11 +467,7 @@ MessageInstance = function MessageInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MessageInstance.prototype, @@ -587,11 +556,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages/<%= sid %>' // jshint ignore:line )(this._solution); @@ -612,10 +577,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MessageContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -653,10 +615,7 @@ MessageContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MessageContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -697,16 +656,9 @@ MessageContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Body': _.get(opts, 'body'), - 'Attributes': _.get(opts, 'attributes') - }); + var data = values.of({'Body': _.get(opts, 'body'), 'Attributes': _.get(opts, 'attributes')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( diff --git a/lib/rest/chat/v1/service/role.js b/lib/rest/chat/v1/service/role.js index 617a57dbb8..143e91a6b3 100644 --- a/lib/rest/chat/v1/service/role.js +++ b/lib/rest/chat/v1/service/role.js @@ -48,9 +48,7 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance._version = version; // Path Solution - RoleListInstance._solution = { - serviceSid: serviceSid - }; + RoleListInstance._solution = {serviceSid: serviceSid}; RoleListInstance._uri = _.template( '/Services/<%= serviceSid %>/Roles' // jshint ignore:line )(RoleListInstance._solution); @@ -92,11 +90,7 @@ RoleList = function RoleList(version, serviceSid) { 'Permission': _.get(opts, 'permission') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -300,18 +294,10 @@ RoleList = function RoleList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -345,17 +331,10 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -383,11 +362,7 @@ RoleList = function RoleList(version, serviceSid) { */ /* jshint ignore:end */ RoleListInstance.get = function get(sid) { - return new RoleContext( - this._version, - this._solution.serviceSid, - sid - ); + return new RoleContext(this._version, this._solution.serviceSid, sid); }; return RoleListInstance; @@ -431,11 +406,7 @@ RolePage.prototype.constructor = RolePage; */ /* jshint ignore:end */ RolePage.prototype.getInstance = function getInstance(payload) { - return new RoleInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new RoleInstance(this._version, payload, this._solution.serviceSid); }; @@ -476,21 +447,14 @@ RoleInstance = function RoleInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(RoleInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RoleContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new RoleContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -565,10 +529,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Roles/<%= sid %>' // jshint ignore:line )(this._solution); @@ -589,10 +550,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { /* jshint ignore:end */ RoleContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -629,10 +587,7 @@ RoleContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RoleContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -673,15 +628,9 @@ RoleContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Permission': _.get(opts, 'permission') - }); + var data = values.of({'Permission': _.get(opts, 'permission')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( diff --git a/lib/rest/chat/v1/service/user.js b/lib/rest/chat/v1/service/user.js index 8d50047b03..e87b0922d0 100644 --- a/lib/rest/chat/v1/service/user.js +++ b/lib/rest/chat/v1/service/user.js @@ -49,9 +49,7 @@ UserList = function UserList(version, serviceSid) { UserListInstance._version = version; // Path Solution - UserListInstance._solution = { - serviceSid: serviceSid - }; + UserListInstance._solution = {serviceSid: serviceSid}; UserListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users' // jshint ignore:line )(UserListInstance._solution); @@ -89,11 +87,7 @@ UserList = function UserList(version, serviceSid) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -297,18 +291,10 @@ UserList = function UserList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,17 +328,10 @@ UserList = function UserList(version, serviceSid) { UserListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,11 +359,7 @@ UserList = function UserList(version, serviceSid) { */ /* jshint ignore:end */ UserListInstance.get = function get(sid) { - return new UserContext( - this._version, - this._solution.serviceSid, - sid - ); + return new UserContext(this._version, this._solution.serviceSid, sid); }; return UserListInstance; @@ -428,11 +403,7 @@ UserPage.prototype.constructor = UserPage; */ /* jshint ignore:end */ UserPage.prototype.getInstance = function getInstance(payload) { - return new UserInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new UserInstance(this._version, payload, this._solution.serviceSid); }; @@ -483,21 +454,14 @@ UserInstance = function UserInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(UserInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new UserContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new UserContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -592,10 +556,7 @@ UserContext = function UserContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= sid %>' // jshint ignore:line )(this._solution); @@ -619,10 +580,7 @@ UserContext = function UserContext(version, serviceSid, sid) { /* jshint ignore:end */ UserContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -659,10 +617,7 @@ UserContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ UserContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -710,11 +665,7 @@ UserContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( diff --git a/lib/rest/chat/v1/service/user/userChannel.js b/lib/rest/chat/v1/service/user/userChannel.js index 2c88a335f4..d19a34bc87 100644 --- a/lib/rest/chat/v1/service/user/userChannel.js +++ b/lib/rest/chat/v1/service/user/userChannel.js @@ -48,10 +48,7 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance._version = version; // Path Solution - UserChannelListInstance._solution = { - serviceSid: serviceSid, - userSid: userSid - }; + UserChannelListInstance._solution = {serviceSid: serviceSid, userSid: userSid}; UserChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels' // jshint ignore:line )(UserChannelListInstance._solution); @@ -237,18 +234,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +271,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,10 +372,7 @@ UserChannelInstance = function UserChannelInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - userSid: userSid, - }; + this._solution = {serviceSid: serviceSid, userSid: userSid,}; }; module.exports = { diff --git a/lib/rest/chat/v2/credential.js b/lib/rest/chat/v2/credential.js index 673e8963a6..c43f9522ae 100644 --- a/lib/rest/chat/v2/credential.js +++ b/lib/rest/chat/v2/credential.js @@ -234,18 +234,10 @@ CredentialList = function CredentialList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -279,17 +271,10 @@ CredentialList = function CredentialList(version) { CredentialListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -343,18 +328,10 @@ CredentialList = function CredentialList(version) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -382,10 +359,7 @@ CredentialList = function CredentialList(version) { */ /* jshint ignore:end */ CredentialListInstance.get = function get(sid) { - return new CredentialContext( - this._version, - sid - ); + return new CredentialContext(this._version, sid); }; return CredentialListInstance; @@ -429,10 +403,7 @@ CredentialPage.prototype.constructor = CredentialPage; */ /* jshint ignore:end */ CredentialPage.prototype.getInstance = function getInstance(payload) { - return new CredentialInstance( - this._version, - payload - ); + return new CredentialInstance(this._version, payload); }; @@ -470,19 +441,14 @@ CredentialInstance = function CredentialInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CredentialInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CredentialContext( - this._version, - this._solution.sid - ); + this._context = new CredentialContext(this._version, this._solution.sid); } return this._context; @@ -561,9 +527,7 @@ CredentialContext = function CredentialContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Credentials/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,17 +548,10 @@ CredentialContext = function CredentialContext(version, sid) { /* jshint ignore:end */ CredentialContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -645,18 +602,10 @@ CredentialContext.prototype.update = function update(opts, callback) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -685,10 +634,7 @@ CredentialContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/chat/v2/service.js b/lib/rest/chat/v2/service.js index 398266166d..a07948a978 100644 --- a/lib/rest/chat/v2/service.js +++ b/lib/rest/chat/v2/service.js @@ -11,6 +11,7 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ +var BindingList = require('./service/binding').BindingList; var ChannelList = require('./service/channel').ChannelList; var Page = require('../../../base/Page'); /* jshint ignore:line */ var RoleList = require('./service/role').RoleList; @@ -79,22 +80,12 @@ ServiceList = function ServiceList(version) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -290,18 +281,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +318,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,10 +349,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -420,10 +393,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -492,19 +462,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -654,6 +619,21 @@ ServiceInstance.prototype.users = function users() { return this._proxy.users; }; +/* jshint ignore:start */ +/** + * Access the bindings + * + * @function bindings + * @memberof Twilio.Chat.V2.ServiceInstance + * @instance + * + * @returns {Twilio.Chat.V2.ServiceContext.BindingList} + */ +/* jshint ignore:end */ +ServiceInstance.prototype.bindings = function bindings() { + return this._proxy.bindings; +}; + /* jshint ignore:start */ /** @@ -664,6 +644,8 @@ ServiceInstance.prototype.users = function users() { * channels resource * @property {Twilio.Chat.V2.ServiceContext.RoleList} roles - roles resource * @property {Twilio.Chat.V2.ServiceContext.UserList} users - users resource + * @property {Twilio.Chat.V2.ServiceContext.BindingList} bindings - + * bindings resource * * @param {Twilio.Chat.V2} version - Version of the resource * @param {sid} sid - The sid @@ -673,9 +655,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -684,6 +664,7 @@ ServiceContext = function ServiceContext(version, sid) { this._channels = undefined; this._roles = undefined; this._users = undefined; + this._bindings = undefined; }; /* jshint ignore:start */ @@ -701,17 +682,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -740,10 +714,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -861,18 +832,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'PostWebhookRetryCount': _.get(opts, 'postWebhookRetryCount') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -890,10 +853,7 @@ Object.defineProperty(ServiceContext.prototype, 'channels', { get: function() { if (!this._channels) { - this._channels = new ChannelList( - this._version, - this._solution.sid - ); + this._channels = new ChannelList(this._version, this._solution.sid); } return this._channels; } @@ -903,10 +863,7 @@ Object.defineProperty(ServiceContext.prototype, 'roles', { get: function() { if (!this._roles) { - this._roles = new RoleList( - this._version, - this._solution.sid - ); + this._roles = new RoleList(this._version, this._solution.sid); } return this._roles; } @@ -916,15 +873,22 @@ Object.defineProperty(ServiceContext.prototype, 'users', { get: function() { if (!this._users) { - this._users = new UserList( - this._version, - this._solution.sid - ); + this._users = new UserList(this._version, this._solution.sid); } return this._users; } }); +Object.defineProperty(ServiceContext.prototype, + 'bindings', { + get: function() { + if (!this._bindings) { + this._bindings = new BindingList(this._version, this._solution.sid); + } + return this._bindings; + } +}); + module.exports = { ServiceList: ServiceList, ServicePage: ServicePage, diff --git a/lib/rest/chat/v2/service/binding.js b/lib/rest/chat/v2/service/binding.js new file mode 100644 index 0000000000..9fd0a8726f --- /dev/null +++ b/lib/rest/chat/v2/service/binding.js @@ -0,0 +1,553 @@ +'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 values = require('../../../../base/values'); /* jshint ignore:line */ + +var BindingList; +var BindingPage; +var BindingInstance; +var BindingContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.BindingList + * @description Initialize the BindingList + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {string} serviceSid - The service_sid + */ +/* jshint ignore:end */ +BindingList = function BindingList(version, serviceSid) { + /* jshint ignore:start */ + /** + * @function bindings + * @memberof Twilio.Chat.V2.ServiceContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.Chat.V2.ServiceContext.BindingContext} + */ + /* jshint ignore:end */ + function BindingListInstance(sid) { + return BindingListInstance.get(sid); + } + + BindingListInstance._version = version; + // Path Solution + BindingListInstance._solution = {serviceSid: serviceSid}; + BindingListInstance._uri = _.template( + '/Services/<%= serviceSid %>/Bindings' // jshint ignore:line + )(BindingListInstance._solution); + /* jshint ignore:start */ + /** + * Streams BindingInstance 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.BindingList + * @instance + * + * @param {object|function} opts - ... + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.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 BindingInstance 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.BindingList + * @instance + * + * @param {object|function} opts - ... + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.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 BindingInstance 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.BindingList + * @instance + * + * @param {object|function} opts - ... + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.page = function page(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'BindingType': _.get(opts, 'bindingType'), + 'Identity': _.get(opts, 'identity'), + '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 BindingPage(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 BindingInstance 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.BindingList + * @instance + * + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.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 BindingPage(this._version, payload, this._solution)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a binding + * + * @function get + * @memberof Twilio.Chat.V2.ServiceContext.BindingList + * @instance + * + * @param {string} sid - The sid + * + * @returns {Twilio.Chat.V2.ServiceContext.BindingContext} + */ + /* jshint ignore:end */ + BindingListInstance.get = function get(sid) { + return new BindingContext(this._version, this._solution.serviceSid, sid); + }; + + return BindingListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.BindingPage + * @augments Page + * @description Initialize the BindingPage + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns BindingPage + */ +/* jshint ignore:end */ +BindingPage = function BindingPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(BindingPage.prototype, Page.prototype); +BindingPage.prototype.constructor = BindingPage; + +/* jshint ignore:start */ +/** + * Build an instance of BindingInstance + * + * @function getInstance + * @memberof Twilio.Chat.V2.ServiceContext.BindingPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns BindingInstance + */ +/* jshint ignore:end */ +BindingPage.prototype.getInstance = function getInstance(payload) { + return new BindingInstance(this._version, payload, this._solution.serviceSid); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.BindingInstance + * @description Initialize the BindingContext + * + * @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} endpoint - The endpoint + * @property {string} identity - The identity + * @property {string} credentialSid - The credential_sid + * @property {binding.binding_type} bindingType - The binding_type + * @property {string} messageTypes - The message_types + * @property {string} url - The url + * @property {string} links - The links + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} serviceSid - The service_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +BindingInstance = function BindingInstance(version, payload, serviceSid, 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.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line + this.endpoint = payload.endpoint; // jshint ignore:line + this.identity = payload.identity; // jshint ignore:line + this.credentialSid = payload.credential_sid; // jshint ignore:line + this.bindingType = payload.binding_type; // jshint ignore:line + this.messageTypes = payload.message_types; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.links = payload.links; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; +}; + +Object.defineProperty(BindingInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new BindingContext(this._version, this._solution.serviceSid, this._solution.sid); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a BindingInstance + * + * @function fetch + * @memberof Twilio.Chat.V2.ServiceContext.BindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * remove a BindingInstance + * + * @function remove + * @memberof Twilio.Chat.V2.ServiceContext.BindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingInstance.prototype.remove = function remove(callback) { + return this._proxy.remove(callback); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.BindingContext + * @description Initialize the BindingContext + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {sid} serviceSid - The service_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +BindingContext = function BindingContext(version, serviceSid, sid) { + this._version = version; + + // Path Solution + this._solution = {serviceSid: serviceSid, sid: sid,}; + this._uri = _.template( + '/Services/<%= serviceSid %>/Bindings/<%= sid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a BindingInstance + * + * @function fetch + * @memberof Twilio.Chat.V2.ServiceContext.BindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingContext.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 BindingInstance( + this._version, + payload, + this._solution.serviceSid, + 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 BindingInstance + * + * @function remove + * @memberof Twilio.Chat.V2.ServiceContext.BindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingContext.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 = { + BindingList: BindingList, + BindingPage: BindingPage, + BindingInstance: BindingInstance, + BindingContext: BindingContext +}; diff --git a/lib/rest/chat/v2/service/channel.js b/lib/rest/chat/v2/service/channel.js index 86e6c016b3..9ca5c56503 100644 --- a/lib/rest/chat/v2/service/channel.js +++ b/lib/rest/chat/v2/service/channel.js @@ -52,9 +52,7 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance._version = version; // Path Solution - ChannelListInstance._solution = { - serviceSid: serviceSid - }; + ChannelListInstance._solution = {serviceSid: serviceSid}; ChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels' // jshint ignore:line )(ChannelListInstance._solution); @@ -97,11 +95,7 @@ ChannelList = function ChannelList(version, serviceSid) { 'CreatedBy': _.get(opts, 'createdBy') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -313,18 +307,10 @@ ChannelList = function ChannelList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -359,17 +345,10 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -397,11 +376,7 @@ ChannelList = function ChannelList(version, serviceSid) { */ /* jshint ignore:end */ ChannelListInstance.get = function get(sid) { - return new ChannelContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ChannelContext(this._version, this._solution.serviceSid, sid); }; return ChannelListInstance; @@ -445,11 +420,7 @@ ChannelPage.prototype.constructor = ChannelPage; */ /* jshint ignore:end */ ChannelPage.prototype.getInstance = function getInstance(payload) { - return new ChannelInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ChannelInstance(this._version, payload, this._solution.serviceSid); }; @@ -500,21 +471,14 @@ ChannelInstance = function ChannelInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ChannelInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ChannelContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ChannelContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -646,10 +610,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= sid %>' // jshint ignore:line )(this._solution); @@ -675,10 +636,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { /* jshint ignore:end */ ChannelContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -715,10 +673,7 @@ ChannelContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ChannelContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -772,11 +727,7 @@ ChannelContext.prototype.update = function update(opts, callback) { 'CreatedBy': _.get(opts, 'createdBy') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -802,11 +753,7 @@ Object.defineProperty(ChannelContext.prototype, 'members', { get: function() { if (!this._members) { - this._members = new MemberList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._members = new MemberList(this._version, this._solution.serviceSid, this._solution.sid); } return this._members; } @@ -816,11 +763,7 @@ Object.defineProperty(ChannelContext.prototype, 'messages', { get: function() { if (!this._messages) { - this._messages = new MessageList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._messages = new MessageList(this._version, this._solution.serviceSid, this._solution.sid); } return this._messages; } @@ -830,11 +773,7 @@ Object.defineProperty(ChannelContext.prototype, 'invites', { get: function() { if (!this._invites) { - this._invites = new InviteList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._invites = new InviteList(this._version, this._solution.serviceSid, this._solution.sid); } return this._invites; } diff --git a/lib/rest/chat/v2/service/channel/invite.js b/lib/rest/chat/v2/service/channel/invite.js index 7db019a0ee..c5d237a7f5 100644 --- a/lib/rest/chat/v2/service/channel/invite.js +++ b/lib/rest/chat/v2/service/channel/invite.js @@ -49,10 +49,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance._version = version; // Path Solution - InviteListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + InviteListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; InviteListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites' // jshint ignore:line )(InviteListInstance._solution); @@ -81,16 +78,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'RoleSid': _.get(opts, 'roleSid') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'RoleSid': _.get(opts, 'roleSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -303,18 +293,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,17 +331,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -387,12 +362,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ InviteListInstance.get = function get(sid) { - return new InviteContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new InviteContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return InviteListInstance; @@ -486,11 +456,7 @@ InviteInstance = function InviteInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(InviteInstance.prototype, @@ -559,11 +525,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,10 +546,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ InviteContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -625,10 +584,7 @@ InviteContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ InviteContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/chat/v2/service/channel/member.js b/lib/rest/chat/v2/service/channel/member.js index d90082c198..5724eb4e55 100644 --- a/lib/rest/chat/v2/service/channel/member.js +++ b/lib/rest/chat/v2/service/channel/member.js @@ -51,10 +51,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance._version = version; // Path Solution - MemberListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MemberListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MemberListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members' // jshint ignore:line )(MemberListInstance._solution); @@ -97,11 +94,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { 'DateUpdated': serialize.iso8601DateTime(_.get(opts, 'dateUpdated')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -314,18 +307,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,17 +345,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -398,12 +376,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MemberListInstance.get = function get(sid) { - return new MemberContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MemberContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MemberListInstance; @@ -499,11 +472,7 @@ MemberInstance = function MemberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MemberInstance.prototype, @@ -596,11 +565,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members/<%= sid %>' // jshint ignore:line )(this._solution); @@ -621,10 +586,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MemberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -662,10 +624,7 @@ MemberContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MemberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -718,11 +677,7 @@ MemberContext.prototype.update = function update(opts, callback) { 'DateUpdated': serialize.iso8601DateTime(_.get(opts, 'dateUpdated')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( diff --git a/lib/rest/chat/v2/service/channel/message.js b/lib/rest/chat/v2/service/channel/message.js index d3b6a3c7de..9c78e9bcff 100644 --- a/lib/rest/chat/v2/service/channel/message.js +++ b/lib/rest/chat/v2/service/channel/message.js @@ -51,10 +51,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance._version = version; // Path Solution - MessageListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MessageListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MessageListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages' // jshint ignore:line )(MessageListInstance._solution); @@ -97,11 +94,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'MediaSid': _.get(opts, 'mediaSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -314,18 +307,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,17 +345,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -398,12 +376,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MessageListInstance.get = function get(sid) { - return new MessageContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MessageContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MessageListInstance; @@ -509,11 +482,7 @@ MessageInstance = function MessageInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MessageInstance.prototype, @@ -605,11 +574,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages/<%= sid %>' // jshint ignore:line )(this._solution); @@ -630,10 +595,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MessageContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -671,10 +633,7 @@ MessageContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MessageContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -726,11 +685,7 @@ MessageContext.prototype.update = function update(opts, callback) { 'LastUpdatedBy': _.get(opts, 'lastUpdatedBy') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( diff --git a/lib/rest/chat/v2/service/role.js b/lib/rest/chat/v2/service/role.js index 970366df31..b60f60b89f 100644 --- a/lib/rest/chat/v2/service/role.js +++ b/lib/rest/chat/v2/service/role.js @@ -48,9 +48,7 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance._version = version; // Path Solution - RoleListInstance._solution = { - serviceSid: serviceSid - }; + RoleListInstance._solution = {serviceSid: serviceSid}; RoleListInstance._uri = _.template( '/Services/<%= serviceSid %>/Roles' // jshint ignore:line )(RoleListInstance._solution); @@ -92,11 +90,7 @@ RoleList = function RoleList(version, serviceSid) { 'Permission': _.get(opts, 'permission') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -300,18 +294,10 @@ RoleList = function RoleList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -345,17 +331,10 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -383,11 +362,7 @@ RoleList = function RoleList(version, serviceSid) { */ /* jshint ignore:end */ RoleListInstance.get = function get(sid) { - return new RoleContext( - this._version, - this._solution.serviceSid, - sid - ); + return new RoleContext(this._version, this._solution.serviceSid, sid); }; return RoleListInstance; @@ -431,11 +406,7 @@ RolePage.prototype.constructor = RolePage; */ /* jshint ignore:end */ RolePage.prototype.getInstance = function getInstance(payload) { - return new RoleInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new RoleInstance(this._version, payload, this._solution.serviceSid); }; @@ -476,21 +447,14 @@ RoleInstance = function RoleInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(RoleInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RoleContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new RoleContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -565,10 +529,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Roles/<%= sid %>' // jshint ignore:line )(this._solution); @@ -589,10 +550,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { /* jshint ignore:end */ RoleContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -629,10 +587,7 @@ RoleContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RoleContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -673,15 +628,9 @@ RoleContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Permission': _.get(opts, 'permission') - }); + var data = values.of({'Permission': _.get(opts, 'permission')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( diff --git a/lib/rest/chat/v2/service/user.js b/lib/rest/chat/v2/service/user.js index 3e9f8ac9fd..c3932c6c38 100644 --- a/lib/rest/chat/v2/service/user.js +++ b/lib/rest/chat/v2/service/user.js @@ -12,6 +12,7 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var UserBindingList = require('./user/userBinding').UserBindingList; var UserChannelList = require('./user/userChannel').UserChannelList; var deserialize = require( '../../../../base/deserialize'); /* jshint ignore:line */ @@ -49,9 +50,7 @@ UserList = function UserList(version, serviceSid) { UserListInstance._version = version; // Path Solution - UserListInstance._solution = { - serviceSid: serviceSid - }; + UserListInstance._solution = {serviceSid: serviceSid}; UserListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users' // jshint ignore:line )(UserListInstance._solution); @@ -89,11 +88,7 @@ UserList = function UserList(version, serviceSid) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -297,18 +292,10 @@ UserList = function UserList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,17 +329,10 @@ UserList = function UserList(version, serviceSid) { UserListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,11 +360,7 @@ UserList = function UserList(version, serviceSid) { */ /* jshint ignore:end */ UserListInstance.get = function get(sid) { - return new UserContext( - this._version, - this._solution.serviceSid, - sid - ); + return new UserContext(this._version, this._solution.serviceSid, sid); }; return UserListInstance; @@ -428,11 +404,7 @@ UserPage.prototype.constructor = UserPage; */ /* jshint ignore:end */ UserPage.prototype.getInstance = function getInstance(payload) { - return new UserInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new UserInstance(this._version, payload, this._solution.serviceSid); }; @@ -483,21 +455,14 @@ UserInstance = function UserInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(UserInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new UserContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new UserContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -574,6 +539,21 @@ UserInstance.prototype.userChannels = function userChannels() { return this._proxy.userChannels; }; +/* jshint ignore:start */ +/** + * Access the userBindings + * + * @function userBindings + * @memberof Twilio.Chat.V2.ServiceContext.UserInstance + * @instance + * + * @returns {Twilio.Chat.V2.ServiceContext.UserContext.UserBindingList} + */ +/* jshint ignore:end */ +UserInstance.prototype.userBindings = function userBindings() { + return this._proxy.userBindings; +}; + /* jshint ignore:start */ /** @@ -582,6 +562,8 @@ UserInstance.prototype.userChannels = function userChannels() { * * @property {Twilio.Chat.V2.ServiceContext.UserContext.UserChannelList} userChannels - * userChannels resource + * @property {Twilio.Chat.V2.ServiceContext.UserContext.UserBindingList} userBindings - + * userBindings resource * * @param {Twilio.Chat.V2} version - Version of the resource * @param {sid} serviceSid - The service_sid @@ -592,16 +574,14 @@ UserContext = function UserContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= sid %>' // jshint ignore:line )(this._solution); // Dependents this._userChannels = undefined; + this._userBindings = undefined; }; /* jshint ignore:start */ @@ -619,10 +599,7 @@ UserContext = function UserContext(version, serviceSid, sid) { /* jshint ignore:end */ UserContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -659,10 +636,7 @@ UserContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ UserContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -710,11 +684,7 @@ UserContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -750,6 +720,20 @@ Object.defineProperty(UserContext.prototype, } }); +Object.defineProperty(UserContext.prototype, + 'userBindings', { + get: function() { + if (!this._userBindings) { + this._userBindings = new UserBindingList( + this._version, + this._solution.serviceSid, + this._solution.sid + ); + } + return this._userBindings; + } +}); + module.exports = { UserList: UserList, UserPage: UserPage, diff --git a/lib/rest/chat/v2/service/user/userBinding.js b/lib/rest/chat/v2/service/user/userBinding.js new file mode 100644 index 0000000000..7a89b028d8 --- /dev/null +++ b/lib/rest/chat/v2/service/user/userBinding.js @@ -0,0 +1,564 @@ +'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 values = require('../../../../../base/values'); /* jshint ignore:line */ + +var UserBindingList; +var UserBindingPage; +var UserBindingInstance; +var UserBindingContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.UserContext.UserBindingList + * @description Initialize the UserBindingList + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {string} serviceSid - The service_sid + * @param {string} userSid - The user_sid + */ +/* jshint ignore:end */ +UserBindingList = function UserBindingList(version, serviceSid, userSid) { + /* jshint ignore:start */ + /** + * @function userBindings + * @memberof Twilio.Chat.V2.ServiceContext.UserContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.Chat.V2.ServiceContext.UserContext.UserBindingContext} + */ + /* jshint ignore:end */ + function UserBindingListInstance(sid) { + return UserBindingListInstance.get(sid); + } + + UserBindingListInstance._version = version; + // Path Solution + UserBindingListInstance._solution = {serviceSid: serviceSid, userSid: userSid}; + UserBindingListInstance._uri = _.template( + '/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings' // jshint ignore:line + )(UserBindingListInstance._solution); + /* jshint ignore:start */ + /** + * Streams UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {object|function} opts - ... + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.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 UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {object|function} opts - ... + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.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 UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {object|function} opts - ... + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.page = function page(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'BindingType': _.get(opts, 'bindingType'), + '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 UserBindingPage(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 UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.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 UserBindingPage(this._version, payload, this._solution)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a user_binding + * + * @function get + * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserBindingList + * @instance + * + * @param {string} sid - The sid + * + * @returns {Twilio.Chat.V2.ServiceContext.UserContext.UserBindingContext} + */ + /* jshint ignore:end */ + UserBindingListInstance.get = function get(sid) { + return new UserBindingContext(this._version, this._solution.serviceSid, this._solution.userSid, sid); + }; + + return UserBindingListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.UserContext.UserBindingPage + * @augments Page + * @description Initialize the UserBindingPage + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns UserBindingPage + */ +/* jshint ignore:end */ +UserBindingPage = function UserBindingPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(UserBindingPage.prototype, Page.prototype); +UserBindingPage.prototype.constructor = UserBindingPage; + +/* jshint ignore:start */ +/** + * Build an instance of UserBindingInstance + * + * @function getInstance + * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserBindingPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingPage.prototype.getInstance = function getInstance(payload) { + return new UserBindingInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid + ); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.UserContext.UserBindingInstance + * @description Initialize the UserBindingContext + * + * @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} endpoint - The endpoint + * @property {string} identity - The identity + * @property {string} userSid - The user_sid + * @property {string} credentialSid - The credential_sid + * @property {user_binding.binding_type} bindingType - The binding_type + * @property {string} messageTypes - The message_types + * @property {string} url - The url + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} serviceSid - The service_sid + * @param {sid_like} userSid - The user_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +UserBindingInstance = function UserBindingInstance(version, payload, serviceSid, + userSid, 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.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line + this.endpoint = payload.endpoint; // jshint ignore:line + this.identity = payload.identity; // jshint ignore:line + this.userSid = payload.user_sid; // jshint ignore:line + this.credentialSid = payload.credential_sid; // jshint ignore:line + this.bindingType = payload.binding_type; // jshint ignore:line + this.messageTypes = payload.message_types; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {serviceSid: serviceSid, userSid: userSid, sid: sid || this.sid,}; +}; + +Object.defineProperty(UserBindingInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new UserBindingContext( + this._version, + this._solution.serviceSid, + this._solution.userSid, + this._solution.sid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a UserBindingInstance + * + * @function fetch + * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserBindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * remove a UserBindingInstance + * + * @function remove + * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserBindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingInstance.prototype.remove = function remove(callback) { + return this._proxy.remove(callback); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.Chat.V2.ServiceContext.UserContext.UserBindingContext + * @description Initialize the UserBindingContext + * + * @param {Twilio.Chat.V2} version - Version of the resource + * @param {sid} serviceSid - The service_sid + * @param {sid_like} userSid - The user_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +UserBindingContext = function UserBindingContext(version, serviceSid, userSid, + sid) { + this._version = version; + + // Path Solution + this._solution = {serviceSid: serviceSid, userSid: userSid, sid: sid,}; + this._uri = _.template( + '/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings/<%= sid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a UserBindingInstance + * + * @function fetch + * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserBindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingContext.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 UserBindingInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid, + 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 UserBindingInstance + * + * @function remove + * @memberof Twilio.Chat.V2.ServiceContext.UserContext.UserBindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingContext.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 = { + UserBindingList: UserBindingList, + UserBindingPage: UserBindingPage, + UserBindingInstance: UserBindingInstance, + UserBindingContext: UserBindingContext +}; diff --git a/lib/rest/chat/v2/service/user/userChannel.js b/lib/rest/chat/v2/service/user/userChannel.js index 912fb31169..e62c1922e1 100644 --- a/lib/rest/chat/v2/service/user/userChannel.js +++ b/lib/rest/chat/v2/service/user/userChannel.js @@ -48,10 +48,7 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance._version = version; // Path Solution - UserChannelListInstance._solution = { - serviceSid: serviceSid, - userSid: userSid - }; + UserChannelListInstance._solution = {serviceSid: serviceSid, userSid: userSid}; UserChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels' // jshint ignore:line )(UserChannelListInstance._solution); @@ -237,18 +234,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +271,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,10 +372,7 @@ UserChannelInstance = function UserChannelInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - userSid: userSid, - }; + this._solution = {serviceSid: serviceSid, userSid: userSid,}; }; module.exports = { diff --git a/lib/rest/fax/v1/fax.js b/lib/rest/fax/v1/fax.js index 008caa58d4..5263922b5e 100644 --- a/lib/rest/fax/v1/fax.js +++ b/lib/rest/fax/v1/fax.js @@ -259,18 +259,10 @@ FaxList = function FaxList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new FaxPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new FaxPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -309,17 +301,10 @@ FaxList = function FaxList(version) { FaxListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new FaxPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new FaxPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -378,18 +363,10 @@ FaxList = function FaxList(version) { 'StoreMedia': serialize.bool(_.get(opts, 'storeMedia')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new FaxInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new FaxInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -417,10 +394,7 @@ FaxList = function FaxList(version) { */ /* jshint ignore:end */ FaxListInstance.get = function get(sid) { - return new FaxContext( - this._version, - sid - ); + return new FaxContext(this._version, sid); }; return FaxListInstance; @@ -465,10 +439,7 @@ FaxPage.prototype.constructor = FaxPage; */ /* jshint ignore:end */ FaxPage.prototype.getInstance = function getInstance(payload) { - return new FaxInstance( - this._version, - payload - ); + return new FaxInstance(this._version, payload); }; @@ -527,19 +498,14 @@ FaxInstance = function FaxInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(FaxInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new FaxContext( - this._version, - this._solution.sid - ); + this._context = new FaxContext(this._version, this._solution.sid); } return this._context; @@ -631,9 +597,7 @@ FaxContext = function FaxContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Faxes/<%= sid %>' // jshint ignore:line )(this._solution); @@ -657,17 +621,10 @@ FaxContext = function FaxContext(version, sid) { /* jshint ignore:end */ FaxContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new FaxInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new FaxInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -704,22 +661,12 @@ FaxContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Status': _.get(opts, 'status') - }); + var data = values.of({'Status': _.get(opts, 'status')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new FaxInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new FaxInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -748,10 +695,7 @@ FaxContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ FaxContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -772,10 +716,7 @@ Object.defineProperty(FaxContext.prototype, 'media', { get: function() { if (!this._media) { - this._media = new FaxMediaList( - this._version, - this._solution.sid - ); + this._media = new FaxMediaList(this._version, this._solution.sid); } return this._media; } diff --git a/lib/rest/fax/v1/fax/faxMedia.js b/lib/rest/fax/v1/fax/faxMedia.js index b72452ebcb..1f46750dfc 100644 --- a/lib/rest/fax/v1/fax/faxMedia.js +++ b/lib/rest/fax/v1/fax/faxMedia.js @@ -49,9 +49,7 @@ FaxMediaList = function FaxMediaList(version, faxSid) { FaxMediaListInstance._version = version; // Path Solution - FaxMediaListInstance._solution = { - faxSid: faxSid - }; + FaxMediaListInstance._solution = {faxSid: faxSid}; FaxMediaListInstance._uri = _.template( '/Faxes/<%= faxSid %>/Media' // jshint ignore:line )(FaxMediaListInstance._solution); @@ -237,18 +235,10 @@ FaxMediaList = function FaxMediaList(version, faxSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new FaxMediaPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new FaxMediaPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +272,10 @@ FaxMediaList = function FaxMediaList(version, faxSid) { FaxMediaListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new FaxMediaPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new FaxMediaPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -320,11 +303,7 @@ FaxMediaList = function FaxMediaList(version, faxSid) { */ /* jshint ignore:end */ FaxMediaListInstance.get = function get(sid) { - return new FaxMediaContext( - this._version, - this._solution.faxSid, - sid - ); + return new FaxMediaContext(this._version, this._solution.faxSid, sid); }; return FaxMediaListInstance; @@ -369,11 +348,7 @@ FaxMediaPage.prototype.constructor = FaxMediaPage; */ /* jshint ignore:end */ FaxMediaPage.prototype.getInstance = function getInstance(payload) { - return new FaxMediaInstance( - this._version, - payload, - this._solution.faxSid - ); + return new FaxMediaInstance(this._version, payload, this._solution.faxSid); }; @@ -411,21 +386,14 @@ FaxMediaInstance = function FaxMediaInstance(version, payload, faxSid, sid) { // Context this._context = undefined; - this._solution = { - faxSid: faxSid, - sid: sid || this.sid, - }; + this._solution = {faxSid: faxSid, sid: sid || this.sid,}; }; Object.defineProperty(FaxMediaInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new FaxMediaContext( - this._version, - this._solution.faxSid, - this._solution.sid - ); + this._context = new FaxMediaContext(this._version, this._solution.faxSid, this._solution.sid); } return this._context; @@ -482,10 +450,7 @@ FaxMediaContext = function FaxMediaContext(version, faxSid, sid) { this._version = version; // Path Solution - this._solution = { - faxSid: faxSid, - sid: sid, - }; + this._solution = {faxSid: faxSid, sid: sid,}; this._uri = _.template( '/Faxes/<%= faxSid %>/Media/<%= sid %>' // jshint ignore:line )(this._solution); @@ -506,10 +471,7 @@ FaxMediaContext = function FaxMediaContext(version, faxSid, sid) { /* jshint ignore:end */ FaxMediaContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new FaxMediaInstance( @@ -546,10 +508,7 @@ FaxMediaContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ FaxMediaContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/ipMessaging/v1/credential.js b/lib/rest/ipMessaging/v1/credential.js index d0286d8108..824bc8ad02 100644 --- a/lib/rest/ipMessaging/v1/credential.js +++ b/lib/rest/ipMessaging/v1/credential.js @@ -234,18 +234,10 @@ CredentialList = function CredentialList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -279,17 +271,10 @@ CredentialList = function CredentialList(version) { CredentialListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -343,18 +328,10 @@ CredentialList = function CredentialList(version) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -382,10 +359,7 @@ CredentialList = function CredentialList(version) { */ /* jshint ignore:end */ CredentialListInstance.get = function get(sid) { - return new CredentialContext( - this._version, - sid - ); + return new CredentialContext(this._version, sid); }; return CredentialListInstance; @@ -429,10 +403,7 @@ CredentialPage.prototype.constructor = CredentialPage; */ /* jshint ignore:end */ CredentialPage.prototype.getInstance = function getInstance(payload) { - return new CredentialInstance( - this._version, - payload - ); + return new CredentialInstance(this._version, payload); }; @@ -470,19 +441,14 @@ CredentialInstance = function CredentialInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CredentialInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CredentialContext( - this._version, - this._solution.sid - ); + this._context = new CredentialContext(this._version, this._solution.sid); } return this._context; @@ -561,9 +527,7 @@ CredentialContext = function CredentialContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Credentials/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,17 +548,10 @@ CredentialContext = function CredentialContext(version, sid) { /* jshint ignore:end */ CredentialContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -645,18 +602,10 @@ CredentialContext.prototype.update = function update(opts, callback) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -685,10 +634,7 @@ CredentialContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/ipMessaging/v1/service.js b/lib/rest/ipMessaging/v1/service.js index ced08cf169..9f63e77dc5 100644 --- a/lib/rest/ipMessaging/v1/service.js +++ b/lib/rest/ipMessaging/v1/service.js @@ -79,22 +79,12 @@ ServiceList = function ServiceList(version) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -290,18 +280,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +317,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,10 +348,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -420,10 +392,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -488,19 +457,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -750,9 +714,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -778,17 +740,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -817,10 +772,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -1059,18 +1011,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'Limits.UserChannels': _.get(opts, 'limits.userChannels') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -1088,10 +1032,7 @@ Object.defineProperty(ServiceContext.prototype, 'channels', { get: function() { if (!this._channels) { - this._channels = new ChannelList( - this._version, - this._solution.sid - ); + this._channels = new ChannelList(this._version, this._solution.sid); } return this._channels; } @@ -1101,10 +1042,7 @@ Object.defineProperty(ServiceContext.prototype, 'roles', { get: function() { if (!this._roles) { - this._roles = new RoleList( - this._version, - this._solution.sid - ); + this._roles = new RoleList(this._version, this._solution.sid); } return this._roles; } @@ -1114,10 +1052,7 @@ Object.defineProperty(ServiceContext.prototype, 'users', { get: function() { if (!this._users) { - this._users = new UserList( - this._version, - this._solution.sid - ); + this._users = new UserList(this._version, this._solution.sid); } return this._users; } diff --git a/lib/rest/ipMessaging/v1/service/channel.js b/lib/rest/ipMessaging/v1/service/channel.js index 32a045bb52..9d298bdf9b 100644 --- a/lib/rest/ipMessaging/v1/service/channel.js +++ b/lib/rest/ipMessaging/v1/service/channel.js @@ -51,9 +51,7 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance._version = version; // Path Solution - ChannelListInstance._solution = { - serviceSid: serviceSid - }; + ChannelListInstance._solution = {serviceSid: serviceSid}; ChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels' // jshint ignore:line )(ChannelListInstance._solution); @@ -90,11 +88,7 @@ ChannelList = function ChannelList(version, serviceSid) { 'Type': _.get(opts, 'type') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -306,18 +300,10 @@ ChannelList = function ChannelList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -352,17 +338,10 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,11 +369,7 @@ ChannelList = function ChannelList(version, serviceSid) { */ /* jshint ignore:end */ ChannelListInstance.get = function get(sid) { - return new ChannelContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ChannelContext(this._version, this._solution.serviceSid, sid); }; return ChannelListInstance; @@ -438,11 +413,7 @@ ChannelPage.prototype.constructor = ChannelPage; */ /* jshint ignore:end */ ChannelPage.prototype.getInstance = function getInstance(payload) { - return new ChannelInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ChannelInstance(this._version, payload, this._solution.serviceSid); }; @@ -493,21 +464,14 @@ ChannelInstance = function ChannelInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ChannelInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ChannelContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ChannelContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -636,10 +600,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= sid %>' // jshint ignore:line )(this._solution); @@ -665,10 +626,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { /* jshint ignore:end */ ChannelContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -705,10 +663,7 @@ ChannelContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ChannelContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -756,11 +711,7 @@ ChannelContext.prototype.update = function update(opts, callback) { 'Attributes': _.get(opts, 'attributes') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -786,11 +737,7 @@ Object.defineProperty(ChannelContext.prototype, 'members', { get: function() { if (!this._members) { - this._members = new MemberList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._members = new MemberList(this._version, this._solution.serviceSid, this._solution.sid); } return this._members; } @@ -800,11 +747,7 @@ Object.defineProperty(ChannelContext.prototype, 'messages', { get: function() { if (!this._messages) { - this._messages = new MessageList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._messages = new MessageList(this._version, this._solution.serviceSid, this._solution.sid); } return this._messages; } @@ -814,11 +757,7 @@ Object.defineProperty(ChannelContext.prototype, 'invites', { get: function() { if (!this._invites) { - this._invites = new InviteList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._invites = new InviteList(this._version, this._solution.serviceSid, this._solution.sid); } return this._invites; } diff --git a/lib/rest/ipMessaging/v1/service/channel/invite.js b/lib/rest/ipMessaging/v1/service/channel/invite.js index d9f6d46529..a361cecd8e 100644 --- a/lib/rest/ipMessaging/v1/service/channel/invite.js +++ b/lib/rest/ipMessaging/v1/service/channel/invite.js @@ -49,10 +49,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance._version = version; // Path Solution - InviteListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + InviteListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; InviteListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites' // jshint ignore:line )(InviteListInstance._solution); @@ -81,16 +78,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'RoleSid': _.get(opts, 'roleSid') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'RoleSid': _.get(opts, 'roleSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -303,18 +293,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,17 +331,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -387,12 +362,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ InviteListInstance.get = function get(sid) { - return new InviteContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new InviteContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return InviteListInstance; @@ -486,11 +456,7 @@ InviteInstance = function InviteInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(InviteInstance.prototype, @@ -559,11 +525,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,10 +546,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ InviteContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -625,10 +584,7 @@ InviteContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ InviteContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/ipMessaging/v1/service/channel/member.js b/lib/rest/ipMessaging/v1/service/channel/member.js index f8a51b8383..26dc14f0a7 100644 --- a/lib/rest/ipMessaging/v1/service/channel/member.js +++ b/lib/rest/ipMessaging/v1/service/channel/member.js @@ -49,10 +49,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance._version = version; // Path Solution - MemberListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MemberListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MemberListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members' // jshint ignore:line )(MemberListInstance._solution); @@ -81,16 +78,9 @@ MemberList = function MemberList(version, serviceSid, channelSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'RoleSid': _.get(opts, 'roleSid') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'RoleSid': _.get(opts, 'roleSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -303,18 +293,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,17 +331,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -387,12 +362,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MemberListInstance.get = function get(sid) { - return new MemberContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MemberContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MemberListInstance; @@ -488,11 +458,7 @@ MemberInstance = function MemberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MemberInstance.prototype, @@ -582,11 +548,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members/<%= sid %>' // jshint ignore:line )(this._solution); @@ -607,10 +569,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MemberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -648,10 +607,7 @@ MemberContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MemberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -698,11 +654,7 @@ MemberContext.prototype.update = function update(opts, callback) { 'LastConsumedMessageIndex': _.get(opts, 'lastConsumedMessageIndex') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( diff --git a/lib/rest/ipMessaging/v1/service/channel/message.js b/lib/rest/ipMessaging/v1/service/channel/message.js index e24664ae19..c9d5c07a31 100644 --- a/lib/rest/ipMessaging/v1/service/channel/message.js +++ b/lib/rest/ipMessaging/v1/service/channel/message.js @@ -49,10 +49,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance._version = version; // Path Solution - MessageListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MessageListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MessageListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages' // jshint ignore:line )(MessageListInstance._solution); @@ -88,11 +85,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'Attributes': _.get(opts, 'attributes') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -305,18 +298,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -351,17 +336,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -389,12 +367,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MessageListInstance.get = function get(sid) { - return new MessageContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MessageContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MessageListInstance; @@ -494,11 +467,7 @@ MessageInstance = function MessageInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MessageInstance.prototype, @@ -587,11 +556,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages/<%= sid %>' // jshint ignore:line )(this._solution); @@ -612,10 +577,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MessageContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -653,10 +615,7 @@ MessageContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MessageContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -697,16 +656,9 @@ MessageContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Body': _.get(opts, 'body'), - 'Attributes': _.get(opts, 'attributes') - }); + var data = values.of({'Body': _.get(opts, 'body'), 'Attributes': _.get(opts, 'attributes')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( diff --git a/lib/rest/ipMessaging/v1/service/role.js b/lib/rest/ipMessaging/v1/service/role.js index a58f6867fc..c02465d994 100644 --- a/lib/rest/ipMessaging/v1/service/role.js +++ b/lib/rest/ipMessaging/v1/service/role.js @@ -48,9 +48,7 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance._version = version; // Path Solution - RoleListInstance._solution = { - serviceSid: serviceSid - }; + RoleListInstance._solution = {serviceSid: serviceSid}; RoleListInstance._uri = _.template( '/Services/<%= serviceSid %>/Roles' // jshint ignore:line )(RoleListInstance._solution); @@ -92,11 +90,7 @@ RoleList = function RoleList(version, serviceSid) { 'Permission': _.get(opts, 'permission') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -300,18 +294,10 @@ RoleList = function RoleList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -345,17 +331,10 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -383,11 +362,7 @@ RoleList = function RoleList(version, serviceSid) { */ /* jshint ignore:end */ RoleListInstance.get = function get(sid) { - return new RoleContext( - this._version, - this._solution.serviceSid, - sid - ); + return new RoleContext(this._version, this._solution.serviceSid, sid); }; return RoleListInstance; @@ -431,11 +406,7 @@ RolePage.prototype.constructor = RolePage; */ /* jshint ignore:end */ RolePage.prototype.getInstance = function getInstance(payload) { - return new RoleInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new RoleInstance(this._version, payload, this._solution.serviceSid); }; @@ -476,21 +447,14 @@ RoleInstance = function RoleInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(RoleInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RoleContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new RoleContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -565,10 +529,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Roles/<%= sid %>' // jshint ignore:line )(this._solution); @@ -589,10 +550,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { /* jshint ignore:end */ RoleContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -629,10 +587,7 @@ RoleContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RoleContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -673,15 +628,9 @@ RoleContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Permission': _.get(opts, 'permission') - }); + var data = values.of({'Permission': _.get(opts, 'permission')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( diff --git a/lib/rest/ipMessaging/v1/service/user.js b/lib/rest/ipMessaging/v1/service/user.js index 38aa9af65d..4a147f6a3d 100644 --- a/lib/rest/ipMessaging/v1/service/user.js +++ b/lib/rest/ipMessaging/v1/service/user.js @@ -49,9 +49,7 @@ UserList = function UserList(version, serviceSid) { UserListInstance._version = version; // Path Solution - UserListInstance._solution = { - serviceSid: serviceSid - }; + UserListInstance._solution = {serviceSid: serviceSid}; UserListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users' // jshint ignore:line )(UserListInstance._solution); @@ -89,11 +87,7 @@ UserList = function UserList(version, serviceSid) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -297,18 +291,10 @@ UserList = function UserList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,17 +328,10 @@ UserList = function UserList(version, serviceSid) { UserListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,11 +359,7 @@ UserList = function UserList(version, serviceSid) { */ /* jshint ignore:end */ UserListInstance.get = function get(sid) { - return new UserContext( - this._version, - this._solution.serviceSid, - sid - ); + return new UserContext(this._version, this._solution.serviceSid, sid); }; return UserListInstance; @@ -428,11 +403,7 @@ UserPage.prototype.constructor = UserPage; */ /* jshint ignore:end */ UserPage.prototype.getInstance = function getInstance(payload) { - return new UserInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new UserInstance(this._version, payload, this._solution.serviceSid); }; @@ -483,21 +454,14 @@ UserInstance = function UserInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(UserInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new UserContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new UserContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -592,10 +556,7 @@ UserContext = function UserContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= sid %>' // jshint ignore:line )(this._solution); @@ -619,10 +580,7 @@ UserContext = function UserContext(version, serviceSid, sid) { /* jshint ignore:end */ UserContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -659,10 +617,7 @@ UserContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ UserContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -710,11 +665,7 @@ UserContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( diff --git a/lib/rest/ipMessaging/v1/service/user/userChannel.js b/lib/rest/ipMessaging/v1/service/user/userChannel.js index fc690f44e5..4dac83f69f 100644 --- a/lib/rest/ipMessaging/v1/service/user/userChannel.js +++ b/lib/rest/ipMessaging/v1/service/user/userChannel.js @@ -48,10 +48,7 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance._version = version; // Path Solution - UserChannelListInstance._solution = { - serviceSid: serviceSid, - userSid: userSid - }; + UserChannelListInstance._solution = {serviceSid: serviceSid, userSid: userSid}; UserChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels' // jshint ignore:line )(UserChannelListInstance._solution); @@ -237,18 +234,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +271,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,10 +372,7 @@ UserChannelInstance = function UserChannelInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - userSid: userSid, - }; + this._solution = {serviceSid: serviceSid, userSid: userSid,}; }; module.exports = { diff --git a/lib/rest/ipMessaging/v2/credential.js b/lib/rest/ipMessaging/v2/credential.js index acc99d87a3..34b26060c3 100644 --- a/lib/rest/ipMessaging/v2/credential.js +++ b/lib/rest/ipMessaging/v2/credential.js @@ -234,18 +234,10 @@ CredentialList = function CredentialList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -279,17 +271,10 @@ CredentialList = function CredentialList(version) { CredentialListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -343,18 +328,10 @@ CredentialList = function CredentialList(version) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -382,10 +359,7 @@ CredentialList = function CredentialList(version) { */ /* jshint ignore:end */ CredentialListInstance.get = function get(sid) { - return new CredentialContext( - this._version, - sid - ); + return new CredentialContext(this._version, sid); }; return CredentialListInstance; @@ -429,10 +403,7 @@ CredentialPage.prototype.constructor = CredentialPage; */ /* jshint ignore:end */ CredentialPage.prototype.getInstance = function getInstance(payload) { - return new CredentialInstance( - this._version, - payload - ); + return new CredentialInstance(this._version, payload); }; @@ -470,19 +441,14 @@ CredentialInstance = function CredentialInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CredentialInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CredentialContext( - this._version, - this._solution.sid - ); + this._context = new CredentialContext(this._version, this._solution.sid); } return this._context; @@ -561,9 +527,7 @@ CredentialContext = function CredentialContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Credentials/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,17 +548,10 @@ CredentialContext = function CredentialContext(version, sid) { /* jshint ignore:end */ CredentialContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -645,18 +602,10 @@ CredentialContext.prototype.update = function update(opts, callback) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -685,10 +634,7 @@ CredentialContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/ipMessaging/v2/service.js b/lib/rest/ipMessaging/v2/service.js index f9aab7607c..8c429c0583 100644 --- a/lib/rest/ipMessaging/v2/service.js +++ b/lib/rest/ipMessaging/v2/service.js @@ -11,6 +11,7 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ +var BindingList = require('./service/binding').BindingList; var ChannelList = require('./service/channel').ChannelList; var Page = require('../../../base/Page'); /* jshint ignore:line */ var RoleList = require('./service/role').RoleList; @@ -79,22 +80,12 @@ ServiceList = function ServiceList(version) { } var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -290,18 +281,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +318,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,10 +349,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -420,10 +393,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -492,19 +462,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -654,6 +619,21 @@ ServiceInstance.prototype.users = function users() { return this._proxy.users; }; +/* jshint ignore:start */ +/** + * Access the bindings + * + * @function bindings + * @memberof Twilio.IpMessaging.V2.ServiceInstance + * @instance + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.BindingList} + */ +/* jshint ignore:end */ +ServiceInstance.prototype.bindings = function bindings() { + return this._proxy.bindings; +}; + /* jshint ignore:start */ /** @@ -664,6 +644,8 @@ ServiceInstance.prototype.users = function users() { * channels resource * @property {Twilio.IpMessaging.V2.ServiceContext.RoleList} roles - roles resource * @property {Twilio.IpMessaging.V2.ServiceContext.UserList} users - users resource + * @property {Twilio.IpMessaging.V2.ServiceContext.BindingList} bindings - + * bindings resource * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {sid} sid - The sid @@ -673,9 +655,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -684,6 +664,7 @@ ServiceContext = function ServiceContext(version, sid) { this._channels = undefined; this._roles = undefined; this._users = undefined; + this._bindings = undefined; }; /* jshint ignore:start */ @@ -701,17 +682,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -740,10 +714,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -861,18 +832,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'PostWebhookRetryCount': _.get(opts, 'postWebhookRetryCount') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -890,10 +853,7 @@ Object.defineProperty(ServiceContext.prototype, 'channels', { get: function() { if (!this._channels) { - this._channels = new ChannelList( - this._version, - this._solution.sid - ); + this._channels = new ChannelList(this._version, this._solution.sid); } return this._channels; } @@ -903,10 +863,7 @@ Object.defineProperty(ServiceContext.prototype, 'roles', { get: function() { if (!this._roles) { - this._roles = new RoleList( - this._version, - this._solution.sid - ); + this._roles = new RoleList(this._version, this._solution.sid); } return this._roles; } @@ -916,15 +873,22 @@ Object.defineProperty(ServiceContext.prototype, 'users', { get: function() { if (!this._users) { - this._users = new UserList( - this._version, - this._solution.sid - ); + this._users = new UserList(this._version, this._solution.sid); } return this._users; } }); +Object.defineProperty(ServiceContext.prototype, + 'bindings', { + get: function() { + if (!this._bindings) { + this._bindings = new BindingList(this._version, this._solution.sid); + } + return this._bindings; + } +}); + module.exports = { ServiceList: ServiceList, ServicePage: ServicePage, diff --git a/lib/rest/ipMessaging/v2/service/binding.js b/lib/rest/ipMessaging/v2/service/binding.js new file mode 100644 index 0000000000..d3592223fe --- /dev/null +++ b/lib/rest/ipMessaging/v2/service/binding.js @@ -0,0 +1,553 @@ +'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 values = require('../../../../base/values'); /* jshint ignore:line */ + +var BindingList; +var BindingPage; +var BindingInstance; +var BindingContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.BindingList + * @description Initialize the BindingList + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {string} serviceSid - The service_sid + */ +/* jshint ignore:end */ +BindingList = function BindingList(version, serviceSid) { + /* jshint ignore:start */ + /** + * @function bindings + * @memberof Twilio.IpMessaging.V2.ServiceContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.BindingContext} + */ + /* jshint ignore:end */ + function BindingListInstance(sid) { + return BindingListInstance.get(sid); + } + + BindingListInstance._version = version; + // Path Solution + BindingListInstance._solution = {serviceSid: serviceSid}; + BindingListInstance._uri = _.template( + '/Services/<%= serviceSid %>/Bindings' // jshint ignore:line + )(BindingListInstance._solution); + /* jshint ignore:start */ + /** + * Streams BindingInstance 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.BindingList + * @instance + * + * @param {object|function} opts - ... + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.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 BindingInstance 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.BindingList + * @instance + * + * @param {object|function} opts - ... + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.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 BindingInstance 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.BindingList + * @instance + * + * @param {object|function} opts - ... + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.page = function page(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'BindingType': _.get(opts, 'bindingType'), + 'Identity': _.get(opts, 'identity'), + '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 BindingPage(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 BindingInstance 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.BindingList + * @instance + * + * @param {binding.binding_type|list} [opts.bindingType] - The binding_type + * @param {string|list} [opts.identity] - The identity + * @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 */ + BindingListInstance.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 BindingPage(this._version, payload, this._solution)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a binding + * + * @function get + * @memberof Twilio.IpMessaging.V2.ServiceContext.BindingList + * @instance + * + * @param {string} sid - The sid + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.BindingContext} + */ + /* jshint ignore:end */ + BindingListInstance.get = function get(sid) { + return new BindingContext(this._version, this._solution.serviceSid, sid); + }; + + return BindingListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.BindingPage + * @augments Page + * @description Initialize the BindingPage + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns BindingPage + */ +/* jshint ignore:end */ +BindingPage = function BindingPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(BindingPage.prototype, Page.prototype); +BindingPage.prototype.constructor = BindingPage; + +/* jshint ignore:start */ +/** + * Build an instance of BindingInstance + * + * @function getInstance + * @memberof Twilio.IpMessaging.V2.ServiceContext.BindingPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns BindingInstance + */ +/* jshint ignore:end */ +BindingPage.prototype.getInstance = function getInstance(payload) { + return new BindingInstance(this._version, payload, this._solution.serviceSid); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.BindingInstance + * @description Initialize the BindingContext + * + * @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} endpoint - The endpoint + * @property {string} identity - The identity + * @property {string} credentialSid - The credential_sid + * @property {binding.binding_type} bindingType - The binding_type + * @property {string} messageTypes - The message_types + * @property {string} url - The url + * @property {string} links - The links + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} serviceSid - The service_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +BindingInstance = function BindingInstance(version, payload, serviceSid, 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.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line + this.endpoint = payload.endpoint; // jshint ignore:line + this.identity = payload.identity; // jshint ignore:line + this.credentialSid = payload.credential_sid; // jshint ignore:line + this.bindingType = payload.binding_type; // jshint ignore:line + this.messageTypes = payload.message_types; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + this.links = payload.links; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; +}; + +Object.defineProperty(BindingInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new BindingContext(this._version, this._solution.serviceSid, this._solution.sid); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a BindingInstance + * + * @function fetch + * @memberof Twilio.IpMessaging.V2.ServiceContext.BindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * remove a BindingInstance + * + * @function remove + * @memberof Twilio.IpMessaging.V2.ServiceContext.BindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingInstance.prototype.remove = function remove(callback) { + return this._proxy.remove(callback); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.BindingContext + * @description Initialize the BindingContext + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {sid} serviceSid - The service_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +BindingContext = function BindingContext(version, serviceSid, sid) { + this._version = version; + + // Path Solution + this._solution = {serviceSid: serviceSid, sid: sid,}; + this._uri = _.template( + '/Services/<%= serviceSid %>/Bindings/<%= sid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a BindingInstance + * + * @function fetch + * @memberof Twilio.IpMessaging.V2.ServiceContext.BindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingContext.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 BindingInstance( + this._version, + payload, + this._solution.serviceSid, + 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 BindingInstance + * + * @function remove + * @memberof Twilio.IpMessaging.V2.ServiceContext.BindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed BindingInstance + */ +/* jshint ignore:end */ +BindingContext.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 = { + BindingList: BindingList, + BindingPage: BindingPage, + BindingInstance: BindingInstance, + BindingContext: BindingContext +}; diff --git a/lib/rest/ipMessaging/v2/service/channel.js b/lib/rest/ipMessaging/v2/service/channel.js index c87dbea325..44466f590a 100644 --- a/lib/rest/ipMessaging/v2/service/channel.js +++ b/lib/rest/ipMessaging/v2/service/channel.js @@ -52,9 +52,7 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance._version = version; // Path Solution - ChannelListInstance._solution = { - serviceSid: serviceSid - }; + ChannelListInstance._solution = {serviceSid: serviceSid}; ChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels' // jshint ignore:line )(ChannelListInstance._solution); @@ -97,11 +95,7 @@ ChannelList = function ChannelList(version, serviceSid) { 'CreatedBy': _.get(opts, 'createdBy') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -313,18 +307,10 @@ ChannelList = function ChannelList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -359,17 +345,10 @@ ChannelList = function ChannelList(version, serviceSid) { ChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -397,11 +376,7 @@ ChannelList = function ChannelList(version, serviceSid) { */ /* jshint ignore:end */ ChannelListInstance.get = function get(sid) { - return new ChannelContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ChannelContext(this._version, this._solution.serviceSid, sid); }; return ChannelListInstance; @@ -445,11 +420,7 @@ ChannelPage.prototype.constructor = ChannelPage; */ /* jshint ignore:end */ ChannelPage.prototype.getInstance = function getInstance(payload) { - return new ChannelInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ChannelInstance(this._version, payload, this._solution.serviceSid); }; @@ -500,21 +471,14 @@ ChannelInstance = function ChannelInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ChannelInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ChannelContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ChannelContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -646,10 +610,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= sid %>' // jshint ignore:line )(this._solution); @@ -675,10 +636,7 @@ ChannelContext = function ChannelContext(version, serviceSid, sid) { /* jshint ignore:end */ ChannelContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -715,10 +673,7 @@ ChannelContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ChannelContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -772,11 +727,7 @@ ChannelContext.prototype.update = function update(opts, callback) { 'CreatedBy': _.get(opts, 'createdBy') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ChannelInstance( @@ -802,11 +753,7 @@ Object.defineProperty(ChannelContext.prototype, 'members', { get: function() { if (!this._members) { - this._members = new MemberList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._members = new MemberList(this._version, this._solution.serviceSid, this._solution.sid); } return this._members; } @@ -816,11 +763,7 @@ Object.defineProperty(ChannelContext.prototype, 'messages', { get: function() { if (!this._messages) { - this._messages = new MessageList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._messages = new MessageList(this._version, this._solution.serviceSid, this._solution.sid); } return this._messages; } @@ -830,11 +773,7 @@ Object.defineProperty(ChannelContext.prototype, 'invites', { get: function() { if (!this._invites) { - this._invites = new InviteList( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._invites = new InviteList(this._version, this._solution.serviceSid, this._solution.sid); } return this._invites; } diff --git a/lib/rest/ipMessaging/v2/service/channel/invite.js b/lib/rest/ipMessaging/v2/service/channel/invite.js index e12675af09..8ca61b6e18 100644 --- a/lib/rest/ipMessaging/v2/service/channel/invite.js +++ b/lib/rest/ipMessaging/v2/service/channel/invite.js @@ -49,10 +49,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance._version = version; // Path Solution - InviteListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + InviteListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; InviteListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites' // jshint ignore:line )(InviteListInstance._solution); @@ -81,16 +78,9 @@ InviteList = function InviteList(version, serviceSid, channelSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'RoleSid': _.get(opts, 'roleSid') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'RoleSid': _.get(opts, 'roleSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -303,18 +293,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,17 +331,10 @@ InviteList = function InviteList(version, serviceSid, channelSid) { InviteListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InvitePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InvitePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -387,12 +362,7 @@ InviteList = function InviteList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ InviteListInstance.get = function get(sid) { - return new InviteContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new InviteContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return InviteListInstance; @@ -486,11 +456,7 @@ InviteInstance = function InviteInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(InviteInstance.prototype, @@ -559,11 +525,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites/<%= sid %>' // jshint ignore:line )(this._solution); @@ -584,10 +546,7 @@ InviteContext = function InviteContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ InviteContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InviteInstance( @@ -625,10 +584,7 @@ InviteContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ InviteContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/ipMessaging/v2/service/channel/member.js b/lib/rest/ipMessaging/v2/service/channel/member.js index 734085d1cb..241b83e570 100644 --- a/lib/rest/ipMessaging/v2/service/channel/member.js +++ b/lib/rest/ipMessaging/v2/service/channel/member.js @@ -51,10 +51,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance._version = version; // Path Solution - MemberListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MemberListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MemberListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members' // jshint ignore:line )(MemberListInstance._solution); @@ -97,11 +94,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { 'DateUpdated': serialize.iso8601DateTime(_.get(opts, 'dateUpdated')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -314,18 +307,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,17 +345,10 @@ MemberList = function MemberList(version, serviceSid, channelSid) { MemberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MemberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MemberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -398,12 +376,7 @@ MemberList = function MemberList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MemberListInstance.get = function get(sid) { - return new MemberContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MemberContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MemberListInstance; @@ -499,11 +472,7 @@ MemberInstance = function MemberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MemberInstance.prototype, @@ -596,11 +565,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members/<%= sid %>' // jshint ignore:line )(this._solution); @@ -621,10 +586,7 @@ MemberContext = function MemberContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MemberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( @@ -662,10 +624,7 @@ MemberContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MemberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -718,11 +677,7 @@ MemberContext.prototype.update = function update(opts, callback) { 'DateUpdated': serialize.iso8601DateTime(_.get(opts, 'dateUpdated')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MemberInstance( diff --git a/lib/rest/ipMessaging/v2/service/channel/message.js b/lib/rest/ipMessaging/v2/service/channel/message.js index 69dcb8328f..841a4f0e88 100644 --- a/lib/rest/ipMessaging/v2/service/channel/message.js +++ b/lib/rest/ipMessaging/v2/service/channel/message.js @@ -51,10 +51,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance._version = version; // Path Solution - MessageListInstance._solution = { - serviceSid: serviceSid, - channelSid: channelSid - }; + MessageListInstance._solution = {serviceSid: serviceSid, channelSid: channelSid}; MessageListInstance._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages' // jshint ignore:line )(MessageListInstance._solution); @@ -97,11 +94,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'MediaSid': _.get(opts, 'mediaSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -314,18 +307,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,17 +345,10 @@ MessageList = function MessageList(version, serviceSid, channelSid) { MessageListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessagePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessagePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -398,12 +376,7 @@ MessageList = function MessageList(version, serviceSid, channelSid) { */ /* jshint ignore:end */ MessageListInstance.get = function get(sid) { - return new MessageContext( - this._version, - this._solution.serviceSid, - this._solution.channelSid, - sid - ); + return new MessageContext(this._version, this._solution.serviceSid, this._solution.channelSid, sid); }; return MessageListInstance; @@ -509,11 +482,7 @@ MessageInstance = function MessageInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid || this.sid,}; }; Object.defineProperty(MessageInstance.prototype, @@ -605,11 +574,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - channelSid: channelSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, channelSid: channelSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages/<%= sid %>' // jshint ignore:line )(this._solution); @@ -630,10 +595,7 @@ MessageContext = function MessageContext(version, serviceSid, channelSid, sid) { /* jshint ignore:end */ MessageContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( @@ -671,10 +633,7 @@ MessageContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ MessageContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -726,11 +685,7 @@ MessageContext.prototype.update = function update(opts, callback) { 'LastUpdatedBy': _.get(opts, 'lastUpdatedBy') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInstance( diff --git a/lib/rest/ipMessaging/v2/service/role.js b/lib/rest/ipMessaging/v2/service/role.js index 9b15516d50..856d1d4672 100644 --- a/lib/rest/ipMessaging/v2/service/role.js +++ b/lib/rest/ipMessaging/v2/service/role.js @@ -48,9 +48,7 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance._version = version; // Path Solution - RoleListInstance._solution = { - serviceSid: serviceSid - }; + RoleListInstance._solution = {serviceSid: serviceSid}; RoleListInstance._uri = _.template( '/Services/<%= serviceSid %>/Roles' // jshint ignore:line )(RoleListInstance._solution); @@ -92,11 +90,7 @@ RoleList = function RoleList(version, serviceSid) { 'Permission': _.get(opts, 'permission') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -300,18 +294,10 @@ RoleList = function RoleList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -345,17 +331,10 @@ RoleList = function RoleList(version, serviceSid) { RoleListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RolePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RolePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -383,11 +362,7 @@ RoleList = function RoleList(version, serviceSid) { */ /* jshint ignore:end */ RoleListInstance.get = function get(sid) { - return new RoleContext( - this._version, - this._solution.serviceSid, - sid - ); + return new RoleContext(this._version, this._solution.serviceSid, sid); }; return RoleListInstance; @@ -431,11 +406,7 @@ RolePage.prototype.constructor = RolePage; */ /* jshint ignore:end */ RolePage.prototype.getInstance = function getInstance(payload) { - return new RoleInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new RoleInstance(this._version, payload, this._solution.serviceSid); }; @@ -476,21 +447,14 @@ RoleInstance = function RoleInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(RoleInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RoleContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new RoleContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -565,10 +529,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Roles/<%= sid %>' // jshint ignore:line )(this._solution); @@ -589,10 +550,7 @@ RoleContext = function RoleContext(version, serviceSid, sid) { /* jshint ignore:end */ RoleContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( @@ -629,10 +587,7 @@ RoleContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RoleContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -673,15 +628,9 @@ RoleContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Permission': _.get(opts, 'permission') - }); + var data = values.of({'Permission': _.get(opts, 'permission')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new RoleInstance( diff --git a/lib/rest/ipMessaging/v2/service/user.js b/lib/rest/ipMessaging/v2/service/user.js index 440fd85621..a720dfcfd4 100644 --- a/lib/rest/ipMessaging/v2/service/user.js +++ b/lib/rest/ipMessaging/v2/service/user.js @@ -12,6 +12,7 @@ var Q = require('q'); /* jshint ignore:line */ var _ = require('lodash'); /* jshint ignore:line */ var Page = require('../../../../base/Page'); /* jshint ignore:line */ +var UserBindingList = require('./user/userBinding').UserBindingList; var UserChannelList = require('./user/userChannel').UserChannelList; var deserialize = require( '../../../../base/deserialize'); /* jshint ignore:line */ @@ -49,9 +50,7 @@ UserList = function UserList(version, serviceSid) { UserListInstance._version = version; // Path Solution - UserListInstance._solution = { - serviceSid: serviceSid - }; + UserListInstance._solution = {serviceSid: serviceSid}; UserListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users' // jshint ignore:line )(UserListInstance._solution); @@ -89,11 +88,7 @@ UserList = function UserList(version, serviceSid) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -297,18 +292,10 @@ UserList = function UserList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,17 +329,10 @@ UserList = function UserList(version, serviceSid) { UserListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,11 +360,7 @@ UserList = function UserList(version, serviceSid) { */ /* jshint ignore:end */ UserListInstance.get = function get(sid) { - return new UserContext( - this._version, - this._solution.serviceSid, - sid - ); + return new UserContext(this._version, this._solution.serviceSid, sid); }; return UserListInstance; @@ -428,11 +404,7 @@ UserPage.prototype.constructor = UserPage; */ /* jshint ignore:end */ UserPage.prototype.getInstance = function getInstance(payload) { - return new UserInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new UserInstance(this._version, payload, this._solution.serviceSid); }; @@ -483,21 +455,14 @@ UserInstance = function UserInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(UserInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new UserContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new UserContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -574,6 +539,21 @@ UserInstance.prototype.userChannels = function userChannels() { return this._proxy.userChannels; }; +/* jshint ignore:start */ +/** + * Access the userBindings + * + * @function userBindings + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserInstance + * @instance + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingList} + */ +/* jshint ignore:end */ +UserInstance.prototype.userBindings = function userBindings() { + return this._proxy.userBindings; +}; + /* jshint ignore:start */ /** @@ -582,6 +562,8 @@ UserInstance.prototype.userChannels = function userChannels() { * * @property {Twilio.IpMessaging.V2.ServiceContext.UserContext.UserChannelList} userChannels - * userChannels resource + * @property {Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingList} userBindings - + * userBindings resource * * @param {Twilio.IpMessaging.V2} version - Version of the resource * @param {sid} serviceSid - The service_sid @@ -592,16 +574,14 @@ UserContext = function UserContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= sid %>' // jshint ignore:line )(this._solution); // Dependents this._userChannels = undefined; + this._userBindings = undefined; }; /* jshint ignore:start */ @@ -619,10 +599,7 @@ UserContext = function UserContext(version, serviceSid, sid) { /* jshint ignore:end */ UserContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -659,10 +636,7 @@ UserContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ UserContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -710,11 +684,7 @@ UserContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -750,6 +720,20 @@ Object.defineProperty(UserContext.prototype, } }); +Object.defineProperty(UserContext.prototype, + 'userBindings', { + get: function() { + if (!this._userBindings) { + this._userBindings = new UserBindingList( + this._version, + this._solution.serviceSid, + this._solution.sid + ); + } + return this._userBindings; + } +}); + module.exports = { UserList: UserList, UserPage: UserPage, diff --git a/lib/rest/ipMessaging/v2/service/user/userBinding.js b/lib/rest/ipMessaging/v2/service/user/userBinding.js new file mode 100644 index 0000000000..c2967825a3 --- /dev/null +++ b/lib/rest/ipMessaging/v2/service/user/userBinding.js @@ -0,0 +1,564 @@ +'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 values = require('../../../../../base/values'); /* jshint ignore:line */ + +var UserBindingList; +var UserBindingPage; +var UserBindingInstance; +var UserBindingContext; + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingList + * @description Initialize the UserBindingList + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {string} serviceSid - The service_sid + * @param {string} userSid - The user_sid + */ +/* jshint ignore:end */ +UserBindingList = function UserBindingList(version, serviceSid, userSid) { + /* jshint ignore:start */ + /** + * @function userBindings + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext + * @instance + * + * @param {string} sid - sid of instance + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingContext} + */ + /* jshint ignore:end */ + function UserBindingListInstance(sid) { + return UserBindingListInstance.get(sid); + } + + UserBindingListInstance._version = version; + // Path Solution + UserBindingListInstance._solution = {serviceSid: serviceSid, userSid: userSid}; + UserBindingListInstance._uri = _.template( + '/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings' // jshint ignore:line + )(UserBindingListInstance._solution); + /* jshint ignore:start */ + /** + * Streams UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {object|function} opts - ... + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.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 UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {object|function} opts - ... + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.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 UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {object|function} opts - ... + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.page = function page(opts, callback) { + if (_.isFunction(opts)) { + callback = opts; + opts = {}; + } + opts = opts || {}; + + var deferred = Q.defer(); + var data = values.of({ + 'BindingType': _.get(opts, 'bindingType'), + '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 UserBindingPage(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 UserBindingInstance 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.UserContext.UserBindingList + * @instance + * + * @param {user_binding.binding_type|list} [opts.bindingType] - The binding_type + * @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 */ + UserBindingListInstance.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 UserBindingPage(this._version, payload, this._solution)); + }.bind(this)); + + promise.catch(function(error) { + deferred.reject(error); + }); + + if (_.isFunction(callback)) { + deferred.promise.nodeify(callback); + } + + return deferred.promise; + }; + + /* jshint ignore:start */ + /** + * Constructs a user_binding + * + * @function get + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingList + * @instance + * + * @param {string} sid - The sid + * + * @returns {Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingContext} + */ + /* jshint ignore:end */ + UserBindingListInstance.get = function get(sid) { + return new UserBindingContext(this._version, this._solution.serviceSid, this._solution.userSid, sid); + }; + + return UserBindingListInstance; +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingPage + * @augments Page + * @description Initialize the UserBindingPage + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {object} response - Response from the API + * @param {object} solution - Path solution + * + * @returns UserBindingPage + */ +/* jshint ignore:end */ +UserBindingPage = function UserBindingPage(version, response, solution) { + // Path Solution + this._solution = solution; + + Page.prototype.constructor.call(this, version, response, this._solution); +}; + +_.extend(UserBindingPage.prototype, Page.prototype); +UserBindingPage.prototype.constructor = UserBindingPage; + +/* jshint ignore:start */ +/** + * Build an instance of UserBindingInstance + * + * @function getInstance + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingPage + * @instance + * + * @param {object} payload - Payload response from the API + * + * @returns UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingPage.prototype.getInstance = function getInstance(payload) { + return new UserBindingInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid + ); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingInstance + * @description Initialize the UserBindingContext + * + * @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} endpoint - The endpoint + * @property {string} identity - The identity + * @property {string} userSid - The user_sid + * @property {string} credentialSid - The credential_sid + * @property {user_binding.binding_type} bindingType - The binding_type + * @property {string} messageTypes - The message_types + * @property {string} url - The url + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {object} payload - The instance payload + * @param {sid} serviceSid - The service_sid + * @param {sid_like} userSid - The user_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +UserBindingInstance = function UserBindingInstance(version, payload, serviceSid, + userSid, 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.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line + this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line + this.endpoint = payload.endpoint; // jshint ignore:line + this.identity = payload.identity; // jshint ignore:line + this.userSid = payload.user_sid; // jshint ignore:line + this.credentialSid = payload.credential_sid; // jshint ignore:line + this.bindingType = payload.binding_type; // jshint ignore:line + this.messageTypes = payload.message_types; // jshint ignore:line + this.url = payload.url; // jshint ignore:line + + // Context + this._context = undefined; + this._solution = {serviceSid: serviceSid, userSid: userSid, sid: sid || this.sid,}; +}; + +Object.defineProperty(UserBindingInstance.prototype, + '_proxy', { + get: function() { + if (!this._context) { + this._context = new UserBindingContext( + this._version, + this._solution.serviceSid, + this._solution.userSid, + this._solution.sid + ); + } + + return this._context; + } +}); + +/* jshint ignore:start */ +/** + * fetch a UserBindingInstance + * + * @function fetch + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingInstance.prototype.fetch = function fetch(callback) { + return this._proxy.fetch(callback); +}; + +/* jshint ignore:start */ +/** + * remove a UserBindingInstance + * + * @function remove + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingInstance + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingInstance.prototype.remove = function remove(callback) { + return this._proxy.remove(callback); +}; + + +/* jshint ignore:start */ +/** + * @constructor Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingContext + * @description Initialize the UserBindingContext + * + * @param {Twilio.IpMessaging.V2} version - Version of the resource + * @param {sid} serviceSid - The service_sid + * @param {sid_like} userSid - The user_sid + * @param {sid} sid - The sid + */ +/* jshint ignore:end */ +UserBindingContext = function UserBindingContext(version, serviceSid, userSid, + sid) { + this._version = version; + + // Path Solution + this._solution = {serviceSid: serviceSid, userSid: userSid, sid: sid,}; + this._uri = _.template( + '/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings/<%= sid %>' // jshint ignore:line + )(this._solution); +}; + +/* jshint ignore:start */ +/** + * fetch a UserBindingInstance + * + * @function fetch + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingContext.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 UserBindingInstance( + this._version, + payload, + this._solution.serviceSid, + this._solution.userSid, + 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 UserBindingInstance + * + * @function remove + * @memberof Twilio.IpMessaging.V2.ServiceContext.UserContext.UserBindingContext + * @instance + * + * @param {function} [callback] - Callback to handle processed record + * + * @returns {Promise} Resolves to processed UserBindingInstance + */ +/* jshint ignore:end */ +UserBindingContext.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 = { + UserBindingList: UserBindingList, + UserBindingPage: UserBindingPage, + UserBindingInstance: UserBindingInstance, + UserBindingContext: UserBindingContext +}; diff --git a/lib/rest/ipMessaging/v2/service/user/userChannel.js b/lib/rest/ipMessaging/v2/service/user/userChannel.js index c768033f57..a69b9648bb 100644 --- a/lib/rest/ipMessaging/v2/service/user/userChannel.js +++ b/lib/rest/ipMessaging/v2/service/user/userChannel.js @@ -48,10 +48,7 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance._version = version; // Path Solution - UserChannelListInstance._solution = { - serviceSid: serviceSid, - userSid: userSid - }; + UserChannelListInstance._solution = {serviceSid: serviceSid, userSid: userSid}; UserChannelListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= userSid %>/Channels' // jshint ignore:line )(UserChannelListInstance._solution); @@ -237,18 +234,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +271,10 @@ UserChannelList = function UserChannelList(version, serviceSid, userSid) { UserChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,10 +372,7 @@ UserChannelInstance = function UserChannelInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - userSid: userSid, - }; + this._solution = {serviceSid: serviceSid, userSid: userSid,}; }; module.exports = { diff --git a/lib/rest/lookups/v1/phoneNumber.js b/lib/rest/lookups/v1/phoneNumber.js index 1ac5068172..a9f924c8a8 100644 --- a/lib/rest/lookups/v1/phoneNumber.js +++ b/lib/rest/lookups/v1/phoneNumber.js @@ -61,10 +61,7 @@ PhoneNumberList = function PhoneNumberList(version) { */ /* jshint ignore:end */ PhoneNumberListInstance.get = function get(phoneNumber) { - return new PhoneNumberContext( - this._version, - phoneNumber - ); + return new PhoneNumberContext(this._version, phoneNumber); }; return PhoneNumberListInstance; @@ -108,10 +105,7 @@ PhoneNumberPage.prototype.constructor = PhoneNumberPage; */ /* jshint ignore:end */ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new PhoneNumberInstance( - this._version, - payload - ); + return new PhoneNumberInstance(this._version, payload); }; @@ -148,19 +142,14 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload, // Context this._context = undefined; - this._solution = { - phoneNumber: phoneNumber || this.phoneNumber, - }; + this._solution = {phoneNumber: phoneNumber || this.phoneNumber,}; }; Object.defineProperty(PhoneNumberInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new PhoneNumberContext( - this._version, - this._solution.phoneNumber - ); + this._context = new PhoneNumberContext(this._version, this._solution.phoneNumber); } return this._context; @@ -203,9 +192,7 @@ PhoneNumberContext = function PhoneNumberContext(version, phoneNumber) { this._version = version; // Path Solution - this._solution = { - phoneNumber: phoneNumber, - }; + this._solution = {phoneNumber: phoneNumber,}; this._uri = _.template( '/PhoneNumbers/<%= phoneNumber %>' // jshint ignore:line )(this._solution); @@ -244,18 +231,10 @@ PhoneNumberContext.prototype.fetch = function fetch(opts, callback) { }); _.extend(data, serialize.prefixedCollapsibleMap(opts.addOnsData, 'AddOns')); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberInstance( - this._version, - payload, - this._solution.phoneNumber - )); + deferred.resolve(new PhoneNumberInstance(this._version, payload, this._solution.phoneNumber)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/messaging/v1/service.js b/lib/rest/messaging/v1/service.js index 3029acc082..c3f42ff590 100644 --- a/lib/rest/messaging/v1/service.js +++ b/lib/rest/messaging/v1/service.js @@ -111,18 +111,10 @@ ServiceList = function ServiceList(version) { 'SynchronousValidation': serialize.bool(_.get(opts, 'synchronousValidation')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -318,18 +310,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -363,17 +347,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -401,10 +378,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -449,10 +423,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -516,19 +487,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -669,9 +635,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -736,18 +700,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'SynchronousValidation': serialize.bool(_.get(opts, 'synchronousValidation')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -776,17 +732,10 @@ ServiceContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -815,10 +764,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -839,10 +785,7 @@ Object.defineProperty(ServiceContext.prototype, 'phoneNumbers', { get: function() { if (!this._phoneNumbers) { - this._phoneNumbers = new PhoneNumberList( - this._version, - this._solution.sid - ); + this._phoneNumbers = new PhoneNumberList(this._version, this._solution.sid); } return this._phoneNumbers; } @@ -852,10 +795,7 @@ Object.defineProperty(ServiceContext.prototype, 'shortCodes', { get: function() { if (!this._shortCodes) { - this._shortCodes = new ShortCodeList( - this._version, - this._solution.sid - ); + this._shortCodes = new ShortCodeList(this._version, this._solution.sid); } return this._shortCodes; } @@ -865,10 +805,7 @@ Object.defineProperty(ServiceContext.prototype, 'alphaSenders', { get: function() { if (!this._alphaSenders) { - this._alphaSenders = new AlphaSenderList( - this._version, - this._solution.sid - ); + this._alphaSenders = new AlphaSenderList(this._version, this._solution.sid); } return this._alphaSenders; } diff --git a/lib/rest/messaging/v1/service/alphaSender.js b/lib/rest/messaging/v1/service/alphaSender.js index 75c58ed73a..08b019c224 100644 --- a/lib/rest/messaging/v1/service/alphaSender.js +++ b/lib/rest/messaging/v1/service/alphaSender.js @@ -49,9 +49,7 @@ AlphaSenderList = function AlphaSenderList(version, serviceSid) { AlphaSenderListInstance._version = version; // Path Solution - AlphaSenderListInstance._solution = { - serviceSid: serviceSid - }; + AlphaSenderListInstance._solution = {serviceSid: serviceSid}; AlphaSenderListInstance._uri = _.template( '/Services/<%= serviceSid %>/AlphaSenders' // jshint ignore:line )(AlphaSenderListInstance._solution); @@ -79,15 +77,9 @@ AlphaSenderList = function AlphaSenderList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'AlphaSender': _.get(opts, 'alphaSender') - }); + var data = values.of({'AlphaSender': _.get(opts, 'alphaSender')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new AlphaSenderInstance( @@ -291,18 +283,10 @@ AlphaSenderList = function AlphaSenderList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AlphaSenderPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AlphaSenderPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,17 +320,10 @@ AlphaSenderList = function AlphaSenderList(version, serviceSid) { AlphaSenderListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AlphaSenderPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AlphaSenderPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,11 +351,7 @@ AlphaSenderList = function AlphaSenderList(version, serviceSid) { */ /* jshint ignore:end */ AlphaSenderListInstance.get = function get(sid) { - return new AlphaSenderContext( - this._version, - this._solution.serviceSid, - sid - ); + return new AlphaSenderContext(this._version, this._solution.serviceSid, sid); }; return AlphaSenderListInstance; @@ -423,11 +396,7 @@ AlphaSenderPage.prototype.constructor = AlphaSenderPage; */ /* jshint ignore:end */ AlphaSenderPage.prototype.getInstance = function getInstance(payload) { - return new AlphaSenderInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new AlphaSenderInstance(this._version, payload, this._solution.serviceSid); }; @@ -468,21 +437,14 @@ AlphaSenderInstance = function AlphaSenderInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(AlphaSenderInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new AlphaSenderContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new AlphaSenderContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -539,10 +501,7 @@ AlphaSenderContext = function AlphaSenderContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/AlphaSenders/<%= sid %>' // jshint ignore:line )(this._solution); @@ -563,10 +522,7 @@ AlphaSenderContext = function AlphaSenderContext(version, serviceSid, sid) { /* jshint ignore:end */ AlphaSenderContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AlphaSenderInstance( @@ -603,10 +559,7 @@ AlphaSenderContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ AlphaSenderContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/messaging/v1/service/phoneNumber.js b/lib/rest/messaging/v1/service/phoneNumber.js index 1fd919b097..506cca229e 100644 --- a/lib/rest/messaging/v1/service/phoneNumber.js +++ b/lib/rest/messaging/v1/service/phoneNumber.js @@ -49,9 +49,7 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { PhoneNumberListInstance._version = version; // Path Solution - PhoneNumberListInstance._solution = { - serviceSid: serviceSid - }; + PhoneNumberListInstance._solution = {serviceSid: serviceSid}; PhoneNumberListInstance._uri = _.template( '/Services/<%= serviceSid %>/PhoneNumbers' // jshint ignore:line )(PhoneNumberListInstance._solution); @@ -79,15 +77,9 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'PhoneNumberSid': _.get(opts, 'phoneNumberSid') - }); + var data = values.of({'PhoneNumberSid': _.get(opts, 'phoneNumberSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( @@ -291,18 +283,10 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,17 +320,10 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { PhoneNumberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,11 +351,7 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { */ /* jshint ignore:end */ PhoneNumberListInstance.get = function get(sid) { - return new PhoneNumberContext( - this._version, - this._solution.serviceSid, - sid - ); + return new PhoneNumberContext(this._version, this._solution.serviceSid, sid); }; return PhoneNumberListInstance; @@ -423,11 +396,7 @@ PhoneNumberPage.prototype.constructor = PhoneNumberPage; */ /* jshint ignore:end */ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new PhoneNumberInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new PhoneNumberInstance(this._version, payload, this._solution.serviceSid); }; @@ -470,21 +439,14 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(PhoneNumberInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new PhoneNumberContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new PhoneNumberContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -541,10 +503,7 @@ PhoneNumberContext = function PhoneNumberContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/PhoneNumbers/<%= sid %>' // jshint ignore:line )(this._solution); @@ -565,10 +524,7 @@ PhoneNumberContext = function PhoneNumberContext(version, serviceSid, sid) { /* jshint ignore:end */ PhoneNumberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -600,10 +556,7 @@ PhoneNumberContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ PhoneNumberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( diff --git a/lib/rest/messaging/v1/service/shortCode.js b/lib/rest/messaging/v1/service/shortCode.js index 541e23d15d..08fe7492ac 100644 --- a/lib/rest/messaging/v1/service/shortCode.js +++ b/lib/rest/messaging/v1/service/shortCode.js @@ -49,9 +49,7 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { ShortCodeListInstance._version = version; // Path Solution - ShortCodeListInstance._solution = { - serviceSid: serviceSid - }; + ShortCodeListInstance._solution = {serviceSid: serviceSid}; ShortCodeListInstance._uri = _.template( '/Services/<%= serviceSid %>/ShortCodes' // jshint ignore:line )(ShortCodeListInstance._solution); @@ -79,15 +77,9 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'ShortCodeSid': _.get(opts, 'shortCodeSid') - }); + var data = values.of({'ShortCodeSid': _.get(opts, 'shortCodeSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( @@ -291,18 +283,10 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,17 +320,10 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { ShortCodeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,11 +351,7 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { */ /* jshint ignore:end */ ShortCodeListInstance.get = function get(sid) { - return new ShortCodeContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ShortCodeContext(this._version, this._solution.serviceSid, sid); }; return ShortCodeListInstance; @@ -423,11 +396,7 @@ ShortCodePage.prototype.constructor = ShortCodePage; */ /* jshint ignore:end */ ShortCodePage.prototype.getInstance = function getInstance(payload) { - return new ShortCodeInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ShortCodeInstance(this._version, payload, this._solution.serviceSid); }; @@ -470,21 +439,14 @@ ShortCodeInstance = function ShortCodeInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ShortCodeInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ShortCodeContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ShortCodeContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -541,10 +503,7 @@ ShortCodeContext = function ShortCodeContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/ShortCodes/<%= sid %>' // jshint ignore:line )(this._solution); @@ -565,10 +524,7 @@ ShortCodeContext = function ShortCodeContext(version, serviceSid, sid) { /* jshint ignore:end */ ShortCodeContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -600,10 +556,7 @@ ShortCodeContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ ShortCodeContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( diff --git a/lib/rest/monitor/v1/alert.js b/lib/rest/monitor/v1/alert.js index aa8fffbf06..6f21cb5c80 100644 --- a/lib/rest/monitor/v1/alert.js +++ b/lib/rest/monitor/v1/alert.js @@ -250,18 +250,10 @@ AlertList = function AlertList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AlertPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AlertPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -298,17 +290,10 @@ AlertList = function AlertList(version) { AlertListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AlertPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AlertPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,10 +321,7 @@ AlertList = function AlertList(version) { */ /* jshint ignore:end */ AlertListInstance.get = function get(sid) { - return new AlertContext( - this._version, - sid - ); + return new AlertContext(this._version, sid); }; return AlertListInstance; @@ -383,10 +365,7 @@ AlertPage.prototype.constructor = AlertPage; */ /* jshint ignore:end */ AlertPage.prototype.getInstance = function getInstance(payload) { - return new AlertInstance( - this._version, - payload - ); + return new AlertInstance(this._version, payload); }; @@ -442,19 +421,14 @@ AlertInstance = function AlertInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(AlertInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new AlertContext( - this._version, - this._solution.sid - ); + this._context = new AlertContext(this._version, this._solution.sid); } return this._context; @@ -509,9 +483,7 @@ AlertContext = function AlertContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Alerts/<%= sid %>' // jshint ignore:line )(this._solution); @@ -532,17 +504,10 @@ AlertContext = function AlertContext(version, sid) { /* jshint ignore:end */ AlertContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new AlertInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AlertInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -571,10 +536,7 @@ AlertContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ AlertContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/monitor/v1/event.js b/lib/rest/monitor/v1/event.js index 89c9d651d8..4423e26bda 100644 --- a/lib/rest/monitor/v1/event.js +++ b/lib/rest/monitor/v1/event.js @@ -262,18 +262,10 @@ EventList = function EventList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new EventPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new EventPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -313,17 +305,10 @@ EventList = function EventList(version) { EventListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new EventPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new EventPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -351,10 +336,7 @@ EventList = function EventList(version) { */ /* jshint ignore:end */ EventListInstance.get = function get(sid) { - return new EventContext( - this._version, - sid - ); + return new EventContext(this._version, sid); }; return EventListInstance; @@ -398,10 +380,7 @@ EventPage.prototype.constructor = EventPage; */ /* jshint ignore:end */ EventPage.prototype.getInstance = function getInstance(payload) { - return new EventInstance( - this._version, - payload - ); + return new EventInstance(this._version, payload); }; @@ -451,19 +430,14 @@ EventInstance = function EventInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(EventInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new EventContext( - this._version, - this._solution.sid - ); + this._context = new EventContext(this._version, this._solution.sid); } return this._context; @@ -501,9 +475,7 @@ EventContext = function EventContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Events/<%= sid %>' // jshint ignore:line )(this._solution); @@ -524,17 +496,10 @@ EventContext = function EventContext(version, sid) { /* jshint ignore:end */ EventContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new EventInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new EventInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/notify/v1/credential.js b/lib/rest/notify/v1/credential.js index 4ebad5f79d..611cafbc57 100644 --- a/lib/rest/notify/v1/credential.js +++ b/lib/rest/notify/v1/credential.js @@ -235,18 +235,10 @@ CredentialList = function CredentialList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -280,17 +272,10 @@ CredentialList = function CredentialList(version) { CredentialListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -344,18 +329,10 @@ CredentialList = function CredentialList(version) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -383,10 +360,7 @@ CredentialList = function CredentialList(version) { */ /* jshint ignore:end */ CredentialListInstance.get = function get(sid) { - return new CredentialContext( - this._version, - sid - ); + return new CredentialContext(this._version, sid); }; return CredentialListInstance; @@ -431,10 +405,7 @@ CredentialPage.prototype.constructor = CredentialPage; */ /* jshint ignore:end */ CredentialPage.prototype.getInstance = function getInstance(payload) { - return new CredentialInstance( - this._version, - payload - ); + return new CredentialInstance(this._version, payload); }; @@ -473,19 +444,14 @@ CredentialInstance = function CredentialInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CredentialInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CredentialContext( - this._version, - this._solution.sid - ); + this._context = new CredentialContext(this._version, this._solution.sid); } return this._context; @@ -565,9 +531,7 @@ CredentialContext = function CredentialContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Credentials/<%= sid %>' // jshint ignore:line )(this._solution); @@ -588,17 +552,10 @@ CredentialContext = function CredentialContext(version, sid) { /* jshint ignore:end */ CredentialContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -649,18 +606,10 @@ CredentialContext.prototype.update = function update(opts, callback) { 'Secret': _.get(opts, 'secret') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CredentialInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -689,10 +638,7 @@ CredentialContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ CredentialContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/notify/v1/service.js b/lib/rest/notify/v1/service.js index 1a8acd88e2..40bfc5e94e 100644 --- a/lib/rest/notify/v1/service.js +++ b/lib/rest/notify/v1/service.js @@ -110,18 +110,10 @@ ServiceList = function ServiceList(version) { 'DefaultAlexaNotificationProtocolVersion': _.get(opts, 'defaultAlexaNotificationProtocolVersion') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -325,18 +317,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -371,17 +355,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -409,10 +386,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -457,10 +431,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -523,19 +494,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -693,9 +659,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -722,10 +686,7 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -757,17 +718,10 @@ ServiceContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -834,18 +788,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'DefaultAlexaNotificationProtocolVersion': _.get(opts, 'defaultAlexaNotificationProtocolVersion') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -863,10 +809,7 @@ Object.defineProperty(ServiceContext.prototype, 'bindings', { get: function() { if (!this._bindings) { - this._bindings = new BindingList( - this._version, - this._solution.sid - ); + this._bindings = new BindingList(this._version, this._solution.sid); } return this._bindings; } @@ -876,10 +819,7 @@ Object.defineProperty(ServiceContext.prototype, 'notifications', { get: function() { if (!this._notifications) { - this._notifications = new NotificationList( - this._version, - this._solution.sid - ); + this._notifications = new NotificationList(this._version, this._solution.sid); } return this._notifications; } @@ -889,10 +829,7 @@ Object.defineProperty(ServiceContext.prototype, 'users', { get: function() { if (!this._users) { - this._users = new UserList( - this._version, - this._solution.sid - ); + this._users = new UserList(this._version, this._solution.sid); } return this._users; } @@ -902,10 +839,7 @@ Object.defineProperty(ServiceContext.prototype, 'segments', { get: function() { if (!this._segments) { - this._segments = new SegmentList( - this._version, - this._solution.sid - ); + this._segments = new SegmentList(this._version, this._solution.sid); } return this._segments; } diff --git a/lib/rest/notify/v1/service/binding.js b/lib/rest/notify/v1/service/binding.js index 889a99992f..31396561cd 100644 --- a/lib/rest/notify/v1/service/binding.js +++ b/lib/rest/notify/v1/service/binding.js @@ -50,9 +50,7 @@ BindingList = function BindingList(version, serviceSid) { BindingListInstance._version = version; // Path Solution - BindingListInstance._solution = { - serviceSid: serviceSid - }; + BindingListInstance._solution = {serviceSid: serviceSid}; BindingListInstance._uri = _.template( '/Services/<%= serviceSid %>/Bindings' // jshint ignore:line )(BindingListInstance._solution); @@ -103,11 +101,7 @@ BindingList = function BindingList(version, serviceSid) { 'Endpoint': _.get(opts, 'endpoint') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new BindingInstance( @@ -331,18 +325,10 @@ BindingList = function BindingList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new BindingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new BindingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,17 +366,10 @@ BindingList = function BindingList(version, serviceSid) { BindingListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new BindingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new BindingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -418,11 +397,7 @@ BindingList = function BindingList(version, serviceSid) { */ /* jshint ignore:end */ BindingListInstance.get = function get(sid) { - return new BindingContext( - this._version, - this._solution.serviceSid, - sid - ); + return new BindingContext(this._version, this._solution.serviceSid, sid); }; return BindingListInstance; @@ -467,11 +442,7 @@ BindingPage.prototype.constructor = BindingPage; */ /* jshint ignore:end */ BindingPage.prototype.getInstance = function getInstance(payload) { - return new BindingInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new BindingInstance(this._version, payload, this._solution.serviceSid); }; @@ -524,21 +495,14 @@ BindingInstance = function BindingInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(BindingInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new BindingContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new BindingContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -595,10 +559,7 @@ BindingContext = function BindingContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Bindings/<%= sid %>' // jshint ignore:line )(this._solution); @@ -619,10 +580,7 @@ BindingContext = function BindingContext(version, serviceSid, sid) { /* jshint ignore:end */ BindingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new BindingInstance( @@ -659,10 +617,7 @@ BindingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ BindingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/notify/v1/service/notification.js b/lib/rest/notify/v1/service/notification.js index 79602c9efb..3d3aa87a99 100644 --- a/lib/rest/notify/v1/service/notification.js +++ b/lib/rest/notify/v1/service/notification.js @@ -49,9 +49,7 @@ NotificationList = function NotificationList(version, serviceSid) { NotificationListInstance._version = version; // Path Solution - NotificationListInstance._solution = { - serviceSid: serviceSid - }; + NotificationListInstance._solution = {serviceSid: serviceSid}; NotificationListInstance._uri = _.template( '/Services/<%= serviceSid %>/Notifications' // jshint ignore:line )(NotificationListInstance._solution); @@ -115,17 +113,10 @@ NotificationList = function NotificationList(version, serviceSid) { 'ToBinding': _.get(opts, 'toBinding') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new NotificationInstance( - this._version, - payload - )); + deferred.resolve(new NotificationInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -181,11 +172,7 @@ NotificationPage.prototype.constructor = NotificationPage; */ /* jshint ignore:end */ NotificationPage.prototype.getInstance = function getInstance(payload) { - return new NotificationInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new NotificationInstance(this._version, payload, this._solution.serviceSid); }; @@ -248,9 +235,7 @@ NotificationInstance = function NotificationInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - }; + this._solution = {serviceSid: serviceSid,}; }; module.exports = { diff --git a/lib/rest/notify/v1/service/segment.js b/lib/rest/notify/v1/service/segment.js index c4dc50bc9f..55f793b8c4 100644 --- a/lib/rest/notify/v1/service/segment.js +++ b/lib/rest/notify/v1/service/segment.js @@ -48,9 +48,7 @@ SegmentList = function SegmentList(version, serviceSid) { SegmentListInstance._version = version; // Path Solution - SegmentListInstance._solution = { - serviceSid: serviceSid - }; + SegmentListInstance._solution = {serviceSid: serviceSid}; SegmentListInstance._uri = _.template( '/Services/<%= serviceSid %>/Segments' // jshint ignore:line )(SegmentListInstance._solution); @@ -236,18 +234,10 @@ SegmentList = function SegmentList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SegmentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SegmentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -281,17 +271,10 @@ SegmentList = function SegmentList(version, serviceSid) { SegmentListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SegmentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SegmentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -347,11 +330,7 @@ SegmentPage.prototype.constructor = SegmentPage; */ /* jshint ignore:end */ SegmentPage.prototype.getInstance = function getInstance(payload) { - return new SegmentInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SegmentInstance(this._version, payload, this._solution.serviceSid); }; @@ -385,9 +364,7 @@ SegmentInstance = function SegmentInstance(version, payload, serviceSid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - }; + this._solution = {serviceSid: serviceSid,}; }; module.exports = { diff --git a/lib/rest/notify/v1/service/user.js b/lib/rest/notify/v1/service/user.js index aeef4614a9..2cf3ec9224 100644 --- a/lib/rest/notify/v1/service/user.js +++ b/lib/rest/notify/v1/service/user.js @@ -52,9 +52,7 @@ UserList = function UserList(version, serviceSid) { UserListInstance._version = version; // Path Solution - UserListInstance._solution = { - serviceSid: serviceSid - }; + UserListInstance._solution = {serviceSid: serviceSid}; UserListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users' // jshint ignore:line )(UserListInstance._solution); @@ -82,16 +80,9 @@ UserList = function UserList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Identity': _.get(opts, 'identity'), - 'Segment': _.get(opts, 'segment') - }); + var data = values.of({'Identity': _.get(opts, 'identity'), 'Segment': _.get(opts, 'segment')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( @@ -307,18 +298,10 @@ UserList = function UserList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -354,17 +337,10 @@ UserList = function UserList(version, serviceSid) { UserListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -392,11 +368,7 @@ UserList = function UserList(version, serviceSid) { */ /* jshint ignore:end */ UserListInstance.get = function get(identity) { - return new UserContext( - this._version, - this._solution.serviceSid, - identity - ); + return new UserContext(this._version, this._solution.serviceSid, identity); }; return UserListInstance; @@ -441,11 +413,7 @@ UserPage.prototype.constructor = UserPage; */ /* jshint ignore:end */ UserPage.prototype.getInstance = function getInstance(payload) { - return new UserInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new UserInstance(this._version, payload, this._solution.serviceSid); }; @@ -487,21 +455,14 @@ UserInstance = function UserInstance(version, payload, serviceSid, identity) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - identity: identity || this.identity, - }; + this._solution = {serviceSid: serviceSid, identity: identity || this.identity,}; }; Object.defineProperty(UserInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new UserContext( - this._version, - this._solution.serviceSid, - this._solution.identity - ); + this._context = new UserContext(this._version, this._solution.serviceSid, this._solution.identity); } return this._context; @@ -593,10 +554,7 @@ UserContext = function UserContext(version, serviceSid, identity) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= identity %>' // jshint ignore:line )(this._solution); @@ -621,10 +579,7 @@ UserContext = function UserContext(version, serviceSid, identity) { /* jshint ignore:end */ UserContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -656,10 +611,7 @@ UserContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ UserContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new UserInstance( diff --git a/lib/rest/notify/v1/service/user/segmentMemberships.js b/lib/rest/notify/v1/service/user/segmentMemberships.js index b618c8d9a9..e2ed8d5126 100644 --- a/lib/rest/notify/v1/service/user/segmentMemberships.js +++ b/lib/rest/notify/v1/service/user/segmentMemberships.js @@ -49,10 +49,7 @@ SegmentMembershipList = function SegmentMembershipList(version, serviceSid, SegmentMembershipListInstance._version = version; // Path Solution - SegmentMembershipListInstance._solution = { - serviceSid: serviceSid, - identity: identity - }; + SegmentMembershipListInstance._solution = {serviceSid: serviceSid, identity: identity}; SegmentMembershipListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= identity %>/SegmentMemberships' // jshint ignore:line )(SegmentMembershipListInstance._solution); @@ -79,15 +76,9 @@ SegmentMembershipList = function SegmentMembershipList(version, serviceSid, } var deferred = Q.defer(); - var data = values.of({ - 'Segment': _.get(opts, 'segment') - }); + var data = values.of({'Segment': _.get(opts, 'segment')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SegmentMembershipInstance( @@ -216,11 +207,7 @@ SegmentMembershipInstance = function SegmentMembershipInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - identity: identity, - segment: segment || this.segment, - }; + this._solution = {serviceSid: serviceSid, identity: identity, segment: segment || this.segment,}; }; Object.defineProperty(SegmentMembershipInstance.prototype, @@ -291,11 +278,7 @@ SegmentMembershipContext = function SegmentMembershipContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - identity: identity, - segment: segment, - }; + this._solution = {serviceSid: serviceSid, identity: identity, segment: segment,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= identity %>/SegmentMemberships/<%= segment %>' // jshint ignore:line )(this._solution); @@ -316,10 +299,7 @@ SegmentMembershipContext = function SegmentMembershipContext(version, /* jshint ignore:end */ SegmentMembershipContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -351,10 +331,7 @@ SegmentMembershipContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ SegmentMembershipContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SegmentMembershipInstance( diff --git a/lib/rest/notify/v1/service/user/userBinding.js b/lib/rest/notify/v1/service/user/userBinding.js index 04757db455..fbde52d31b 100644 --- a/lib/rest/notify/v1/service/user/userBinding.js +++ b/lib/rest/notify/v1/service/user/userBinding.js @@ -52,10 +52,7 @@ UserBindingList = function UserBindingList(version, serviceSid, identity) { UserBindingListInstance._version = version; // Path Solution - UserBindingListInstance._solution = { - serviceSid: serviceSid, - identity: identity - }; + UserBindingListInstance._solution = {serviceSid: serviceSid, identity: identity}; UserBindingListInstance._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= identity %>/Bindings' // jshint ignore:line )(UserBindingListInstance._solution); @@ -101,11 +98,7 @@ UserBindingList = function UserBindingList(version, serviceSid, identity) { 'Endpoint': _.get(opts, 'endpoint') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new UserBindingInstance( @@ -326,18 +319,10 @@ UserBindingList = function UserBindingList(version, serviceSid, identity) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UserBindingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserBindingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,17 +359,10 @@ UserBindingList = function UserBindingList(version, serviceSid, identity) { UserBindingListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UserBindingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UserBindingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -412,12 +390,7 @@ UserBindingList = function UserBindingList(version, serviceSid, identity) { */ /* jshint ignore:end */ UserBindingListInstance.get = function get(sid) { - return new UserBindingContext( - this._version, - this._solution.serviceSid, - this._solution.identity, - sid - ); + return new UserBindingContext(this._version, this._solution.serviceSid, this._solution.identity, sid); }; return UserBindingListInstance; @@ -522,11 +495,7 @@ UserBindingInstance = function UserBindingInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - identity: identity, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, identity: identity, sid: sid || this.sid,}; }; Object.defineProperty(UserBindingInstance.prototype, @@ -597,11 +566,7 @@ UserBindingContext = function UserBindingContext(version, serviceSid, identity, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - identity: identity, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, identity: identity, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Users/<%= identity %>/Bindings/<%= sid %>' // jshint ignore:line )(this._solution); @@ -622,10 +587,7 @@ UserBindingContext = function UserBindingContext(version, serviceSid, identity, /* jshint ignore:end */ UserBindingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new UserBindingInstance( @@ -663,10 +625,7 @@ UserBindingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ UserBindingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/preview/acc_security/service.js b/lib/rest/preview/acc_security/service.js index 2be3bb5226..2e43769354 100644 --- a/lib/rest/preview/acc_security/service.js +++ b/lib/rest/preview/acc_security/service.js @@ -81,23 +81,12 @@ ServiceList = function ServiceList(version) { } var deferred = Q.defer(); - var data = values.of({ - 'Name': _.get(opts, 'name'), - 'CodeLength': _.get(opts, 'codeLength') - }); + var data = values.of({'Name': _.get(opts, 'name'), 'CodeLength': _.get(opts, 'codeLength')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -293,18 +282,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -338,17 +319,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -376,10 +350,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -424,10 +395,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -467,19 +435,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -574,9 +537,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -601,17 +562,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -650,23 +604,12 @@ ServiceContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Name': _.get(opts, 'name'), - 'CodeLength': _.get(opts, 'codeLength') - }); + var data = values.of({'Name': _.get(opts, 'name'), 'CodeLength': _.get(opts, 'codeLength')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -684,10 +627,7 @@ Object.defineProperty(ServiceContext.prototype, 'verifications', { get: function() { if (!this._verifications) { - this._verifications = new VerificationList( - this._version, - this._solution.sid - ); + this._verifications = new VerificationList(this._version, this._solution.sid); } return this._verifications; } @@ -697,10 +637,7 @@ Object.defineProperty(ServiceContext.prototype, 'verificationChecks', { get: function() { if (!this._verificationChecks) { - this._verificationChecks = new VerificationCheckList( - this._version, - this._solution.sid - ); + this._verificationChecks = new VerificationCheckList(this._version, this._solution.sid); } return this._verificationChecks; } diff --git a/lib/rest/preview/acc_security/service/verification.js b/lib/rest/preview/acc_security/service/verification.js index c4b0820f6e..a04511e7c4 100644 --- a/lib/rest/preview/acc_security/service/verification.js +++ b/lib/rest/preview/acc_security/service/verification.js @@ -48,9 +48,7 @@ VerificationList = function VerificationList(version, serviceSid) { VerificationListInstance._version = version; // Path Solution - VerificationListInstance._solution = { - serviceSid: serviceSid - }; + VerificationListInstance._solution = {serviceSid: serviceSid}; VerificationListInstance._uri = _.template( '/Services/<%= serviceSid %>/Verifications' // jshint ignore:line )(VerificationListInstance._solution); @@ -90,17 +88,10 @@ VerificationList = function VerificationList(version, serviceSid) { 'CustomMessage': _.get(opts, 'customMessage') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new VerificationInstance( - this._version, - payload - )); + deferred.resolve(new VerificationInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -156,11 +147,7 @@ VerificationPage.prototype.constructor = VerificationPage; */ /* jshint ignore:end */ VerificationPage.prototype.getInstance = function getInstance(payload) { - return new VerificationInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new VerificationInstance(this._version, payload, this._solution.serviceSid); }; @@ -201,9 +188,7 @@ VerificationInstance = function VerificationInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - }; + this._solution = {serviceSid: serviceSid,}; }; module.exports = { diff --git a/lib/rest/preview/acc_security/service/verificationCheck.js b/lib/rest/preview/acc_security/service/verificationCheck.js index d7262ad076..0527640a70 100644 --- a/lib/rest/preview/acc_security/service/verificationCheck.js +++ b/lib/rest/preview/acc_security/service/verificationCheck.js @@ -48,9 +48,7 @@ VerificationCheckList = function VerificationCheckList(version, serviceSid) { VerificationCheckListInstance._version = version; // Path Solution - VerificationCheckListInstance._solution = { - serviceSid: serviceSid - }; + VerificationCheckListInstance._solution = {serviceSid: serviceSid}; VerificationCheckListInstance._uri = _.template( '/Services/<%= serviceSid %>/VerificationCheck' // jshint ignore:line )(VerificationCheckListInstance._solution); @@ -80,22 +78,12 @@ VerificationCheckList = function VerificationCheckList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Code': _.get(opts, 'code'), - 'To': _.get(opts, 'to') - }); + var data = values.of({'Code': _.get(opts, 'code'), 'To': _.get(opts, 'to')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new VerificationCheckInstance( - this._version, - payload - )); + deferred.resolve(new VerificationCheckInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -152,11 +140,7 @@ VerificationCheckPage.prototype.constructor = VerificationCheckPage; */ /* jshint ignore:end */ VerificationCheckPage.prototype.getInstance = function getInstance(payload) { - return new VerificationCheckInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new VerificationCheckInstance(this._version, payload, this._solution.serviceSid); }; @@ -198,9 +182,7 @@ VerificationCheckInstance = function VerificationCheckInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - }; + this._solution = {serviceSid: serviceSid,}; }; module.exports = { diff --git a/lib/rest/preview/bulk_exports/export.js b/lib/rest/preview/bulk_exports/export.js index d86d03487f..70b33f6364 100644 --- a/lib/rest/preview/bulk_exports/export.js +++ b/lib/rest/preview/bulk_exports/export.js @@ -62,10 +62,7 @@ ExportList = function ExportList(version) { */ /* jshint ignore:end */ ExportListInstance.get = function get(resourceType) { - return new ExportContext( - this._version, - resourceType - ); + return new ExportContext(this._version, resourceType); }; return ExportListInstance; @@ -110,10 +107,7 @@ ExportPage.prototype.constructor = ExportPage; */ /* jshint ignore:end */ ExportPage.prototype.getInstance = function getInstance(payload) { - return new ExportInstance( - this._version, - payload - ); + return new ExportInstance(this._version, payload); }; @@ -142,19 +136,14 @@ ExportInstance = function ExportInstance(version, payload, resourceType) { // Context this._context = undefined; - this._solution = { - resourceType: resourceType || this.resourceType, - }; + this._solution = {resourceType: resourceType || this.resourceType,}; }; Object.defineProperty(ExportInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ExportContext( - this._version, - this._solution.resourceType - ); + this._context = new ExportContext(this._version, this._solution.resourceType); } return this._context; @@ -211,9 +200,7 @@ ExportContext = function ExportContext(version, resourceType) { this._version = version; // Path Solution - this._solution = { - resourceType: resourceType, - }; + this._solution = {resourceType: resourceType,}; this._uri = _.template( '/Exports/<%= resourceType %>' // jshint ignore:line )(this._solution); @@ -237,17 +224,10 @@ ExportContext = function ExportContext(version, resourceType) { /* jshint ignore:end */ ExportContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ExportInstance( - this._version, - payload, - this._solution.resourceType - )); + deferred.resolve(new ExportInstance(this._version, payload, this._solution.resourceType)); }.bind(this)); promise.catch(function(error) { @@ -265,10 +245,7 @@ Object.defineProperty(ExportContext.prototype, 'days', { get: function() { if (!this._days) { - this._days = new DayList( - this._version, - this._solution.resourceType - ); + this._days = new DayList(this._version, this._solution.resourceType); } return this._days; } diff --git a/lib/rest/preview/bulk_exports/export/day.js b/lib/rest/preview/bulk_exports/export/day.js index d3ea05b8e2..0c1aca9ee4 100644 --- a/lib/rest/preview/bulk_exports/export/day.js +++ b/lib/rest/preview/bulk_exports/export/day.js @@ -48,9 +48,7 @@ DayList = function DayList(version, resourceType) { DayListInstance._version = version; // Path Solution - DayListInstance._solution = { - resourceType: resourceType - }; + DayListInstance._solution = {resourceType: resourceType}; DayListInstance._uri = _.template( '/Exports/<%= resourceType %>/Days' // jshint ignore:line )(DayListInstance._solution); @@ -236,18 +234,10 @@ DayList = function DayList(version, resourceType) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DayPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DayPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -281,17 +271,10 @@ DayList = function DayList(version, resourceType) { DayListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DayPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DayPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -347,11 +330,7 @@ DayPage.prototype.constructor = DayPage; */ /* jshint ignore:end */ DayPage.prototype.getInstance = function getInstance(payload) { - return new DayInstance( - this._version, - payload, - this._solution.resourceType - ); + return new DayInstance(this._version, payload, this._solution.resourceType); }; @@ -381,9 +360,7 @@ DayInstance = function DayInstance(version, payload, resourceType) { // Context this._context = undefined; - this._solution = { - resourceType: resourceType, - }; + this._solution = {resourceType: resourceType,}; }; module.exports = { diff --git a/lib/rest/preview/bulk_exports/exportConfiguration.js b/lib/rest/preview/bulk_exports/exportConfiguration.js index 8844d221cf..28e8cc3d68 100644 --- a/lib/rest/preview/bulk_exports/exportConfiguration.js +++ b/lib/rest/preview/bulk_exports/exportConfiguration.js @@ -62,10 +62,7 @@ ExportConfigurationList = function ExportConfigurationList(version) { */ /* jshint ignore:end */ ExportConfigurationListInstance.get = function get(resourceType) { - return new ExportConfigurationContext( - this._version, - resourceType - ); + return new ExportConfigurationContext(this._version, resourceType); }; return ExportConfigurationListInstance; @@ -111,10 +108,7 @@ ExportConfigurationPage.prototype.constructor = ExportConfigurationPage; */ /* jshint ignore:end */ ExportConfigurationPage.prototype.getInstance = function getInstance(payload) { - return new ExportConfigurationInstance( - this._version, - payload - ); + return new ExportConfigurationInstance(this._version, payload); }; @@ -148,19 +142,14 @@ ExportConfigurationInstance = function ExportConfigurationInstance(version, // Context this._context = undefined; - this._solution = { - resourceType: resourceType || this.resourceType, - }; + this._solution = {resourceType: resourceType || this.resourceType,}; }; Object.defineProperty(ExportConfigurationInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ExportConfigurationContext( - this._version, - this._solution.resourceType - ); + this._context = new ExportConfigurationContext(this._version, this._solution.resourceType); } return this._context; @@ -221,9 +210,7 @@ ExportConfigurationContext = function ExportConfigurationContext(version, this._version = version; // Path Solution - this._solution = { - resourceType: resourceType, - }; + this._solution = {resourceType: resourceType,}; this._uri = _.template( '/Exports/<%= resourceType %>/Configuration' // jshint ignore:line )(this._solution); @@ -244,10 +231,7 @@ ExportConfigurationContext = function ExportConfigurationContext(version, /* jshint ignore:end */ ExportConfigurationContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ExportConfigurationInstance( @@ -299,11 +283,7 @@ ExportConfigurationContext.prototype.update = function update(opts, callback) { 'WebhookMethod': _.get(opts, 'webhookMethod') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ExportConfigurationInstance( diff --git a/lib/rest/preview/deployed_devices/fleet.js b/lib/rest/preview/deployed_devices/fleet.js index ec5fad66b5..6537fa0355 100644 --- a/lib/rest/preview/deployed_devices/fleet.js +++ b/lib/rest/preview/deployed_devices/fleet.js @@ -80,22 +80,12 @@ FleetList = function FleetList(version) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new FleetInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new FleetInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -291,18 +281,10 @@ FleetList = function FleetList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new FleetPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new FleetPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,17 +318,10 @@ FleetList = function FleetList(version) { FleetListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new FleetPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new FleetPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,10 +349,7 @@ FleetList = function FleetList(version) { */ /* jshint ignore:end */ FleetListInstance.get = function get(sid) { - return new FleetContext( - this._version, - sid - ); + return new FleetContext(this._version, sid); }; return FleetListInstance; @@ -422,10 +394,7 @@ FleetPage.prototype.constructor = FleetPage; */ /* jshint ignore:end */ FleetPage.prototype.getInstance = function getInstance(payload) { - return new FleetInstance( - this._version, - payload - ); + return new FleetInstance(this._version, payload); }; @@ -467,19 +436,14 @@ FleetInstance = function FleetInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(FleetInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new FleetContext( - this._version, - this._solution.sid - ); + this._context = new FleetContext(this._version, this._solution.sid); } return this._context; @@ -625,9 +589,7 @@ FleetContext = function FleetContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Fleets/<%= sid %>' // jshint ignore:line )(this._solution); @@ -654,17 +616,10 @@ FleetContext = function FleetContext(version, sid) { /* jshint ignore:end */ FleetContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new FleetInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new FleetInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -693,10 +648,7 @@ FleetContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ FleetContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -743,18 +695,10 @@ FleetContext.prototype.update = function update(opts, callback) { 'DefaultDeploymentSid': _.get(opts, 'defaultDeploymentSid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new FleetInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new FleetInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -772,10 +716,7 @@ Object.defineProperty(FleetContext.prototype, 'devices', { get: function() { if (!this._devices) { - this._devices = new DeviceList( - this._version, - this._solution.sid - ); + this._devices = new DeviceList(this._version, this._solution.sid); } return this._devices; } @@ -785,10 +726,7 @@ Object.defineProperty(FleetContext.prototype, 'deployments', { get: function() { if (!this._deployments) { - this._deployments = new DeploymentList( - this._version, - this._solution.sid - ); + this._deployments = new DeploymentList(this._version, this._solution.sid); } return this._deployments; } @@ -798,10 +736,7 @@ Object.defineProperty(FleetContext.prototype, 'certificates', { get: function() { if (!this._certificates) { - this._certificates = new CertificateList( - this._version, - this._solution.sid - ); + this._certificates = new CertificateList(this._version, this._solution.sid); } return this._certificates; } @@ -811,10 +746,7 @@ Object.defineProperty(FleetContext.prototype, 'keys', { get: function() { if (!this._keys) { - this._keys = new KeyList( - this._version, - this._solution.sid - ); + this._keys = new KeyList(this._version, this._solution.sid); } return this._keys; } diff --git a/lib/rest/preview/deployed_devices/fleet/certificate.js b/lib/rest/preview/deployed_devices/fleet/certificate.js index e9eb7be1b5..491f5fd3a3 100644 --- a/lib/rest/preview/deployed_devices/fleet/certificate.js +++ b/lib/rest/preview/deployed_devices/fleet/certificate.js @@ -49,9 +49,7 @@ CertificateList = function CertificateList(version, fleetSid) { CertificateListInstance._version = version; // Path Solution - CertificateListInstance._solution = { - fleetSid: fleetSid - }; + CertificateListInstance._solution = {fleetSid: fleetSid}; CertificateListInstance._uri = _.template( '/Fleets/<%= fleetSid %>/Certificates' // jshint ignore:line )(CertificateListInstance._solution); @@ -89,11 +87,7 @@ CertificateList = function CertificateList(version, fleetSid) { 'DeviceSid': _.get(opts, 'deviceSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CertificateInstance( @@ -308,18 +302,10 @@ CertificateList = function CertificateList(version, fleetSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CertificatePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CertificatePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -355,17 +341,10 @@ CertificateList = function CertificateList(version, fleetSid) { CertificateListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CertificatePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CertificatePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -393,11 +372,7 @@ CertificateList = function CertificateList(version, fleetSid) { */ /* jshint ignore:end */ CertificateListInstance.get = function get(sid) { - return new CertificateContext( - this._version, - this._solution.fleetSid, - sid - ); + return new CertificateContext(this._version, this._solution.fleetSid, sid); }; return CertificateListInstance; @@ -442,11 +417,7 @@ CertificatePage.prototype.constructor = CertificatePage; */ /* jshint ignore:end */ CertificatePage.prototype.getInstance = function getInstance(payload) { - return new CertificateInstance( - this._version, - payload, - this._solution.fleetSid - ); + return new CertificateInstance(this._version, payload, this._solution.fleetSid); }; @@ -490,21 +461,14 @@ CertificateInstance = function CertificateInstance(version, payload, fleetSid, // Context this._context = undefined; - this._solution = { - fleetSid: fleetSid, - sid: sid || this.sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid || this.sid,}; }; Object.defineProperty(CertificateInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CertificateContext( - this._version, - this._solution.fleetSid, - this._solution.sid - ); + this._context = new CertificateContext(this._version, this._solution.fleetSid, this._solution.sid); } return this._context; @@ -583,10 +547,7 @@ CertificateContext = function CertificateContext(version, fleetSid, sid) { this._version = version; // Path Solution - this._solution = { - fleetSid: fleetSid, - sid: sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid,}; this._uri = _.template( '/Fleets/<%= fleetSid %>/Certificates/<%= sid %>' // jshint ignore:line )(this._solution); @@ -607,10 +568,7 @@ CertificateContext = function CertificateContext(version, fleetSid, sid) { /* jshint ignore:end */ CertificateContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new CertificateInstance( @@ -647,10 +605,7 @@ CertificateContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ CertificateContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -698,11 +653,7 @@ CertificateContext.prototype.update = function update(opts, callback) { 'DeviceSid': _.get(opts, 'deviceSid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CertificateInstance( diff --git a/lib/rest/preview/deployed_devices/fleet/deployment.js b/lib/rest/preview/deployed_devices/fleet/deployment.js index 4eca42b212..6fb6272b76 100644 --- a/lib/rest/preview/deployed_devices/fleet/deployment.js +++ b/lib/rest/preview/deployed_devices/fleet/deployment.js @@ -49,9 +49,7 @@ DeploymentList = function DeploymentList(version, fleetSid) { DeploymentListInstance._version = version; // Path Solution - DeploymentListInstance._solution = { - fleetSid: fleetSid - }; + DeploymentListInstance._solution = {fleetSid: fleetSid}; DeploymentListInstance._uri = _.template( '/Fleets/<%= fleetSid %>/Deployments' // jshint ignore:line )(DeploymentListInstance._solution); @@ -86,11 +84,7 @@ DeploymentList = function DeploymentList(version, fleetSid) { 'SyncServiceSid': _.get(opts, 'syncServiceSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DeploymentInstance( @@ -294,18 +288,10 @@ DeploymentList = function DeploymentList(version, fleetSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DeploymentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DeploymentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -339,17 +325,10 @@ DeploymentList = function DeploymentList(version, fleetSid) { DeploymentListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DeploymentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DeploymentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -377,11 +356,7 @@ DeploymentList = function DeploymentList(version, fleetSid) { */ /* jshint ignore:end */ DeploymentListInstance.get = function get(sid) { - return new DeploymentContext( - this._version, - this._solution.fleetSid, - sid - ); + return new DeploymentContext(this._version, this._solution.fleetSid, sid); }; return DeploymentListInstance; @@ -426,11 +401,7 @@ DeploymentPage.prototype.constructor = DeploymentPage; */ /* jshint ignore:end */ DeploymentPage.prototype.getInstance = function getInstance(payload) { - return new DeploymentInstance( - this._version, - payload, - this._solution.fleetSid - ); + return new DeploymentInstance(this._version, payload, this._solution.fleetSid); }; @@ -473,21 +444,14 @@ DeploymentInstance = function DeploymentInstance(version, payload, fleetSid, // Context this._context = undefined; - this._solution = { - fleetSid: fleetSid, - sid: sid || this.sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid || this.sid,}; }; Object.defineProperty(DeploymentInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new DeploymentContext( - this._version, - this._solution.fleetSid, - this._solution.sid - ); + this._context = new DeploymentContext(this._version, this._solution.fleetSid, this._solution.sid); } return this._context; @@ -566,10 +530,7 @@ DeploymentContext = function DeploymentContext(version, fleetSid, sid) { this._version = version; // Path Solution - this._solution = { - fleetSid: fleetSid, - sid: sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid,}; this._uri = _.template( '/Fleets/<%= fleetSid %>/Deployments/<%= sid %>' // jshint ignore:line )(this._solution); @@ -590,10 +551,7 @@ DeploymentContext = function DeploymentContext(version, fleetSid, sid) { /* jshint ignore:end */ DeploymentContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DeploymentInstance( @@ -630,10 +588,7 @@ DeploymentContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ DeploymentContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -681,11 +636,7 @@ DeploymentContext.prototype.update = function update(opts, callback) { 'SyncServiceSid': _.get(opts, 'syncServiceSid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DeploymentInstance( diff --git a/lib/rest/preview/deployed_devices/fleet/device.js b/lib/rest/preview/deployed_devices/fleet/device.js index 48de50d522..8b96cb6cfb 100644 --- a/lib/rest/preview/deployed_devices/fleet/device.js +++ b/lib/rest/preview/deployed_devices/fleet/device.js @@ -50,9 +50,7 @@ DeviceList = function DeviceList(version, fleetSid) { DeviceListInstance._version = version; // Path Solution - DeviceListInstance._solution = { - fleetSid: fleetSid - }; + DeviceListInstance._solution = {fleetSid: fleetSid}; DeviceListInstance._uri = _.template( '/Fleets/<%= fleetSid %>/Devices' // jshint ignore:line )(DeviceListInstance._solution); @@ -92,11 +90,7 @@ DeviceList = function DeviceList(version, fleetSid) { 'Enabled': serialize.bool(_.get(opts, 'enabled')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DeviceInstance( @@ -311,18 +305,10 @@ DeviceList = function DeviceList(version, fleetSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DevicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DevicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -358,17 +344,10 @@ DeviceList = function DeviceList(version, fleetSid) { DeviceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DevicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DevicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -396,11 +375,7 @@ DeviceList = function DeviceList(version, fleetSid) { */ /* jshint ignore:end */ DeviceListInstance.get = function get(sid) { - return new DeviceContext( - this._version, - this._solution.fleetSid, - sid - ); + return new DeviceContext(this._version, this._solution.fleetSid, sid); }; return DeviceListInstance; @@ -445,11 +420,7 @@ DevicePage.prototype.constructor = DevicePage; */ /* jshint ignore:end */ DevicePage.prototype.getInstance = function getInstance(payload) { - return new DeviceInstance( - this._version, - payload, - this._solution.fleetSid - ); + return new DeviceInstance(this._version, payload, this._solution.fleetSid); }; @@ -497,21 +468,14 @@ DeviceInstance = function DeviceInstance(version, payload, fleetSid, sid) { // Context this._context = undefined; - this._solution = { - fleetSid: fleetSid, - sid: sid || this.sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid || this.sid,}; }; Object.defineProperty(DeviceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new DeviceContext( - this._version, - this._solution.fleetSid, - this._solution.sid - ); + this._context = new DeviceContext(this._version, this._solution.fleetSid, this._solution.sid); } return this._context; @@ -591,10 +555,7 @@ DeviceContext = function DeviceContext(version, fleetSid, sid) { this._version = version; // Path Solution - this._solution = { - fleetSid: fleetSid, - sid: sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid,}; this._uri = _.template( '/Fleets/<%= fleetSid %>/Devices/<%= sid %>' // jshint ignore:line )(this._solution); @@ -615,10 +576,7 @@ DeviceContext = function DeviceContext(version, fleetSid, sid) { /* jshint ignore:end */ DeviceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DeviceInstance( @@ -655,10 +613,7 @@ DeviceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ DeviceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -709,11 +664,7 @@ DeviceContext.prototype.update = function update(opts, callback) { 'Enabled': serialize.bool(_.get(opts, 'enabled')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DeviceInstance( diff --git a/lib/rest/preview/deployed_devices/fleet/key.js b/lib/rest/preview/deployed_devices/fleet/key.js index 63838bdb9f..c8efa92bf8 100644 --- a/lib/rest/preview/deployed_devices/fleet/key.js +++ b/lib/rest/preview/deployed_devices/fleet/key.js @@ -49,9 +49,7 @@ KeyList = function KeyList(version, fleetSid) { KeyListInstance._version = version; // Path Solution - KeyListInstance._solution = { - fleetSid: fleetSid - }; + KeyListInstance._solution = {fleetSid: fleetSid}; KeyListInstance._uri = _.template( '/Fleets/<%= fleetSid %>/Keys' // jshint ignore:line )(KeyListInstance._solution); @@ -86,19 +84,10 @@ KeyList = function KeyList(version, fleetSid) { 'DeviceSid': _.get(opts, 'deviceSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new KeyInstance( - this._version, - payload, - this._solution.fleetSid, - this._solution.sid - )); + deferred.resolve(new KeyInstance(this._version, payload, this._solution.fleetSid, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -305,18 +294,10 @@ KeyList = function KeyList(version, fleetSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new KeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new KeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -352,17 +333,10 @@ KeyList = function KeyList(version, fleetSid) { KeyListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new KeyPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new KeyPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,11 +364,7 @@ KeyList = function KeyList(version, fleetSid) { */ /* jshint ignore:end */ KeyListInstance.get = function get(sid) { - return new KeyContext( - this._version, - this._solution.fleetSid, - sid - ); + return new KeyContext(this._version, this._solution.fleetSid, sid); }; return KeyListInstance; @@ -439,11 +409,7 @@ KeyPage.prototype.constructor = KeyPage; */ /* jshint ignore:end */ KeyPage.prototype.getInstance = function getInstance(payload) { - return new KeyInstance( - this._version, - payload, - this._solution.fleetSid - ); + return new KeyInstance(this._version, payload, this._solution.fleetSid); }; @@ -485,21 +451,14 @@ KeyInstance = function KeyInstance(version, payload, fleetSid, sid) { // Context this._context = undefined; - this._solution = { - fleetSid: fleetSid, - sid: sid || this.sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid || this.sid,}; }; Object.defineProperty(KeyInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new KeyContext( - this._version, - this._solution.fleetSid, - this._solution.sid - ); + this._context = new KeyContext(this._version, this._solution.fleetSid, this._solution.sid); } return this._context; @@ -578,10 +537,7 @@ KeyContext = function KeyContext(version, fleetSid, sid) { this._version = version; // Path Solution - this._solution = { - fleetSid: fleetSid, - sid: sid, - }; + this._solution = {fleetSid: fleetSid, sid: sid,}; this._uri = _.template( '/Fleets/<%= fleetSid %>/Keys/<%= sid %>' // jshint ignore:line )(this._solution); @@ -602,18 +558,10 @@ KeyContext = function KeyContext(version, fleetSid, sid) { /* jshint ignore:end */ KeyContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new KeyInstance( - this._version, - payload, - this._solution.fleetSid, - this._solution.sid - )); + deferred.resolve(new KeyInstance(this._version, payload, this._solution.fleetSid, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -642,10 +590,7 @@ KeyContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ KeyContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -693,19 +638,10 @@ KeyContext.prototype.update = function update(opts, callback) { 'DeviceSid': _.get(opts, 'deviceSid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new KeyInstance( - this._version, - payload, - this._solution.fleetSid, - this._solution.sid - )); + deferred.resolve(new KeyInstance(this._version, payload, this._solution.fleetSid, this._solution.sid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/preview/hosted_numbers/authorizationDocument.js b/lib/rest/preview/hosted_numbers/authorizationDocument.js index 15e38ac6ff..3ea1801895 100644 --- a/lib/rest/preview/hosted_numbers/authorizationDocument.js +++ b/lib/rest/preview/hosted_numbers/authorizationDocument.js @@ -234,18 +234,10 @@ AuthorizationDocumentList = function AuthorizationDocumentList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizationDocumentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AuthorizationDocumentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -280,17 +272,10 @@ AuthorizationDocumentList = function AuthorizationDocumentList(version) { callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizationDocumentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AuthorizationDocumentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -345,18 +330,10 @@ AuthorizationDocumentList = function AuthorizationDocumentList(version) { 'CcEmails': _.get(opts, 'ccEmails') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizationDocumentInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AuthorizationDocumentInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -384,10 +361,7 @@ AuthorizationDocumentList = function AuthorizationDocumentList(version) { */ /* jshint ignore:end */ AuthorizationDocumentListInstance.get = function get(sid) { - return new AuthorizationDocumentContext( - this._version, - sid - ); + return new AuthorizationDocumentContext(this._version, sid); }; return AuthorizationDocumentListInstance; @@ -434,10 +408,7 @@ AuthorizationDocumentPage.prototype.constructor = AuthorizationDocumentPage; /* jshint ignore:end */ AuthorizationDocumentPage.prototype.getInstance = function getInstance(payload) { - return new AuthorizationDocumentInstance( - this._version, - payload - ); + return new AuthorizationDocumentInstance(this._version, payload); }; @@ -478,19 +449,14 @@ AuthorizationDocumentInstance = function AuthorizationDocumentInstance(version, // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(AuthorizationDocumentInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new AuthorizationDocumentContext( - this._version, - this._solution.sid - ); + this._context = new AuthorizationDocumentContext(this._version, this._solution.sid); } return this._context; @@ -556,9 +522,7 @@ AuthorizationDocumentContext = function AuthorizationDocumentContext(version, this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/AuthorizationDocuments/<%= sid %>' // jshint ignore:line )(this._solution); @@ -579,17 +543,10 @@ AuthorizationDocumentContext = function AuthorizationDocumentContext(version, /* jshint ignore:end */ AuthorizationDocumentContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizationDocumentInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AuthorizationDocumentInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -641,18 +598,10 @@ AuthorizationDocumentContext.prototype.update = function update(opts, callback) 'Status': _.get(opts, 'status') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new AuthorizationDocumentInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AuthorizationDocumentInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/preview/hosted_numbers/hostedNumberOrder.js b/lib/rest/preview/hosted_numbers/hostedNumberOrder.js index 5f118619c5..38f2fd062a 100644 --- a/lib/rest/preview/hosted_numbers/hostedNumberOrder.js +++ b/lib/rest/preview/hosted_numbers/hostedNumberOrder.js @@ -268,18 +268,10 @@ HostedNumberOrderList = function HostedNumberOrderList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new HostedNumberOrderPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new HostedNumberOrderPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -321,17 +313,10 @@ HostedNumberOrderList = function HostedNumberOrderList(version) { HostedNumberOrderListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new HostedNumberOrderPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new HostedNumberOrderPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -411,18 +396,10 @@ HostedNumberOrderList = function HostedNumberOrderList(version) { 'Email': _.get(opts, 'email') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new HostedNumberOrderInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new HostedNumberOrderInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -450,10 +427,7 @@ HostedNumberOrderList = function HostedNumberOrderList(version) { */ /* jshint ignore:end */ HostedNumberOrderListInstance.get = function get(sid) { - return new HostedNumberOrderContext( - this._version, - sid - ); + return new HostedNumberOrderContext(this._version, sid); }; return HostedNumberOrderListInstance; @@ -499,10 +473,7 @@ HostedNumberOrderPage.prototype.constructor = HostedNumberOrderPage; */ /* jshint ignore:end */ HostedNumberOrderPage.prototype.getInstance = function getInstance(payload) { - return new HostedNumberOrderInstance( - this._version, - payload - ); + return new HostedNumberOrderInstance(this._version, payload); }; @@ -561,19 +532,14 @@ HostedNumberOrderInstance = function HostedNumberOrderInstance(version, payload, // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(HostedNumberOrderInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new HostedNumberOrderContext( - this._version, - this._solution.sid - ); + this._context = new HostedNumberOrderContext(this._version, this._solution.sid); } return this._context; @@ -656,9 +622,7 @@ HostedNumberOrderContext = function HostedNumberOrderContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/HostedNumberOrders/<%= sid %>' // jshint ignore:line )(this._solution); @@ -679,17 +643,10 @@ HostedNumberOrderContext = function HostedNumberOrderContext(version, sid) { /* jshint ignore:end */ HostedNumberOrderContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new HostedNumberOrderInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new HostedNumberOrderInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -718,10 +675,7 @@ HostedNumberOrderContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ HostedNumberOrderContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -778,18 +732,10 @@ HostedNumberOrderContext.prototype.update = function update(opts, callback) { 'VerificationCode': _.get(opts, 'verificationCode') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new HostedNumberOrderInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new HostedNumberOrderInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/preview/marketplace/availableAddOn.js b/lib/rest/preview/marketplace/availableAddOn.js index b504dfb4ad..dc1c420407 100644 --- a/lib/rest/preview/marketplace/availableAddOn.js +++ b/lib/rest/preview/marketplace/availableAddOn.js @@ -234,18 +234,10 @@ AvailableAddOnList = function AvailableAddOnList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AvailableAddOnPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AvailableAddOnPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -279,17 +271,10 @@ AvailableAddOnList = function AvailableAddOnList(version) { AvailableAddOnListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AvailableAddOnPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AvailableAddOnPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -317,10 +302,7 @@ AvailableAddOnList = function AvailableAddOnList(version) { */ /* jshint ignore:end */ AvailableAddOnListInstance.get = function get(sid) { - return new AvailableAddOnContext( - this._version, - sid - ); + return new AvailableAddOnContext(this._version, sid); }; return AvailableAddOnListInstance; @@ -365,10 +347,7 @@ AvailableAddOnPage.prototype.constructor = AvailableAddOnPage; */ /* jshint ignore:end */ AvailableAddOnPage.prototype.getInstance = function getInstance(payload) { - return new AvailableAddOnInstance( - this._version, - payload - ); + return new AvailableAddOnInstance(this._version, payload); }; @@ -408,19 +387,14 @@ AvailableAddOnInstance = function AvailableAddOnInstance(version, payload, sid) // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(AvailableAddOnInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new AvailableAddOnContext( - this._version, - this._solution.sid - ); + this._context = new AvailableAddOnContext(this._version, this._solution.sid); } return this._context; @@ -477,9 +451,7 @@ AvailableAddOnContext = function AvailableAddOnContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/AvailableAddOns/<%= sid %>' // jshint ignore:line )(this._solution); @@ -503,17 +475,10 @@ AvailableAddOnContext = function AvailableAddOnContext(version, sid) { /* jshint ignore:end */ AvailableAddOnContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new AvailableAddOnInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new AvailableAddOnInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -531,10 +496,7 @@ Object.defineProperty(AvailableAddOnContext.prototype, 'extensions', { get: function() { if (!this._extensions) { - this._extensions = new AvailableAddOnExtensionList( - this._version, - this._solution.sid - ); + this._extensions = new AvailableAddOnExtensionList(this._version, this._solution.sid); } return this._extensions; } diff --git a/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js b/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js index 8ca1b016ba..87cb597443 100644 --- a/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js +++ b/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js @@ -48,9 +48,7 @@ AvailableAddOnExtensionList = function AvailableAddOnExtensionList(version, AvailableAddOnExtensionListInstance._version = version; // Path Solution - AvailableAddOnExtensionListInstance._solution = { - availableAddOnSid: availableAddOnSid - }; + AvailableAddOnExtensionListInstance._solution = {availableAddOnSid: availableAddOnSid}; AvailableAddOnExtensionListInstance._uri = _.template( '/AvailableAddOns/<%= availableAddOnSid %>/Extensions' // jshint ignore:line )(AvailableAddOnExtensionListInstance._solution); @@ -236,18 +234,10 @@ AvailableAddOnExtensionList = function AvailableAddOnExtensionList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new AvailableAddOnExtensionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AvailableAddOnExtensionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +272,10 @@ AvailableAddOnExtensionList = function AvailableAddOnExtensionList(version, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new AvailableAddOnExtensionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new AvailableAddOnExtensionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -320,11 +303,7 @@ AvailableAddOnExtensionList = function AvailableAddOnExtensionList(version, */ /* jshint ignore:end */ AvailableAddOnExtensionListInstance.get = function get(sid) { - return new AvailableAddOnExtensionContext( - this._version, - this._solution.availableAddOnSid, - sid - ); + return new AvailableAddOnExtensionContext(this._version, this._solution.availableAddOnSid, sid); }; return AvailableAddOnExtensionListInstance; @@ -371,11 +350,7 @@ AvailableAddOnExtensionPage.prototype.constructor = AvailableAddOnExtensionPage; /* jshint ignore:end */ AvailableAddOnExtensionPage.prototype.getInstance = function getInstance(payload) { - return new AvailableAddOnExtensionInstance( - this._version, - payload, - this._solution.availableAddOnSid - ); + return new AvailableAddOnExtensionInstance(this._version, payload, this._solution.availableAddOnSid); }; @@ -414,10 +389,7 @@ AvailableAddOnExtensionInstance = function // Context this._context = undefined; - this._solution = { - availableAddOnSid: availableAddOnSid, - sid: sid || this.sid, - }; + this._solution = {availableAddOnSid: availableAddOnSid, sid: sid || this.sid,}; }; Object.defineProperty(AvailableAddOnExtensionInstance.prototype, @@ -469,10 +441,7 @@ AvailableAddOnExtensionContext = function this._version = version; // Path Solution - this._solution = { - availableAddOnSid: availableAddOnSid, - sid: sid, - }; + this._solution = {availableAddOnSid: availableAddOnSid, sid: sid,}; this._uri = _.template( '/AvailableAddOns/<%= availableAddOnSid %>/Extensions/<%= sid %>' // jshint ignore:line )(this._solution); @@ -493,10 +462,7 @@ AvailableAddOnExtensionContext = function /* jshint ignore:end */ AvailableAddOnExtensionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new AvailableAddOnExtensionInstance( diff --git a/lib/rest/preview/marketplace/installedAddOn.js b/lib/rest/preview/marketplace/installedAddOn.js index d24ad19076..22d1b880ef 100644 --- a/lib/rest/preview/marketplace/installedAddOn.js +++ b/lib/rest/preview/marketplace/installedAddOn.js @@ -96,18 +96,10 @@ InstalledAddOnList = function InstalledAddOnList(version) { 'UniqueName': _.get(opts, 'uniqueName') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new InstalledAddOnInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -303,18 +295,10 @@ InstalledAddOnList = function InstalledAddOnList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InstalledAddOnPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -348,17 +332,10 @@ InstalledAddOnList = function InstalledAddOnList(version) { InstalledAddOnListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InstalledAddOnPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -386,10 +363,7 @@ InstalledAddOnList = function InstalledAddOnList(version) { */ /* jshint ignore:end */ InstalledAddOnListInstance.get = function get(sid) { - return new InstalledAddOnContext( - this._version, - sid - ); + return new InstalledAddOnContext(this._version, sid); }; return InstalledAddOnListInstance; @@ -434,10 +408,7 @@ InstalledAddOnPage.prototype.constructor = InstalledAddOnPage; */ /* jshint ignore:end */ InstalledAddOnPage.prototype.getInstance = function getInstance(payload) { - return new InstalledAddOnInstance( - this._version, - payload - ); + return new InstalledAddOnInstance(this._version, payload); }; @@ -485,19 +456,14 @@ InstalledAddOnInstance = function InstalledAddOnInstance(version, payload, sid) // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(InstalledAddOnInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new InstalledAddOnContext( - this._version, - this._solution.sid - ); + this._context = new InstalledAddOnContext(this._version, this._solution.sid); } return this._context; @@ -593,9 +559,7 @@ InstalledAddOnContext = function InstalledAddOnContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/InstalledAddOns/<%= sid %>' // jshint ignore:line )(this._solution); @@ -619,10 +583,7 @@ InstalledAddOnContext = function InstalledAddOnContext(version, sid) { /* jshint ignore:end */ InstalledAddOnContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -654,17 +615,10 @@ InstalledAddOnContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ InstalledAddOnContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new InstalledAddOnInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -709,18 +663,10 @@ InstalledAddOnContext.prototype.update = function update(opts, callback) { 'UniqueName': _.get(opts, 'uniqueName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new InstalledAddOnInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -738,10 +684,7 @@ Object.defineProperty(InstalledAddOnContext.prototype, 'extensions', { get: function() { if (!this._extensions) { - this._extensions = new InstalledAddOnExtensionList( - this._version, - this._solution.sid - ); + this._extensions = new InstalledAddOnExtensionList(this._version, this._solution.sid); } return this._extensions; } diff --git a/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js b/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js index 27874c4f14..bd8c0a6aa5 100644 --- a/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js +++ b/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js @@ -49,9 +49,7 @@ InstalledAddOnExtensionList = function InstalledAddOnExtensionList(version, InstalledAddOnExtensionListInstance._version = version; // Path Solution - InstalledAddOnExtensionListInstance._solution = { - installedAddOnSid: installedAddOnSid - }; + InstalledAddOnExtensionListInstance._solution = {installedAddOnSid: installedAddOnSid}; InstalledAddOnExtensionListInstance._uri = _.template( '/InstalledAddOns/<%= installedAddOnSid %>/Extensions' // jshint ignore:line )(InstalledAddOnExtensionListInstance._solution); @@ -237,18 +235,10 @@ InstalledAddOnExtensionList = function InstalledAddOnExtensionList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnExtensionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InstalledAddOnExtensionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -283,17 +273,10 @@ InstalledAddOnExtensionList = function InstalledAddOnExtensionList(version, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InstalledAddOnExtensionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InstalledAddOnExtensionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -321,11 +304,7 @@ InstalledAddOnExtensionList = function InstalledAddOnExtensionList(version, */ /* jshint ignore:end */ InstalledAddOnExtensionListInstance.get = function get(sid) { - return new InstalledAddOnExtensionContext( - this._version, - this._solution.installedAddOnSid, - sid - ); + return new InstalledAddOnExtensionContext(this._version, this._solution.installedAddOnSid, sid); }; return InstalledAddOnExtensionListInstance; @@ -372,11 +351,7 @@ InstalledAddOnExtensionPage.prototype.constructor = InstalledAddOnExtensionPage; /* jshint ignore:end */ InstalledAddOnExtensionPage.prototype.getInstance = function getInstance(payload) { - return new InstalledAddOnExtensionInstance( - this._version, - payload, - this._solution.installedAddOnSid - ); + return new InstalledAddOnExtensionInstance(this._version, payload, this._solution.installedAddOnSid); }; @@ -418,10 +393,7 @@ InstalledAddOnExtensionInstance = function // Context this._context = undefined; - this._solution = { - installedAddOnSid: installedAddOnSid, - sid: sid || this.sid, - }; + this._solution = {installedAddOnSid: installedAddOnSid, sid: sid || this.sid,}; }; Object.defineProperty(InstalledAddOnExtensionInstance.prototype, @@ -494,10 +466,7 @@ InstalledAddOnExtensionContext = function this._version = version; // Path Solution - this._solution = { - installedAddOnSid: installedAddOnSid, - sid: sid, - }; + this._solution = {installedAddOnSid: installedAddOnSid, sid: sid,}; this._uri = _.template( '/InstalledAddOns/<%= installedAddOnSid %>/Extensions/<%= sid %>' // jshint ignore:line )(this._solution); @@ -518,10 +487,7 @@ InstalledAddOnExtensionContext = function /* jshint ignore:end */ InstalledAddOnExtensionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InstalledAddOnExtensionInstance( @@ -569,15 +535,9 @@ InstalledAddOnExtensionContext.prototype.update = function update(opts, } var deferred = Q.defer(); - var data = values.of({ - 'Enabled': serialize.bool(_.get(opts, 'enabled')) - }); + var data = values.of({'Enabled': serialize.bool(_.get(opts, 'enabled'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new InstalledAddOnExtensionInstance( diff --git a/lib/rest/preview/proxy/service.js b/lib/rest/preview/proxy/service.js index 31a3440a59..2d740a34ac 100644 --- a/lib/rest/preview/proxy/service.js +++ b/lib/rest/preview/proxy/service.js @@ -238,18 +238,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -283,17 +275,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -340,18 +325,10 @@ ServiceList = function ServiceList(version) { 'CallbackUrl': _.get(opts, 'callbackUrl') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -379,10 +356,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -427,10 +401,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -472,19 +443,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -615,9 +581,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -643,17 +607,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -682,10 +639,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -735,18 +689,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'CallbackUrl': _.get(opts, 'callbackUrl') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -764,10 +710,7 @@ Object.defineProperty(ServiceContext.prototype, 'sessions', { get: function() { if (!this._sessions) { - this._sessions = new SessionList( - this._version, - this._solution.sid - ); + this._sessions = new SessionList(this._version, this._solution.sid); } return this._sessions; } @@ -777,10 +720,7 @@ Object.defineProperty(ServiceContext.prototype, 'phoneNumbers', { get: function() { if (!this._phoneNumbers) { - this._phoneNumbers = new PhoneNumberList( - this._version, - this._solution.sid - ); + this._phoneNumbers = new PhoneNumberList(this._version, this._solution.sid); } return this._phoneNumbers; } @@ -790,10 +730,7 @@ Object.defineProperty(ServiceContext.prototype, 'shortCodes', { get: function() { if (!this._shortCodes) { - this._shortCodes = new ShortCodeList( - this._version, - this._solution.sid - ); + this._shortCodes = new ShortCodeList(this._version, this._solution.sid); } return this._shortCodes; } diff --git a/lib/rest/preview/proxy/service/phoneNumber.js b/lib/rest/preview/proxy/service/phoneNumber.js index d2a71f9f2a..925cf305b4 100644 --- a/lib/rest/preview/proxy/service/phoneNumber.js +++ b/lib/rest/preview/proxy/service/phoneNumber.js @@ -49,9 +49,7 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { PhoneNumberListInstance._version = version; // Path Solution - PhoneNumberListInstance._solution = { - serviceSid: serviceSid - }; + PhoneNumberListInstance._solution = {serviceSid: serviceSid}; PhoneNumberListInstance._uri = _.template( '/Services/<%= serviceSid %>/PhoneNumbers' // jshint ignore:line )(PhoneNumberListInstance._solution); @@ -78,15 +76,9 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Sid': _.get(opts, 'sid') - }); + var data = values.of({'Sid': _.get(opts, 'sid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( @@ -290,18 +282,10 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +319,10 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { PhoneNumberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,11 +350,7 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { */ /* jshint ignore:end */ PhoneNumberListInstance.get = function get(sid) { - return new PhoneNumberContext( - this._version, - this._solution.serviceSid, - sid - ); + return new PhoneNumberContext(this._version, this._solution.serviceSid, sid); }; return PhoneNumberListInstance; @@ -422,11 +395,7 @@ PhoneNumberPage.prototype.constructor = PhoneNumberPage; */ /* jshint ignore:end */ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new PhoneNumberInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new PhoneNumberInstance(this._version, payload, this._solution.serviceSid); }; @@ -470,21 +439,14 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(PhoneNumberInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new PhoneNumberContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new PhoneNumberContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -541,10 +503,7 @@ PhoneNumberContext = function PhoneNumberContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/PhoneNumbers/<%= sid %>' // jshint ignore:line )(this._solution); @@ -565,10 +524,7 @@ PhoneNumberContext = function PhoneNumberContext(version, serviceSid, sid) { /* jshint ignore:end */ PhoneNumberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -600,10 +556,7 @@ PhoneNumberContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ PhoneNumberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( diff --git a/lib/rest/preview/proxy/service/session.js b/lib/rest/preview/proxy/service/session.js index 08f9b1ee01..fd26851112 100644 --- a/lib/rest/preview/proxy/service/session.js +++ b/lib/rest/preview/proxy/service/session.js @@ -51,9 +51,7 @@ SessionList = function SessionList(version, serviceSid) { SessionListInstance._version = version; // Path Solution - SessionListInstance._solution = { - serviceSid: serviceSid - }; + SessionListInstance._solution = {serviceSid: serviceSid}; SessionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Sessions' // jshint ignore:line )(SessionListInstance._solution); @@ -254,18 +252,10 @@ SessionList = function SessionList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SessionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SessionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -302,17 +292,10 @@ SessionList = function SessionList(version, serviceSid) { SessionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SessionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SessionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,11 +343,7 @@ SessionList = function SessionList(version, serviceSid) { 'Participants': _.get(opts, 'participants') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SessionInstance( @@ -400,11 +379,7 @@ SessionList = function SessionList(version, serviceSid) { */ /* jshint ignore:end */ SessionListInstance.get = function get(sid) { - return new SessionContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SessionContext(this._version, this._solution.serviceSid, sid); }; return SessionListInstance; @@ -449,11 +424,7 @@ SessionPage.prototype.constructor = SessionPage; */ /* jshint ignore:end */ SessionPage.prototype.getInstance = function getInstance(payload) { - return new SessionInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SessionInstance(this._version, payload, this._solution.serviceSid); }; @@ -502,21 +473,14 @@ SessionInstance = function SessionInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SessionInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SessionContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SessionContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -631,10 +595,7 @@ SessionContext = function SessionContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sid %>' // jshint ignore:line )(this._solution); @@ -659,10 +620,7 @@ SessionContext = function SessionContext(version, serviceSid, sid) { /* jshint ignore:end */ SessionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SessionInstance( @@ -699,10 +657,7 @@ SessionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SessionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -753,11 +708,7 @@ SessionContext.prototype.update = function update(opts, callback) { 'Participants': _.get(opts, 'participants') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SessionInstance( diff --git a/lib/rest/preview/proxy/service/session/interaction.js b/lib/rest/preview/proxy/service/session/interaction.js index acb418d731..cb957f74a4 100644 --- a/lib/rest/preview/proxy/service/session/interaction.js +++ b/lib/rest/preview/proxy/service/session/interaction.js @@ -50,10 +50,7 @@ InteractionList = function InteractionList(version, serviceSid, sessionSid) { InteractionListInstance._version = version; // Path Solution - InteractionListInstance._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid - }; + InteractionListInstance._solution = {serviceSid: serviceSid, sessionSid: sessionSid}; InteractionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Interactions' // jshint ignore:line )(InteractionListInstance._solution); @@ -257,18 +254,10 @@ InteractionList = function InteractionList(version, serviceSid, sessionSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +295,10 @@ InteractionList = function InteractionList(version, serviceSid, sessionSid) { InteractionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -467,11 +449,7 @@ InteractionInstance = function InteractionInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid || this.sid,}; }; Object.defineProperty(InteractionInstance.prototype, @@ -525,11 +503,7 @@ InteractionContext = function InteractionContext(version, serviceSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Interactions/<%= sid %>' // jshint ignore:line )(this._solution); @@ -550,10 +524,7 @@ InteractionContext = function InteractionContext(version, serviceSid, /* jshint ignore:end */ InteractionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InteractionInstance( diff --git a/lib/rest/preview/proxy/service/session/participant.js b/lib/rest/preview/proxy/service/session/participant.js index 6a1b958391..76abd19f3d 100644 --- a/lib/rest/preview/proxy/service/session/participant.js +++ b/lib/rest/preview/proxy/service/session/participant.js @@ -52,10 +52,7 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { ParticipantListInstance._version = version; // Path Solution - ParticipantListInstance._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid - }; + ParticipantListInstance._solution = {serviceSid: serviceSid, sessionSid: sessionSid}; ParticipantListInstance._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Participants' // jshint ignore:line )(ParticipantListInstance._solution); @@ -259,18 +256,10 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ParticipantPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ParticipantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -308,17 +297,10 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { ParticipantListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ParticipantPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ParticipantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +349,7 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { 'ParticipantType': _.get(opts, 'participantType') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -516,11 +494,7 @@ ParticipantInstance = function ParticipantInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid || this.sid,}; }; Object.defineProperty(ParticipantInstance.prototype, @@ -634,11 +608,7 @@ ParticipantContext = function ParticipantContext(version, serviceSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Participants/<%= sid %>' // jshint ignore:line )(this._solution); @@ -662,10 +632,7 @@ ParticipantContext = function ParticipantContext(version, serviceSid, /* jshint ignore:end */ ParticipantContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -703,10 +670,7 @@ ParticipantContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ParticipantContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -757,11 +721,7 @@ ParticipantContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( diff --git a/lib/rest/preview/proxy/service/session/participant/messageInteraction.js b/lib/rest/preview/proxy/service/session/participant/messageInteraction.js index 7d5a9b3533..48a72c5aa0 100644 --- a/lib/rest/preview/proxy/service/session/participant/messageInteraction.js +++ b/lib/rest/preview/proxy/service/session/participant/messageInteraction.js @@ -86,16 +86,9 @@ MessageInteractionList = function MessageInteractionList(version, serviceSid, opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Body': _.get(opts, 'body'), - 'MediaUrl': _.get(opts, 'mediaUrl') - }); + var data = values.of({'Body': _.get(opts, 'body'), 'MediaUrl': _.get(opts, 'mediaUrl')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInteractionInstance( @@ -301,18 +294,10 @@ MessageInteractionList = function MessageInteractionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessageInteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessageInteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -346,17 +331,10 @@ MessageInteractionList = function MessageInteractionList(version, serviceSid, MessageInteractionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessageInteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessageInteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -600,10 +578,7 @@ MessageInteractionContext = function MessageInteractionContext(version, /* jshint ignore:end */ MessageInteractionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInteractionInstance( diff --git a/lib/rest/preview/proxy/service/shortCode.js b/lib/rest/preview/proxy/service/shortCode.js index 83f8cbaeb6..751488c12b 100644 --- a/lib/rest/preview/proxy/service/shortCode.js +++ b/lib/rest/preview/proxy/service/shortCode.js @@ -49,9 +49,7 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { ShortCodeListInstance._version = version; // Path Solution - ShortCodeListInstance._solution = { - serviceSid: serviceSid - }; + ShortCodeListInstance._solution = {serviceSid: serviceSid}; ShortCodeListInstance._uri = _.template( '/Services/<%= serviceSid %>/ShortCodes' // jshint ignore:line )(ShortCodeListInstance._solution); @@ -78,15 +76,9 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Sid': _.get(opts, 'sid') - }); + var data = values.of({'Sid': _.get(opts, 'sid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( @@ -290,18 +282,10 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +319,10 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { ShortCodeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,11 +350,7 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { */ /* jshint ignore:end */ ShortCodeListInstance.get = function get(sid) { - return new ShortCodeContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ShortCodeContext(this._version, this._solution.serviceSid, sid); }; return ShortCodeListInstance; @@ -422,11 +395,7 @@ ShortCodePage.prototype.constructor = ShortCodePage; */ /* jshint ignore:end */ ShortCodePage.prototype.getInstance = function getInstance(payload) { - return new ShortCodeInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ShortCodeInstance(this._version, payload, this._solution.serviceSid); }; @@ -469,21 +438,14 @@ ShortCodeInstance = function ShortCodeInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ShortCodeInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ShortCodeContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ShortCodeContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -540,10 +502,7 @@ ShortCodeContext = function ShortCodeContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/ShortCodes/<%= sid %>' // jshint ignore:line )(this._solution); @@ -564,10 +523,7 @@ ShortCodeContext = function ShortCodeContext(version, serviceSid, sid) { /* jshint ignore:end */ ShortCodeContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -599,10 +555,7 @@ ShortCodeContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ ShortCodeContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( diff --git a/lib/rest/preview/sync/service.js b/lib/rest/preview/sync/service.js index b6cce47ee0..53b366f24a 100644 --- a/lib/rest/preview/sync/service.js +++ b/lib/rest/preview/sync/service.js @@ -90,18 +90,10 @@ ServiceList = function ServiceList(version) { 'AclEnabled': serialize.bool(_.get(opts, 'aclEnabled')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -297,18 +289,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -342,17 +326,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,10 +357,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -428,10 +402,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -475,19 +446,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -618,9 +584,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -646,17 +610,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -685,10 +642,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -739,18 +693,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'AclEnabled': serialize.bool(_.get(opts, 'aclEnabled')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -768,10 +714,7 @@ Object.defineProperty(ServiceContext.prototype, 'documents', { get: function() { if (!this._documents) { - this._documents = new DocumentList( - this._version, - this._solution.sid - ); + this._documents = new DocumentList(this._version, this._solution.sid); } return this._documents; } @@ -781,10 +724,7 @@ Object.defineProperty(ServiceContext.prototype, 'syncLists', { get: function() { if (!this._syncLists) { - this._syncLists = new SyncListList( - this._version, - this._solution.sid - ); + this._syncLists = new SyncListList(this._version, this._solution.sid); } return this._syncLists; } @@ -794,10 +734,7 @@ Object.defineProperty(ServiceContext.prototype, 'syncMaps', { get: function() { if (!this._syncMaps) { - this._syncMaps = new SyncMapList( - this._version, - this._solution.sid - ); + this._syncMaps = new SyncMapList(this._version, this._solution.sid); } return this._syncMaps; } diff --git a/lib/rest/preview/sync/service/document.js b/lib/rest/preview/sync/service/document.js index 5178778382..bc15531f5d 100644 --- a/lib/rest/preview/sync/service/document.js +++ b/lib/rest/preview/sync/service/document.js @@ -52,9 +52,7 @@ DocumentList = function DocumentList(version, serviceSid) { DocumentListInstance._version = version; // Path Solution - DocumentListInstance._solution = { - serviceSid: serviceSid - }; + DocumentListInstance._solution = {serviceSid: serviceSid}; DocumentListInstance._uri = _.template( '/Services/<%= serviceSid %>/Documents' // jshint ignore:line )(DocumentListInstance._solution); @@ -87,11 +85,7 @@ DocumentList = function DocumentList(version, serviceSid) { 'Data': serialize.object(_.get(opts, 'data')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DocumentInstance( @@ -295,18 +289,10 @@ DocumentList = function DocumentList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -340,17 +326,10 @@ DocumentList = function DocumentList(version, serviceSid) { DocumentListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -378,11 +357,7 @@ DocumentList = function DocumentList(version, serviceSid) { */ /* jshint ignore:end */ DocumentListInstance.get = function get(sid) { - return new DocumentContext( - this._version, - this._solution.serviceSid, - sid - ); + return new DocumentContext(this._version, this._solution.serviceSid, sid); }; return DocumentListInstance; @@ -427,11 +402,7 @@ DocumentPage.prototype.constructor = DocumentPage; */ /* jshint ignore:end */ DocumentPage.prototype.getInstance = function getInstance(payload) { - return new DocumentInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new DocumentInstance(this._version, payload, this._solution.serviceSid); }; @@ -478,21 +449,14 @@ DocumentInstance = function DocumentInstance(version, payload, serviceSid, sid) // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(DocumentInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new DocumentContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new DocumentContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -587,10 +551,7 @@ DocumentContext = function DocumentContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Documents/<%= sid %>' // jshint ignore:line )(this._solution); @@ -614,10 +575,7 @@ DocumentContext = function DocumentContext(version, serviceSid, sid) { /* jshint ignore:end */ DocumentContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DocumentInstance( @@ -654,10 +612,7 @@ DocumentContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ DocumentContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -698,15 +653,9 @@ DocumentContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DocumentInstance( diff --git a/lib/rest/preview/sync/service/document/documentPermission.js b/lib/rest/preview/sync/service/document/documentPermission.js index 56d03df615..f082445ef4 100644 --- a/lib/rest/preview/sync/service/document/documentPermission.js +++ b/lib/rest/preview/sync/service/document/documentPermission.js @@ -51,10 +51,7 @@ DocumentPermissionList = function DocumentPermissionList(version, serviceSid, DocumentPermissionListInstance._version = version; // Path Solution - DocumentPermissionListInstance._solution = { - serviceSid: serviceSid, - documentSid: documentSid - }; + DocumentPermissionListInstance._solution = {serviceSid: serviceSid, documentSid: documentSid}; DocumentPermissionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Documents/<%= documentSid %>/Permissions' // jshint ignore:line )(DocumentPermissionListInstance._solution); @@ -240,18 +237,10 @@ DocumentPermissionList = function DocumentPermissionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +274,10 @@ DocumentPermissionList = function DocumentPermissionList(version, serviceSid, DocumentPermissionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -521,11 +503,7 @@ DocumentPermissionContext = function DocumentPermissionContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - documentSid: documentSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, documentSid: documentSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Documents/<%= documentSid %>/Permissions/<%= identity %>' // jshint ignore:line )(this._solution); @@ -546,10 +524,7 @@ DocumentPermissionContext = function DocumentPermissionContext(version, /* jshint ignore:end */ DocumentPermissionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DocumentPermissionInstance( @@ -587,10 +562,7 @@ DocumentPermissionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ DocumentPermissionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -645,11 +617,7 @@ DocumentPermissionContext.prototype.update = function update(opts, callback) { 'Manage': serialize.bool(_.get(opts, 'manage')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DocumentPermissionInstance( diff --git a/lib/rest/preview/sync/service/syncList.js b/lib/rest/preview/sync/service/syncList.js index dc5fa95e7b..3fac3f5a78 100644 --- a/lib/rest/preview/sync/service/syncList.js +++ b/lib/rest/preview/sync/service/syncList.js @@ -52,9 +52,7 @@ SyncListList = function SyncListList(version, serviceSid) { SyncListListInstance._version = version; // Path Solution - SyncListListInstance._solution = { - serviceSid: serviceSid - }; + SyncListListInstance._solution = {serviceSid: serviceSid}; SyncListListInstance._uri = _.template( '/Services/<%= serviceSid %>/Lists' // jshint ignore:line )(SyncListListInstance._solution); @@ -81,15 +79,9 @@ SyncListList = function SyncListList(version, serviceSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'UniqueName': _.get(opts, 'uniqueName') - }); + var data = values.of({'UniqueName': _.get(opts, 'uniqueName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListInstance( @@ -293,18 +285,10 @@ SyncListList = function SyncListList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -338,17 +322,10 @@ SyncListList = function SyncListList(version, serviceSid) { SyncListListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -376,11 +353,7 @@ SyncListList = function SyncListList(version, serviceSid) { */ /* jshint ignore:end */ SyncListListInstance.get = function get(sid) { - return new SyncListContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SyncListContext(this._version, this._solution.serviceSid, sid); }; return SyncListListInstance; @@ -425,11 +398,7 @@ SyncListPage.prototype.constructor = SyncListPage; */ /* jshint ignore:end */ SyncListPage.prototype.getInstance = function getInstance(payload) { - return new SyncListInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SyncListInstance(this._version, payload, this._solution.serviceSid); }; @@ -474,21 +443,14 @@ SyncListInstance = function SyncListInstance(version, payload, serviceSid, sid) // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SyncListInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SyncListContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SyncListContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -581,10 +543,7 @@ SyncListContext = function SyncListContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= sid %>' // jshint ignore:line )(this._solution); @@ -609,10 +568,7 @@ SyncListContext = function SyncListContext(version, serviceSid, sid) { /* jshint ignore:end */ SyncListContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncListInstance( @@ -649,10 +605,7 @@ SyncListContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncListContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/preview/sync/service/syncList/syncListItem.js b/lib/rest/preview/sync/service/syncList/syncListItem.js index 21bb105a06..ff5b8017ec 100644 --- a/lib/rest/preview/sync/service/syncList/syncListItem.js +++ b/lib/rest/preview/sync/service/syncList/syncListItem.js @@ -52,10 +52,7 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { SyncListItemListInstance._version = version; // Path Solution - SyncListItemListInstance._solution = { - serviceSid: serviceSid, - listSid: listSid - }; + SyncListItemListInstance._solution = {serviceSid: serviceSid, listSid: listSid}; SyncListItemListInstance._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items' // jshint ignore:line )(SyncListItemListInstance._solution); @@ -83,15 +80,9 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListItemInstance( @@ -312,18 +303,10 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,17 +343,10 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { SyncListItemListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -500,11 +476,7 @@ SyncListItemInstance = function SyncListItemInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - index: index || this.index, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, index: index || this.index,}; }; Object.defineProperty(SyncListItemInstance.prototype, @@ -594,11 +566,7 @@ SyncListItemContext = function SyncListItemContext(version, serviceSid, listSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - index: index, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, index: index,}; this._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items/<%= index %>' // jshint ignore:line )(this._solution); @@ -619,10 +587,7 @@ SyncListItemContext = function SyncListItemContext(version, serviceSid, listSid, /* jshint ignore:end */ SyncListItemContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncListItemInstance( @@ -660,10 +625,7 @@ SyncListItemContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncListItemContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -704,15 +666,9 @@ SyncListItemContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListItemInstance( diff --git a/lib/rest/preview/sync/service/syncList/syncListPermission.js b/lib/rest/preview/sync/service/syncList/syncListPermission.js index 6cb814fc08..25ae5fd581 100644 --- a/lib/rest/preview/sync/service/syncList/syncListPermission.js +++ b/lib/rest/preview/sync/service/syncList/syncListPermission.js @@ -51,10 +51,7 @@ SyncListPermissionList = function SyncListPermissionList(version, serviceSid, SyncListPermissionListInstance._version = version; // Path Solution - SyncListPermissionListInstance._solution = { - serviceSid: serviceSid, - listSid: listSid - }; + SyncListPermissionListInstance._solution = {serviceSid: serviceSid, listSid: listSid}; SyncListPermissionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Permissions' // jshint ignore:line )(SyncListPermissionListInstance._solution); @@ -240,18 +237,10 @@ SyncListPermissionList = function SyncListPermissionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +274,10 @@ SyncListPermissionList = function SyncListPermissionList(version, serviceSid, SyncListPermissionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -424,11 +406,7 @@ SyncListPermissionInstance = function SyncListPermissionInstance(version, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - identity: identity || this.identity, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, identity: identity || this.identity,}; }; Object.defineProperty(SyncListPermissionInstance.prototype, @@ -521,11 +499,7 @@ SyncListPermissionContext = function SyncListPermissionContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Permissions/<%= identity %>' // jshint ignore:line )(this._solution); @@ -546,10 +520,7 @@ SyncListPermissionContext = function SyncListPermissionContext(version, /* jshint ignore:end */ SyncListPermissionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncListPermissionInstance( @@ -587,10 +558,7 @@ SyncListPermissionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncListPermissionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -645,11 +613,7 @@ SyncListPermissionContext.prototype.update = function update(opts, callback) { 'Manage': serialize.bool(_.get(opts, 'manage')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListPermissionInstance( diff --git a/lib/rest/preview/sync/service/syncMap.js b/lib/rest/preview/sync/service/syncMap.js index 203c2b448a..cbeb024c32 100644 --- a/lib/rest/preview/sync/service/syncMap.js +++ b/lib/rest/preview/sync/service/syncMap.js @@ -52,9 +52,7 @@ SyncMapList = function SyncMapList(version, serviceSid) { SyncMapListInstance._version = version; // Path Solution - SyncMapListInstance._solution = { - serviceSid: serviceSid - }; + SyncMapListInstance._solution = {serviceSid: serviceSid}; SyncMapListInstance._uri = _.template( '/Services/<%= serviceSid %>/Maps' // jshint ignore:line )(SyncMapListInstance._solution); @@ -81,15 +79,9 @@ SyncMapList = function SyncMapList(version, serviceSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'UniqueName': _.get(opts, 'uniqueName') - }); + var data = values.of({'UniqueName': _.get(opts, 'uniqueName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapInstance( @@ -293,18 +285,10 @@ SyncMapList = function SyncMapList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -338,17 +322,10 @@ SyncMapList = function SyncMapList(version, serviceSid) { SyncMapListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -376,11 +353,7 @@ SyncMapList = function SyncMapList(version, serviceSid) { */ /* jshint ignore:end */ SyncMapListInstance.get = function get(sid) { - return new SyncMapContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SyncMapContext(this._version, this._solution.serviceSid, sid); }; return SyncMapListInstance; @@ -425,11 +398,7 @@ SyncMapPage.prototype.constructor = SyncMapPage; */ /* jshint ignore:end */ SyncMapPage.prototype.getInstance = function getInstance(payload) { - return new SyncMapInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SyncMapInstance(this._version, payload, this._solution.serviceSid); }; @@ -473,21 +442,14 @@ SyncMapInstance = function SyncMapInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SyncMapInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SyncMapContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SyncMapContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -579,10 +541,7 @@ SyncMapContext = function SyncMapContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= sid %>' // jshint ignore:line )(this._solution); @@ -607,10 +566,7 @@ SyncMapContext = function SyncMapContext(version, serviceSid, sid) { /* jshint ignore:end */ SyncMapContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapInstance( @@ -647,10 +603,7 @@ SyncMapContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncMapContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/preview/sync/service/syncMap/syncMapItem.js b/lib/rest/preview/sync/service/syncMap/syncMapItem.js index fbf133d837..79854e1c08 100644 --- a/lib/rest/preview/sync/service/syncMap/syncMapItem.js +++ b/lib/rest/preview/sync/service/syncMap/syncMapItem.js @@ -52,10 +52,7 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { SyncMapItemListInstance._version = version; // Path Solution - SyncMapItemListInstance._solution = { - serviceSid: serviceSid, - mapSid: mapSid - }; + SyncMapItemListInstance._solution = {serviceSid: serviceSid, mapSid: mapSid}; SyncMapItemListInstance._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items' // jshint ignore:line )(SyncMapItemListInstance._solution); @@ -86,16 +83,9 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Key': _.get(opts, 'key'), - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Key': _.get(opts, 'key'), 'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapItemInstance( @@ -316,18 +306,10 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -364,17 +346,10 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { SyncMapItemListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -402,12 +377,7 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { */ /* jshint ignore:end */ SyncMapItemListInstance.get = function get(key) { - return new SyncMapItemContext( - this._version, - this._solution.serviceSid, - this._solution.mapSid, - key - ); + return new SyncMapItemContext(this._version, this._solution.serviceSid, this._solution.mapSid, key); }; return SyncMapItemListInstance; @@ -503,11 +473,7 @@ SyncMapItemInstance = function SyncMapItemInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - key: key || this.key, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, key: key || this.key,}; }; Object.defineProperty(SyncMapItemInstance.prototype, @@ -597,11 +563,7 @@ SyncMapItemContext = function SyncMapItemContext(version, serviceSid, mapSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - key: key, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, key: key,}; this._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items/<%= key %>' // jshint ignore:line )(this._solution); @@ -622,10 +584,7 @@ SyncMapItemContext = function SyncMapItemContext(version, serviceSid, mapSid, /* jshint ignore:end */ SyncMapItemContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapItemInstance( @@ -663,10 +622,7 @@ SyncMapItemContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncMapItemContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -707,15 +663,9 @@ SyncMapItemContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapItemInstance( diff --git a/lib/rest/preview/sync/service/syncMap/syncMapPermission.js b/lib/rest/preview/sync/service/syncMap/syncMapPermission.js index 799dc2a8ec..e34d6f616e 100644 --- a/lib/rest/preview/sync/service/syncMap/syncMapPermission.js +++ b/lib/rest/preview/sync/service/syncMap/syncMapPermission.js @@ -51,10 +51,7 @@ SyncMapPermissionList = function SyncMapPermissionList(version, serviceSid, SyncMapPermissionListInstance._version = version; // Path Solution - SyncMapPermissionListInstance._solution = { - serviceSid: serviceSid, - mapSid: mapSid - }; + SyncMapPermissionListInstance._solution = {serviceSid: serviceSid, mapSid: mapSid}; SyncMapPermissionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Permissions' // jshint ignore:line )(SyncMapPermissionListInstance._solution); @@ -240,18 +237,10 @@ SyncMapPermissionList = function SyncMapPermissionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +274,10 @@ SyncMapPermissionList = function SyncMapPermissionList(version, serviceSid, SyncMapPermissionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -424,11 +406,7 @@ SyncMapPermissionInstance = function SyncMapPermissionInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - identity: identity || this.identity, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, identity: identity || this.identity,}; }; Object.defineProperty(SyncMapPermissionInstance.prototype, @@ -521,11 +499,7 @@ SyncMapPermissionContext = function SyncMapPermissionContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Permissions/<%= identity %>' // jshint ignore:line )(this._solution); @@ -546,10 +520,7 @@ SyncMapPermissionContext = function SyncMapPermissionContext(version, /* jshint ignore:end */ SyncMapPermissionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapPermissionInstance( @@ -587,10 +558,7 @@ SyncMapPermissionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncMapPermissionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -645,11 +613,7 @@ SyncMapPermissionContext.prototype.update = function update(opts, callback) { 'Manage': serialize.bool(_.get(opts, 'manage')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapPermissionInstance( diff --git a/lib/rest/preview/wireless/command.js b/lib/rest/preview/wireless/command.js index 3464f0e071..dfa1e617df 100644 --- a/lib/rest/preview/wireless/command.js +++ b/lib/rest/preview/wireless/command.js @@ -254,18 +254,10 @@ CommandList = function CommandList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CommandPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CommandPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -303,17 +295,10 @@ CommandList = function CommandList(version) { CommandListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CommandPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CommandPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,18 +352,10 @@ CommandList = function CommandList(version) { 'IncludeSid': _.get(opts, 'includeSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CommandInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CommandInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -406,10 +383,7 @@ CommandList = function CommandList(version) { */ /* jshint ignore:end */ CommandListInstance.get = function get(sid) { - return new CommandContext( - this._version, - sid - ); + return new CommandContext(this._version, sid); }; return CommandListInstance; @@ -454,10 +428,7 @@ CommandPage.prototype.constructor = CommandPage; */ /* jshint ignore:end */ CommandPage.prototype.getInstance = function getInstance(payload) { - return new CommandInstance( - this._version, - payload - ); + return new CommandInstance(this._version, payload); }; @@ -502,19 +473,14 @@ CommandInstance = function CommandInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CommandInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CommandContext( - this._version, - this._solution.sid - ); + this._context = new CommandContext(this._version, this._solution.sid); } return this._context; @@ -553,9 +519,7 @@ CommandContext = function CommandContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Commands/<%= sid %>' // jshint ignore:line )(this._solution); @@ -576,17 +540,10 @@ CommandContext = function CommandContext(version, sid) { /* jshint ignore:end */ CommandContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CommandInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CommandInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/preview/wireless/ratePlan.js b/lib/rest/preview/wireless/ratePlan.js index 032ad376b0..07de10ae8f 100644 --- a/lib/rest/preview/wireless/ratePlan.js +++ b/lib/rest/preview/wireless/ratePlan.js @@ -235,18 +235,10 @@ RatePlanList = function RatePlanList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RatePlanPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -280,17 +272,10 @@ RatePlanList = function RatePlanList(version) { RatePlanListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RatePlanPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -349,18 +334,10 @@ RatePlanList = function RatePlanList(version) { 'InternationalRoaming': _.get(opts, 'internationalRoaming') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RatePlanInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -388,10 +365,7 @@ RatePlanList = function RatePlanList(version) { */ /* jshint ignore:end */ RatePlanListInstance.get = function get(sid) { - return new RatePlanContext( - this._version, - sid - ); + return new RatePlanContext(this._version, sid); }; return RatePlanListInstance; @@ -436,10 +410,7 @@ RatePlanPage.prototype.constructor = RatePlanPage; */ /* jshint ignore:end */ RatePlanPage.prototype.getInstance = function getInstance(payload) { - return new RatePlanInstance( - this._version, - payload - ); + return new RatePlanInstance(this._version, payload); }; @@ -490,19 +461,14 @@ RatePlanInstance = function RatePlanInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(RatePlanInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RatePlanContext( - this._version, - this._solution.sid - ); + this._context = new RatePlanContext(this._version, this._solution.sid); } return this._context; @@ -578,9 +544,7 @@ RatePlanContext = function RatePlanContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/RatePlans/<%= sid %>' // jshint ignore:line )(this._solution); @@ -601,17 +565,10 @@ RatePlanContext = function RatePlanContext(version, sid) { /* jshint ignore:end */ RatePlanContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RatePlanInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -654,18 +611,10 @@ RatePlanContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RatePlanInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -694,10 +643,7 @@ RatePlanContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ RatePlanContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/preview/wireless/sim.js b/lib/rest/preview/wireless/sim.js index 0b16e49350..f22ea5663e 100644 --- a/lib/rest/preview/wireless/sim.js +++ b/lib/rest/preview/wireless/sim.js @@ -259,18 +259,10 @@ SimList = function SimList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SimPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SimPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -309,17 +301,10 @@ SimList = function SimList(version) { SimListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SimPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SimPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -347,10 +332,7 @@ SimList = function SimList(version) { */ /* jshint ignore:end */ SimListInstance.get = function get(sid) { - return new SimContext( - this._version, - sid - ); + return new SimContext(this._version, sid); }; return SimListInstance; @@ -395,10 +377,7 @@ SimPage.prototype.constructor = SimPage; */ /* jshint ignore:end */ SimPage.prototype.getInstance = function getInstance(payload) { - return new SimInstance( - this._version, - payload - ); + return new SimInstance(this._version, payload); }; @@ -465,19 +444,14 @@ SimInstance = function SimInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(SimInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SimContext( - this._version, - this._solution.sid - ); + this._context = new SimContext(this._version, this._solution.sid); } return this._context; @@ -567,9 +541,7 @@ SimContext = function SimContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Sims/<%= sid %>' // jshint ignore:line )(this._solution); @@ -593,17 +565,10 @@ SimContext = function SimContext(version, sid) { /* jshint ignore:end */ SimContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new SimInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new SimInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -674,18 +639,10 @@ SimContext.prototype.update = function update(opts, callback) { 'VoiceUrl': _.get(opts, 'voiceUrl') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new SimInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new SimInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -703,10 +660,7 @@ Object.defineProperty(SimContext.prototype, 'usage', { get: function() { if (!this._usage) { - this._usage = new UsageList( - this._version, - this._solution.sid - ); + this._usage = new UsageList(this._version, this._solution.sid); } return this._usage; } diff --git a/lib/rest/preview/wireless/sim/usage.js b/lib/rest/preview/wireless/sim/usage.js index 5610fbf2f5..56880d0b8d 100644 --- a/lib/rest/preview/wireless/sim/usage.js +++ b/lib/rest/preview/wireless/sim/usage.js @@ -47,9 +47,7 @@ UsageList = function UsageList(version, simSid) { UsageListInstance._version = version; // Path Solution - UsageListInstance._solution = { - simSid: simSid - }; + UsageListInstance._solution = {simSid: simSid}; /* jshint ignore:start */ /** * Constructs a usage @@ -62,10 +60,7 @@ UsageList = function UsageList(version, simSid) { */ /* jshint ignore:end */ UsageListInstance.get = function get() { - return new UsageContext( - this._version, - this._solution.simSid - ); + return new UsageContext(this._version, this._solution.simSid); }; return UsageListInstance; @@ -110,11 +105,7 @@ UsagePage.prototype.constructor = UsagePage; */ /* jshint ignore:end */ UsagePage.prototype.getInstance = function getInstance(payload) { - return new UsageInstance( - this._version, - payload, - this._solution.simSid - ); + return new UsageInstance(this._version, payload, this._solution.simSid); }; @@ -155,19 +146,14 @@ UsageInstance = function UsageInstance(version, payload, simSid) { // Context this._context = undefined; - this._solution = { - simSid: simSid, - }; + this._solution = {simSid: simSid,}; }; Object.defineProperty(UsageInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new UsageContext( - this._version, - this._solution.simSid - ); + this._context = new UsageContext(this._version, this._solution.simSid); } return this._context; @@ -209,9 +195,7 @@ UsageContext = function UsageContext(version, simSid) { this._version = version; // Path Solution - this._solution = { - simSid: simSid, - }; + this._solution = {simSid: simSid,}; this._uri = _.template( '/Sims/<%= simSid %>/Usage' // jshint ignore:line )(this._solution); @@ -241,23 +225,12 @@ UsageContext.prototype.fetch = function fetch(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'End': _.get(opts, 'end'), - 'Start': _.get(opts, 'start') - }); + var data = values.of({'End': _.get(opts, 'end'), 'Start': _.get(opts, 'start')}); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UsageInstance( - this._version, - payload, - this._solution.simSid - )); + deferred.resolve(new UsageInstance(this._version, payload, this._solution.simSid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/pricing/v1/messaging.js b/lib/rest/pricing/v1/messaging.js index 3076959d77..1e8472e971 100644 --- a/lib/rest/pricing/v1/messaging.js +++ b/lib/rest/pricing/v1/messaging.js @@ -52,9 +52,7 @@ MessagingList = function MessagingList(version) { 'countries', { get: function countries() { if (!this._countries) { - this._countries = new CountryList( - this._version - ); + this._countries = new CountryList(this._version); } return this._countries; @@ -102,10 +100,7 @@ MessagingPage.prototype.constructor = MessagingPage; */ /* jshint ignore:end */ MessagingPage.prototype.getInstance = function getInstance(payload) { - return new MessagingInstance( - this._version, - payload - ); + return new MessagingInstance(this._version, payload); }; diff --git a/lib/rest/pricing/v1/messaging/country.js b/lib/rest/pricing/v1/messaging/country.js index ca946fbfd2..4361650021 100644 --- a/lib/rest/pricing/v1/messaging/country.js +++ b/lib/rest/pricing/v1/messaging/country.js @@ -231,18 +231,10 @@ CountryList = function CountryList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -276,17 +268,10 @@ CountryList = function CountryList(version) { CountryListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -314,10 +299,7 @@ CountryList = function CountryList(version) { */ /* jshint ignore:end */ CountryListInstance.get = function get(isoCountry) { - return new CountryContext( - this._version, - isoCountry - ); + return new CountryContext(this._version, isoCountry); }; return CountryListInstance; @@ -361,10 +343,7 @@ CountryPage.prototype.constructor = CountryPage; */ /* jshint ignore:end */ CountryPage.prototype.getInstance = function getInstance(payload) { - return new CountryInstance( - this._version, - payload - ); + return new CountryInstance(this._version, payload); }; @@ -398,19 +377,14 @@ CountryInstance = function CountryInstance(version, payload, isoCountry) { // Context this._context = undefined; - this._solution = { - isoCountry: isoCountry || this.isoCountry, - }; + this._solution = {isoCountry: isoCountry || this.isoCountry,}; }; Object.defineProperty(CountryInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CountryContext( - this._version, - this._solution.isoCountry - ); + this._context = new CountryContext(this._version, this._solution.isoCountry); } return this._context; @@ -448,9 +422,7 @@ CountryContext = function CountryContext(version, isoCountry) { this._version = version; // Path Solution - this._solution = { - isoCountry: isoCountry, - }; + this._solution = {isoCountry: isoCountry,}; this._uri = _.template( '/Messaging/Countries/<%= isoCountry %>' // jshint ignore:line )(this._solution); @@ -471,17 +443,10 @@ CountryContext = function CountryContext(version, isoCountry) { /* jshint ignore:end */ CountryContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CountryInstance( - this._version, - payload, - this._solution.isoCountry - )); + deferred.resolve(new CountryInstance(this._version, payload, this._solution.isoCountry)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/pricing/v1/phoneNumber.js b/lib/rest/pricing/v1/phoneNumber.js index 202df25574..ffd0b1301f 100644 --- a/lib/rest/pricing/v1/phoneNumber.js +++ b/lib/rest/pricing/v1/phoneNumber.js @@ -52,9 +52,7 @@ PhoneNumberList = function PhoneNumberList(version) { 'countries', { get: function countries() { if (!this._countries) { - this._countries = new CountryList( - this._version - ); + this._countries = new CountryList(this._version); } return this._countries; @@ -102,10 +100,7 @@ PhoneNumberPage.prototype.constructor = PhoneNumberPage; */ /* jshint ignore:end */ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new PhoneNumberInstance( - this._version, - payload - ); + return new PhoneNumberInstance(this._version, payload); }; diff --git a/lib/rest/pricing/v1/phoneNumber/country.js b/lib/rest/pricing/v1/phoneNumber/country.js index cf4142d549..649e3f04b8 100644 --- a/lib/rest/pricing/v1/phoneNumber/country.js +++ b/lib/rest/pricing/v1/phoneNumber/country.js @@ -231,18 +231,10 @@ CountryList = function CountryList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -276,17 +268,10 @@ CountryList = function CountryList(version) { CountryListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -314,10 +299,7 @@ CountryList = function CountryList(version) { */ /* jshint ignore:end */ CountryListInstance.get = function get(isoCountry) { - return new CountryContext( - this._version, - isoCountry - ); + return new CountryContext(this._version, isoCountry); }; return CountryListInstance; @@ -361,10 +343,7 @@ CountryPage.prototype.constructor = CountryPage; */ /* jshint ignore:end */ CountryPage.prototype.getInstance = function getInstance(payload) { - return new CountryInstance( - this._version, - payload - ); + return new CountryInstance(this._version, payload); }; @@ -396,19 +375,14 @@ CountryInstance = function CountryInstance(version, payload, isoCountry) { // Context this._context = undefined; - this._solution = { - isoCountry: isoCountry || this.isoCountry, - }; + this._solution = {isoCountry: isoCountry || this.isoCountry,}; }; Object.defineProperty(CountryInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CountryContext( - this._version, - this._solution.isoCountry - ); + this._context = new CountryContext(this._version, this._solution.isoCountry); } return this._context; @@ -446,9 +420,7 @@ CountryContext = function CountryContext(version, isoCountry) { this._version = version; // Path Solution - this._solution = { - isoCountry: isoCountry, - }; + this._solution = {isoCountry: isoCountry,}; this._uri = _.template( '/PhoneNumbers/Countries/<%= isoCountry %>' // jshint ignore:line )(this._solution); @@ -469,17 +441,10 @@ CountryContext = function CountryContext(version, isoCountry) { /* jshint ignore:end */ CountryContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CountryInstance( - this._version, - payload, - this._solution.isoCountry - )); + deferred.resolve(new CountryInstance(this._version, payload, this._solution.isoCountry)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/pricing/v1/voice.js b/lib/rest/pricing/v1/voice.js index cc8050021b..c3344f0c8d 100644 --- a/lib/rest/pricing/v1/voice.js +++ b/lib/rest/pricing/v1/voice.js @@ -54,9 +54,7 @@ VoiceList = function VoiceList(version) { 'numbers', { get: function numbers() { if (!this._numbers) { - this._numbers = new NumberList( - this._version - ); + this._numbers = new NumberList(this._version); } return this._numbers; @@ -67,9 +65,7 @@ VoiceList = function VoiceList(version) { 'countries', { get: function countries() { if (!this._countries) { - this._countries = new CountryList( - this._version - ); + this._countries = new CountryList(this._version); } return this._countries; @@ -117,10 +113,7 @@ VoicePage.prototype.constructor = VoicePage; */ /* jshint ignore:end */ VoicePage.prototype.getInstance = function getInstance(payload) { - return new VoiceInstance( - this._version, - payload - ); + return new VoiceInstance(this._version, payload); }; diff --git a/lib/rest/pricing/v1/voice/country.js b/lib/rest/pricing/v1/voice/country.js index 9b99d13823..807036aed7 100644 --- a/lib/rest/pricing/v1/voice/country.js +++ b/lib/rest/pricing/v1/voice/country.js @@ -231,18 +231,10 @@ CountryList = function CountryList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -276,17 +268,10 @@ CountryList = function CountryList(version) { CountryListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CountryPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CountryPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -314,10 +299,7 @@ CountryList = function CountryList(version) { */ /* jshint ignore:end */ CountryListInstance.get = function get(isoCountry) { - return new CountryContext( - this._version, - isoCountry - ); + return new CountryContext(this._version, isoCountry); }; return CountryListInstance; @@ -361,10 +343,7 @@ CountryPage.prototype.constructor = CountryPage; */ /* jshint ignore:end */ CountryPage.prototype.getInstance = function getInstance(payload) { - return new CountryInstance( - this._version, - payload - ); + return new CountryInstance(this._version, payload); }; @@ -398,19 +377,14 @@ CountryInstance = function CountryInstance(version, payload, isoCountry) { // Context this._context = undefined; - this._solution = { - isoCountry: isoCountry || this.isoCountry, - }; + this._solution = {isoCountry: isoCountry || this.isoCountry,}; }; Object.defineProperty(CountryInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CountryContext( - this._version, - this._solution.isoCountry - ); + this._context = new CountryContext(this._version, this._solution.isoCountry); } return this._context; @@ -448,9 +422,7 @@ CountryContext = function CountryContext(version, isoCountry) { this._version = version; // Path Solution - this._solution = { - isoCountry: isoCountry, - }; + this._solution = {isoCountry: isoCountry,}; this._uri = _.template( '/Voice/Countries/<%= isoCountry %>' // jshint ignore:line )(this._solution); @@ -471,17 +443,10 @@ CountryContext = function CountryContext(version, isoCountry) { /* jshint ignore:end */ CountryContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CountryInstance( - this._version, - payload, - this._solution.isoCountry - )); + deferred.resolve(new CountryInstance(this._version, payload, this._solution.isoCountry)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/pricing/v1/voice/number.js b/lib/rest/pricing/v1/voice/number.js index 2b81923aad..013793f45b 100644 --- a/lib/rest/pricing/v1/voice/number.js +++ b/lib/rest/pricing/v1/voice/number.js @@ -60,10 +60,7 @@ NumberList = function NumberList(version) { */ /* jshint ignore:end */ NumberListInstance.get = function get(number) { - return new NumberContext( - this._version, - number - ); + return new NumberContext(this._version, number); }; return NumberListInstance; @@ -107,10 +104,7 @@ NumberPage.prototype.constructor = NumberPage; */ /* jshint ignore:end */ NumberPage.prototype.getInstance = function getInstance(payload) { - return new NumberInstance( - this._version, - payload - ); + return new NumberInstance(this._version, payload); }; @@ -146,19 +140,14 @@ NumberInstance = function NumberInstance(version, payload, number) { // Context this._context = undefined; - this._solution = { - number: number || this.number, - }; + this._solution = {number: number || this.number,}; }; Object.defineProperty(NumberInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new NumberContext( - this._version, - this._solution.number - ); + this._context = new NumberContext(this._version, this._solution.number); } return this._context; @@ -196,9 +185,7 @@ NumberContext = function NumberContext(version, number) { this._version = version; // Path Solution - this._solution = { - number: number, - }; + this._solution = {number: number,}; this._uri = _.template( '/Voice/Numbers/<%= number %>' // jshint ignore:line )(this._solution); @@ -219,17 +206,10 @@ NumberContext = function NumberContext(version, number) { /* jshint ignore:end */ NumberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new NumberInstance( - this._version, - payload, - this._solution.number - )); + deferred.resolve(new NumberInstance(this._version, payload, this._solution.number)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/proxy/v1/service.js b/lib/rest/proxy/v1/service.js index f41b61bf16..a00bce1674 100644 --- a/lib/rest/proxy/v1/service.js +++ b/lib/rest/proxy/v1/service.js @@ -237,18 +237,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -282,17 +274,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -338,18 +323,10 @@ ServiceList = function ServiceList(version) { 'CallbackUrl': _.get(opts, 'callbackUrl') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -377,10 +354,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -425,10 +399,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -469,19 +440,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -611,9 +577,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -639,17 +603,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -678,10 +635,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -730,18 +684,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'CallbackUrl': _.get(opts, 'callbackUrl') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -759,10 +705,7 @@ Object.defineProperty(ServiceContext.prototype, 'sessions', { get: function() { if (!this._sessions) { - this._sessions = new SessionList( - this._version, - this._solution.sid - ); + this._sessions = new SessionList(this._version, this._solution.sid); } return this._sessions; } @@ -772,10 +715,7 @@ Object.defineProperty(ServiceContext.prototype, 'phoneNumbers', { get: function() { if (!this._phoneNumbers) { - this._phoneNumbers = new PhoneNumberList( - this._version, - this._solution.sid - ); + this._phoneNumbers = new PhoneNumberList(this._version, this._solution.sid); } return this._phoneNumbers; } @@ -785,10 +725,7 @@ Object.defineProperty(ServiceContext.prototype, 'shortCodes', { get: function() { if (!this._shortCodes) { - this._shortCodes = new ShortCodeList( - this._version, - this._solution.sid - ); + this._shortCodes = new ShortCodeList(this._version, this._solution.sid); } return this._shortCodes; } diff --git a/lib/rest/proxy/v1/service/phoneNumber.js b/lib/rest/proxy/v1/service/phoneNumber.js index 585be68907..bf1098c63f 100644 --- a/lib/rest/proxy/v1/service/phoneNumber.js +++ b/lib/rest/proxy/v1/service/phoneNumber.js @@ -49,9 +49,7 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { PhoneNumberListInstance._version = version; // Path Solution - PhoneNumberListInstance._solution = { - serviceSid: serviceSid - }; + PhoneNumberListInstance._solution = {serviceSid: serviceSid}; PhoneNumberListInstance._uri = _.template( '/Services/<%= serviceSid %>/PhoneNumbers' // jshint ignore:line )(PhoneNumberListInstance._solution); @@ -78,15 +76,9 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Sid': _.get(opts, 'sid') - }); + var data = values.of({'Sid': _.get(opts, 'sid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( @@ -290,18 +282,10 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +319,10 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { PhoneNumberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,11 +350,7 @@ PhoneNumberList = function PhoneNumberList(version, serviceSid) { */ /* jshint ignore:end */ PhoneNumberListInstance.get = function get(sid) { - return new PhoneNumberContext( - this._version, - this._solution.serviceSid, - sid - ); + return new PhoneNumberContext(this._version, this._solution.serviceSid, sid); }; return PhoneNumberListInstance; @@ -422,11 +395,7 @@ PhoneNumberPage.prototype.constructor = PhoneNumberPage; */ /* jshint ignore:end */ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new PhoneNumberInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new PhoneNumberInstance(this._version, payload, this._solution.serviceSid); }; @@ -471,21 +440,14 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(PhoneNumberInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new PhoneNumberContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new PhoneNumberContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -542,10 +504,7 @@ PhoneNumberContext = function PhoneNumberContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/PhoneNumbers/<%= sid %>' // jshint ignore:line )(this._solution); @@ -566,10 +525,7 @@ PhoneNumberContext = function PhoneNumberContext(version, serviceSid, sid) { /* jshint ignore:end */ PhoneNumberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -601,10 +557,7 @@ PhoneNumberContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ PhoneNumberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( diff --git a/lib/rest/proxy/v1/service/session.js b/lib/rest/proxy/v1/service/session.js index f58dfd812d..080610c4dd 100644 --- a/lib/rest/proxy/v1/service/session.js +++ b/lib/rest/proxy/v1/service/session.js @@ -52,9 +52,7 @@ SessionList = function SessionList(version, serviceSid) { SessionListInstance._version = version; // Path Solution - SessionListInstance._solution = { - serviceSid: serviceSid - }; + SessionListInstance._solution = {serviceSid: serviceSid}; SessionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Sessions' // jshint ignore:line )(SessionListInstance._solution); @@ -255,18 +253,10 @@ SessionList = function SessionList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SessionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SessionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -303,17 +293,10 @@ SessionList = function SessionList(version, serviceSid) { SessionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SessionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SessionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -364,11 +347,7 @@ SessionList = function SessionList(version, serviceSid) { 'Participants': _.get(opts, 'participants') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SessionInstance( @@ -404,11 +383,7 @@ SessionList = function SessionList(version, serviceSid) { */ /* jshint ignore:end */ SessionListInstance.get = function get(sid) { - return new SessionContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SessionContext(this._version, this._solution.serviceSid, sid); }; return SessionListInstance; @@ -453,11 +428,7 @@ SessionPage.prototype.constructor = SessionPage; */ /* jshint ignore:end */ SessionPage.prototype.getInstance = function getInstance(payload) { - return new SessionInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SessionInstance(this._version, payload, this._solution.serviceSid); }; @@ -512,21 +483,14 @@ SessionInstance = function SessionInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SessionInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SessionContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SessionContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -643,10 +607,7 @@ SessionContext = function SessionContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sid %>' // jshint ignore:line )(this._solution); @@ -671,10 +632,7 @@ SessionContext = function SessionContext(version, serviceSid, sid) { /* jshint ignore:end */ SessionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SessionInstance( @@ -711,10 +669,7 @@ SessionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SessionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -768,11 +723,7 @@ SessionContext.prototype.update = function update(opts, callback) { 'Participants': _.get(opts, 'participants') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SessionInstance( diff --git a/lib/rest/proxy/v1/service/session/interaction.js b/lib/rest/proxy/v1/service/session/interaction.js index e8bc7ca027..9bcb2b76aa 100644 --- a/lib/rest/proxy/v1/service/session/interaction.js +++ b/lib/rest/proxy/v1/service/session/interaction.js @@ -50,10 +50,7 @@ InteractionList = function InteractionList(version, serviceSid, sessionSid) { InteractionListInstance._version = version; // Path Solution - InteractionListInstance._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid - }; + InteractionListInstance._solution = {serviceSid: serviceSid, sessionSid: sessionSid}; InteractionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Interactions' // jshint ignore:line )(InteractionListInstance._solution); @@ -257,18 +254,10 @@ InteractionList = function InteractionList(version, serviceSid, sessionSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new InteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +295,10 @@ InteractionList = function InteractionList(version, serviceSid, sessionSid) { InteractionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new InteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new InteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -467,11 +449,7 @@ InteractionInstance = function InteractionInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid || this.sid,}; }; Object.defineProperty(InteractionInstance.prototype, @@ -525,11 +503,7 @@ InteractionContext = function InteractionContext(version, serviceSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Interactions/<%= sid %>' // jshint ignore:line )(this._solution); @@ -550,10 +524,7 @@ InteractionContext = function InteractionContext(version, serviceSid, /* jshint ignore:end */ InteractionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new InteractionInstance( diff --git a/lib/rest/proxy/v1/service/session/participant.js b/lib/rest/proxy/v1/service/session/participant.js index 64adc8e3a6..cbd15bea0f 100644 --- a/lib/rest/proxy/v1/service/session/participant.js +++ b/lib/rest/proxy/v1/service/session/participant.js @@ -52,10 +52,7 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { ParticipantListInstance._version = version; // Path Solution - ParticipantListInstance._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid - }; + ParticipantListInstance._solution = {serviceSid: serviceSid, sessionSid: sessionSid}; ParticipantListInstance._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Participants' // jshint ignore:line )(ParticipantListInstance._solution); @@ -256,18 +253,10 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ParticipantPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ParticipantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -304,17 +293,10 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { ParticipantListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ParticipantPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ParticipantPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -367,11 +349,7 @@ ParticipantList = function ParticipantList(version, serviceSid, sessionSid) { 'ProxyIdentifierSid': _.get(opts, 'proxyIdentifierSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -519,11 +497,7 @@ ParticipantInstance = function ParticipantInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid || this.sid,}; }; Object.defineProperty(ParticipantInstance.prototype, @@ -639,11 +613,7 @@ ParticipantContext = function ParticipantContext(version, serviceSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sessionSid: sessionSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sessionSid: sessionSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Participants/<%= sid %>' // jshint ignore:line )(this._solution); @@ -667,10 +637,7 @@ ParticipantContext = function ParticipantContext(version, serviceSid, /* jshint ignore:end */ ParticipantContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( @@ -708,10 +675,7 @@ ParticipantContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ParticipantContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -766,11 +730,7 @@ ParticipantContext.prototype.update = function update(opts, callback) { 'ProxyIdentifierSid': _.get(opts, 'proxyIdentifierSid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ParticipantInstance( diff --git a/lib/rest/proxy/v1/service/session/participant/messageInteraction.js b/lib/rest/proxy/v1/service/session/participant/messageInteraction.js index a76e96a9c2..11aa17e88e 100644 --- a/lib/rest/proxy/v1/service/session/participant/messageInteraction.js +++ b/lib/rest/proxy/v1/service/session/participant/messageInteraction.js @@ -85,16 +85,9 @@ MessageInteractionList = function MessageInteractionList(version, serviceSid, opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'Body': _.get(opts, 'body'), - 'MediaUrl': _.get(opts, 'mediaUrl') - }); + var data = values.of({'Body': _.get(opts, 'body'), 'MediaUrl': _.get(opts, 'mediaUrl')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new MessageInteractionInstance( @@ -300,18 +293,10 @@ MessageInteractionList = function MessageInteractionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new MessageInteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessageInteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -345,17 +330,10 @@ MessageInteractionList = function MessageInteractionList(version, serviceSid, MessageInteractionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new MessageInteractionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new MessageInteractionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -601,10 +579,7 @@ MessageInteractionContext = function MessageInteractionContext(version, /* jshint ignore:end */ MessageInteractionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new MessageInteractionInstance( diff --git a/lib/rest/proxy/v1/service/shortCode.js b/lib/rest/proxy/v1/service/shortCode.js index 382fe23ec3..598b1becdc 100644 --- a/lib/rest/proxy/v1/service/shortCode.js +++ b/lib/rest/proxy/v1/service/shortCode.js @@ -49,9 +49,7 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { ShortCodeListInstance._version = version; // Path Solution - ShortCodeListInstance._solution = { - serviceSid: serviceSid - }; + ShortCodeListInstance._solution = {serviceSid: serviceSid}; ShortCodeListInstance._uri = _.template( '/Services/<%= serviceSid %>/ShortCodes' // jshint ignore:line )(ShortCodeListInstance._solution); @@ -78,15 +76,9 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Sid': _.get(opts, 'sid') - }); + var data = values.of({'Sid': _.get(opts, 'sid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( @@ -290,18 +282,10 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +319,10 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { ShortCodeListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ShortCodePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ShortCodePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,11 +350,7 @@ ShortCodeList = function ShortCodeList(version, serviceSid) { */ /* jshint ignore:end */ ShortCodeListInstance.get = function get(sid) { - return new ShortCodeContext( - this._version, - this._solution.serviceSid, - sid - ); + return new ShortCodeContext(this._version, this._solution.serviceSid, sid); }; return ShortCodeListInstance; @@ -422,11 +395,7 @@ ShortCodePage.prototype.constructor = ShortCodePage; */ /* jshint ignore:end */ ShortCodePage.prototype.getInstance = function getInstance(payload) { - return new ShortCodeInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new ShortCodeInstance(this._version, payload, this._solution.serviceSid); }; @@ -469,21 +438,14 @@ ShortCodeInstance = function ShortCodeInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(ShortCodeInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ShortCodeContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new ShortCodeContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -540,10 +502,7 @@ ShortCodeContext = function ShortCodeContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/ShortCodes/<%= sid %>' // jshint ignore:line )(this._solution); @@ -564,10 +523,7 @@ ShortCodeContext = function ShortCodeContext(version, serviceSid, sid) { /* jshint ignore:end */ ShortCodeContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -599,10 +555,7 @@ ShortCodeContext.prototype.remove = function remove(callback) { /* jshint ignore:end */ ShortCodeContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ShortCodeInstance( diff --git a/lib/rest/sync/v1/service.js b/lib/rest/sync/v1/service.js index 86972e77ad..692ce384f1 100644 --- a/lib/rest/sync/v1/service.js +++ b/lib/rest/sync/v1/service.js @@ -91,18 +91,10 @@ ServiceList = function ServiceList(version) { 'AclEnabled': serialize.bool(_.get(opts, 'aclEnabled')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -298,18 +290,10 @@ ServiceList = function ServiceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -343,17 +327,10 @@ ServiceList = function ServiceList(version) { ServiceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ServicePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ServicePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -381,10 +358,7 @@ ServiceList = function ServiceList(version) { */ /* jshint ignore:end */ ServiceListInstance.get = function get(sid) { - return new ServiceContext( - this._version, - sid - ); + return new ServiceContext(this._version, sid); }; return ServiceListInstance; @@ -429,10 +403,7 @@ ServicePage.prototype.constructor = ServicePage; */ /* jshint ignore:end */ ServicePage.prototype.getInstance = function getInstance(payload) { - return new ServiceInstance( - this._version, - payload - ); + return new ServiceInstance(this._version, payload); }; @@ -478,19 +449,14 @@ ServiceInstance = function ServiceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(ServiceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ServiceContext( - this._version, - this._solution.sid - ); + this._context = new ServiceContext(this._version, this._solution.sid); } return this._context; @@ -638,9 +604,7 @@ ServiceContext = function ServiceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Services/<%= sid %>' // jshint ignore:line )(this._solution); @@ -667,17 +631,10 @@ ServiceContext = function ServiceContext(version, sid) { /* jshint ignore:end */ ServiceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -706,10 +663,7 @@ ServiceContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ ServiceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -760,18 +714,10 @@ ServiceContext.prototype.update = function update(opts, callback) { 'AclEnabled': serialize.bool(_.get(opts, 'aclEnabled')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new ServiceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new ServiceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -789,10 +735,7 @@ Object.defineProperty(ServiceContext.prototype, 'documents', { get: function() { if (!this._documents) { - this._documents = new DocumentList( - this._version, - this._solution.sid - ); + this._documents = new DocumentList(this._version, this._solution.sid); } return this._documents; } @@ -802,10 +745,7 @@ Object.defineProperty(ServiceContext.prototype, 'syncLists', { get: function() { if (!this._syncLists) { - this._syncLists = new SyncListList( - this._version, - this._solution.sid - ); + this._syncLists = new SyncListList(this._version, this._solution.sid); } return this._syncLists; } @@ -815,10 +755,7 @@ Object.defineProperty(ServiceContext.prototype, 'syncMaps', { get: function() { if (!this._syncMaps) { - this._syncMaps = new SyncMapList( - this._version, - this._solution.sid - ); + this._syncMaps = new SyncMapList(this._version, this._solution.sid); } return this._syncMaps; } @@ -828,10 +765,7 @@ Object.defineProperty(ServiceContext.prototype, 'syncStreams', { get: function() { if (!this._syncStreams) { - this._syncStreams = new SyncStreamList( - this._version, - this._solution.sid - ); + this._syncStreams = new SyncStreamList(this._version, this._solution.sid); } return this._syncStreams; } diff --git a/lib/rest/sync/v1/service/document.js b/lib/rest/sync/v1/service/document.js index aedde88886..8f43ed5420 100644 --- a/lib/rest/sync/v1/service/document.js +++ b/lib/rest/sync/v1/service/document.js @@ -52,9 +52,7 @@ DocumentList = function DocumentList(version, serviceSid) { DocumentListInstance._version = version; // Path Solution - DocumentListInstance._solution = { - serviceSid: serviceSid - }; + DocumentListInstance._solution = {serviceSid: serviceSid}; DocumentListInstance._uri = _.template( '/Services/<%= serviceSid %>/Documents' // jshint ignore:line )(DocumentListInstance._solution); @@ -87,11 +85,7 @@ DocumentList = function DocumentList(version, serviceSid) { 'Data': serialize.object(_.get(opts, 'data')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DocumentInstance( @@ -295,18 +289,10 @@ DocumentList = function DocumentList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -340,17 +326,10 @@ DocumentList = function DocumentList(version, serviceSid) { DocumentListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -378,11 +357,7 @@ DocumentList = function DocumentList(version, serviceSid) { */ /* jshint ignore:end */ DocumentListInstance.get = function get(sid) { - return new DocumentContext( - this._version, - this._solution.serviceSid, - sid - ); + return new DocumentContext(this._version, this._solution.serviceSid, sid); }; return DocumentListInstance; @@ -427,11 +402,7 @@ DocumentPage.prototype.constructor = DocumentPage; */ /* jshint ignore:end */ DocumentPage.prototype.getInstance = function getInstance(payload) { - return new DocumentInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new DocumentInstance(this._version, payload, this._solution.serviceSid); }; @@ -478,21 +449,14 @@ DocumentInstance = function DocumentInstance(version, payload, serviceSid, sid) // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(DocumentInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new DocumentContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new DocumentContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -587,10 +551,7 @@ DocumentContext = function DocumentContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Documents/<%= sid %>' // jshint ignore:line )(this._solution); @@ -614,10 +575,7 @@ DocumentContext = function DocumentContext(version, serviceSid, sid) { /* jshint ignore:end */ DocumentContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DocumentInstance( @@ -654,10 +612,7 @@ DocumentContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ DocumentContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -698,15 +653,9 @@ DocumentContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DocumentInstance( diff --git a/lib/rest/sync/v1/service/document/documentPermission.js b/lib/rest/sync/v1/service/document/documentPermission.js index a4020d9ec1..e42793116f 100644 --- a/lib/rest/sync/v1/service/document/documentPermission.js +++ b/lib/rest/sync/v1/service/document/documentPermission.js @@ -51,10 +51,7 @@ DocumentPermissionList = function DocumentPermissionList(version, serviceSid, DocumentPermissionListInstance._version = version; // Path Solution - DocumentPermissionListInstance._solution = { - serviceSid: serviceSid, - documentSid: documentSid - }; + DocumentPermissionListInstance._solution = {serviceSid: serviceSid, documentSid: documentSid}; DocumentPermissionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Documents/<%= documentSid %>/Permissions' // jshint ignore:line )(DocumentPermissionListInstance._solution); @@ -240,18 +237,10 @@ DocumentPermissionList = function DocumentPermissionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +274,10 @@ DocumentPermissionList = function DocumentPermissionList(version, serviceSid, DocumentPermissionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DocumentPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DocumentPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -521,11 +503,7 @@ DocumentPermissionContext = function DocumentPermissionContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - documentSid: documentSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, documentSid: documentSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Documents/<%= documentSid %>/Permissions/<%= identity %>' // jshint ignore:line )(this._solution); @@ -546,10 +524,7 @@ DocumentPermissionContext = function DocumentPermissionContext(version, /* jshint ignore:end */ DocumentPermissionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new DocumentPermissionInstance( @@ -587,10 +562,7 @@ DocumentPermissionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ DocumentPermissionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -645,11 +617,7 @@ DocumentPermissionContext.prototype.update = function update(opts, callback) { 'Manage': serialize.bool(_.get(opts, 'manage')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new DocumentPermissionInstance( diff --git a/lib/rest/sync/v1/service/syncList.js b/lib/rest/sync/v1/service/syncList.js index ac8f8e68ed..fdd012de49 100644 --- a/lib/rest/sync/v1/service/syncList.js +++ b/lib/rest/sync/v1/service/syncList.js @@ -52,9 +52,7 @@ SyncListList = function SyncListList(version, serviceSid) { SyncListListInstance._version = version; // Path Solution - SyncListListInstance._solution = { - serviceSid: serviceSid - }; + SyncListListInstance._solution = {serviceSid: serviceSid}; SyncListListInstance._uri = _.template( '/Services/<%= serviceSid %>/Lists' // jshint ignore:line )(SyncListListInstance._solution); @@ -81,15 +79,9 @@ SyncListList = function SyncListList(version, serviceSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'UniqueName': _.get(opts, 'uniqueName') - }); + var data = values.of({'UniqueName': _.get(opts, 'uniqueName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListInstance( @@ -293,18 +285,10 @@ SyncListList = function SyncListList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -338,17 +322,10 @@ SyncListList = function SyncListList(version, serviceSid) { SyncListListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -376,11 +353,7 @@ SyncListList = function SyncListList(version, serviceSid) { */ /* jshint ignore:end */ SyncListListInstance.get = function get(sid) { - return new SyncListContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SyncListContext(this._version, this._solution.serviceSid, sid); }; return SyncListListInstance; @@ -425,11 +398,7 @@ SyncListPage.prototype.constructor = SyncListPage; */ /* jshint ignore:end */ SyncListPage.prototype.getInstance = function getInstance(payload) { - return new SyncListInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SyncListInstance(this._version, payload, this._solution.serviceSid); }; @@ -474,21 +443,14 @@ SyncListInstance = function SyncListInstance(version, payload, serviceSid, sid) // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SyncListInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SyncListContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SyncListContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -581,10 +543,7 @@ SyncListContext = function SyncListContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= sid %>' // jshint ignore:line )(this._solution); @@ -609,10 +568,7 @@ SyncListContext = function SyncListContext(version, serviceSid, sid) { /* jshint ignore:end */ SyncListContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncListInstance( @@ -649,10 +605,7 @@ SyncListContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncListContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/sync/v1/service/syncList/syncListItem.js b/lib/rest/sync/v1/service/syncList/syncListItem.js index b15085aebb..9ff2fa9b63 100644 --- a/lib/rest/sync/v1/service/syncList/syncListItem.js +++ b/lib/rest/sync/v1/service/syncList/syncListItem.js @@ -52,10 +52,7 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { SyncListItemListInstance._version = version; // Path Solution - SyncListItemListInstance._solution = { - serviceSid: serviceSid, - listSid: listSid - }; + SyncListItemListInstance._solution = {serviceSid: serviceSid, listSid: listSid}; SyncListItemListInstance._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items' // jshint ignore:line )(SyncListItemListInstance._solution); @@ -83,15 +80,9 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListItemInstance( @@ -312,18 +303,10 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,17 +343,10 @@ SyncListItemList = function SyncListItemList(version, serviceSid, listSid) { SyncListItemListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -500,11 +476,7 @@ SyncListItemInstance = function SyncListItemInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - index: index || this.index, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, index: index || this.index,}; }; Object.defineProperty(SyncListItemInstance.prototype, @@ -594,11 +566,7 @@ SyncListItemContext = function SyncListItemContext(version, serviceSid, listSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - index: index, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, index: index,}; this._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items/<%= index %>' // jshint ignore:line )(this._solution); @@ -619,10 +587,7 @@ SyncListItemContext = function SyncListItemContext(version, serviceSid, listSid, /* jshint ignore:end */ SyncListItemContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncListItemInstance( @@ -660,10 +625,7 @@ SyncListItemContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncListItemContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -704,15 +666,9 @@ SyncListItemContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListItemInstance( diff --git a/lib/rest/sync/v1/service/syncList/syncListPermission.js b/lib/rest/sync/v1/service/syncList/syncListPermission.js index bd29699b68..7a64302a2c 100644 --- a/lib/rest/sync/v1/service/syncList/syncListPermission.js +++ b/lib/rest/sync/v1/service/syncList/syncListPermission.js @@ -51,10 +51,7 @@ SyncListPermissionList = function SyncListPermissionList(version, serviceSid, SyncListPermissionListInstance._version = version; // Path Solution - SyncListPermissionListInstance._solution = { - serviceSid: serviceSid, - listSid: listSid - }; + SyncListPermissionListInstance._solution = {serviceSid: serviceSid, listSid: listSid}; SyncListPermissionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Permissions' // jshint ignore:line )(SyncListPermissionListInstance._solution); @@ -240,18 +237,10 @@ SyncListPermissionList = function SyncListPermissionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +274,10 @@ SyncListPermissionList = function SyncListPermissionList(version, serviceSid, SyncListPermissionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncListPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncListPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -424,11 +406,7 @@ SyncListPermissionInstance = function SyncListPermissionInstance(version, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - identity: identity || this.identity, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, identity: identity || this.identity,}; }; Object.defineProperty(SyncListPermissionInstance.prototype, @@ -521,11 +499,7 @@ SyncListPermissionContext = function SyncListPermissionContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - listSid: listSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, listSid: listSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Lists/<%= listSid %>/Permissions/<%= identity %>' // jshint ignore:line )(this._solution); @@ -546,10 +520,7 @@ SyncListPermissionContext = function SyncListPermissionContext(version, /* jshint ignore:end */ SyncListPermissionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncListPermissionInstance( @@ -587,10 +558,7 @@ SyncListPermissionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncListPermissionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -645,11 +613,7 @@ SyncListPermissionContext.prototype.update = function update(opts, callback) { 'Manage': serialize.bool(_.get(opts, 'manage')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncListPermissionInstance( diff --git a/lib/rest/sync/v1/service/syncMap.js b/lib/rest/sync/v1/service/syncMap.js index 416991b3e2..1d0217a6da 100644 --- a/lib/rest/sync/v1/service/syncMap.js +++ b/lib/rest/sync/v1/service/syncMap.js @@ -52,9 +52,7 @@ SyncMapList = function SyncMapList(version, serviceSid) { SyncMapListInstance._version = version; // Path Solution - SyncMapListInstance._solution = { - serviceSid: serviceSid - }; + SyncMapListInstance._solution = {serviceSid: serviceSid}; SyncMapListInstance._uri = _.template( '/Services/<%= serviceSid %>/Maps' // jshint ignore:line )(SyncMapListInstance._solution); @@ -81,15 +79,9 @@ SyncMapList = function SyncMapList(version, serviceSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'UniqueName': _.get(opts, 'uniqueName') - }); + var data = values.of({'UniqueName': _.get(opts, 'uniqueName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapInstance( @@ -293,18 +285,10 @@ SyncMapList = function SyncMapList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -338,17 +322,10 @@ SyncMapList = function SyncMapList(version, serviceSid) { SyncMapListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -376,11 +353,7 @@ SyncMapList = function SyncMapList(version, serviceSid) { */ /* jshint ignore:end */ SyncMapListInstance.get = function get(sid) { - return new SyncMapContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SyncMapContext(this._version, this._solution.serviceSid, sid); }; return SyncMapListInstance; @@ -425,11 +398,7 @@ SyncMapPage.prototype.constructor = SyncMapPage; */ /* jshint ignore:end */ SyncMapPage.prototype.getInstance = function getInstance(payload) { - return new SyncMapInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SyncMapInstance(this._version, payload, this._solution.serviceSid); }; @@ -473,21 +442,14 @@ SyncMapInstance = function SyncMapInstance(version, payload, serviceSid, sid) { // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SyncMapInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SyncMapContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SyncMapContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -579,10 +541,7 @@ SyncMapContext = function SyncMapContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= sid %>' // jshint ignore:line )(this._solution); @@ -607,10 +566,7 @@ SyncMapContext = function SyncMapContext(version, serviceSid, sid) { /* jshint ignore:end */ SyncMapContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapInstance( @@ -647,10 +603,7 @@ SyncMapContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncMapContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/sync/v1/service/syncMap/syncMapItem.js b/lib/rest/sync/v1/service/syncMap/syncMapItem.js index f4f9666ab5..4dc5aeebc7 100644 --- a/lib/rest/sync/v1/service/syncMap/syncMapItem.js +++ b/lib/rest/sync/v1/service/syncMap/syncMapItem.js @@ -52,10 +52,7 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { SyncMapItemListInstance._version = version; // Path Solution - SyncMapItemListInstance._solution = { - serviceSid: serviceSid, - mapSid: mapSid - }; + SyncMapItemListInstance._solution = {serviceSid: serviceSid, mapSid: mapSid}; SyncMapItemListInstance._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items' // jshint ignore:line )(SyncMapItemListInstance._solution); @@ -86,16 +83,9 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Key': _.get(opts, 'key'), - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Key': _.get(opts, 'key'), 'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapItemInstance( @@ -316,18 +306,10 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -364,17 +346,10 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { SyncMapItemListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapItemPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapItemPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -402,12 +377,7 @@ SyncMapItemList = function SyncMapItemList(version, serviceSid, mapSid) { */ /* jshint ignore:end */ SyncMapItemListInstance.get = function get(key) { - return new SyncMapItemContext( - this._version, - this._solution.serviceSid, - this._solution.mapSid, - key - ); + return new SyncMapItemContext(this._version, this._solution.serviceSid, this._solution.mapSid, key); }; return SyncMapItemListInstance; @@ -503,11 +473,7 @@ SyncMapItemInstance = function SyncMapItemInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - key: key || this.key, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, key: key || this.key,}; }; Object.defineProperty(SyncMapItemInstance.prototype, @@ -597,11 +563,7 @@ SyncMapItemContext = function SyncMapItemContext(version, serviceSid, mapSid, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - key: key, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, key: key,}; this._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items/<%= key %>' // jshint ignore:line )(this._solution); @@ -622,10 +584,7 @@ SyncMapItemContext = function SyncMapItemContext(version, serviceSid, mapSid, /* jshint ignore:end */ SyncMapItemContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapItemInstance( @@ -663,10 +622,7 @@ SyncMapItemContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncMapItemContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -707,15 +663,9 @@ SyncMapItemContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapItemInstance( diff --git a/lib/rest/sync/v1/service/syncMap/syncMapPermission.js b/lib/rest/sync/v1/service/syncMap/syncMapPermission.js index 3a3dd5f817..67282e7819 100644 --- a/lib/rest/sync/v1/service/syncMap/syncMapPermission.js +++ b/lib/rest/sync/v1/service/syncMap/syncMapPermission.js @@ -51,10 +51,7 @@ SyncMapPermissionList = function SyncMapPermissionList(version, serviceSid, SyncMapPermissionListInstance._version = version; // Path Solution - SyncMapPermissionListInstance._solution = { - serviceSid: serviceSid, - mapSid: mapSid - }; + SyncMapPermissionListInstance._solution = {serviceSid: serviceSid, mapSid: mapSid}; SyncMapPermissionListInstance._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Permissions' // jshint ignore:line )(SyncMapPermissionListInstance._solution); @@ -240,18 +237,10 @@ SyncMapPermissionList = function SyncMapPermissionList(version, serviceSid, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -285,17 +274,10 @@ SyncMapPermissionList = function SyncMapPermissionList(version, serviceSid, SyncMapPermissionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncMapPermissionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncMapPermissionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -424,11 +406,7 @@ SyncMapPermissionInstance = function SyncMapPermissionInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - identity: identity || this.identity, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, identity: identity || this.identity,}; }; Object.defineProperty(SyncMapPermissionInstance.prototype, @@ -521,11 +499,7 @@ SyncMapPermissionContext = function SyncMapPermissionContext(version, this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - mapSid: mapSid, - identity: identity, - }; + this._solution = {serviceSid: serviceSid, mapSid: mapSid, identity: identity,}; this._uri = _.template( '/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Permissions/<%= identity %>' // jshint ignore:line )(this._solution); @@ -546,10 +520,7 @@ SyncMapPermissionContext = function SyncMapPermissionContext(version, /* jshint ignore:end */ SyncMapPermissionContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapPermissionInstance( @@ -587,10 +558,7 @@ SyncMapPermissionContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncMapPermissionContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -645,11 +613,7 @@ SyncMapPermissionContext.prototype.update = function update(opts, callback) { 'Manage': serialize.bool(_.get(opts, 'manage')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncMapPermissionInstance( diff --git a/lib/rest/sync/v1/service/syncStream.js b/lib/rest/sync/v1/service/syncStream.js index 66648199d2..e1fc26702f 100644 --- a/lib/rest/sync/v1/service/syncStream.js +++ b/lib/rest/sync/v1/service/syncStream.js @@ -50,9 +50,7 @@ SyncStreamList = function SyncStreamList(version, serviceSid) { SyncStreamListInstance._version = version; // Path Solution - SyncStreamListInstance._solution = { - serviceSid: serviceSid - }; + SyncStreamListInstance._solution = {serviceSid: serviceSid}; SyncStreamListInstance._uri = _.template( '/Services/<%= serviceSid %>/Streams' // jshint ignore:line )(SyncStreamListInstance._solution); @@ -79,15 +77,9 @@ SyncStreamList = function SyncStreamList(version, serviceSid) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'UniqueName': _.get(opts, 'uniqueName') - }); + var data = values.of({'UniqueName': _.get(opts, 'uniqueName')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new SyncStreamInstance( @@ -291,18 +283,10 @@ SyncStreamList = function SyncStreamList(version, serviceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SyncStreamPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncStreamPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,17 +320,10 @@ SyncStreamList = function SyncStreamList(version, serviceSid) { SyncStreamListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SyncStreamPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SyncStreamPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,11 +351,7 @@ SyncStreamList = function SyncStreamList(version, serviceSid) { */ /* jshint ignore:end */ SyncStreamListInstance.get = function get(sid) { - return new SyncStreamContext( - this._version, - this._solution.serviceSid, - sid - ); + return new SyncStreamContext(this._version, this._solution.serviceSid, sid); }; return SyncStreamListInstance; @@ -423,11 +396,7 @@ SyncStreamPage.prototype.constructor = SyncStreamPage; */ /* jshint ignore:end */ SyncStreamPage.prototype.getInstance = function getInstance(payload) { - return new SyncStreamInstance( - this._version, - payload, - this._solution.serviceSid - ); + return new SyncStreamInstance(this._version, payload, this._solution.serviceSid); }; @@ -470,21 +439,14 @@ SyncStreamInstance = function SyncStreamInstance(version, payload, serviceSid, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - sid: sid || this.sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid || this.sid,}; }; Object.defineProperty(SyncStreamInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SyncStreamContext( - this._version, - this._solution.serviceSid, - this._solution.sid - ); + this._context = new SyncStreamContext(this._version, this._solution.serviceSid, this._solution.sid); } return this._context; @@ -559,10 +521,7 @@ SyncStreamContext = function SyncStreamContext(version, serviceSid, sid) { this._version = version; // Path Solution - this._solution = { - serviceSid: serviceSid, - sid: sid, - }; + this._solution = {serviceSid: serviceSid, sid: sid,}; this._uri = _.template( '/Services/<%= serviceSid %>/Streams/<%= sid %>' // jshint ignore:line )(this._solution); @@ -586,10 +545,7 @@ SyncStreamContext = function SyncStreamContext(version, serviceSid, sid) { /* jshint ignore:end */ SyncStreamContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new SyncStreamInstance( @@ -626,10 +582,7 @@ SyncStreamContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ SyncStreamContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/sync/v1/service/syncStream/streamMessage.js b/lib/rest/sync/v1/service/syncStream/streamMessage.js index 9fb4f14065..04a088f8ff 100644 --- a/lib/rest/sync/v1/service/syncStream/streamMessage.js +++ b/lib/rest/sync/v1/service/syncStream/streamMessage.js @@ -49,10 +49,7 @@ StreamMessageList = function StreamMessageList(version, serviceSid, streamSid) { StreamMessageListInstance._version = version; // Path Solution - StreamMessageListInstance._solution = { - serviceSid: serviceSid, - streamSid: streamSid - }; + StreamMessageListInstance._solution = {serviceSid: serviceSid, streamSid: streamSid}; StreamMessageListInstance._uri = _.template( '/Services/<%= serviceSid %>/Streams/<%= streamSid %>/Messages' // jshint ignore:line )(StreamMessageListInstance._solution); @@ -82,21 +79,12 @@ StreamMessageList = function StreamMessageList(version, serviceSid, streamSid) { } var deferred = Q.defer(); - var data = values.of({ - 'Data': serialize.object(_.get(opts, 'data')) - }); + var data = values.of({'Data': serialize.object(_.get(opts, 'data'))}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new StreamMessageInstance( - this._version, - payload - )); + deferred.resolve(new StreamMessageInstance(this._version, payload)); }.bind(this)); promise.catch(function(error) { @@ -184,10 +172,7 @@ StreamMessageInstance = function StreamMessageInstance(version, payload, // Context this._context = undefined; - this._solution = { - serviceSid: serviceSid, - streamSid: streamSid, - }; + this._solution = {serviceSid: serviceSid, streamSid: streamSid,}; }; module.exports = { diff --git a/lib/rest/taskrouter/v1/workspace.js b/lib/rest/taskrouter/v1/workspace.js index 06bef154e9..184390c190 100644 --- a/lib/rest/taskrouter/v1/workspace.js +++ b/lib/rest/taskrouter/v1/workspace.js @@ -255,18 +255,10 @@ WorkspaceList = function WorkspaceList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkspacePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkspacePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -301,17 +293,10 @@ WorkspaceList = function WorkspaceList(version) { WorkspaceListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new WorkspacePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkspacePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -364,18 +349,10 @@ WorkspaceList = function WorkspaceList(version) { 'PrioritizeQueueOrder': _.get(opts, 'prioritizeQueueOrder') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkspaceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new WorkspaceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -403,10 +380,7 @@ WorkspaceList = function WorkspaceList(version) { */ /* jshint ignore:end */ WorkspaceListInstance.get = function get(sid) { - return new WorkspaceContext( - this._version, - sid - ); + return new WorkspaceContext(this._version, sid); }; return WorkspaceListInstance; @@ -450,10 +424,7 @@ WorkspacePage.prototype.constructor = WorkspacePage; */ /* jshint ignore:end */ WorkspacePage.prototype.getInstance = function getInstance(payload) { - return new WorkspaceInstance( - this._version, - payload - ); + return new WorkspaceInstance(this._version, payload); }; @@ -506,19 +477,14 @@ WorkspaceInstance = function WorkspaceInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(WorkspaceInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkspaceContext( - this._version, - this._solution.sid - ); + this._context = new WorkspaceContext(this._version, this._solution.sid); } return this._context; @@ -771,9 +737,7 @@ WorkspaceContext = function WorkspaceContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Workspaces/<%= sid %>' // jshint ignore:line )(this._solution); @@ -806,17 +770,10 @@ WorkspaceContext = function WorkspaceContext(version, sid) { /* jshint ignore:end */ WorkspaceContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new WorkspaceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new WorkspaceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -870,18 +827,10 @@ WorkspaceContext.prototype.update = function update(opts, callback) { 'PrioritizeQueueOrder': _.get(opts, 'prioritizeQueueOrder') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkspaceInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new WorkspaceInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -910,10 +859,7 @@ WorkspaceContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ WorkspaceContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -934,10 +880,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'activities', { get: function() { if (!this._activities) { - this._activities = new ActivityList( - this._version, - this._solution.sid - ); + this._activities = new ActivityList(this._version, this._solution.sid); } return this._activities; } @@ -947,10 +890,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'events', { get: function() { if (!this._events) { - this._events = new EventList( - this._version, - this._solution.sid - ); + this._events = new EventList(this._version, this._solution.sid); } return this._events; } @@ -960,10 +900,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'tasks', { get: function() { if (!this._tasks) { - this._tasks = new TaskList( - this._version, - this._solution.sid - ); + this._tasks = new TaskList(this._version, this._solution.sid); } return this._tasks; } @@ -973,10 +910,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'taskQueues', { get: function() { if (!this._taskQueues) { - this._taskQueues = new TaskQueueList( - this._version, - this._solution.sid - ); + this._taskQueues = new TaskQueueList(this._version, this._solution.sid); } return this._taskQueues; } @@ -986,10 +920,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'workers', { get: function() { if (!this._workers) { - this._workers = new WorkerList( - this._version, - this._solution.sid - ); + this._workers = new WorkerList(this._version, this._solution.sid); } return this._workers; } @@ -999,10 +930,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'workflows', { get: function() { if (!this._workflows) { - this._workflows = new WorkflowList( - this._version, - this._solution.sid - ); + this._workflows = new WorkflowList(this._version, this._solution.sid); } return this._workflows; } @@ -1012,10 +940,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'statistics', { get: function() { if (!this._statistics) { - this._statistics = new WorkspaceStatisticsList( - this._version, - this._solution.sid - ); + this._statistics = new WorkspaceStatisticsList(this._version, this._solution.sid); } return this._statistics; } @@ -1025,10 +950,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'realTimeStatistics', { get: function() { if (!this._realTimeStatistics) { - this._realTimeStatistics = new WorkspaceRealTimeStatisticsList( - this._version, - this._solution.sid - ); + this._realTimeStatistics = new WorkspaceRealTimeStatisticsList(this._version, this._solution.sid); } return this._realTimeStatistics; } @@ -1051,10 +973,7 @@ Object.defineProperty(WorkspaceContext.prototype, 'taskChannels', { get: function() { if (!this._taskChannels) { - this._taskChannels = new TaskChannelList( - this._version, - this._solution.sid - ); + this._taskChannels = new TaskChannelList(this._version, this._solution.sid); } return this._taskChannels; } diff --git a/lib/rest/taskrouter/v1/workspace/activity.js b/lib/rest/taskrouter/v1/workspace/activity.js index 03650299b3..3ae881d22f 100644 --- a/lib/rest/taskrouter/v1/workspace/activity.js +++ b/lib/rest/taskrouter/v1/workspace/activity.js @@ -49,9 +49,7 @@ ActivityList = function ActivityList(version, workspaceSid) { ActivityListInstance._version = version; // Path Solution - ActivityListInstance._solution = { - workspaceSid: workspaceSid - }; + ActivityListInstance._solution = {workspaceSid: workspaceSid}; ActivityListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Activities' // jshint ignore:line )(ActivityListInstance._solution); @@ -249,18 +247,10 @@ ActivityList = function ActivityList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ActivityPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ActivityPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -296,17 +286,10 @@ ActivityList = function ActivityList(version, workspaceSid) { ActivityListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ActivityPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ActivityPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -350,11 +333,7 @@ ActivityList = function ActivityList(version, workspaceSid) { 'Available': serialize.bool(_.get(opts, 'available')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ActivityInstance( @@ -390,11 +369,7 @@ ActivityList = function ActivityList(version, workspaceSid) { */ /* jshint ignore:end */ ActivityListInstance.get = function get(sid) { - return new ActivityContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new ActivityContext(this._version, this._solution.workspaceSid, sid); }; return ActivityListInstance; @@ -438,11 +413,7 @@ ActivityPage.prototype.constructor = ActivityPage; */ /* jshint ignore:end */ ActivityPage.prototype.getInstance = function getInstance(payload) { - return new ActivityInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new ActivityInstance(this._version, payload, this._solution.workspaceSid); }; @@ -482,21 +453,14 @@ ActivityInstance = function ActivityInstance(version, payload, workspaceSid, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(ActivityInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new ActivityContext( - this._version, - this._solution.workspaceSid, - this._solution.sid - ); + this._context = new ActivityContext(this._version, this._solution.workspaceSid, this._solution.sid); } return this._context; @@ -571,10 +535,7 @@ ActivityContext = function ActivityContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Activities/<%= sid %>' // jshint ignore:line )(this._solution); @@ -595,10 +556,7 @@ ActivityContext = function ActivityContext(version, workspaceSid, sid) { /* jshint ignore:end */ ActivityContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ActivityInstance( @@ -643,15 +601,9 @@ ActivityContext.prototype.update = function update(opts, callback) { opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'FriendlyName': _.get(opts, 'friendlyName') - }); + var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ActivityInstance( @@ -688,10 +640,7 @@ ActivityContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ ActivityContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/taskrouter/v1/workspace/event.js b/lib/rest/taskrouter/v1/workspace/event.js index 29391d29be..cf65dcc765 100644 --- a/lib/rest/taskrouter/v1/workspace/event.js +++ b/lib/rest/taskrouter/v1/workspace/event.js @@ -49,9 +49,7 @@ EventList = function EventList(version, workspaceSid) { EventListInstance._version = version; // Path Solution - EventListInstance._solution = { - workspaceSid: workspaceSid - }; + EventListInstance._solution = {workspaceSid: workspaceSid}; EventListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Events' // jshint ignore:line )(EventListInstance._solution); @@ -277,18 +275,10 @@ EventList = function EventList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new EventPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new EventPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -331,17 +321,10 @@ EventList = function EventList(version, workspaceSid) { EventListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new EventPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new EventPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -369,11 +352,7 @@ EventList = function EventList(version, workspaceSid) { */ /* jshint ignore:end */ EventListInstance.get = function get(sid) { - return new EventContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new EventContext(this._version, this._solution.workspaceSid, sid); }; return EventListInstance; @@ -417,11 +396,7 @@ EventPage.prototype.constructor = EventPage; */ /* jshint ignore:end */ EventPage.prototype.getInstance = function getInstance(payload) { - return new EventInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new EventInstance(this._version, payload, this._solution.workspaceSid); }; @@ -474,21 +449,14 @@ EventInstance = function EventInstance(version, payload, workspaceSid, sid) { // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(EventInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new EventContext( - this._version, - this._solution.workspaceSid, - this._solution.sid - ); + this._context = new EventContext(this._version, this._solution.workspaceSid, this._solution.sid); } return this._context; @@ -527,10 +495,7 @@ EventContext = function EventContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Events/<%= sid %>' // jshint ignore:line )(this._solution); @@ -551,10 +516,7 @@ EventContext = function EventContext(version, workspaceSid, sid) { /* jshint ignore:end */ EventContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new EventInstance( diff --git a/lib/rest/taskrouter/v1/workspace/task.js b/lib/rest/taskrouter/v1/workspace/task.js index 46aa3a8a28..017da7ef81 100644 --- a/lib/rest/taskrouter/v1/workspace/task.js +++ b/lib/rest/taskrouter/v1/workspace/task.js @@ -50,9 +50,7 @@ TaskList = function TaskList(version, workspaceSid) { TaskListInstance._version = version; // Path Solution - TaskListInstance._solution = { - workspaceSid: workspaceSid - }; + TaskListInstance._solution = {workspaceSid: workspaceSid}; TaskListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Tasks' // jshint ignore:line )(TaskListInstance._solution); @@ -278,18 +276,10 @@ TaskList = function TaskList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TaskPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -332,17 +322,10 @@ TaskList = function TaskList(version, workspaceSid) { TaskListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TaskPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -391,11 +374,7 @@ TaskList = function TaskList(version, workspaceSid) { 'Attributes': _.get(opts, 'attributes') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskInstance( @@ -431,11 +410,7 @@ TaskList = function TaskList(version, workspaceSid) { */ /* jshint ignore:end */ TaskListInstance.get = function get(sid) { - return new TaskContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new TaskContext(this._version, this._solution.workspaceSid, sid); }; return TaskListInstance; @@ -479,11 +454,7 @@ TaskPage.prototype.constructor = TaskPage; */ /* jshint ignore:end */ TaskPage.prototype.getInstance = function getInstance(payload) { - return new TaskInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new TaskInstance(this._version, payload, this._solution.workspaceSid); }; @@ -546,21 +517,14 @@ TaskInstance = function TaskInstance(version, payload, workspaceSid, sid) { // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(TaskInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new TaskContext( - this._version, - this._solution.workspaceSid, - this._solution.sid - ); + this._context = new TaskContext(this._version, this._solution.workspaceSid, this._solution.sid); } return this._context; @@ -657,10 +621,7 @@ TaskContext = function TaskContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Tasks/<%= sid %>' // jshint ignore:line )(this._solution); @@ -684,10 +645,7 @@ TaskContext = function TaskContext(version, workspaceSid, sid) { /* jshint ignore:end */ TaskContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new TaskInstance( @@ -744,11 +702,7 @@ TaskContext.prototype.update = function update(opts, callback) { 'TaskChannel': _.get(opts, 'taskChannel') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskInstance( @@ -785,10 +739,7 @@ TaskContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ TaskContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/taskrouter/v1/workspace/task/reservation.js b/lib/rest/taskrouter/v1/workspace/task/reservation.js index 23c9b3603e..033015e26e 100644 --- a/lib/rest/taskrouter/v1/workspace/task/reservation.js +++ b/lib/rest/taskrouter/v1/workspace/task/reservation.js @@ -51,10 +51,7 @@ ReservationList = function ReservationList(version, workspaceSid, taskSid) { ReservationListInstance._version = version; // Path Solution - ReservationListInstance._solution = { - workspaceSid: workspaceSid, - taskSid: taskSid - }; + ReservationListInstance._solution = {workspaceSid: workspaceSid, taskSid: taskSid}; ReservationListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Tasks/<%= taskSid %>/Reservations' // jshint ignore:line )(ReservationListInstance._solution); @@ -248,18 +245,10 @@ ReservationList = function ReservationList(version, workspaceSid, taskSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ReservationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ReservationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -294,17 +283,10 @@ ReservationList = function ReservationList(version, workspaceSid, taskSid) { ReservationListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ReservationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ReservationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -332,12 +314,7 @@ ReservationList = function ReservationList(version, workspaceSid, taskSid) { */ /* jshint ignore:end */ ReservationListInstance.get = function get(sid) { - return new ReservationContext( - this._version, - this._solution.workspaceSid, - this._solution.taskSid, - sid - ); + return new ReservationContext(this._version, this._solution.workspaceSid, this._solution.taskSid, sid); }; return ReservationListInstance; @@ -434,11 +411,7 @@ ReservationInstance = function ReservationInstance(version, payload, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - taskSid: taskSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, taskSid: taskSid, sid: sid || this.sid,}; }; Object.defineProperty(ReservationInstance.prototype, @@ -567,11 +540,7 @@ ReservationContext = function ReservationContext(version, workspaceSid, taskSid, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - taskSid: taskSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, taskSid: taskSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Tasks/<%= taskSid %>/Reservations/<%= sid %>' // jshint ignore:line )(this._solution); @@ -592,10 +561,7 @@ ReservationContext = function ReservationContext(version, workspaceSid, taskSid, /* jshint ignore:end */ ReservationContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ReservationInstance( @@ -750,11 +716,7 @@ ReservationContext.prototype.update = function update(opts, callback) { 'PostWorkActivitySid': _.get(opts, 'postWorkActivitySid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ReservationInstance( diff --git a/lib/rest/taskrouter/v1/workspace/taskChannel.js b/lib/rest/taskrouter/v1/workspace/taskChannel.js index 103f1877a7..ef4ffb8724 100644 --- a/lib/rest/taskrouter/v1/workspace/taskChannel.js +++ b/lib/rest/taskrouter/v1/workspace/taskChannel.js @@ -48,9 +48,7 @@ TaskChannelList = function TaskChannelList(version, workspaceSid) { TaskChannelListInstance._version = version; // Path Solution - TaskChannelListInstance._solution = { - workspaceSid: workspaceSid - }; + TaskChannelListInstance._solution = {workspaceSid: workspaceSid}; TaskChannelListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskChannels' // jshint ignore:line )(TaskChannelListInstance._solution); @@ -236,18 +234,10 @@ TaskChannelList = function TaskChannelList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TaskChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -281,17 +271,10 @@ TaskChannelList = function TaskChannelList(version, workspaceSid) { TaskChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TaskChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -319,11 +302,7 @@ TaskChannelList = function TaskChannelList(version, workspaceSid) { */ /* jshint ignore:end */ TaskChannelListInstance.get = function get(sid) { - return new TaskChannelContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new TaskChannelContext(this._version, this._solution.workspaceSid, sid); }; return TaskChannelListInstance; @@ -367,11 +346,7 @@ TaskChannelPage.prototype.constructor = TaskChannelPage; */ /* jshint ignore:end */ TaskChannelPage.prototype.getInstance = function getInstance(payload) { - return new TaskChannelInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new TaskChannelInstance(this._version, payload, this._solution.workspaceSid); }; @@ -411,10 +386,7 @@ TaskChannelInstance = function TaskChannelInstance(version, payload, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(TaskChannelInstance.prototype, @@ -464,10 +436,7 @@ TaskChannelContext = function TaskChannelContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskChannels/<%= sid %>' // jshint ignore:line )(this._solution); @@ -488,10 +457,7 @@ TaskChannelContext = function TaskChannelContext(version, workspaceSid, sid) { /* jshint ignore:end */ TaskChannelContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new TaskChannelInstance( diff --git a/lib/rest/taskrouter/v1/workspace/taskQueue.js b/lib/rest/taskrouter/v1/workspace/taskQueue.js index b4f6b62dbb..daa147294c 100644 --- a/lib/rest/taskrouter/v1/workspace/taskQueue.js +++ b/lib/rest/taskrouter/v1/workspace/taskQueue.js @@ -56,9 +56,7 @@ TaskQueueList = function TaskQueueList(version, workspaceSid) { TaskQueueListInstance._version = version; // Path Solution - TaskQueueListInstance._solution = { - workspaceSid: workspaceSid - }; + TaskQueueListInstance._solution = {workspaceSid: workspaceSid}; TaskQueueListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskQueues' // jshint ignore:line )(TaskQueueListInstance._solution); @@ -264,18 +262,10 @@ TaskQueueList = function TaskQueueList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TaskQueuePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskQueuePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -312,17 +302,10 @@ TaskQueueList = function TaskQueueList(version, workspaceSid) { TaskQueueListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TaskQueuePage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskQueuePage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -380,11 +363,7 @@ TaskQueueList = function TaskQueueList(version, workspaceSid) { 'TaskOrder': _.get(opts, 'taskOrder') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskQueueInstance( @@ -410,10 +389,7 @@ TaskQueueList = function TaskQueueList(version, workspaceSid) { 'statistics', { get: function statistics() { if (!this._statistics) { - this._statistics = new TaskQueuesStatisticsList( - this._version, - this._solution.workspaceSid - ); + this._statistics = new TaskQueuesStatisticsList(this._version, this._solution.workspaceSid); } return this._statistics; @@ -434,11 +410,7 @@ TaskQueueList = function TaskQueueList(version, workspaceSid) { */ /* jshint ignore:end */ TaskQueueListInstance.get = function get(sid) { - return new TaskQueueContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new TaskQueueContext(this._version, this._solution.workspaceSid, sid); }; return TaskQueueListInstance; @@ -482,11 +454,7 @@ TaskQueuePage.prototype.constructor = TaskQueuePage; */ /* jshint ignore:end */ TaskQueuePage.prototype.getInstance = function getInstance(payload) { - return new TaskQueueInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new TaskQueueInstance(this._version, payload, this._solution.workspaceSid); }; @@ -540,21 +508,14 @@ TaskQueueInstance = function TaskQueueInstance(version, payload, workspaceSid, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(TaskQueueInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new TaskQueueContext( - this._version, - this._solution.workspaceSid, - this._solution.sid - ); + this._context = new TaskQueueContext(this._version, this._solution.workspaceSid, this._solution.sid); } return this._context; @@ -687,10 +648,7 @@ TaskQueueContext = function TaskQueueContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskQueues/<%= sid %>' // jshint ignore:line )(this._solution); @@ -716,10 +674,7 @@ TaskQueueContext = function TaskQueueContext(version, workspaceSid, sid) { /* jshint ignore:end */ TaskQueueContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new TaskQueueInstance( @@ -778,11 +733,7 @@ TaskQueueContext.prototype.update = function update(opts, callback) { 'TaskOrder': _.get(opts, 'taskOrder') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskQueueInstance( @@ -819,10 +770,7 @@ TaskQueueContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ TaskQueueContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js index 1af138bcfd..f3087247a5 100644 --- a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.js @@ -190,10 +190,7 @@ TaskQueueCumulativeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid, - }; + this._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid,}; }; Object.defineProperty(TaskQueueCumulativeStatisticsInstance.prototype, @@ -251,10 +248,7 @@ TaskQueueCumulativeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid, - }; + this._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskQueues/<%= taskQueueSid %>/CumulativeStatistics' // jshint ignore:line )(this._solution); @@ -296,11 +290,7 @@ TaskQueueCumulativeStatisticsContext.prototype.fetch = function fetch(opts, 'SplitByWaitTime': _.get(opts, 'splitByWaitTime') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskQueueCumulativeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js index c6c07b54e9..4ec333cdf2 100644 --- a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.js @@ -168,10 +168,7 @@ TaskQueueRealTimeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid, - }; + this._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid,}; }; Object.defineProperty(TaskQueueRealTimeStatisticsInstance.prototype, @@ -225,10 +222,7 @@ TaskQueueRealTimeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid, - }; + this._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskQueues/<%= taskQueueSid %>/RealTimeStatistics' // jshint ignore:line )(this._solution); @@ -258,15 +252,9 @@ TaskQueueRealTimeStatisticsContext.prototype.fetch = function fetch(opts, opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'TaskChannel': _.get(opts, 'taskChannel') - }); + var data = values.of({'TaskChannel': _.get(opts, 'taskChannel')}); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskQueueRealTimeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js index c5c4fb4d71..ef6264f544 100644 --- a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.js @@ -51,10 +51,7 @@ TaskQueueStatisticsList = function TaskQueueStatisticsList(version, TaskQueueStatisticsListInstance._version = version; // Path Solution - TaskQueueStatisticsListInstance._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid - }; + TaskQueueStatisticsListInstance._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid}; /* jshint ignore:start */ /** * Constructs a task_queue_statistics @@ -157,10 +154,7 @@ TaskQueueStatisticsInstance = function TaskQueueStatisticsInstance(version, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid, - }; + this._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid,}; }; Object.defineProperty(TaskQueueStatisticsInstance.prototype, @@ -217,10 +211,7 @@ TaskQueueStatisticsContext = function TaskQueueStatisticsContext(version, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - taskQueueSid: taskQueueSid, - }; + this._solution = {workspaceSid: workspaceSid, taskQueueSid: taskQueueSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskQueues/<%= taskQueueSid %>/Statistics' // jshint ignore:line )(this._solution); @@ -261,11 +252,7 @@ TaskQueueStatisticsContext.prototype.fetch = function fetch(opts, callback) { 'SplitByWaitTime': _.get(opts, 'splitByWaitTime') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new TaskQueueStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js index b582a0ea9b..8bba7a65ca 100644 --- a/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js @@ -48,9 +48,7 @@ TaskQueuesStatisticsList = function TaskQueuesStatisticsList(version, TaskQueuesStatisticsListInstance._version = version; // Path Solution - TaskQueuesStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + TaskQueuesStatisticsListInstance._solution = {workspaceSid: workspaceSid}; TaskQueuesStatisticsListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/TaskQueues/Statistics' // jshint ignore:line )(TaskQueuesStatisticsListInstance._solution); @@ -264,18 +262,10 @@ TaskQueuesStatisticsList = function TaskQueuesStatisticsList(version, 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TaskQueuesStatisticsPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskQueuesStatisticsPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -316,17 +306,10 @@ TaskQueuesStatisticsList = function TaskQueuesStatisticsList(version, { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TaskQueuesStatisticsPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TaskQueuesStatisticsPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -382,11 +365,7 @@ TaskQueuesStatisticsPage.prototype.constructor = TaskQueuesStatisticsPage; */ /* jshint ignore:end */ TaskQueuesStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new TaskQueuesStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new TaskQueuesStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -418,9 +397,7 @@ TaskQueuesStatisticsInstance = function TaskQueuesStatisticsInstance(version, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; module.exports = { diff --git a/lib/rest/taskrouter/v1/workspace/worker.js b/lib/rest/taskrouter/v1/workspace/worker.js index 77fe81803b..cd207657f9 100644 --- a/lib/rest/taskrouter/v1/workspace/worker.js +++ b/lib/rest/taskrouter/v1/workspace/worker.js @@ -58,9 +58,7 @@ WorkerList = function WorkerList(version, workspaceSid) { WorkerListInstance._version = version; // Path Solution - WorkerListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkerListInstance._solution = {workspaceSid: workspaceSid}; WorkerListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers' // jshint ignore:line )(WorkerListInstance._solution); @@ -282,18 +280,10 @@ WorkerList = function WorkerList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkerPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkerPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -334,17 +324,10 @@ WorkerList = function WorkerList(version, workspaceSid) { WorkerListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new WorkerPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkerPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -390,11 +373,7 @@ WorkerList = function WorkerList(version, workspaceSid) { 'Attributes': _.get(opts, 'attributes') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkerInstance( @@ -420,10 +399,7 @@ WorkerList = function WorkerList(version, workspaceSid) { 'statistics', { get: function statistics() { if (!this._statistics) { - this._statistics = new WorkersStatisticsList( - this._version, - this._solution.workspaceSid - ); + this._statistics = new WorkersStatisticsList(this._version, this._solution.workspaceSid); } return this._statistics; @@ -444,11 +420,7 @@ WorkerList = function WorkerList(version, workspaceSid) { */ /* jshint ignore:end */ WorkerListInstance.get = function get(sid) { - return new WorkerContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new WorkerContext(this._version, this._solution.workspaceSid, sid); }; return WorkerListInstance; @@ -492,11 +464,7 @@ WorkerPage.prototype.constructor = WorkerPage; */ /* jshint ignore:end */ WorkerPage.prototype.getInstance = function getInstance(payload) { - return new WorkerInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkerInstance(this._version, payload, this._solution.workspaceSid); }; @@ -545,21 +513,14 @@ WorkerInstance = function WorkerInstance(version, payload, workspaceSid, sid) { // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(WorkerInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkerContext( - this._version, - this._solution.workspaceSid, - this._solution.sid - ); + this._context = new WorkerContext(this._version, this._solution.workspaceSid, this._solution.sid); } return this._context; @@ -723,10 +684,7 @@ WorkerContext = function WorkerContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/<%= sid %>' // jshint ignore:line )(this._solution); @@ -754,10 +712,7 @@ WorkerContext = function WorkerContext(version, workspaceSid, sid) { /* jshint ignore:end */ WorkerContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new WorkerInstance( @@ -810,11 +765,7 @@ WorkerContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkerInstance( @@ -851,10 +802,7 @@ WorkerContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ WorkerContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/taskrouter/v1/workspace/worker/reservation.js b/lib/rest/taskrouter/v1/workspace/worker/reservation.js index e7acd58faa..e16afddd72 100644 --- a/lib/rest/taskrouter/v1/workspace/worker/reservation.js +++ b/lib/rest/taskrouter/v1/workspace/worker/reservation.js @@ -51,10 +51,7 @@ ReservationList = function ReservationList(version, workspaceSid, workerSid) { ReservationListInstance._version = version; // Path Solution - ReservationListInstance._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid - }; + ReservationListInstance._solution = {workspaceSid: workspaceSid, workerSid: workerSid}; ReservationListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/<%= workerSid %>/Reservations' // jshint ignore:line )(ReservationListInstance._solution); @@ -248,18 +245,10 @@ ReservationList = function ReservationList(version, workspaceSid, workerSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new ReservationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ReservationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -294,17 +283,10 @@ ReservationList = function ReservationList(version, workspaceSid, workerSid) { ReservationListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new ReservationPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new ReservationPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -434,11 +416,7 @@ ReservationInstance = function ReservationInstance(version, payload, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, workerSid: workerSid, sid: sid || this.sid,}; }; Object.defineProperty(ReservationInstance.prototype, @@ -567,11 +545,7 @@ ReservationContext = function ReservationContext(version, workspaceSid, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, workerSid: workerSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/<%= workerSid %>/Reservations/<%= sid %>' // jshint ignore:line )(this._solution); @@ -592,10 +566,7 @@ ReservationContext = function ReservationContext(version, workspaceSid, /* jshint ignore:end */ ReservationContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new ReservationInstance( @@ -750,11 +721,7 @@ ReservationContext.prototype.update = function update(opts, callback) { 'PostWorkActivitySid': _.get(opts, 'postWorkActivitySid') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new ReservationInstance( diff --git a/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js b/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js index 9d25b03df9..d8559aea16 100644 --- a/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js +++ b/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js @@ -52,10 +52,7 @@ WorkerChannelList = function WorkerChannelList(version, workspaceSid, workerSid) WorkerChannelListInstance._version = version; // Path Solution - WorkerChannelListInstance._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid - }; + WorkerChannelListInstance._solution = {workspaceSid: workspaceSid, workerSid: workerSid}; WorkerChannelListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/<%= workerSid %>/Channels' // jshint ignore:line )(WorkerChannelListInstance._solution); @@ -241,18 +238,10 @@ WorkerChannelList = function WorkerChannelList(version, workspaceSid, workerSid) 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkerChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkerChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -286,17 +275,10 @@ WorkerChannelList = function WorkerChannelList(version, workspaceSid, workerSid) WorkerChannelListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new WorkerChannelPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkerChannelPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -433,11 +415,7 @@ WorkerChannelInstance = function WorkerChannelInstance(version, payload, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, workerSid: workerSid, sid: sid || this.sid,}; }; Object.defineProperty(WorkerChannelInstance.prototype, @@ -510,11 +488,7 @@ WorkerChannelContext = function WorkerChannelContext(version, workspaceSid, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, workerSid: workerSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/<%= workerSid %>/Channels/<%= sid %>' // jshint ignore:line )(this._solution); @@ -535,10 +509,7 @@ WorkerChannelContext = function WorkerChannelContext(version, workspaceSid, /* jshint ignore:end */ WorkerChannelContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new WorkerChannelInstance( @@ -590,11 +561,7 @@ WorkerChannelContext.prototype.update = function update(opts, callback) { 'Available': serialize.bool(_.get(opts, 'available')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkerChannelInstance( diff --git a/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js b/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js index dbd636ebf1..3d4f8aa2a0 100644 --- a/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/worker/workerStatistics.js @@ -50,10 +50,7 @@ WorkerStatisticsList = function WorkerStatisticsList(version, workspaceSid, WorkerStatisticsListInstance._version = version; // Path Solution - WorkerStatisticsListInstance._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid - }; + WorkerStatisticsListInstance._solution = {workspaceSid: workspaceSid, workerSid: workerSid}; /* jshint ignore:start */ /** * Constructs a worker_statistics @@ -154,10 +151,7 @@ WorkerStatisticsInstance = function WorkerStatisticsInstance(version, payload, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid, - }; + this._solution = {workspaceSid: workspaceSid, workerSid: workerSid,}; }; Object.defineProperty(WorkerStatisticsInstance.prototype, @@ -214,10 +208,7 @@ WorkerStatisticsContext = function WorkerStatisticsContext(version, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - workerSid: workerSid, - }; + this._solution = {workspaceSid: workspaceSid, workerSid: workerSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/<%= workerSid %>/Statistics' // jshint ignore:line )(this._solution); @@ -256,11 +247,7 @@ WorkerStatisticsContext.prototype.fetch = function fetch(opts, callback) { 'TaskChannel': _.get(opts, 'taskChannel') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkerStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js b/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js index 3f720fef1a..089e2ab3a7 100644 --- a/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.js @@ -51,9 +51,7 @@ WorkersCumulativeStatisticsList = function WorkersCumulativeStatisticsListInstance._version = version; // Path Solution - WorkersCumulativeStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkersCumulativeStatisticsListInstance._solution = {workspaceSid: workspaceSid}; /* jshint ignore:start */ /** * Constructs a workers_cumulative_statistics @@ -66,10 +64,7 @@ WorkersCumulativeStatisticsList = function */ /* jshint ignore:end */ WorkersCumulativeStatisticsListInstance.get = function get() { - return new WorkersCumulativeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + return new WorkersCumulativeStatisticsContext(this._version, this._solution.workspaceSid); }; return WorkersCumulativeStatisticsListInstance; @@ -115,11 +110,7 @@ WorkersCumulativeStatisticsPage.prototype.constructor = WorkersCumulativeStatist /* jshint ignore:end */ WorkersCumulativeStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new WorkersCumulativeStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkersCumulativeStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -166,19 +157,14 @@ WorkersCumulativeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; Object.defineProperty(WorkersCumulativeStatisticsInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkersCumulativeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + this._context = new WorkersCumulativeStatisticsContext(this._version, this._solution.workspaceSid); } return this._context; @@ -223,9 +209,7 @@ WorkersCumulativeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/CumulativeStatistics' // jshint ignore:line )(this._solution); @@ -265,11 +249,7 @@ WorkersCumulativeStatisticsContext.prototype.fetch = function fetch(opts, 'TaskChannel': _.get(opts, 'taskChannel') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkersCumulativeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js b/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js index 3ff9350a90..9a5f6ab394 100644 --- a/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.js @@ -49,9 +49,7 @@ WorkersRealTimeStatisticsList = function WorkersRealTimeStatisticsList(version, WorkersRealTimeStatisticsListInstance._version = version; // Path Solution - WorkersRealTimeStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkersRealTimeStatisticsListInstance._solution = {workspaceSid: workspaceSid}; /* jshint ignore:start */ /** * Constructs a workers_real_time_statistics @@ -64,10 +62,7 @@ WorkersRealTimeStatisticsList = function WorkersRealTimeStatisticsList(version, */ /* jshint ignore:end */ WorkersRealTimeStatisticsListInstance.get = function get() { - return new WorkersRealTimeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + return new WorkersRealTimeStatisticsContext(this._version, this._solution.workspaceSid); }; return WorkersRealTimeStatisticsListInstance; @@ -113,11 +108,7 @@ WorkersRealTimeStatisticsPage.prototype.constructor = WorkersRealTimeStatisticsP /* jshint ignore:end */ WorkersRealTimeStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new WorkersRealTimeStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkersRealTimeStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -150,19 +141,14 @@ WorkersRealTimeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; Object.defineProperty(WorkersRealTimeStatisticsInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkersRealTimeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + this._context = new WorkersRealTimeStatisticsContext(this._version, this._solution.workspaceSid); } return this._context; @@ -204,9 +190,7 @@ WorkersRealTimeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/RealTimeStatistics' // jshint ignore:line )(this._solution); @@ -236,15 +220,9 @@ WorkersRealTimeStatisticsContext.prototype.fetch = function fetch(opts, opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'TaskChannel': _.get(opts, 'taskChannel') - }); + var data = values.of({'TaskChannel': _.get(opts, 'taskChannel')}); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkersRealTimeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js b/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js index f754c319ba..822ded00ac 100644 --- a/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/worker/workersStatistics.js @@ -48,9 +48,7 @@ WorkersStatisticsList = function WorkersStatisticsList(version, workspaceSid) { WorkersStatisticsListInstance._version = version; // Path Solution - WorkersStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkersStatisticsListInstance._solution = {workspaceSid: workspaceSid}; /* jshint ignore:start */ /** * Constructs a workers_statistics @@ -63,10 +61,7 @@ WorkersStatisticsList = function WorkersStatisticsList(version, workspaceSid) { */ /* jshint ignore:end */ WorkersStatisticsListInstance.get = function get() { - return new WorkersStatisticsContext( - this._version, - this._solution.workspaceSid - ); + return new WorkersStatisticsContext(this._version, this._solution.workspaceSid); }; return WorkersStatisticsListInstance; @@ -111,11 +106,7 @@ WorkersStatisticsPage.prototype.constructor = WorkersStatisticsPage; */ /* jshint ignore:end */ WorkersStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new WorkersStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkersStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -148,19 +139,14 @@ WorkersStatisticsInstance = function WorkersStatisticsInstance(version, payload, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; Object.defineProperty(WorkersStatisticsInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkersStatisticsContext( - this._version, - this._solution.workspaceSid - ); + this._context = new WorkersStatisticsContext(this._version, this._solution.workspaceSid); } return this._context; @@ -207,9 +193,7 @@ WorkersStatisticsContext = function WorkersStatisticsContext(version, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workers/Statistics' // jshint ignore:line )(this._solution); @@ -254,18 +238,10 @@ WorkersStatisticsContext.prototype.fetch = function fetch(opts, callback) { 'TaskChannel': _.get(opts, 'taskChannel') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkersStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - )); + deferred.resolve(new WorkersStatisticsInstance(this._version, payload, this._solution.workspaceSid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/taskrouter/v1/workspace/workflow.js b/lib/rest/taskrouter/v1/workspace/workflow.js index e66d8c0c3c..76519d6ba8 100644 --- a/lib/rest/taskrouter/v1/workspace/workflow.js +++ b/lib/rest/taskrouter/v1/workspace/workflow.js @@ -54,9 +54,7 @@ WorkflowList = function WorkflowList(version, workspaceSid) { WorkflowListInstance._version = version; // Path Solution - WorkflowListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkflowListInstance._solution = {workspaceSid: workspaceSid}; WorkflowListInstance._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workflows' // jshint ignore:line )(WorkflowListInstance._solution); @@ -250,18 +248,10 @@ WorkflowList = function WorkflowList(version, workspaceSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new WorkflowPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkflowPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -296,17 +286,10 @@ WorkflowList = function WorkflowList(version, workspaceSid) { WorkflowListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new WorkflowPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new WorkflowPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,11 +343,7 @@ WorkflowList = function WorkflowList(version, workspaceSid) { 'TaskReservationTimeout': _.get(opts, 'taskReservationTimeout') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkflowInstance( @@ -400,11 +379,7 @@ WorkflowList = function WorkflowList(version, workspaceSid) { */ /* jshint ignore:end */ WorkflowListInstance.get = function get(sid) { - return new WorkflowContext( - this._version, - this._solution.workspaceSid, - sid - ); + return new WorkflowContext(this._version, this._solution.workspaceSid, sid); }; return WorkflowListInstance; @@ -448,11 +423,7 @@ WorkflowPage.prototype.constructor = WorkflowPage; */ /* jshint ignore:end */ WorkflowPage.prototype.getInstance = function getInstance(payload) { - return new WorkflowInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkflowInstance(this._version, payload, this._solution.workspaceSid); }; @@ -503,21 +474,14 @@ WorkflowInstance = function WorkflowInstance(version, payload, workspaceSid, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - sid: sid || this.sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid || this.sid,}; }; Object.defineProperty(WorkflowInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkflowContext( - this._version, - this._solution.workspaceSid, - this._solution.sid - ); + this._context = new WorkflowContext(this._version, this._solution.workspaceSid, this._solution.sid); } return this._context; @@ -650,10 +614,7 @@ WorkflowContext = function WorkflowContext(version, workspaceSid, sid) { this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - sid: sid, - }; + this._solution = {workspaceSid: workspaceSid, sid: sid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workflows/<%= sid %>' // jshint ignore:line )(this._solution); @@ -679,10 +640,7 @@ WorkflowContext = function WorkflowContext(version, workspaceSid, sid) { /* jshint ignore:end */ WorkflowContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new WorkflowInstance( @@ -740,11 +698,7 @@ WorkflowContext.prototype.update = function update(opts, callback) { 'TaskReservationTimeout': _.get(opts, 'taskReservationTimeout') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkflowInstance( @@ -781,10 +735,7 @@ WorkflowContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ WorkflowContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js b/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js index dec2c7ae26..7e0a5b382a 100644 --- a/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.js @@ -192,10 +192,7 @@ WorkflowCumulativeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid, - }; + this._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid,}; }; Object.defineProperty(WorkflowCumulativeStatisticsInstance.prototype, @@ -253,10 +250,7 @@ WorkflowCumulativeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid, - }; + this._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workflows/<%= workflowSid %>/CumulativeStatistics' // jshint ignore:line )(this._solution); @@ -298,11 +292,7 @@ WorkflowCumulativeStatisticsContext.prototype.fetch = function fetch(opts, 'SplitByWaitTime': _.get(opts, 'splitByWaitTime') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkflowCumulativeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js b/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js index 4f0fb96fe7..9746aaa25e 100644 --- a/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.js @@ -162,10 +162,7 @@ WorkflowRealTimeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid, - }; + this._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid,}; }; Object.defineProperty(WorkflowRealTimeStatisticsInstance.prototype, @@ -219,10 +216,7 @@ WorkflowRealTimeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid, - }; + this._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workflows/<%= workflowSid %>/RealTimeStatistics' // jshint ignore:line )(this._solution); @@ -252,15 +246,9 @@ WorkflowRealTimeStatisticsContext.prototype.fetch = function fetch(opts, opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'TaskChannel': _.get(opts, 'taskChannel') - }); + var data = values.of({'TaskChannel': _.get(opts, 'taskChannel')}); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkflowRealTimeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js b/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js index 2ea24af52c..2b3ba4abcf 100644 --- a/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/workflow/workflowStatistics.js @@ -50,10 +50,7 @@ WorkflowStatisticsList = function WorkflowStatisticsList(version, workspaceSid, WorkflowStatisticsListInstance._version = version; // Path Solution - WorkflowStatisticsListInstance._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid - }; + WorkflowStatisticsListInstance._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid}; /* jshint ignore:start */ /** * Constructs a workflow_statistics @@ -156,10 +153,7 @@ WorkflowStatisticsInstance = function WorkflowStatisticsInstance(version, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid, - }; + this._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid,}; }; Object.defineProperty(WorkflowStatisticsInstance.prototype, @@ -216,10 +210,7 @@ WorkflowStatisticsContext = function WorkflowStatisticsContext(version, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - workflowSid: workflowSid, - }; + this._solution = {workspaceSid: workspaceSid, workflowSid: workflowSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Workflows/<%= workflowSid %>/Statistics' // jshint ignore:line )(this._solution); @@ -260,11 +251,7 @@ WorkflowStatisticsContext.prototype.fetch = function fetch(opts, callback) { 'SplitByWaitTime': _.get(opts, 'splitByWaitTime') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkflowStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js b/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js index d9eb1bf550..204a511b1c 100644 --- a/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.js @@ -50,9 +50,7 @@ WorkspaceCumulativeStatisticsList = function WorkspaceCumulativeStatisticsListInstance._version = version; // Path Solution - WorkspaceCumulativeStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkspaceCumulativeStatisticsListInstance._solution = {workspaceSid: workspaceSid}; /* jshint ignore:start */ /** * Constructs a workspace_cumulative_statistics @@ -65,10 +63,7 @@ WorkspaceCumulativeStatisticsList = function */ /* jshint ignore:end */ WorkspaceCumulativeStatisticsListInstance.get = function get() { - return new WorkspaceCumulativeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + return new WorkspaceCumulativeStatisticsContext(this._version, this._solution.workspaceSid); }; return WorkspaceCumulativeStatisticsListInstance; @@ -114,11 +109,7 @@ WorkspaceCumulativeStatisticsPage.prototype.constructor = WorkspaceCumulativeSta /* jshint ignore:end */ WorkspaceCumulativeStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new WorkspaceCumulativeStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkspaceCumulativeStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -183,19 +174,14 @@ WorkspaceCumulativeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; Object.defineProperty(WorkspaceCumulativeStatisticsInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkspaceCumulativeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + this._context = new WorkspaceCumulativeStatisticsContext(this._version, this._solution.workspaceSid); } return this._context; @@ -241,9 +227,7 @@ WorkspaceCumulativeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/CumulativeStatistics' // jshint ignore:line )(this._solution); @@ -285,11 +269,7 @@ WorkspaceCumulativeStatisticsContext.prototype.fetch = function fetch(opts, 'SplitByWaitTime': _.get(opts, 'splitByWaitTime') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkspaceCumulativeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js b/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js index c99747f604..e86d7d0d81 100644 --- a/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.js @@ -49,9 +49,7 @@ WorkspaceRealTimeStatisticsList = function WorkspaceRealTimeStatisticsListInstance._version = version; // Path Solution - WorkspaceRealTimeStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkspaceRealTimeStatisticsListInstance._solution = {workspaceSid: workspaceSid}; /* jshint ignore:start */ /** * Constructs a workspace_real_time_statistics @@ -64,10 +62,7 @@ WorkspaceRealTimeStatisticsList = function */ /* jshint ignore:end */ WorkspaceRealTimeStatisticsListInstance.get = function get() { - return new WorkspaceRealTimeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + return new WorkspaceRealTimeStatisticsContext(this._version, this._solution.workspaceSid); }; return WorkspaceRealTimeStatisticsListInstance; @@ -113,11 +108,7 @@ WorkspaceRealTimeStatisticsPage.prototype.constructor = WorkspaceRealTimeStatist /* jshint ignore:end */ WorkspaceRealTimeStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new WorkspaceRealTimeStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkspaceRealTimeStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -158,19 +149,14 @@ WorkspaceRealTimeStatisticsInstance = function // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; Object.defineProperty(WorkspaceRealTimeStatisticsInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkspaceRealTimeStatisticsContext( - this._version, - this._solution.workspaceSid - ); + this._context = new WorkspaceRealTimeStatisticsContext(this._version, this._solution.workspaceSid); } return this._context; @@ -212,9 +198,7 @@ WorkspaceRealTimeStatisticsContext = function this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/RealTimeStatistics' // jshint ignore:line )(this._solution); @@ -244,15 +228,9 @@ WorkspaceRealTimeStatisticsContext.prototype.fetch = function fetch(opts, opts = opts || {}; var deferred = Q.defer(); - var data = values.of({ - 'TaskChannel': _.get(opts, 'taskChannel') - }); + var data = values.of({'TaskChannel': _.get(opts, 'taskChannel')}); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkspaceRealTimeStatisticsInstance( diff --git a/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js b/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js index f90b389b58..e3c53dfabe 100644 --- a/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js +++ b/lib/rest/taskrouter/v1/workspace/workspaceStatistics.js @@ -48,9 +48,7 @@ WorkspaceStatisticsList = function WorkspaceStatisticsList(version, WorkspaceStatisticsListInstance._version = version; // Path Solution - WorkspaceStatisticsListInstance._solution = { - workspaceSid: workspaceSid - }; + WorkspaceStatisticsListInstance._solution = {workspaceSid: workspaceSid}; /* jshint ignore:start */ /** * Constructs a workspace_statistics @@ -63,10 +61,7 @@ WorkspaceStatisticsList = function WorkspaceStatisticsList(version, */ /* jshint ignore:end */ WorkspaceStatisticsListInstance.get = function get() { - return new WorkspaceStatisticsContext( - this._version, - this._solution.workspaceSid - ); + return new WorkspaceStatisticsContext(this._version, this._solution.workspaceSid); }; return WorkspaceStatisticsListInstance; @@ -111,11 +106,7 @@ WorkspaceStatisticsPage.prototype.constructor = WorkspaceStatisticsPage; */ /* jshint ignore:end */ WorkspaceStatisticsPage.prototype.getInstance = function getInstance(payload) { - return new WorkspaceStatisticsInstance( - this._version, - payload, - this._solution.workspaceSid - ); + return new WorkspaceStatisticsInstance(this._version, payload, this._solution.workspaceSid); }; @@ -148,19 +139,14 @@ WorkspaceStatisticsInstance = function WorkspaceStatisticsInstance(version, // Context this._context = undefined; - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; }; Object.defineProperty(WorkspaceStatisticsInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new WorkspaceStatisticsContext( - this._version, - this._solution.workspaceSid - ); + this._context = new WorkspaceStatisticsContext(this._version, this._solution.workspaceSid); } return this._context; @@ -205,9 +191,7 @@ WorkspaceStatisticsContext = function WorkspaceStatisticsContext(version, this._version = version; // Path Solution - this._solution = { - workspaceSid: workspaceSid, - }; + this._solution = {workspaceSid: workspaceSid,}; this._uri = _.template( '/Workspaces/<%= workspaceSid %>/Statistics' // jshint ignore:line )(this._solution); @@ -248,11 +232,7 @@ WorkspaceStatisticsContext.prototype.fetch = function fetch(opts, callback) { 'SplitByWaitTime': _.get(opts, 'splitByWaitTime') }); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { deferred.resolve(new WorkspaceStatisticsInstance( diff --git a/lib/rest/trunking/v1/trunk.js b/lib/rest/trunking/v1/trunk.js index e423afa6b2..64e5b7d5a8 100644 --- a/lib/rest/trunking/v1/trunk.js +++ b/lib/rest/trunking/v1/trunk.js @@ -94,18 +94,10 @@ TrunkList = function TrunkList(version) { 'Secure': serialize.bool(_.get(opts, 'secure')) }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new TrunkInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new TrunkInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -301,18 +293,10 @@ TrunkList = function TrunkList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new TrunkPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TrunkPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -346,17 +330,10 @@ TrunkList = function TrunkList(version) { TrunkListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new TrunkPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new TrunkPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -384,10 +361,7 @@ TrunkList = function TrunkList(version) { */ /* jshint ignore:end */ TrunkListInstance.get = function get(sid) { - return new TrunkContext( - this._version, - sid - ); + return new TrunkContext(this._version, sid); }; return TrunkListInstance; @@ -431,10 +405,7 @@ TrunkPage.prototype.constructor = TrunkPage; */ /* jshint ignore:end */ TrunkPage.prototype.getInstance = function getInstance(payload) { - return new TrunkInstance( - this._version, - payload - ); + return new TrunkInstance(this._version, payload); }; @@ -484,19 +455,14 @@ TrunkInstance = function TrunkInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(TrunkInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new TrunkContext( - this._version, - this._solution.sid - ); + this._context = new TrunkContext(this._version, this._solution.sid); } return this._context; @@ -644,9 +610,7 @@ TrunkContext = function TrunkContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Trunks/<%= sid %>' // jshint ignore:line )(this._solution); @@ -673,17 +637,10 @@ TrunkContext = function TrunkContext(version, sid) { /* jshint ignore:end */ TrunkContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new TrunkInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new TrunkInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -712,10 +669,7 @@ TrunkContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ TrunkContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -769,18 +723,10 @@ TrunkContext.prototype.update = function update(opts, callback) { 'Secure': serialize.bool(_.get(opts, 'secure')) }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new TrunkInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new TrunkInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -798,10 +744,7 @@ Object.defineProperty(TrunkContext.prototype, 'originationUrls', { get: function() { if (!this._originationUrls) { - this._originationUrls = new OriginationUrlList( - this._version, - this._solution.sid - ); + this._originationUrls = new OriginationUrlList(this._version, this._solution.sid); } return this._originationUrls; } @@ -811,10 +754,7 @@ Object.defineProperty(TrunkContext.prototype, 'credentialsLists', { get: function() { if (!this._credentialsLists) { - this._credentialsLists = new CredentialListList( - this._version, - this._solution.sid - ); + this._credentialsLists = new CredentialListList(this._version, this._solution.sid); } return this._credentialsLists; } @@ -824,10 +764,7 @@ Object.defineProperty(TrunkContext.prototype, 'ipAccessControlLists', { get: function() { if (!this._ipAccessControlLists) { - this._ipAccessControlLists = new IpAccessControlListList( - this._version, - this._solution.sid - ); + this._ipAccessControlLists = new IpAccessControlListList(this._version, this._solution.sid); } return this._ipAccessControlLists; } @@ -837,10 +774,7 @@ Object.defineProperty(TrunkContext.prototype, 'phoneNumbers', { get: function() { if (!this._phoneNumbers) { - this._phoneNumbers = new PhoneNumberList( - this._version, - this._solution.sid - ); + this._phoneNumbers = new PhoneNumberList(this._version, this._solution.sid); } return this._phoneNumbers; } diff --git a/lib/rest/trunking/v1/trunk/credentialList.js b/lib/rest/trunking/v1/trunk/credentialList.js index 1c10a7dd20..79a5ba1084 100644 --- a/lib/rest/trunking/v1/trunk/credentialList.js +++ b/lib/rest/trunking/v1/trunk/credentialList.js @@ -48,9 +48,7 @@ CredentialListList = function CredentialListList(version, trunkSid) { CredentialListListInstance._version = version; // Path Solution - CredentialListListInstance._solution = { - trunkSid: trunkSid - }; + CredentialListListInstance._solution = {trunkSid: trunkSid}; CredentialListListInstance._uri = _.template( '/Trunks/<%= trunkSid %>/CredentialLists' // jshint ignore:line )(CredentialListListInstance._solution); @@ -78,15 +76,9 @@ CredentialListList = function CredentialListList(version, trunkSid) { } var deferred = Q.defer(); - var data = values.of({ - 'CredentialListSid': _.get(opts, 'credentialListSid') - }); + var data = values.of({'CredentialListSid': _.get(opts, 'credentialListSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListInstance( @@ -290,18 +282,10 @@ CredentialListList = function CredentialListList(version, trunkSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +319,10 @@ CredentialListList = function CredentialListList(version, trunkSid) { CredentialListListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CredentialListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CredentialListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,11 +350,7 @@ CredentialListList = function CredentialListList(version, trunkSid) { */ /* jshint ignore:end */ CredentialListListInstance.get = function get(sid) { - return new CredentialListContext( - this._version, - this._solution.trunkSid, - sid - ); + return new CredentialListContext(this._version, this._solution.trunkSid, sid); }; return CredentialListListInstance; @@ -421,11 +394,7 @@ CredentialListPage.prototype.constructor = CredentialListPage; */ /* jshint ignore:end */ CredentialListPage.prototype.getInstance = function getInstance(payload) { - return new CredentialListInstance( - this._version, - payload, - this._solution.trunkSid - ); + return new CredentialListInstance(this._version, payload, this._solution.trunkSid); }; @@ -463,21 +432,14 @@ CredentialListInstance = function CredentialListInstance(version, payload, // Context this._context = undefined; - this._solution = { - trunkSid: trunkSid, - sid: sid || this.sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid || this.sid,}; }; Object.defineProperty(CredentialListInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CredentialListContext( - this._version, - this._solution.trunkSid, - this._solution.sid - ); + this._context = new CredentialListContext(this._version, this._solution.trunkSid, this._solution.sid); } return this._context; @@ -533,10 +495,7 @@ CredentialListContext = function CredentialListContext(version, trunkSid, sid) { this._version = version; // Path Solution - this._solution = { - trunkSid: trunkSid, - sid: sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid,}; this._uri = _.template( '/Trunks/<%= trunkSid %>/CredentialLists/<%= sid %>' // jshint ignore:line )(this._solution); @@ -557,10 +516,7 @@ CredentialListContext = function CredentialListContext(version, trunkSid, sid) { /* jshint ignore:end */ CredentialListContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new CredentialListInstance( @@ -597,10 +553,7 @@ CredentialListContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ CredentialListContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/trunking/v1/trunk/ipAccessControlList.js b/lib/rest/trunking/v1/trunk/ipAccessControlList.js index 5e870f984a..38ac5915fa 100644 --- a/lib/rest/trunking/v1/trunk/ipAccessControlList.js +++ b/lib/rest/trunking/v1/trunk/ipAccessControlList.js @@ -48,9 +48,7 @@ IpAccessControlListList = function IpAccessControlListList(version, trunkSid) { IpAccessControlListListInstance._version = version; // Path Solution - IpAccessControlListListInstance._solution = { - trunkSid: trunkSid - }; + IpAccessControlListListInstance._solution = {trunkSid: trunkSid}; IpAccessControlListListInstance._uri = _.template( '/Trunks/<%= trunkSid %>/IpAccessControlLists' // jshint ignore:line )(IpAccessControlListListInstance._solution); @@ -78,15 +76,9 @@ IpAccessControlListList = function IpAccessControlListList(version, trunkSid) { } var deferred = Q.defer(); - var data = values.of({ - 'IpAccessControlListSid': _.get(opts, 'ipAccessControlListSid') - }); + var data = values.of({'IpAccessControlListSid': _.get(opts, 'ipAccessControlListSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListInstance( @@ -290,18 +282,10 @@ IpAccessControlListList = function IpAccessControlListList(version, trunkSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new IpAccessControlListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAccessControlListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -336,17 +320,10 @@ IpAccessControlListList = function IpAccessControlListList(version, trunkSid) { { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new IpAccessControlListPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new IpAccessControlListPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -374,11 +351,7 @@ IpAccessControlListList = function IpAccessControlListList(version, trunkSid) { */ /* jshint ignore:end */ IpAccessControlListListInstance.get = function get(sid) { - return new IpAccessControlListContext( - this._version, - this._solution.trunkSid, - sid - ); + return new IpAccessControlListContext(this._version, this._solution.trunkSid, sid); }; return IpAccessControlListListInstance; @@ -423,11 +396,7 @@ IpAccessControlListPage.prototype.constructor = IpAccessControlListPage; */ /* jshint ignore:end */ IpAccessControlListPage.prototype.getInstance = function getInstance(payload) { - return new IpAccessControlListInstance( - this._version, - payload, - this._solution.trunkSid - ); + return new IpAccessControlListInstance(this._version, payload, this._solution.trunkSid); }; @@ -465,10 +434,7 @@ IpAccessControlListInstance = function IpAccessControlListInstance(version, // Context this._context = undefined; - this._solution = { - trunkSid: trunkSid, - sid: sid || this.sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid || this.sid,}; }; Object.defineProperty(IpAccessControlListInstance.prototype, @@ -536,10 +502,7 @@ IpAccessControlListContext = function IpAccessControlListContext(version, this._version = version; // Path Solution - this._solution = { - trunkSid: trunkSid, - sid: sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid,}; this._uri = _.template( '/Trunks/<%= trunkSid %>/IpAccessControlLists/<%= sid %>' // jshint ignore:line )(this._solution); @@ -560,10 +523,7 @@ IpAccessControlListContext = function IpAccessControlListContext(version, /* jshint ignore:end */ IpAccessControlListContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new IpAccessControlListInstance( @@ -600,10 +560,7 @@ IpAccessControlListContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ IpAccessControlListContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/trunking/v1/trunk/originationUrl.js b/lib/rest/trunking/v1/trunk/originationUrl.js index d0903a12dd..7eb183db01 100644 --- a/lib/rest/trunking/v1/trunk/originationUrl.js +++ b/lib/rest/trunking/v1/trunk/originationUrl.js @@ -49,9 +49,7 @@ OriginationUrlList = function OriginationUrlList(version, trunkSid) { OriginationUrlListInstance._version = version; // Path Solution - OriginationUrlListInstance._solution = { - trunkSid: trunkSid - }; + OriginationUrlListInstance._solution = {trunkSid: trunkSid}; OriginationUrlListInstance._uri = _.template( '/Trunks/<%= trunkSid %>/OriginationUrls' // jshint ignore:line )(OriginationUrlListInstance._solution); @@ -103,11 +101,7 @@ OriginationUrlList = function OriginationUrlList(version, trunkSid) { 'SipUrl': _.get(opts, 'sipUrl') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new OriginationUrlInstance( @@ -311,18 +305,10 @@ OriginationUrlList = function OriginationUrlList(version, trunkSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new OriginationUrlPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new OriginationUrlPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -356,17 +342,10 @@ OriginationUrlList = function OriginationUrlList(version, trunkSid) { OriginationUrlListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new OriginationUrlPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new OriginationUrlPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -394,11 +373,7 @@ OriginationUrlList = function OriginationUrlList(version, trunkSid) { */ /* jshint ignore:end */ OriginationUrlListInstance.get = function get(sid) { - return new OriginationUrlContext( - this._version, - this._solution.trunkSid, - sid - ); + return new OriginationUrlContext(this._version, this._solution.trunkSid, sid); }; return OriginationUrlListInstance; @@ -442,11 +417,7 @@ OriginationUrlPage.prototype.constructor = OriginationUrlPage; */ /* jshint ignore:end */ OriginationUrlPage.prototype.getInstance = function getInstance(payload) { - return new OriginationUrlInstance( - this._version, - payload, - this._solution.trunkSid - ); + return new OriginationUrlInstance(this._version, payload, this._solution.trunkSid); }; @@ -492,21 +463,14 @@ OriginationUrlInstance = function OriginationUrlInstance(version, payload, // Context this._context = undefined; - this._solution = { - trunkSid: trunkSid, - sid: sid || this.sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid || this.sid,}; }; Object.defineProperty(OriginationUrlInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new OriginationUrlContext( - this._version, - this._solution.trunkSid, - this._solution.sid - ); + this._context = new OriginationUrlContext(this._version, this._solution.trunkSid, this._solution.sid); } return this._context; @@ -585,10 +549,7 @@ OriginationUrlContext = function OriginationUrlContext(version, trunkSid, sid) { this._version = version; // Path Solution - this._solution = { - trunkSid: trunkSid, - sid: sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid,}; this._uri = _.template( '/Trunks/<%= trunkSid %>/OriginationUrls/<%= sid %>' // jshint ignore:line )(this._solution); @@ -609,10 +570,7 @@ OriginationUrlContext = function OriginationUrlContext(version, trunkSid, sid) { /* jshint ignore:end */ OriginationUrlContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new OriginationUrlInstance( @@ -649,10 +607,7 @@ OriginationUrlContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ OriginationUrlContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); @@ -704,11 +659,7 @@ OriginationUrlContext.prototype.update = function update(opts, callback) { 'SipUrl': _.get(opts, 'sipUrl') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new OriginationUrlInstance( diff --git a/lib/rest/trunking/v1/trunk/phoneNumber.js b/lib/rest/trunking/v1/trunk/phoneNumber.js index 7b683cdc3d..17ec9a0f99 100644 --- a/lib/rest/trunking/v1/trunk/phoneNumber.js +++ b/lib/rest/trunking/v1/trunk/phoneNumber.js @@ -48,9 +48,7 @@ PhoneNumberList = function PhoneNumberList(version, trunkSid) { PhoneNumberListInstance._version = version; // Path Solution - PhoneNumberListInstance._solution = { - trunkSid: trunkSid - }; + PhoneNumberListInstance._solution = {trunkSid: trunkSid}; PhoneNumberListInstance._uri = _.template( '/Trunks/<%= trunkSid %>/PhoneNumbers' // jshint ignore:line )(PhoneNumberListInstance._solution); @@ -78,15 +76,9 @@ PhoneNumberList = function PhoneNumberList(version, trunkSid) { } var deferred = Q.defer(); - var data = values.of({ - 'PhoneNumberSid': _.get(opts, 'phoneNumberSid') - }); + var data = values.of({'PhoneNumberSid': _.get(opts, 'phoneNumberSid')}); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( @@ -290,18 +282,10 @@ PhoneNumberList = function PhoneNumberList(version, trunkSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -335,17 +319,10 @@ PhoneNumberList = function PhoneNumberList(version, trunkSid) { PhoneNumberListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new PhoneNumberPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new PhoneNumberPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,11 +350,7 @@ PhoneNumberList = function PhoneNumberList(version, trunkSid) { */ /* jshint ignore:end */ PhoneNumberListInstance.get = function get(sid) { - return new PhoneNumberContext( - this._version, - this._solution.trunkSid, - sid - ); + return new PhoneNumberContext(this._version, this._solution.trunkSid, sid); }; return PhoneNumberListInstance; @@ -421,11 +394,7 @@ PhoneNumberPage.prototype.constructor = PhoneNumberPage; */ /* jshint ignore:end */ PhoneNumberPage.prototype.getInstance = function getInstance(payload) { - return new PhoneNumberInstance( - this._version, - payload, - this._solution.trunkSid - ); + return new PhoneNumberInstance(this._version, payload, this._solution.trunkSid); }; @@ -502,21 +471,14 @@ PhoneNumberInstance = function PhoneNumberInstance(version, payload, trunkSid, // Context this._context = undefined; - this._solution = { - trunkSid: trunkSid, - sid: sid || this.sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid || this.sid,}; }; Object.defineProperty(PhoneNumberInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new PhoneNumberContext( - this._version, - this._solution.trunkSid, - this._solution.sid - ); + this._context = new PhoneNumberContext(this._version, this._solution.trunkSid, this._solution.sid); } return this._context; @@ -572,10 +534,7 @@ PhoneNumberContext = function PhoneNumberContext(version, trunkSid, sid) { this._version = version; // Path Solution - this._solution = { - trunkSid: trunkSid, - sid: sid, - }; + this._solution = {trunkSid: trunkSid, sid: sid,}; this._uri = _.template( '/Trunks/<%= trunkSid %>/PhoneNumbers/<%= sid %>' // jshint ignore:line )(this._solution); @@ -596,10 +555,7 @@ PhoneNumberContext = function PhoneNumberContext(version, trunkSid, sid) { /* jshint ignore:end */ PhoneNumberContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new PhoneNumberInstance( @@ -636,10 +592,7 @@ PhoneNumberContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ PhoneNumberContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/video/v1/recording.js b/lib/rest/video/v1/recording.js index 659945a890..cc40eafe56 100644 --- a/lib/rest/video/v1/recording.js +++ b/lib/rest/video/v1/recording.js @@ -258,18 +258,10 @@ RecordingList = function RecordingList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -308,17 +300,10 @@ RecordingList = function RecordingList(version) { RecordingListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -346,10 +331,7 @@ RecordingList = function RecordingList(version) { */ /* jshint ignore:end */ RecordingListInstance.get = function get(sid) { - return new RecordingContext( - this._version, - sid - ); + return new RecordingContext(this._version, sid); }; return RecordingListInstance; @@ -393,10 +375,7 @@ RecordingPage.prototype.constructor = RecordingPage; */ /* jshint ignore:end */ RecordingPage.prototype.getInstance = function getInstance(payload) { - return new RecordingInstance( - this._version, - payload - ); + return new RecordingInstance(this._version, payload); }; @@ -444,19 +423,14 @@ RecordingInstance = function RecordingInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(RecordingInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RecordingContext( - this._version, - this._solution.sid - ); + this._context = new RecordingContext(this._version, this._solution.sid); } return this._context; @@ -511,9 +485,7 @@ RecordingContext = function RecordingContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Recordings/<%= sid %>' // jshint ignore:line )(this._solution); @@ -534,17 +506,10 @@ RecordingContext = function RecordingContext(version, sid) { /* jshint ignore:end */ RecordingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new RecordingInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RecordingInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -573,10 +538,7 @@ RecordingContext.prototype.fetch = function fetch(callback) { /* jshint ignore:end */ RecordingContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/video/v1/room.js b/lib/rest/video/v1/room.js index 3f4327e61d..fce7c57ed9 100644 --- a/lib/rest/video/v1/room.js +++ b/lib/rest/video/v1/room.js @@ -97,18 +97,10 @@ RoomList = function RoomList(version) { 'MediaRegion': _.get(opts, 'mediaRegion') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new RoomInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RoomInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -324,18 +316,10 @@ RoomList = function RoomList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RoomPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RoomPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -373,17 +357,10 @@ RoomList = function RoomList(version) { RoomListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RoomPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RoomPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -411,10 +388,7 @@ RoomList = function RoomList(version) { */ /* jshint ignore:end */ RoomListInstance.get = function get(sid) { - return new RoomContext( - this._version, - sid - ); + return new RoomContext(this._version, sid); }; return RoomListInstance; @@ -458,10 +432,7 @@ RoomPage.prototype.constructor = RoomPage; */ /* jshint ignore:end */ RoomPage.prototype.getInstance = function getInstance(payload) { - return new RoomInstance( - this._version, - payload - ); + return new RoomInstance(this._version, payload); }; @@ -518,19 +489,14 @@ RoomInstance = function RoomInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(RoomInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RoomContext( - this._version, - this._solution.sid - ); + this._context = new RoomContext(this._version, this._solution.sid); } return this._context; @@ -605,9 +571,7 @@ RoomContext = function RoomContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Rooms/<%= sid %>' // jshint ignore:line )(this._solution); @@ -631,17 +595,10 @@ RoomContext = function RoomContext(version, sid) { /* jshint ignore:end */ RoomContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new RoomInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RoomInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -679,22 +636,12 @@ RoomContext.prototype.update = function update(opts, callback) { } var deferred = Q.defer(); - var data = values.of({ - 'Status': _.get(opts, 'status') - }); + var data = values.of({'Status': _.get(opts, 'status')}); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new RoomInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RoomInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -712,10 +659,7 @@ Object.defineProperty(RoomContext.prototype, 'recordings', { get: function() { if (!this._recordings) { - this._recordings = new RoomRecordingList( - this._version, - this._solution.sid - ); + this._recordings = new RoomRecordingList(this._version, this._solution.sid); } return this._recordings; } diff --git a/lib/rest/video/v1/room/recording.js b/lib/rest/video/v1/room/recording.js index 857ca38ddd..cb9ff57880 100644 --- a/lib/rest/video/v1/room/recording.js +++ b/lib/rest/video/v1/room/recording.js @@ -49,9 +49,7 @@ RoomRecordingList = function RoomRecordingList(version, roomSid) { RoomRecordingListInstance._version = version; // Path Solution - RoomRecordingListInstance._solution = { - roomSid: roomSid - }; + RoomRecordingListInstance._solution = {roomSid: roomSid}; RoomRecordingListInstance._uri = _.template( '/Rooms/<%= roomSid %>/Recordings' // jshint ignore:line )(RoomRecordingListInstance._solution); @@ -257,18 +255,10 @@ RoomRecordingList = function RoomRecordingList(version, roomSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RoomRecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RoomRecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -306,17 +296,10 @@ RoomRecordingList = function RoomRecordingList(version, roomSid) { RoomRecordingListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RoomRecordingPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RoomRecordingPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -344,11 +327,7 @@ RoomRecordingList = function RoomRecordingList(version, roomSid) { */ /* jshint ignore:end */ RoomRecordingListInstance.get = function get(sid) { - return new RoomRecordingContext( - this._version, - this._solution.roomSid, - sid - ); + return new RoomRecordingContext(this._version, this._solution.roomSid, sid); }; return RoomRecordingListInstance; @@ -392,11 +371,7 @@ RoomRecordingPage.prototype.constructor = RoomRecordingPage; */ /* jshint ignore:end */ RoomRecordingPage.prototype.getInstance = function getInstance(payload) { - return new RoomRecordingInstance( - this._version, - payload, - this._solution.roomSid - ); + return new RoomRecordingInstance(this._version, payload, this._solution.roomSid); }; @@ -448,21 +423,14 @@ RoomRecordingInstance = function RoomRecordingInstance(version, payload, // Context this._context = undefined; - this._solution = { - roomSid: roomSid, - sid: sid || this.sid, - }; + this._solution = {roomSid: roomSid, sid: sid || this.sid,}; }; Object.defineProperty(RoomRecordingInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RoomRecordingContext( - this._version, - this._solution.roomSid, - this._solution.sid - ); + this._context = new RoomRecordingContext(this._version, this._solution.roomSid, this._solution.sid); } return this._context; @@ -501,10 +469,7 @@ RoomRecordingContext = function RoomRecordingContext(version, roomSid, sid) { this._version = version; // Path Solution - this._solution = { - roomSid: roomSid, - sid: sid, - }; + this._solution = {roomSid: roomSid, sid: sid,}; this._uri = _.template( '/Rooms/<%= roomSid %>/Recordings/<%= sid %>' // jshint ignore:line )(this._solution); @@ -525,10 +490,7 @@ RoomRecordingContext = function RoomRecordingContext(version, roomSid, sid) { /* jshint ignore:end */ RoomRecordingContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { deferred.resolve(new RoomRecordingInstance( diff --git a/lib/rest/wireless/v1/command.js b/lib/rest/wireless/v1/command.js index 5e7e74eb37..c401ef5602 100644 --- a/lib/rest/wireless/v1/command.js +++ b/lib/rest/wireless/v1/command.js @@ -250,18 +250,10 @@ CommandList = function CommandList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new CommandPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CommandPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -298,17 +290,10 @@ CommandList = function CommandList(version) { CommandListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new CommandPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new CommandPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -360,18 +345,10 @@ CommandList = function CommandList(version) { 'IncludeSid': _.get(opts, 'includeSid') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new CommandInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CommandInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -399,10 +376,7 @@ CommandList = function CommandList(version) { */ /* jshint ignore:end */ CommandListInstance.get = function get(sid) { - return new CommandContext( - this._version, - sid - ); + return new CommandContext(this._version, sid); }; return CommandListInstance; @@ -447,10 +421,7 @@ CommandPage.prototype.constructor = CommandPage; */ /* jshint ignore:end */ CommandPage.prototype.getInstance = function getInstance(payload) { - return new CommandInstance( - this._version, - payload - ); + return new CommandInstance(this._version, payload); }; @@ -493,19 +464,14 @@ CommandInstance = function CommandInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(CommandInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new CommandContext( - this._version, - this._solution.sid - ); + this._context = new CommandContext(this._version, this._solution.sid); } return this._context; @@ -544,9 +510,7 @@ CommandContext = function CommandContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Commands/<%= sid %>' // jshint ignore:line )(this._solution); @@ -567,17 +531,10 @@ CommandContext = function CommandContext(version, sid) { /* jshint ignore:end */ CommandContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new CommandInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new CommandInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { diff --git a/lib/rest/wireless/v1/ratePlan.js b/lib/rest/wireless/v1/ratePlan.js index f795976d72..009580f464 100644 --- a/lib/rest/wireless/v1/ratePlan.js +++ b/lib/rest/wireless/v1/ratePlan.js @@ -235,18 +235,10 @@ RatePlanList = function RatePlanList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RatePlanPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -280,17 +272,10 @@ RatePlanList = function RatePlanList(version) { RatePlanListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new RatePlanPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -353,18 +338,10 @@ RatePlanList = function RatePlanList(version) { 'InternationalRoamingDataLimit': _.get(opts, 'internationalRoamingDataLimit') }); - var promise = this._version.create({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.create({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RatePlanInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -392,10 +369,7 @@ RatePlanList = function RatePlanList(version) { */ /* jshint ignore:end */ RatePlanListInstance.get = function get(sid) { - return new RatePlanContext( - this._version, - sid - ); + return new RatePlanContext(this._version, sid); }; return RatePlanListInstance; @@ -440,10 +414,7 @@ RatePlanPage.prototype.constructor = RatePlanPage; */ /* jshint ignore:end */ RatePlanPage.prototype.getInstance = function getInstance(payload) { - return new RatePlanInstance( - this._version, - payload - ); + return new RatePlanInstance(this._version, payload); }; @@ -499,19 +470,14 @@ RatePlanInstance = function RatePlanInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(RatePlanInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new RatePlanContext( - this._version, - this._solution.sid - ); + this._context = new RatePlanContext(this._version, this._solution.sid); } return this._context; @@ -587,9 +553,7 @@ RatePlanContext = function RatePlanContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/RatePlans/<%= sid %>' // jshint ignore:line )(this._solution); @@ -610,17 +574,10 @@ RatePlanContext = function RatePlanContext(version, sid) { /* jshint ignore:end */ RatePlanContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RatePlanInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -663,18 +620,10 @@ RatePlanContext.prototype.update = function update(opts, callback) { 'FriendlyName': _.get(opts, 'friendlyName') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new RatePlanInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new RatePlanInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -703,10 +652,7 @@ RatePlanContext.prototype.update = function update(opts, callback) { /* jshint ignore:end */ RatePlanContext.prototype.remove = function remove(callback) { var deferred = Q.defer(); - var promise = this._version.remove({ - uri: this._uri, - method: 'DELETE' - }); + var promise = this._version.remove({uri: this._uri, method: 'DELETE'}); promise = promise.then(function(payload) { deferred.resolve(payload); diff --git a/lib/rest/wireless/v1/sim.js b/lib/rest/wireless/v1/sim.js index 65dfb84fa4..835ee70dd2 100644 --- a/lib/rest/wireless/v1/sim.js +++ b/lib/rest/wireless/v1/sim.js @@ -260,18 +260,10 @@ SimList = function SimList(version) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new SimPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SimPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -310,17 +302,10 @@ SimList = function SimList(version) { SimListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new SimPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new SimPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -348,10 +333,7 @@ SimList = function SimList(version) { */ /* jshint ignore:end */ SimListInstance.get = function get(sid) { - return new SimContext( - this._version, - sid - ); + return new SimContext(this._version, sid); }; return SimListInstance; @@ -396,10 +378,7 @@ SimPage.prototype.constructor = SimPage; */ /* jshint ignore:end */ SimPage.prototype.getInstance = function getInstance(payload) { - return new SimInstance( - this._version, - payload - ); + return new SimInstance(this._version, payload); }; @@ -468,19 +447,14 @@ SimInstance = function SimInstance(version, payload, sid) { // Context this._context = undefined; - this._solution = { - sid: sid || this.sid, - }; + this._solution = {sid: sid || this.sid,}; }; Object.defineProperty(SimInstance.prototype, '_proxy', { get: function() { if (!this._context) { - this._context = new SimContext( - this._version, - this._solution.sid - ); + this._context = new SimContext(this._version, this._solution.sid); } return this._context; @@ -588,9 +562,7 @@ SimContext = function SimContext(version, sid) { this._version = version; // Path Solution - this._solution = { - sid: sid, - }; + this._solution = {sid: sid,}; this._uri = _.template( '/Sims/<%= sid %>' // jshint ignore:line )(this._solution); @@ -615,17 +587,10 @@ SimContext = function SimContext(version, sid) { /* jshint ignore:end */ SimContext.prototype.fetch = function fetch(callback) { var deferred = Q.defer(); - var promise = this._version.fetch({ - uri: this._uri, - method: 'GET' - }); + var promise = this._version.fetch({uri: this._uri, method: 'GET'}); promise = promise.then(function(payload) { - deferred.resolve(new SimInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new SimInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -696,18 +661,10 @@ SimContext.prototype.update = function update(opts, callback) { 'VoiceUrl': _.get(opts, 'voiceUrl') }); - var promise = this._version.update({ - uri: this._uri, - method: 'POST', - data: data - }); + var promise = this._version.update({uri: this._uri, method: 'POST', data: data}); promise = promise.then(function(payload) { - deferred.resolve(new SimInstance( - this._version, - payload, - this._solution.sid - )); + deferred.resolve(new SimInstance(this._version, payload, this._solution.sid)); }.bind(this)); promise.catch(function(error) { @@ -725,10 +682,7 @@ Object.defineProperty(SimContext.prototype, 'usageRecords', { get: function() { if (!this._usageRecords) { - this._usageRecords = new UsageRecordList( - this._version, - this._solution.sid - ); + this._usageRecords = new UsageRecordList(this._version, this._solution.sid); } return this._usageRecords; } @@ -738,10 +692,7 @@ Object.defineProperty(SimContext.prototype, 'dataSessions', { get: function() { if (!this._dataSessions) { - this._dataSessions = new DataSessionList( - this._version, - this._solution.sid - ); + this._dataSessions = new DataSessionList(this._version, this._solution.sid); } return this._dataSessions; } diff --git a/lib/rest/wireless/v1/sim/dataSession.js b/lib/rest/wireless/v1/sim/dataSession.js index 50239ae323..15f9542af4 100644 --- a/lib/rest/wireless/v1/sim/dataSession.js +++ b/lib/rest/wireless/v1/sim/dataSession.js @@ -49,9 +49,7 @@ DataSessionList = function DataSessionList(version, simSid) { DataSessionListInstance._version = version; // Path Solution - DataSessionListInstance._solution = { - simSid: simSid - }; + DataSessionListInstance._solution = {simSid: simSid}; DataSessionListInstance._uri = _.template( '/Sims/<%= simSid %>/DataSessions' // jshint ignore:line )(DataSessionListInstance._solution); @@ -249,18 +247,10 @@ DataSessionList = function DataSessionList(version, simSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new DataSessionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DataSessionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -296,17 +286,10 @@ DataSessionList = function DataSessionList(version, simSid) { DataSessionListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new DataSessionPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new DataSessionPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -362,11 +345,7 @@ DataSessionPage.prototype.constructor = DataSessionPage; */ /* jshint ignore:end */ DataSessionPage.prototype.getInstance = function getInstance(payload) { - return new DataSessionInstance( - this._version, - payload, - this._solution.simSid - ); + return new DataSessionInstance(this._version, payload, this._solution.simSid); }; @@ -418,9 +397,7 @@ DataSessionInstance = function DataSessionInstance(version, payload, simSid) { // Context this._context = undefined; - this._solution = { - simSid: simSid, - }; + this._solution = {simSid: simSid,}; }; module.exports = { diff --git a/lib/rest/wireless/v1/sim/usageRecord.js b/lib/rest/wireless/v1/sim/usageRecord.js index 87079ba88a..9ccbdaaaba 100644 --- a/lib/rest/wireless/v1/sim/usageRecord.js +++ b/lib/rest/wireless/v1/sim/usageRecord.js @@ -47,9 +47,7 @@ UsageRecordList = function UsageRecordList(version, simSid) { UsageRecordListInstance._version = version; // Path Solution - UsageRecordListInstance._solution = { - simSid: simSid - }; + UsageRecordListInstance._solution = {simSid: simSid}; UsageRecordListInstance._uri = _.template( '/Sims/<%= simSid %>/UsageRecords' // jshint ignore:line )(UsageRecordListInstance._solution); @@ -251,18 +249,10 @@ UsageRecordList = function UsageRecordList(version, simSid) { 'PageSize': opts.pageSize }); - var promise = this._version.page({ - uri: this._uri, - method: 'GET', - params: data - }); + var promise = this._version.page({uri: this._uri, method: 'GET', params: data}); promise = promise.then(function(payload) { - deferred.resolve(new UsageRecordPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UsageRecordPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -299,17 +289,10 @@ UsageRecordList = function UsageRecordList(version, simSid) { UsageRecordListInstance.getPage = function getPage(targetUrl, callback) { var deferred = Q.defer(); - var promise = this._version._domain.twilio.request({ - method: 'GET', - uri: targetUrl - }); + var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl}); promise = promise.then(function(payload) { - deferred.resolve(new UsageRecordPage( - this._version, - payload, - this._solution - )); + deferred.resolve(new UsageRecordPage(this._version, payload, this._solution)); }.bind(this)); promise.catch(function(error) { @@ -365,11 +348,7 @@ UsageRecordPage.prototype.constructor = UsageRecordPage; */ /* jshint ignore:end */ UsageRecordPage.prototype.getInstance = function getInstance(payload) { - return new UsageRecordInstance( - this._version, - payload, - this._solution.simSid - ); + return new UsageRecordInstance(this._version, payload, this._solution.simSid); }; @@ -401,9 +380,7 @@ UsageRecordInstance = function UsageRecordInstance(version, payload, simSid) { // Context this._context = undefined; - this._solution = { - simSid: simSid, - }; + this._solution = {simSid: simSid,}; }; module.exports = { diff --git a/lib/twiml/MessagingResponse.js b/lib/twiml/MessagingResponse.js index c5c2cbda84..d88ceb3a63 100644 --- a/lib/twiml/MessagingResponse.js +++ b/lib/twiml/MessagingResponse.js @@ -26,8 +26,8 @@ function MessagingResponse() { * TwiML Verb * * @param {object} attributes - ... - * @param {phone_number} [attributes.to] Phone Number to send Message to - * @param {phone_number} [attributes.from] Phone Number to send Message from + * @param {string} [attributes.to] Phone Number to send Message to + * @param {string} [attributes.from] Phone Number to send Message from * @param {url} [attributes.action] Action URL * @param {http_method} [attributes.method] Action URL Method * @param {string} [body] Message Body diff --git a/lib/twiml/VoiceResponse.js b/lib/twiml/VoiceResponse.js index 1e5778a837..8fb6c96909 100644 --- a/lib/twiml/VoiceResponse.js +++ b/lib/twiml/VoiceResponse.js @@ -32,12 +32,12 @@ function VoiceResponse() { * @param {boolean} [attributes.hangupOnStar] Hangup call on star press * @param {integer} [attributes.timeLimit] Max time length * @param {string} [attributes.callerId] Caller ID to display - * @param {enum:trim} [attributes.record] Record the call - * @param {enum:trim} [attributes.trim] Trim the recording + * @param {record.trim} [attributes.record] Record the call + * @param {record.trim} [attributes.trim] Trim the recording * @param {url} [attributes.recordingStatusCallback] Recording status callback URL * @param {http_method} [attributes.recordingStatusCallbackMethod] Recording status callback URL method * @param {boolean} [attributes.answerOnBridge] Preserve the ringing behavior of the inbound call until the Dialed call picks up - * @param {enum:ring_tone} [attributes.ringTone] Ringtone allows you to override the ringback tone that Twilio will play back to the caller while executing the Dial + * @param {dial.ring_tone} [attributes.ringTone] Ringtone allows you to override the ringback tone that Twilio will play back to the caller while executing the Dial * @param {string} [number] Phone number to dial * * @returns Dial @@ -82,7 +82,7 @@ VoiceResponse.prototype.enqueue = function enqueue(attributes, name) { * TwiML Verb * * @param {object} attributes - ... - * @param {enum:input} [attributes.input] Input type Twilio should accept + * @param {gather.input} [attributes.input] Input type Twilio should accept * @param {url} [attributes.action] Action URL * @param {http_method} [attributes.method] Action URL method * @param {integer} [attributes.timeout] Time to wait to gather input @@ -93,7 +93,7 @@ VoiceResponse.prototype.enqueue = function enqueue(attributes, name) { * @param {integer} [attributes.numDigits] Number of digits to collect * @param {url} [attributes.partialResultCallback] Partial result callback URL * @param {http_method} [attributes.partialResultCallbackMethod] Partial result callback URL method - * @param {enum:language} [attributes.language] Language to use + * @param {say.language} [attributes.language] Language to use * @param {string} [attributes.hints] Speech recognition hints * @param {boolean} [attributes.bargeIn] Stop playing media upon speech * @@ -179,7 +179,7 @@ VoiceResponse.prototype.queue = function queue(attributes, name) { * @param {string} [attributes.finishOnKey] Finish recording on key * @param {integer} [attributes.maxLength] Max time to record in seconds * @param {boolean} [attributes.playBeep] Play beep - * @param {enum:trim} [attributes.trim] Trim the recording + * @param {conference.trim} [attributes.trim] Trim the recording * @param {url} [attributes.recordingStatusCallback] Status callback URL * @param {http_method} [attributes.recordingStatusCallbackMethod] Status callback URL method * @param {boolean} [attributes.transcribe] Transcribe the recording @@ -208,7 +208,7 @@ VoiceResponse.prototype.redirect = function redirect(attributes, url) { * TwiML Verb * * @param {object} attributes - ... - * @param {enum:reason} [attributes.reason] Rejection reason + * @param {reject.reason} [attributes.reason] Rejection reason */ /* jshint ignore:end */ VoiceResponse.prototype.reject = function reject(attributes) { @@ -220,9 +220,9 @@ VoiceResponse.prototype.reject = function reject(attributes) { * TwiML Verb * * @param {object} attributes - ... - * @param {enum:voice} [attributes.voice] Voice to use + * @param {say.voice} [attributes.voice] Voice to use * @param {integer} [attributes.loop] Times to loop message - * @param {enum:language} [attributes.language] Message langauge + * @param {say.language} [attributes.language] Message langauge * @param {string} message Message to say */ /* jshint ignore:end */ @@ -275,9 +275,9 @@ function Gather(gather) { * TwiML Verb * * @param {object} attributes - ... - * @param {enum:voice} [attributes.voice] Voice to use + * @param {say.voice} [attributes.voice] Voice to use * @param {integer} [attributes.loop] Times to loop message - * @param {enum:language} [attributes.language] Message langauge + * @param {say.language} [attributes.language] Message langauge * @param {string} message Message to say */ /* jshint ignore:end */ @@ -354,7 +354,7 @@ function Dial(dial) { * @param {object} attributes - ... * @param {url} [attributes.url] Client URL * @param {http_method} [attributes.method] Client URL Method - * @param {enum:event} [attributes.statusCallbackEvent] Events to trigger status callback + * @param {sip.event} [attributes.statusCallbackEvent] Events to trigger status callback * @param {url} [attributes.statusCallback] Status Callback URL * @param {http_method} [attributes.statusCallbackMethod] Status Callback URL Method * @param {string} name Client name @@ -370,17 +370,17 @@ Dial.prototype.client = function client(attributes, name) { * * @param {object} attributes - ... * @param {boolean} [attributes.muted] Join the conference muted - * @param {enum:beep} [attributes.beep] Play beep when joining + * @param {conference.beep} [attributes.beep] Play beep when joining * @param {boolean} [attributes.startConferenceOnEnter] Start the conference on enter * @param {boolean} [attributes.endConferenceOnExit] End the conferenceon exit * @param {url} [attributes.waitUrl] Wait URL * @param {http_method} [attributes.waitMethod] Wait URL method * @param {integer} [attributes.maxParticipants] Maximum number of participants - * @param {enum:record} [attributes.record] Record the conference - * @param {enum:region} [attributes.region] Conference region + * @param {conference.record} [attributes.record] Record the conference + * @param {conference.region} [attributes.region] Conference region * @param {sid} [attributes.whisper] Call whisper - * @param {enum:trim} [attributes.trim] Trim the conference recording - * @param {enum:event} [attributes.statusCallbackEvent] Events to call status callback URL + * @param {conference.trim} [attributes.trim] Trim the conference recording + * @param {sip.event} [attributes.statusCallbackEvent] Events to call status callback URL * @param {url} [attributes.statusCallback] Status callback URL * @param {http_method} [attributes.statusCallbackMethod] Status callback URL method * @param {url} [attributes.recordingStatusCallback] Recording status callback URL @@ -401,7 +401,7 @@ Dial.prototype.conference = function conference(attributes, name) { * @param {string} [attributes.sendDigits] DTMF tones to play when the call is answered * @param {url} [attributes.url] TwiML URL * @param {http_method} [attributes.method] TwiML URL method - * @param {enum:event} [attributes.statusCallbackEvent] Events to call status callback + * @param {sip.event} [attributes.statusCallbackEvent] Events to call status callback * @param {url} [attributes.statusCallback] Status callback URL * @param {http_method} [attributes.statusCallbackMethod] Status callback URL method * @param {phone_number} phoneNumber Phone Number to dial @@ -448,7 +448,7 @@ Dial.prototype.sim = function sim(attributes, simSid) { * @param {string} [attributes.password] SIP Password * @param {url} [attributes.url] Action URL * @param {http_method} [attributes.method] Action URL method - * @param {enum:event} [attributes.statusCallbackEvent] Status callback events + * @param {sip.event} [attributes.statusCallbackEvent] Status callback events * @param {url} [attributes.statusCallback] Status callback URL * @param {http_method} [attributes.statusCallbackMethod] Status callback URL method * @param {url} sipUrl SIP URL diff --git a/spec/integration/rest/accounts/v1/credential/publicKey.spec.js b/spec/integration/rest/accounts/v1/credential/publicKey.spec.js index 59817d4ca8..d1ef8a463c 100644 --- a/spec/integration/rest/accounts/v1/credential/publicKey.spec.js +++ b/spec/integration/rest/accounts/v1/credential/publicKey.spec.js @@ -120,9 +120,7 @@ describe('PublicKey', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - publicKey: 'publickey' - }; + var opts = {publicKey: 'publickey'}; var promise = client.accounts.v1.credentials .publicKey.create(opts); promise = promise.then(function() { @@ -134,9 +132,7 @@ describe('PublicKey', function() { var url = 'https://accounts.twilio.com/v1/Credentials/PublicKeys'; - var values = { - PublicKey: 'publickey', - }; + var values = {PublicKey: 'publickey',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -157,9 +153,7 @@ describe('PublicKey', function() { holodeck.mock(new Response(201, body)); - var opts = { - publicKey: 'publickey' - }; + var opts = {publicKey: 'publickey'}; var promise = client.accounts.v1.credentials .publicKey.create(opts); promise = promise.then(function(response) { @@ -184,9 +178,7 @@ describe('PublicKey', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://accounts.twilio.com/v1/Credentials/PublicKeys/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -232,9 +224,7 @@ describe('PublicKey', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://accounts.twilio.com/v1/Credentials/PublicKeys/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -280,9 +270,7 @@ describe('PublicKey', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://accounts.twilio.com/v1/Credentials/PublicKeys/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account.spec.js b/spec/integration/rest/api/v2010/account.spec.js index adddb0a0da..d5c43c9c6c 100644 --- a/spec/integration/rest/api/v2010/account.spec.js +++ b/spec/integration/rest/api/v2010/account.spec.js @@ -99,9 +99,7 @@ describe('Account', function() { }); promise.done(); - var solution = { - sid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= sid %>.json')(solution); holodeck.assertHasRequest(new Request({ @@ -268,9 +266,7 @@ describe('Account', function() { }); promise.done(); - var solution = { - sid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= sid %>.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/address.spec.js b/spec/integration/rest/api/v2010/account/address.spec.js index 09d99ffa51..50ba7aa93c 100644 --- a/spec/integration/rest/api/v2010/account/address.spec.js +++ b/spec/integration/rest/api/v2010/account/address.spec.js @@ -51,9 +51,7 @@ describe('Address', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Addresses.json')(solution); var values = { @@ -280,9 +278,7 @@ describe('Address', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Addresses.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/application.spec.js b/spec/integration/rest/api/v2010/account/application.spec.js index e0831aa4a6..f2ac945956 100644 --- a/spec/integration/rest/api/v2010/account/application.spec.js +++ b/spec/integration/rest/api/v2010/account/application.spec.js @@ -34,9 +34,7 @@ describe('Application', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .applications.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('Application', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Applications.json')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -88,9 +82,7 @@ describe('Application', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .applications.create(opts); promise = promise.then(function(response) { @@ -220,9 +212,7 @@ describe('Application', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Applications.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js b/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js index 53ec9fb6cc..c794afea35 100644 --- a/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js +++ b/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js @@ -98,9 +98,7 @@ describe('AuthorizedConnectApp', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/AuthorizedConnectApps.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js index 204b6ce66a..e272c6a7b9 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js @@ -43,9 +43,7 @@ describe('AvailablePhoneNumberCountry', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/AvailablePhoneNumbers.json')(solution); holodeck.assertHasRequest(new Request({ @@ -137,10 +135,7 @@ describe('AvailablePhoneNumberCountry', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - countryCode: 'US' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', countryCode: 'US'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js index 4b6a84d285..bb56c2b1e5 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js @@ -44,10 +44,7 @@ describe('Local', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - countryCode: 'US' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', countryCode: 'US'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Local.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js index 450f0b3bf7..14f3a1d40e 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js @@ -44,10 +44,7 @@ describe('Mobile', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - countryCode: 'US' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', countryCode: 'US'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Mobile.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js index 6d668fde61..58917d44a9 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js @@ -44,10 +44,7 @@ describe('TollFree', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - countryCode: 'US' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', countryCode: 'US'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/TollFree.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/call.spec.js b/spec/integration/rest/api/v2010/account/call.spec.js index b7c02d653a..de45540553 100644 --- a/spec/integration/rest/api/v2010/account/call.spec.js +++ b/spec/integration/rest/api/v2010/account/call.spec.js @@ -34,10 +34,7 @@ describe('Call', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - to: '+123456789', - from: '+987654321' - }; + var opts = {to: '+123456789', from: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls.create(opts); promise = promise.then(function() { @@ -47,15 +44,10 @@ describe('Call', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Calls.json')(solution); - var values = { - To: '+123456789', - From: '+987654321', - }; + var values = {To: '+123456789', From: '+987654321',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -89,7 +81,9 @@ describe('Call', function() { 'status': 'completed', 'subresource_uris': { 'notifications': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json', - 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' + 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json', + 'feedback': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json', + 'feedback_summaries': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json' }, 'to': '+14158675309', 'to_formatted': '(415) 867-5309', @@ -98,10 +92,7 @@ describe('Call', function() { holodeck.mock(new Response(201, body)); - var opts = { - to: '+123456789', - from: '+987654321' - }; + var opts = {to: '+123456789', from: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls.create(opts); promise = promise.then(function(response) { @@ -239,9 +230,7 @@ describe('Call', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Calls.json')(solution); holodeck.assertHasRequest(new Request({ @@ -287,14 +276,11 @@ describe('Call', function() { ], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0', - 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=9690', 'next_page_uri': null, - 'num_pages': 9691, 'page': 0, 'page_size': 1, 'previous_page_uri': null, 'start': 0, - 'total': 9691, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0' }); @@ -317,14 +303,11 @@ describe('Call', function() { 'calls': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0', - 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=9690', 'next_page_uri': null, - 'num_pages': 9691, 'page': 0, 'page_size': 1, 'previous_page_uri': null, 'start': 0, - 'total': 9691, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0' }); diff --git a/spec/integration/rest/api/v2010/account/call/feedback.spec.js b/spec/integration/rest/api/v2010/account/call/feedback.spec.js index cc7b89262c..a9dfe4ee19 100644 --- a/spec/integration/rest/api/v2010/account/call/feedback.spec.js +++ b/spec/integration/rest/api/v2010/account/call/feedback.spec.js @@ -34,9 +34,7 @@ describe('Feedback', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - qualityScore: 1 - }; + var opts = {qualityScore: 1}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls('CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .feedback().create(opts); @@ -53,9 +51,7 @@ describe('Feedback', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Feedback.json')(solution); - var values = { - QualityScore: 1, - }; + var values = {QualityScore: 1,}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -79,9 +75,7 @@ describe('Feedback', function() { holodeck.mock(new Response(201, body)); - var opts = { - qualityScore: 1 - }; + var opts = {qualityScore: 1}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls('CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .feedback().create(opts); @@ -152,9 +146,7 @@ describe('Feedback', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - qualityScore: 1 - }; + var opts = {qualityScore: 1}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls('CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .feedback().update(opts); @@ -171,9 +163,7 @@ describe('Feedback', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Feedback.json')(solution); - var values = { - QualityScore: 1, - }; + var values = {QualityScore: 1,}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -197,9 +187,7 @@ describe('Feedback', function() { holodeck.mock(new Response(200, body)); - var opts = { - qualityScore: 1 - }; + var opts = {qualityScore: 1}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls('CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .feedback().update(opts); diff --git a/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js b/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js index ddd503be70..e8f6c18a94 100644 --- a/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js +++ b/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js @@ -36,10 +36,7 @@ describe('FeedbackSummary', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - startDate: new Date(Date.UTC(2008, 0, 2)), - endDate: new Date(Date.UTC(2008, 0, 2)) - }; + var opts = {startDate: new Date(Date.UTC(2008, 0, 2)), endDate: new Date(Date.UTC(2008, 0, 2))}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls .feedbackSummaries.create(opts); @@ -50,9 +47,7 @@ describe('FeedbackSummary', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Calls/FeedbackSummary.json')(solution); var values = { @@ -93,10 +88,7 @@ describe('FeedbackSummary', function() { holodeck.mock(new Response(201, body)); - var opts = { - startDate: new Date(Date.UTC(2008, 0, 2)), - endDate: new Date(Date.UTC(2008, 0, 2)) - }; + var opts = {startDate: new Date(Date.UTC(2008, 0, 2)), endDate: new Date(Date.UTC(2008, 0, 2))}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .calls .feedbackSummaries.create(opts); diff --git a/spec/integration/rest/api/v2010/account/conference.spec.js b/spec/integration/rest/api/v2010/account/conference.spec.js index cc44dc344a..51cd181568 100644 --- a/spec/integration/rest/api/v2010/account/conference.spec.js +++ b/spec/integration/rest/api/v2010/account/conference.spec.js @@ -98,9 +98,7 @@ describe('Conference', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Conferences.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/conference/participant.spec.js b/spec/integration/rest/api/v2010/account/conference/participant.spec.js index 3a6dc1e90b..1da07d0817 100644 --- a/spec/integration/rest/api/v2010/account/conference/participant.spec.js +++ b/spec/integration/rest/api/v2010/account/conference/participant.spec.js @@ -148,10 +148,7 @@ describe('Participant', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - from: '+987654321', - to: '+123456789' - }; + var opts = {from: '+987654321', to: '+123456789'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .conferences('CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); @@ -168,10 +165,7 @@ describe('Participant', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Conferences/<%= conferenceSid %>/Participants.json')(solution); - var values = { - From: '+987654321', - To: '+123456789', - }; + var values = {From: '+987654321', To: '+123456789',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -197,10 +191,7 @@ describe('Participant', function() { holodeck.mock(new Response(201, body)); - var opts = { - from: '+987654321', - to: '+123456789' - }; + var opts = {from: '+987654321', to: '+123456789'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .conferences('CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); @@ -231,10 +222,7 @@ describe('Participant', function() { holodeck.mock(new Response(201, body)); - var opts = { - from: '+987654321', - to: '+123456789' - }; + var opts = {from: '+987654321', to: '+123456789'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .conferences('CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); diff --git a/spec/integration/rest/api/v2010/account/connectApp.spec.js b/spec/integration/rest/api/v2010/account/connectApp.spec.js index 7f726a5da3..3d4880acd9 100644 --- a/spec/integration/rest/api/v2010/account/connectApp.spec.js +++ b/spec/integration/rest/api/v2010/account/connectApp.spec.js @@ -151,9 +151,7 @@ describe('ConnectApp', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/ConnectApps.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js index fd9aec3ff7..7912c7ed5b 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js @@ -239,9 +239,7 @@ describe('IncomingPhoneNumber', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers.json')(solution); holodeck.assertHasRequest(new Request({ @@ -360,9 +358,7 @@ describe('IncomingPhoneNumber', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js index 28212d0c89..695b6523da 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js @@ -195,9 +195,7 @@ describe('AssignedAddOn', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - installedAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {installedAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers('PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .assignedAddOns.create(opts); @@ -214,9 +212,7 @@ describe('AssignedAddOn', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/<%= resourceSid %>/AssignedAddOns.json')(solution); - var values = { - InstalledAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {InstalledAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -246,9 +242,7 @@ describe('AssignedAddOn', function() { holodeck.mock(new Response(201, body)); - var opts = { - installedAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {installedAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers('PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .assignedAddOns.create(opts); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js index 2745033789..5876fbb74c 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js @@ -44,9 +44,7 @@ describe('Local', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/Local.json')(solution); holodeck.assertHasRequest(new Request({ @@ -156,9 +154,7 @@ describe('Local', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers .local.create(opts); @@ -169,14 +165,10 @@ describe('Local', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/Local.json')(solution); - var values = { - PhoneNumber: '+987654321', - }; + var values = {PhoneNumber: '+987654321',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -223,9 +215,7 @@ describe('Local', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers .local.create(opts); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js index 772bfac4ff..685d7cd0bf 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js @@ -44,9 +44,7 @@ describe('Mobile', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/Mobile.json')(solution); holodeck.assertHasRequest(new Request({ @@ -156,9 +154,7 @@ describe('Mobile', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers .mobile.create(opts); @@ -169,14 +165,10 @@ describe('Mobile', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/Mobile.json')(solution); - var values = { - PhoneNumber: '+987654321', - }; + var values = {PhoneNumber: '+987654321',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -223,9 +215,7 @@ describe('Mobile', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers .mobile.create(opts); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js index c24f76a4b2..40ebec9e65 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js @@ -44,9 +44,7 @@ describe('TollFree', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/TollFree.json')(solution); holodeck.assertHasRequest(new Request({ @@ -156,9 +154,7 @@ describe('TollFree', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers .tollFree.create(opts); @@ -169,14 +165,10 @@ describe('TollFree', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/IncomingPhoneNumbers/TollFree.json')(solution); - var values = { - PhoneNumber: '+987654321', - }; + var values = {PhoneNumber: '+987654321',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -223,9 +215,7 @@ describe('TollFree', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .incomingPhoneNumbers .tollFree.create(opts); diff --git a/spec/integration/rest/api/v2010/account/key.spec.js b/spec/integration/rest/api/v2010/account/key.spec.js index 1f5c7706ea..d66f0f7e54 100644 --- a/spec/integration/rest/api/v2010/account/key.spec.js +++ b/spec/integration/rest/api/v2010/account/key.spec.js @@ -179,9 +179,7 @@ describe('Key', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Keys.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/message.spec.js b/spec/integration/rest/api/v2010/account/message.spec.js index 11649267ad..261eeb434f 100644 --- a/spec/integration/rest/api/v2010/account/message.spec.js +++ b/spec/integration/rest/api/v2010/account/message.spec.js @@ -34,9 +34,7 @@ describe('Message', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - to: '+123456789' - }; + var opts = {to: '+123456789'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('Message', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Messages.json')(solution); - var values = { - To: '+123456789', - }; + var values = {To: '+123456789',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -90,9 +84,7 @@ describe('Message', function() { holodeck.mock(new Response(201, body)); - var opts = { - to: '+123456789' - }; + var opts = {to: '+123456789'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); promise = promise.then(function(response) { @@ -224,9 +216,7 @@ describe('Message', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Messages.json')(solution); holodeck.assertHasRequest(new Request({ @@ -324,9 +314,7 @@ describe('Message', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages('MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -342,9 +330,7 @@ describe('Message', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Messages/<%= sid %>.json')(solution); - var values = { - Body: 'body', - }; + var values = {Body: 'body',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -381,9 +367,7 @@ describe('Message', function() { holodeck.mock(new Response(200, body)); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages('MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/api/v2010/account/newKey.spec.js b/spec/integration/rest/api/v2010/account/newKey.spec.js index 249db1e065..2fbf1cf684 100644 --- a/spec/integration/rest/api/v2010/account/newKey.spec.js +++ b/spec/integration/rest/api/v2010/account/newKey.spec.js @@ -43,9 +43,7 @@ describe('NewKey', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Keys.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/newSigningKey.spec.js b/spec/integration/rest/api/v2010/account/newSigningKey.spec.js index e56db52a5d..47d41ac287 100644 --- a/spec/integration/rest/api/v2010/account/newSigningKey.spec.js +++ b/spec/integration/rest/api/v2010/account/newSigningKey.spec.js @@ -43,9 +43,7 @@ describe('NewSigningKey', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SigningKeys.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/notification.spec.js b/spec/integration/rest/api/v2010/account/notification.spec.js index 9ba3491c03..ad2bb74268 100644 --- a/spec/integration/rest/api/v2010/account/notification.spec.js +++ b/spec/integration/rest/api/v2010/account/notification.spec.js @@ -145,9 +145,7 @@ describe('Notification', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Notifications.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js b/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js index 8726bc66a4..264424a182 100644 --- a/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js +++ b/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js @@ -185,9 +185,7 @@ describe('OutgoingCallerId', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/OutgoingCallerIds.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/queue.spec.js b/spec/integration/rest/api/v2010/account/queue.spec.js index d4a2661bfd..b8aaed61cd 100644 --- a/spec/integration/rest/api/v2010/account/queue.spec.js +++ b/spec/integration/rest/api/v2010/account/queue.spec.js @@ -189,9 +189,7 @@ describe('Queue', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Queues.json')(solution); holodeck.assertHasRequest(new Request({ @@ -276,9 +274,7 @@ describe('Queue', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .queues.create(opts); promise = promise.then(function() { @@ -288,14 +284,10 @@ describe('Queue', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Queues.json')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -319,9 +311,7 @@ describe('Queue', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .queues.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/api/v2010/account/queue/member.spec.js b/spec/integration/rest/api/v2010/account/queue/member.spec.js index 6f572597d4..ce31b7898b 100644 --- a/spec/integration/rest/api/v2010/account/queue/member.spec.js +++ b/spec/integration/rest/api/v2010/account/queue/member.spec.js @@ -85,10 +85,7 @@ describe('Member', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - url: 'https://example.com', - method: 'GET' - }; + var opts = {url: 'https://example.com', method: 'GET'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .queues('QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members('CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); @@ -106,10 +103,7 @@ describe('Member', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Queues/<%= queueSid %>/Members/<%= callSid %>.json')(solution); - var values = { - Url: 'https://example.com', - Method: 'GET', - }; + var values = {Url: 'https://example.com', Method: 'GET',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -129,10 +123,7 @@ describe('Member', function() { holodeck.mock(new Response(200, body)); - var opts = { - url: 'https://example.com', - method: 'GET' - }; + var opts = {url: 'https://example.com', method: 'GET'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .queues('QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members('CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); diff --git a/spec/integration/rest/api/v2010/account/recording.spec.js b/spec/integration/rest/api/v2010/account/recording.spec.js index 2122b77499..e1732600b2 100644 --- a/spec/integration/rest/api/v2010/account/recording.spec.js +++ b/spec/integration/rest/api/v2010/account/recording.spec.js @@ -147,9 +147,7 @@ describe('Recording', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Recordings.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/shortCode.spec.js b/spec/integration/rest/api/v2010/account/shortCode.spec.js index 84380b8e8e..a573399608 100644 --- a/spec/integration/rest/api/v2010/account/shortCode.spec.js +++ b/spec/integration/rest/api/v2010/account/shortCode.spec.js @@ -153,9 +153,7 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SMS/ShortCodes.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/signingKey.spec.js b/spec/integration/rest/api/v2010/account/signingKey.spec.js index ce52c0f83d..bb71772e42 100644 --- a/spec/integration/rest/api/v2010/account/signingKey.spec.js +++ b/spec/integration/rest/api/v2010/account/signingKey.spec.js @@ -179,9 +179,7 @@ describe('SigningKey', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SigningKeys.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js b/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js index b4663bba95..b9b4df0299 100644 --- a/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js @@ -44,9 +44,7 @@ describe('CredentialList', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/CredentialLists.json')(solution); holodeck.assertHasRequest(new Request({ @@ -123,9 +121,7 @@ describe('CredentialList', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .credentialLists.create(opts); @@ -136,14 +132,10 @@ describe('CredentialList', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/CredentialLists.json')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -167,9 +159,7 @@ describe('CredentialList', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .credentialLists.create(opts); @@ -240,9 +230,7 @@ describe('CredentialList', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .credentialLists('CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); @@ -259,9 +247,7 @@ describe('CredentialList', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/CredentialLists/<%= sid %>.json')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -285,9 +271,7 @@ describe('CredentialList', function() { holodeck.mock(new Response(200, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .credentialLists('CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); diff --git a/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js b/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js index 333bdf9c59..2dff162e4d 100644 --- a/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js @@ -135,10 +135,7 @@ describe('Credential', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - username: 'username', - password: 'password' - }; + var opts = {username: 'username', password: 'password'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .credentialLists('CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') @@ -156,10 +153,7 @@ describe('Credential', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/CredentialLists/<%= credentialListSid %>/Credentials.json')(solution); - var values = { - Username: 'username', - Password: 'password', - }; + var values = {Username: 'username', Password: 'password',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -181,10 +175,7 @@ describe('Credential', function() { holodeck.mock(new Response(201, body)); - var opts = { - username: 'username', - password: 'password' - }; + var opts = {username: 'username', password: 'password'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .credentialLists('CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') diff --git a/spec/integration/rest/api/v2010/account/sip/domain.spec.js b/spec/integration/rest/api/v2010/account/sip/domain.spec.js index 9c58d2517e..d1d2543fe1 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain.spec.js @@ -44,9 +44,7 @@ describe('Domain', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/Domains.json')(solution); holodeck.assertHasRequest(new Request({ @@ -134,9 +132,7 @@ describe('Domain', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - domainName: 'domainName' - }; + var opts = {domainName: 'domainName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .domains.create(opts); @@ -147,14 +143,10 @@ describe('Domain', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/Domains.json')(solution); - var values = { - DomainName: 'domainName', - }; + var values = {DomainName: 'domainName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -189,9 +181,7 @@ describe('Domain', function() { holodeck.mock(new Response(201, body)); - var opts = { - domainName: 'domainName' - }; + var opts = {domainName: 'domainName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .domains.create(opts); diff --git a/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js index b87c84ea0d..3364faf1ca 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js @@ -34,9 +34,7 @@ describe('CredentialListMapping', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .domains('SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') @@ -54,9 +52,7 @@ describe('CredentialListMapping', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/Domains/<%= domainSid %>/CredentialListMappings.json')(solution); - var values = { - CredentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {CredentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -80,9 +76,7 @@ describe('CredentialListMapping', function() { holodeck.mock(new Response(201, body)); - var opts = { - credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .domains('SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') diff --git a/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js index a0ab3aad66..3e98e66108 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js @@ -91,9 +91,7 @@ describe('IpAccessControlListMapping', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .domains('SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') @@ -111,9 +109,7 @@ describe('IpAccessControlListMapping', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/Domains/<%= domainSid %>/IpAccessControlListMappings.json')(solution); - var values = { - IpAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {IpAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -137,9 +133,7 @@ describe('IpAccessControlListMapping', function() { holodeck.mock(new Response(201, body)); - var opts = { - ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .domains('SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') diff --git a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js index 5584184764..a09d2ca67a 100644 --- a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js @@ -44,9 +44,7 @@ describe('IpAccessControlList', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/IpAccessControlLists.json')(solution); holodeck.assertHasRequest(new Request({ @@ -133,9 +131,7 @@ describe('IpAccessControlList', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .ipAccessControlLists.create(opts); @@ -146,14 +142,10 @@ describe('IpAccessControlList', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/IpAccessControlLists.json')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -177,9 +169,7 @@ describe('IpAccessControlList', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .ipAccessControlLists.create(opts); @@ -250,9 +240,7 @@ describe('IpAccessControlList', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .ipAccessControlLists('ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); @@ -269,9 +257,7 @@ describe('IpAccessControlList', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/IpAccessControlLists/<%= sid %>.json')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -295,9 +281,7 @@ describe('IpAccessControlList', function() { holodeck.mock(new Response(200, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .ipAccessControlLists('ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); diff --git a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js index 85387c6dac..e58f107cc5 100644 --- a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js @@ -136,10 +136,7 @@ describe('IpAddress', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName', - ipAddress: 'ipAddress' - }; + var opts = {friendlyName: 'friendlyName', ipAddress: 'ipAddress'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .ipAccessControlLists('ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') @@ -157,10 +154,7 @@ describe('IpAddress', function() { }; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/SIP/IpAccessControlLists/<%= ipAccessControlListSid %>/IpAddresses.json')(solution); - var values = { - FriendlyName: 'friendlyName', - IpAddress: 'ipAddress', - }; + var values = {FriendlyName: 'friendlyName', IpAddress: 'ipAddress',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -183,10 +177,7 @@ describe('IpAddress', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName', - ipAddress: 'ipAddress' - }; + var opts = {friendlyName: 'friendlyName', ipAddress: 'ipAddress'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sip .ipAccessControlLists('ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') diff --git a/spec/integration/rest/api/v2010/account/token.spec.js b/spec/integration/rest/api/v2010/account/token.spec.js index c56abaef92..5c3acb49e2 100644 --- a/spec/integration/rest/api/v2010/account/token.spec.js +++ b/spec/integration/rest/api/v2010/account/token.spec.js @@ -43,9 +43,7 @@ describe('Token', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Tokens.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/transcription.spec.js b/spec/integration/rest/api/v2010/account/transcription.spec.js index ccbb724eed..b3a7332b78 100644 --- a/spec/integration/rest/api/v2010/account/transcription.spec.js +++ b/spec/integration/rest/api/v2010/account/transcription.spec.js @@ -141,9 +141,7 @@ describe('Transcription', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Transcriptions.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record.spec.js b/spec/integration/rest/api/v2010/account/usage/record.spec.js index ab968f6632..89536a1079 100644 --- a/spec/integration/rest/api/v2010/account/usage/record.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record.spec.js @@ -44,9 +44,7 @@ describe('Record', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js b/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js index 7d36813428..c125d7c207 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js @@ -45,9 +45,7 @@ describe('AllTime', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/AllTime.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js b/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js index 54fd44e100..0e17e0d8e8 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js @@ -45,9 +45,7 @@ describe('Daily', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/Daily.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js b/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js index f57f8ada08..a4bb4ab4b2 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js @@ -45,9 +45,7 @@ describe('LastMonth', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/LastMonth.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js b/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js index cf20b37878..db6472a58b 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js @@ -45,9 +45,7 @@ describe('Monthly', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/Monthly.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js b/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js index 65fa612137..9038856a28 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js @@ -45,9 +45,7 @@ describe('ThisMonth', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/ThisMonth.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/today.spec.js b/spec/integration/rest/api/v2010/account/usage/record/today.spec.js index e4a6e5d7ab..9e7d56d89d 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/today.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/today.spec.js @@ -45,9 +45,7 @@ describe('Today', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/Today.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js b/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js index 17f4936634..d6a38f716f 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js @@ -45,9 +45,7 @@ describe('Yearly', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/Yearly.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js b/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js index d6d6f79251..d38b30ed5b 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js @@ -45,9 +45,7 @@ describe('Yesterday', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Records/Yesterday.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/usage/trigger.spec.js b/spec/integration/rest/api/v2010/account/usage/trigger.spec.js index 8f16967235..1945ab6618 100644 --- a/spec/integration/rest/api/v2010/account/usage/trigger.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/trigger.spec.js @@ -215,9 +215,7 @@ describe('Trigger', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Triggers.json')(solution); var values = { @@ -286,9 +284,7 @@ describe('Trigger', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/Usage/Triggers.json')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/api/v2010/account/validationRequest.spec.js b/spec/integration/rest/api/v2010/account/validationRequest.spec.js index c2b59eaccd..fcf90c1de3 100644 --- a/spec/integration/rest/api/v2010/account/validationRequest.spec.js +++ b/spec/integration/rest/api/v2010/account/validationRequest.spec.js @@ -34,9 +34,7 @@ describe('ValidationRequest', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .validationRequests.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('ValidationRequest', function() { }); promise.done(); - var solution = { - accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {accountSid: 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://api.twilio.com/2010-04-01/Accounts/<%= accountSid %>/OutgoingCallerIds.json')(solution); - var values = { - PhoneNumber: '+987654321', - }; + var values = {PhoneNumber: '+987654321',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -73,9 +67,7 @@ describe('ValidationRequest', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumber: '+987654321' - }; + var opts = {phoneNumber: '+987654321'}; var promise = client.api.v2010.accounts('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .validationRequests.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/chat/v1/credential.spec.js b/spec/integration/rest/chat/v1/credential.spec.js index 1914e4a1e0..7c31d66175 100644 --- a/spec/integration/rest/chat/v1/credential.spec.js +++ b/spec/integration/rest/chat/v1/credential.spec.js @@ -119,9 +119,7 @@ describe('Credential', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.chat.v1.credentials.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -132,9 +130,7 @@ describe('Credential', function() { var url = 'https://chat.twilio.com/v1/Credentials'; - var values = { - Type: 'gcm', - }; + var values = {Type: 'gcm',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -157,9 +153,7 @@ describe('Credential', function() { holodeck.mock(new Response(201, body)); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.chat.v1.credentials.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -182,9 +176,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -230,9 +222,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -278,9 +268,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/chat/v1/service.spec.js b/spec/integration/rest/chat/v1/service.spec.js index 266962f0c6..a85c141637 100644 --- a/spec/integration/rest/chat/v1/service.spec.js +++ b/spec/integration/rest/chat/v1/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -109,9 +107,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -140,9 +136,7 @@ describe('Service', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.chat.v1.services.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -153,9 +147,7 @@ describe('Service', function() { var url = 'https://chat.twilio.com/v1/Services'; - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -197,9 +189,7 @@ describe('Service', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.chat.v1.services.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -326,9 +316,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/chat/v1/service/channel.spec.js b/spec/integration/rest/chat/v1/service/channel.spec.js index 5d6fa5eb5f..525d0d5513 100644 --- a/spec/integration/rest/chat/v1/service/channel.spec.js +++ b/spec/integration/rest/chat/v1/service/channel.spec.js @@ -147,9 +147,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ @@ -208,9 +206,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/chat/v1/service/channel/invite.spec.js b/spec/integration/rest/chat/v1/service/channel/invite.spec.js index fb51e5d1f0..8ed5dea670 100644 --- a/spec/integration/rest/chat/v1/service/channel/invite.spec.js +++ b/spec/integration/rest/chat/v1/service/channel/invite.spec.js @@ -90,9 +90,7 @@ describe('Invite', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); @@ -109,9 +107,7 @@ describe('Invite', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -136,9 +132,7 @@ describe('Invite', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); diff --git a/spec/integration/rest/chat/v1/service/channel/member.spec.js b/spec/integration/rest/chat/v1/service/channel/member.spec.js index 6b34e46dce..577bdce00c 100644 --- a/spec/integration/rest/chat/v1/service/channel/member.spec.js +++ b/spec/integration/rest/chat/v1/service/channel/member.spec.js @@ -91,9 +91,7 @@ describe('Member', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); @@ -110,9 +108,7 @@ describe('Member', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -138,9 +134,7 @@ describe('Member', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); diff --git a/spec/integration/rest/chat/v1/service/channel/message.spec.js b/spec/integration/rest/chat/v1/service/channel/message.spec.js index bd06f1daec..5d9d5fb07f 100644 --- a/spec/integration/rest/chat/v1/service/channel/message.spec.js +++ b/spec/integration/rest/chat/v1/service/channel/message.spec.js @@ -93,9 +93,7 @@ describe('Message', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); @@ -112,9 +110,7 @@ describe('Message', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages')(solution); - var values = { - Body: 'body', - }; + var values = {Body: 'body',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -142,9 +138,7 @@ describe('Message', function() { holodeck.mock(new Response(201, body)); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); @@ -177,9 +171,7 @@ describe('Message', function() { holodeck.mock(new Response(201, body)); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); diff --git a/spec/integration/rest/chat/v1/service/role.spec.js b/spec/integration/rest/chat/v1/service/role.spec.js index 26476f7abb..4560322ae2 100644 --- a/spec/integration/rest/chat/v1/service/role.spec.js +++ b/spec/integration/rest/chat/v1/service/role.spec.js @@ -133,11 +133,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function() { @@ -147,16 +143,10 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Roles')(solution); - var values = { - FriendlyName: 'friendlyName', - Type: 'channel', - Permission: ['permission'], - }; + var values = {FriendlyName: 'friendlyName', Type: 'channel', Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,11 +175,7 @@ describe('Role', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function(response) { @@ -214,9 +200,7 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Roles')(solution); holodeck.assertHasRequest(new Request({ @@ -302,9 +286,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -320,9 +302,7 @@ describe('Role', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Roles/<%= sid %>')(solution); - var values = { - Permission: ['permission'], - }; + var values = {Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -351,9 +331,7 @@ describe('Role', function() { holodeck.mock(new Response(200, body)); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/chat/v1/service/user.spec.js b/spec/integration/rest/chat/v1/service/user.spec.js index 016fbb6889..fc3a7eadc1 100644 --- a/spec/integration/rest/chat/v1/service/user.spec.js +++ b/spec/integration/rest/chat/v1/service/user.spec.js @@ -135,9 +135,7 @@ describe('User', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function() { @@ -147,14 +145,10 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Users')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,9 +179,7 @@ describe('User', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function(response) { @@ -212,9 +204,7 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Users')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/chat/v2/credential.spec.js b/spec/integration/rest/chat/v2/credential.spec.js index 31b4cf40e6..05b00af108 100644 --- a/spec/integration/rest/chat/v2/credential.spec.js +++ b/spec/integration/rest/chat/v2/credential.spec.js @@ -119,9 +119,7 @@ describe('Credential', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.chat.v2.credentials.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -132,9 +130,7 @@ describe('Credential', function() { var url = 'https://chat.twilio.com/v2/Credentials'; - var values = { - Type: 'gcm', - }; + var values = {Type: 'gcm',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -157,9 +153,7 @@ describe('Credential', function() { holodeck.mock(new Response(201, body)); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.chat.v2.credentials.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -182,9 +176,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -230,9 +222,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -278,9 +268,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/chat/v2/service.spec.js b/spec/integration/rest/chat/v2/service.spec.js index dcb0f4251f..8603221bc9 100644 --- a/spec/integration/rest/chat/v2/service.spec.js +++ b/spec/integration/rest/chat/v2/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -71,7 +69,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': {}, 'post_webhook_url': 'post_webhook_url', @@ -117,9 +116,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -148,9 +145,7 @@ describe('Service', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.chat.v2.services.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -161,9 +156,7 @@ describe('Service', function() { var url = 'https://chat.twilio.com/v2/Services'; - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -189,7 +182,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': {}, 'post_webhook_url': 'post_webhook_url', @@ -213,9 +207,7 @@ describe('Service', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.chat.v2.services.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -302,7 +294,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': {}, 'post_webhook_url': 'post_webhook_url', @@ -350,9 +343,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -379,7 +370,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': { 'added_to_channel': { diff --git a/spec/integration/rest/chat/v2/service/binding.spec.js b/spec/integration/rest/chat/v2/service/binding.spec.js new file mode 100644 index 0000000000..68cf7f6106 --- /dev/null +++ b/spec/integration/rest/chat/v2/service/binding.spec.js @@ -0,0 +1,238 @@ +'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('Binding', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Bindings')(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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [ + { + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'user': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser' + } + } + ] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings.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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings.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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Bindings/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'user': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser' + } + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Bindings/<%= 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function(response) { + expect(response).toBe(true); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); + diff --git a/spec/integration/rest/chat/v2/service/channel.spec.js b/spec/integration/rest/chat/v2/service/channel.spec.js index c74bd4b54e..722a9f1645 100644 --- a/spec/integration/rest/chat/v2/service/channel.spec.js +++ b/spec/integration/rest/chat/v2/service/channel.spec.js @@ -147,9 +147,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ @@ -208,9 +206,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/chat/v2/service/channel/invite.spec.js b/spec/integration/rest/chat/v2/service/channel/invite.spec.js index 102bde0108..b82da99d2d 100644 --- a/spec/integration/rest/chat/v2/service/channel/invite.spec.js +++ b/spec/integration/rest/chat/v2/service/channel/invite.spec.js @@ -90,9 +90,7 @@ describe('Invite', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); @@ -109,9 +107,7 @@ describe('Invite', function() { }; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -136,9 +132,7 @@ describe('Invite', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); diff --git a/spec/integration/rest/chat/v2/service/channel/member.spec.js b/spec/integration/rest/chat/v2/service/channel/member.spec.js index 9498d5f0e9..b377102a06 100644 --- a/spec/integration/rest/chat/v2/service/channel/member.spec.js +++ b/spec/integration/rest/chat/v2/service/channel/member.spec.js @@ -91,9 +91,7 @@ describe('Member', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); @@ -110,9 +108,7 @@ describe('Member', function() { }; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -138,9 +134,7 @@ describe('Member', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); diff --git a/spec/integration/rest/chat/v2/service/role.spec.js b/spec/integration/rest/chat/v2/service/role.spec.js index a12682f70b..48bc2ef365 100644 --- a/spec/integration/rest/chat/v2/service/role.spec.js +++ b/spec/integration/rest/chat/v2/service/role.spec.js @@ -133,11 +133,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function() { @@ -147,16 +143,10 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Roles')(solution); - var values = { - FriendlyName: 'friendlyName', - Type: 'channel', - Permission: ['permission'], - }; + var values = {FriendlyName: 'friendlyName', Type: 'channel', Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,11 +175,7 @@ describe('Role', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function(response) { @@ -214,9 +200,7 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Roles')(solution); holodeck.assertHasRequest(new Request({ @@ -302,9 +286,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -320,9 +302,7 @@ describe('Role', function() { }; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Roles/<%= sid %>')(solution); - var values = { - Permission: ['permission'], - }; + var values = {Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -351,9 +331,7 @@ describe('Role', function() { holodeck.mock(new Response(200, body)); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/chat/v2/service/user.spec.js b/spec/integration/rest/chat/v2/service/user.spec.js index da0eb65189..f776864cbc 100644 --- a/spec/integration/rest/chat/v2/service/user.spec.js +++ b/spec/integration/rest/chat/v2/service/user.spec.js @@ -71,7 +71,8 @@ describe('User', function() { 'date_created': '2016-03-24T21:05:19Z', 'date_updated': '2016-03-24T21:05:19Z', 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }); @@ -135,9 +136,7 @@ describe('User', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function() { @@ -147,14 +146,10 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -178,16 +173,15 @@ describe('User', function() { 'date_created': '2016-03-24T21:05:19Z', 'date_updated': '2016-03-24T21:05:19Z', 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }); holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function(response) { @@ -212,9 +206,7 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users')(solution); holodeck.assertHasRequest(new Request({ @@ -250,7 +242,8 @@ describe('User', function() { 'date_updated': '2016-03-24T21:05:19Z', 'joined_channels_count': 0, 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } @@ -339,7 +332,8 @@ describe('User', function() { 'date_created': '2016-03-24T21:05:19Z', 'date_updated': '2016-03-24T21:05:19Z', 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }); diff --git a/spec/integration/rest/chat/v2/service/user/userBinding.spec.js b/spec/integration/rest/chat/v2/service/user/userBinding.spec.js new file mode 100644 index 0000000000..d318752ad2 --- /dev/null +++ b/spec/integration/rest/chat/v2/service/user/userBinding.spec.js @@ -0,0 +1,246 @@ +'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('UserBinding', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + userSid: 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings')(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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [ + { + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + ] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings.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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings.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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + userSid: 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.chat.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + userSid: 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings/<%= 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function(response) { + expect(response).toBe(true); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); + diff --git a/spec/integration/rest/fax/v1/fax.spec.js b/spec/integration/rest/fax/v1/fax.spec.js index 9b1db96274..92e2ff6a5d 100644 --- a/spec/integration/rest/fax/v1/fax.spec.js +++ b/spec/integration/rest/fax/v1/fax.spec.js @@ -42,9 +42,7 @@ describe('Fax', function() { }); promise.done(); - var solution = { - sid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://fax.twilio.com/v1/Faxes/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -191,10 +189,7 @@ describe('Fax', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - to: 'to', - mediaUrl: 'https://example.com' - }; + var opts = {to: 'to', mediaUrl: 'https://example.com'}; var promise = client.fax.v1.faxes.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -205,10 +200,7 @@ describe('Fax', function() { var url = 'https://fax.twilio.com/v1/Faxes'; - var values = { - To: 'to', - MediaUrl: 'https://example.com', - }; + var values = {To: 'to', MediaUrl: 'https://example.com',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -243,10 +235,7 @@ describe('Fax', function() { holodeck.mock(new Response(201, body)); - var opts = { - to: 'to', - mediaUrl: 'https://example.com' - }; + var opts = {to: 'to', mediaUrl: 'https://example.com'}; var promise = client.fax.v1.faxes.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -269,9 +258,7 @@ describe('Fax', function() { }); promise.done(); - var solution = { - sid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://fax.twilio.com/v1/Faxes/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -329,9 +316,7 @@ describe('Fax', function() { }); promise.done(); - var solution = { - sid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://fax.twilio.com/v1/Faxes/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/fax/v1/fax/faxMedia.spec.js b/spec/integration/rest/fax/v1/fax/faxMedia.spec.js index a98c0b0278..f6196862d4 100644 --- a/spec/integration/rest/fax/v1/fax/faxMedia.spec.js +++ b/spec/integration/rest/fax/v1/fax/faxMedia.spec.js @@ -93,9 +93,7 @@ describe('FaxMedia', function() { }); promise.done(); - var solution = { - faxSid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {faxSid: 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://fax.twilio.com/v1/Faxes/<%= faxSid %>/Media')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v1/credential.spec.js b/spec/integration/rest/ipMessaging/v1/credential.spec.js index d6ee9e87a5..26a36f4a5a 100644 --- a/spec/integration/rest/ipMessaging/v1/credential.spec.js +++ b/spec/integration/rest/ipMessaging/v1/credential.spec.js @@ -119,9 +119,7 @@ describe('Credential', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.ipMessaging.v1.credentials.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -132,9 +130,7 @@ describe('Credential', function() { var url = 'https://chat.twilio.com/v1/Credentials'; - var values = { - Type: 'gcm', - }; + var values = {Type: 'gcm',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -157,9 +153,7 @@ describe('Credential', function() { holodeck.mock(new Response(201, body)); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.ipMessaging.v1.credentials.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -182,9 +176,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -230,9 +222,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -278,9 +268,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v1/service.spec.js b/spec/integration/rest/ipMessaging/v1/service.spec.js index 56ac4ff93b..495228e1f1 100644 --- a/spec/integration/rest/ipMessaging/v1/service.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -109,9 +107,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -140,9 +136,7 @@ describe('Service', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.ipMessaging.v1.services.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -153,9 +147,7 @@ describe('Service', function() { var url = 'https://chat.twilio.com/v1/Services'; - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -197,9 +189,7 @@ describe('Service', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.ipMessaging.v1.services.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -326,9 +316,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v1/service/channel.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel.spec.js index b420ad0b0f..a21d59cd1a 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel.spec.js @@ -147,9 +147,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ @@ -208,9 +206,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js index e05c55a5bd..3c0ec58d8d 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js @@ -90,9 +90,7 @@ describe('Invite', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); @@ -109,9 +107,7 @@ describe('Invite', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -136,9 +132,7 @@ describe('Invite', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); diff --git a/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js index 486e5dfdd3..a81dfacc48 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js @@ -91,9 +91,7 @@ describe('Member', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); @@ -110,9 +108,7 @@ describe('Member', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -138,9 +134,7 @@ describe('Member', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); diff --git a/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js index b8af93a411..f841d56c70 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js @@ -93,9 +93,7 @@ describe('Message', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); @@ -112,9 +110,7 @@ describe('Message', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Messages')(solution); - var values = { - Body: 'body', - }; + var values = {Body: 'body',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -142,9 +138,7 @@ describe('Message', function() { holodeck.mock(new Response(201, body)); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); @@ -177,9 +171,7 @@ describe('Message', function() { holodeck.mock(new Response(201, body)); - var opts = { - body: 'body' - }; + var opts = {body: 'body'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .messages.create(opts); diff --git a/spec/integration/rest/ipMessaging/v1/service/role.spec.js b/spec/integration/rest/ipMessaging/v1/service/role.spec.js index 4ce86d9b30..24171cdbaa 100644 --- a/spec/integration/rest/ipMessaging/v1/service/role.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/role.spec.js @@ -133,11 +133,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function() { @@ -147,16 +143,10 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Roles')(solution); - var values = { - FriendlyName: 'friendlyName', - Type: 'channel', - Permission: ['permission'], - }; + var values = {FriendlyName: 'friendlyName', Type: 'channel', Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,11 +175,7 @@ describe('Role', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function(response) { @@ -214,9 +200,7 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Roles')(solution); holodeck.assertHasRequest(new Request({ @@ -302,9 +286,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -320,9 +302,7 @@ describe('Role', function() { }; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Roles/<%= sid %>')(solution); - var values = { - Permission: ['permission'], - }; + var values = {Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -351,9 +331,7 @@ describe('Role', function() { holodeck.mock(new Response(200, body)); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/ipMessaging/v1/service/user.spec.js b/spec/integration/rest/ipMessaging/v1/service/user.spec.js index 095c4c2cf8..6a68fcd7be 100644 --- a/spec/integration/rest/ipMessaging/v1/service/user.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/user.spec.js @@ -135,9 +135,7 @@ describe('User', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function() { @@ -147,14 +145,10 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Users')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,9 +179,7 @@ describe('User', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function(response) { @@ -212,9 +204,7 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v1/Services/<%= serviceSid %>/Users')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v2/credential.spec.js b/spec/integration/rest/ipMessaging/v2/credential.spec.js index aac0224cf9..f29ce12245 100644 --- a/spec/integration/rest/ipMessaging/v2/credential.spec.js +++ b/spec/integration/rest/ipMessaging/v2/credential.spec.js @@ -119,9 +119,7 @@ describe('Credential', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.ipMessaging.v2.credentials.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -132,9 +130,7 @@ describe('Credential', function() { var url = 'https://chat.twilio.com/v2/Credentials'; - var values = { - Type: 'gcm', - }; + var values = {Type: 'gcm',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -157,9 +153,7 @@ describe('Credential', function() { holodeck.mock(new Response(201, body)); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.ipMessaging.v2.credentials.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -182,9 +176,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -230,9 +222,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -278,9 +268,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v2/service.spec.js b/spec/integration/rest/ipMessaging/v2/service.spec.js index d4731edb7c..6da673785c 100644 --- a/spec/integration/rest/ipMessaging/v2/service.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -71,7 +69,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': {}, 'post_webhook_url': 'post_webhook_url', @@ -117,9 +116,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -148,9 +145,7 @@ describe('Service', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.ipMessaging.v2.services.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -161,9 +156,7 @@ describe('Service', function() { var url = 'https://chat.twilio.com/v2/Services'; - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -189,7 +182,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': {}, 'post_webhook_url': 'post_webhook_url', @@ -213,9 +207,7 @@ describe('Service', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.ipMessaging.v2.services.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -302,7 +294,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': {}, 'post_webhook_url': 'post_webhook_url', @@ -350,9 +343,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -379,7 +370,8 @@ describe('Service', function() { 'links': { 'channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'users': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', - 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' + 'roles': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', + 'bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'notifications': { 'added_to_channel': { diff --git a/spec/integration/rest/ipMessaging/v2/service/binding.spec.js b/spec/integration/rest/ipMessaging/v2/service/binding.spec.js new file mode 100644 index 0000000000..d73c508500 --- /dev/null +++ b/spec/integration/rest/ipMessaging/v2/service/binding.spec.js @@ -0,0 +1,238 @@ +'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('Binding', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Bindings')(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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [ + { + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'user': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser' + } + } + ] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings.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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings.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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Bindings/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'links': { + 'user': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser' + } + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Bindings/<%= 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .bindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').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 9cd8e09c94..156535ea54 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel.spec.js @@ -147,9 +147,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ @@ -208,9 +206,7 @@ describe('Channel', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js index ea81fe272e..7daaeb153d 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js @@ -90,9 +90,7 @@ describe('Invite', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); @@ -109,9 +107,7 @@ describe('Invite', function() { }; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Invites')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -136,9 +132,7 @@ describe('Invite', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .invites.create(opts); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js index a1be8b9cec..abf39f983c 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js @@ -91,9 +91,7 @@ describe('Member', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); @@ -110,9 +108,7 @@ describe('Member', function() { }; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Channels/<%= channelSid %>/Members')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -138,9 +134,7 @@ describe('Member', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .channels('CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .members.create(opts); diff --git a/spec/integration/rest/ipMessaging/v2/service/role.spec.js b/spec/integration/rest/ipMessaging/v2/service/role.spec.js index 14ab2d61a6..b03084d582 100644 --- a/spec/integration/rest/ipMessaging/v2/service/role.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/role.spec.js @@ -133,11 +133,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function() { @@ -147,16 +143,10 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Roles')(solution); - var values = { - FriendlyName: 'friendlyName', - Type: 'channel', - Permission: ['permission'], - }; + var values = {FriendlyName: 'friendlyName', Type: 'channel', Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,11 +175,7 @@ describe('Role', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName', - type: 'channel', - permission: ['permission'] - }; + var opts = {friendlyName: 'friendlyName', type: 'channel', permission: ['permission']}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles.create(opts); promise = promise.then(function(response) { @@ -214,9 +200,7 @@ describe('Role', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Roles')(solution); holodeck.assertHasRequest(new Request({ @@ -302,9 +286,7 @@ describe('Role', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -320,9 +302,7 @@ describe('Role', function() { }; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Roles/<%= sid %>')(solution); - var values = { - Permission: ['permission'], - }; + var values = {Permission: ['permission'],}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -351,9 +331,7 @@ describe('Role', function() { holodeck.mock(new Response(200, body)); - var opts = { - permission: ['permission'] - }; + var opts = {permission: ['permission']}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .roles('RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/ipMessaging/v2/service/user.spec.js b/spec/integration/rest/ipMessaging/v2/service/user.spec.js index bd5f213f84..9d5cf5dbe8 100644 --- a/spec/integration/rest/ipMessaging/v2/service/user.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/user.spec.js @@ -71,7 +71,8 @@ describe('User', function() { 'date_created': '2016-03-24T21:05:19Z', 'date_updated': '2016-03-24T21:05:19Z', 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }); @@ -135,9 +136,7 @@ describe('User', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function() { @@ -147,14 +146,10 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -178,16 +173,15 @@ describe('User', function() { 'date_created': '2016-03-24T21:05:19Z', 'date_updated': '2016-03-24T21:05:19Z', 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }); holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function(response) { @@ -212,9 +206,7 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users')(solution); holodeck.assertHasRequest(new Request({ @@ -250,7 +242,8 @@ describe('User', function() { 'date_updated': '2016-03-24T21:05:19Z', 'joined_channels_count': 0, 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } @@ -339,7 +332,8 @@ describe('User', function() { 'date_created': '2016-03-24T21:05:19Z', 'date_updated': '2016-03-24T21:05:19Z', 'links': { - 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' + 'user_channels': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', + 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }); diff --git a/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js b/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js new file mode 100644 index 0000000000..956be55148 --- /dev/null +++ b/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js @@ -0,0 +1,246 @@ +'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('UserBinding', function() { + beforeEach(function() { + holodeck = new Holodeck(); + client = new Twilio('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', { + httpClient: holodeck + }); + }); + it('should generate valid list request', + function() { + holodeck.mock(new Response(500, '{}')); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings.list(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + userSid: 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings')(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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [ + { + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + } + ] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings.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': 50, + 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'previous_page_url': null, + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0', + 'next_page_url': null, + 'key': 'bindings' + }, + 'bindings': [] + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings.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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + userSid: 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings/<%= sid %>')(solution); + + holodeck.assertHasRequest(new Request({ + method: 'GET', + url: url + })); + } + ); + it('should generate valid fetch response', + function() { + var body = JSON.stringify({ + 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'date_created': '2016-10-21T11:37:03Z', + 'date_updated': '2016-10-21T11:37:03Z', + 'endpoint': 'TestUser-endpoint', + 'identity': 'TestUser', + 'user_sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'binding_type': 'gcm', + 'credential_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'message_types': [ + 'removed_from_channel', + 'new_message', + 'added_to_channel', + 'invited_to_channel' + ], + 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }); + + holodeck.mock(new Response(200, body)); + + var promise = client.ipMessaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').fetch(); + 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function() { + throw new Error('failed'); + }, function(error) { + expect(error.constructor).toBe(RestException.prototype.constructor); + }); + promise.done(); + + var solution = { + serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + userSid: 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + sid: 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + }; + var url = _.template('https://chat.twilio.com/v2/Services/<%= serviceSid %>/Users/<%= userSid %>/Bindings/<%= 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('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .users('USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + .userBindings('BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').remove(); + promise = promise.then(function(response) { + expect(response).toBe(true); + }, function() { + throw new Error('failed'); + }); + + promise.done(); + } + ); +}); + diff --git a/spec/integration/rest/lookups/v1/phoneNumber.spec.js b/spec/integration/rest/lookups/v1/phoneNumber.spec.js index 73f1e17bce..8661b30f89 100644 --- a/spec/integration/rest/lookups/v1/phoneNumber.spec.js +++ b/spec/integration/rest/lookups/v1/phoneNumber.spec.js @@ -42,9 +42,7 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - phoneNumber: '+987654321' - }; + var solution = {phoneNumber: '+987654321'}; var url = _.template('https://lookups.twilio.com/v1/PhoneNumbers/<%= phoneNumber %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/messaging/v1/service.spec.js b/spec/integration/rest/messaging/v1/service.spec.js index f97564d9ad..daf7b52762 100644 --- a/spec/integration/rest/messaging/v1/service.spec.js +++ b/spec/integration/rest/messaging/v1/service.spec.js @@ -34,9 +34,7 @@ describe('Service', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.messaging.v1.services.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -47,9 +45,7 @@ describe('Service', function() { var url = 'https://messaging.twilio.com/v1/Services'; - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -88,9 +84,7 @@ describe('Service', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.messaging.v1.services.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -113,9 +107,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -251,9 +243,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -315,9 +305,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/messaging/v1/service/alphaSender.spec.js b/spec/integration/rest/messaging/v1/service/alphaSender.spec.js index e49c6c298e..d089b42323 100644 --- a/spec/integration/rest/messaging/v1/service/alphaSender.spec.js +++ b/spec/integration/rest/messaging/v1/service/alphaSender.spec.js @@ -34,9 +34,7 @@ describe('AlphaSender', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - alphaSender: 'alphaSender' - }; + var opts = {alphaSender: 'alphaSender'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .alphaSenders.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('AlphaSender', function() { }); promise.done(); - var solution = { - serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= serviceSid %>/AlphaSenders')(solution); - var values = { - AlphaSender: 'alphaSender', - }; + var values = {AlphaSender: 'alphaSender',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -76,9 +70,7 @@ describe('AlphaSender', function() { holodeck.mock(new Response(201, body)); - var opts = { - alphaSender: 'alphaSender' - }; + var opts = {alphaSender: 'alphaSender'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .alphaSenders.create(opts); promise = promise.then(function(response) { @@ -103,9 +95,7 @@ describe('AlphaSender', function() { }); promise.done(); - var solution = { - serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= serviceSid %>/AlphaSenders')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js b/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js index 0a3b309d97..66303d8ac3 100644 --- a/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js +++ b/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js @@ -34,9 +34,7 @@ describe('PhoneNumber', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= serviceSid %>/PhoneNumbers')(solution); - var values = { - PhoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {PhoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -77,9 +71,7 @@ describe('PhoneNumber', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function(response) { @@ -111,9 +103,7 @@ describe('PhoneNumber', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function(response) { @@ -180,9 +170,7 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= serviceSid %>/PhoneNumbers')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/messaging/v1/service/shortCode.spec.js b/spec/integration/rest/messaging/v1/service/shortCode.spec.js index 6beeedd166..38d853286a 100644 --- a/spec/integration/rest/messaging/v1/service/shortCode.spec.js +++ b/spec/integration/rest/messaging/v1/service/shortCode.spec.js @@ -34,9 +34,7 @@ describe('ShortCode', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - shortCodeSid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {shortCodeSid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .shortCodes.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= serviceSid %>/ShortCodes')(solution); - var values = { - ShortCodeSid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {ShortCodeSid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -77,9 +71,7 @@ describe('ShortCode', function() { holodeck.mock(new Response(201, body)); - var opts = { - shortCodeSid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {shortCodeSid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.messaging.v1.services('MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .shortCodes.create(opts); promise = promise.then(function(response) { @@ -146,9 +138,7 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://messaging.twilio.com/v1/Services/<%= serviceSid %>/ShortCodes')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/monitor/v1/alert.spec.js b/spec/integration/rest/monitor/v1/alert.spec.js index 8c4fc411cf..1486041a87 100644 --- a/spec/integration/rest/monitor/v1/alert.spec.js +++ b/spec/integration/rest/monitor/v1/alert.spec.js @@ -42,9 +42,7 @@ describe('Alert', function() { }); promise.done(); - var solution = { - sid: 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://monitor.twilio.com/v1/Alerts/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -99,9 +97,7 @@ describe('Alert', function() { }); promise.done(); - var solution = { - sid: 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://monitor.twilio.com/v1/Alerts/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/monitor/v1/event.spec.js b/spec/integration/rest/monitor/v1/event.spec.js index 87eda46b98..be7e1b3884 100644 --- a/spec/integration/rest/monitor/v1/event.spec.js +++ b/spec/integration/rest/monitor/v1/event.spec.js @@ -42,9 +42,7 @@ describe('Event', function() { }); promise.done(); - var solution = { - sid: 'AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://monitor.twilio.com/v1/Events/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/credential.spec.js b/spec/integration/rest/notify/v1/credential.spec.js index 6cd4a04417..1e32a1f3cf 100644 --- a/spec/integration/rest/notify/v1/credential.spec.js +++ b/spec/integration/rest/notify/v1/credential.spec.js @@ -119,9 +119,7 @@ describe('Credential', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.notify.v1.credentials.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -132,9 +130,7 @@ describe('Credential', function() { var url = 'https://notify.twilio.com/v1/Credentials'; - var values = { - Type: 'gcm', - }; + var values = {Type: 'gcm',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -157,9 +153,7 @@ describe('Credential', function() { holodeck.mock(new Response(201, body)); - var opts = { - type: 'gcm' - }; + var opts = {type: 'gcm'}; var promise = client.notify.v1.credentials.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -182,9 +176,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -230,9 +222,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -278,9 +268,7 @@ describe('Credential', function() { }); promise.done(); - var solution = { - sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Credentials/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/service.spec.js b/spec/integration/rest/notify/v1/service.spec.js index 7720300c20..46d5b15986 100644 --- a/spec/integration/rest/notify/v1/service.spec.js +++ b/spec/integration/rest/notify/v1/service.spec.js @@ -102,9 +102,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -141,9 +139,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -304,9 +300,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/service/binding.spec.js b/spec/integration/rest/notify/v1/service/binding.spec.js index f7663e7bbe..b5ae23e945 100644 --- a/spec/integration/rest/notify/v1/service/binding.spec.js +++ b/spec/integration/rest/notify/v1/service/binding.spec.js @@ -137,11 +137,7 @@ describe('Binding', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity', - bindingType: 'apn', - address: 'address' - }; + var opts = {identity: 'identity', bindingType: 'apn', address: 'address'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .bindings.create(opts); promise = promise.then(function() { @@ -151,16 +147,10 @@ describe('Binding', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Bindings')(solution); - var values = { - Identity: 'identity', - BindingType: 'apn', - Address: 'address', - }; + var values = {Identity: 'identity', BindingType: 'apn', Address: 'address',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -193,11 +183,7 @@ describe('Binding', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity', - bindingType: 'apn', - address: 'address' - }; + var opts = {identity: 'identity', bindingType: 'apn', address: 'address'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .bindings.create(opts); promise = promise.then(function(response) { @@ -222,9 +208,7 @@ describe('Binding', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Bindings')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/service/notification.spec.js b/spec/integration/rest/notify/v1/service/notification.spec.js index feec97d4f2..7b1e800d73 100644 --- a/spec/integration/rest/notify/v1/service/notification.spec.js +++ b/spec/integration/rest/notify/v1/service/notification.spec.js @@ -43,9 +43,7 @@ describe('Notification', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Notifications')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/service/segment.spec.js b/spec/integration/rest/notify/v1/service/segment.spec.js index 817a0ac98b..f8d9f91c76 100644 --- a/spec/integration/rest/notify/v1/service/segment.spec.js +++ b/spec/integration/rest/notify/v1/service/segment.spec.js @@ -43,9 +43,7 @@ describe('Segment', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Segments')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/service/user.spec.js b/spec/integration/rest/notify/v1/service/user.spec.js index d8762c5cfb..1b993c7641 100644 --- a/spec/integration/rest/notify/v1/service/user.spec.js +++ b/spec/integration/rest/notify/v1/service/user.spec.js @@ -34,9 +34,7 @@ describe('User', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Users')(solution); - var values = { - Identity: 'identity', - }; + var values = {Identity: 'identity',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -82,9 +76,7 @@ describe('User', function() { holodeck.mock(new Response(201, body)); - var opts = { - identity: 'identity' - }; + var opts = {identity: 'identity'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users.create(opts); promise = promise.then(function(response) { @@ -208,9 +200,7 @@ describe('User', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Users')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/notify/v1/service/user/segmentMemberships.spec.js b/spec/integration/rest/notify/v1/service/user/segmentMemberships.spec.js index cd73512a01..8a78c54605 100644 --- a/spec/integration/rest/notify/v1/service/user/segmentMemberships.spec.js +++ b/spec/integration/rest/notify/v1/service/user/segmentMemberships.spec.js @@ -34,9 +34,7 @@ describe('SegmentMembership', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - segment: 'segment' - }; + var opts = {segment: 'segment'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users('NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .segmentMemberships.create(opts); @@ -53,9 +51,7 @@ describe('SegmentMembership', function() { }; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Users/<%= identity %>/SegmentMemberships')(solution); - var values = { - Segment: 'segment', - }; + var values = {Segment: 'segment',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -75,9 +71,7 @@ describe('SegmentMembership', function() { holodeck.mock(new Response(201, body)); - var opts = { - segment: 'segment' - }; + var opts = {segment: 'segment'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users('NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .segmentMemberships.create(opts); diff --git a/spec/integration/rest/notify/v1/service/user/userBinding.spec.js b/spec/integration/rest/notify/v1/service/user/userBinding.spec.js index 70d38513f2..e727fd2abe 100644 --- a/spec/integration/rest/notify/v1/service/user/userBinding.spec.js +++ b/spec/integration/rest/notify/v1/service/user/userBinding.spec.js @@ -143,10 +143,7 @@ describe('UserBinding', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - bindingType: 'apn', - address: 'address' - }; + var opts = {bindingType: 'apn', address: 'address'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users('NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .bindings.create(opts); @@ -163,10 +160,7 @@ describe('UserBinding', function() { }; var url = _.template('https://notify.twilio.com/v1/Services/<%= serviceSid %>/Users/<%= identity %>/Bindings')(solution); - var values = { - BindingType: 'apn', - Address: 'address', - }; + var values = {BindingType: 'apn', Address: 'address',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -199,10 +193,7 @@ describe('UserBinding', function() { holodeck.mock(new Response(201, body)); - var opts = { - bindingType: 'apn', - address: 'address' - }; + var opts = {bindingType: 'apn', address: 'address'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users('NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .bindings.create(opts); @@ -240,10 +231,7 @@ describe('UserBinding', function() { holodeck.mock(new Response(201, body)); - var opts = { - bindingType: 'apn', - address: 'address' - }; + var opts = {bindingType: 'apn', address: 'address'}; var promise = client.notify.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .users('NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .bindings.create(opts); diff --git a/spec/integration/rest/preview/acc_security/service.spec.js b/spec/integration/rest/preview/acc_security/service.spec.js index 347fc9f9ba..9971d701cd 100644 --- a/spec/integration/rest/preview/acc_security/service.spec.js +++ b/spec/integration/rest/preview/acc_security/service.spec.js @@ -34,9 +34,7 @@ describe('Service', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - name: 'name' - }; + var opts = {name: 'name'}; var promise = client.preview.acc_security.services.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -47,9 +45,7 @@ describe('Service', function() { var url = 'https://preview.twilio.com/Verification/Services'; - var values = { - Name: 'name', - }; + var values = {Name: 'name',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -75,9 +71,7 @@ describe('Service', function() { holodeck.mock(new Response(201, body)); - var opts = { - name: 'name' - }; + var opts = {name: 'name'}; var promise = client.preview.acc_security.services.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -100,9 +94,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Verification/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -212,9 +204,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Verification/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/acc_security/service/verification.spec.js b/spec/integration/rest/preview/acc_security/service/verification.spec.js index 2252f9fae0..1859ea601e 100644 --- a/spec/integration/rest/preview/acc_security/service/verification.spec.js +++ b/spec/integration/rest/preview/acc_security/service/verification.spec.js @@ -34,10 +34,7 @@ describe('Verification', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - to: 'to', - channel: 'channel' - }; + var opts = {to: 'to', channel: 'channel'}; var promise = client.preview.acc_security.services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .verifications.create(opts); promise = promise.then(function() { @@ -47,15 +44,10 @@ describe('Verification', function() { }); promise.done(); - var solution = { - serviceSid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Verification/Services/<%= serviceSid %>/Verifications')(solution); - var values = { - To: 'to', - Channel: 'channel', - }; + var values = {To: 'to', Channel: 'channel',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -79,10 +71,7 @@ describe('Verification', function() { holodeck.mock(new Response(201, body)); - var opts = { - to: 'to', - channel: 'channel' - }; + var opts = {to: 'to', channel: 'channel'}; var promise = client.preview.acc_security.services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .verifications.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/preview/acc_security/service/verificationCheck.spec.js b/spec/integration/rest/preview/acc_security/service/verificationCheck.spec.js index 524080438f..97c5fd32cd 100644 --- a/spec/integration/rest/preview/acc_security/service/verificationCheck.spec.js +++ b/spec/integration/rest/preview/acc_security/service/verificationCheck.spec.js @@ -34,9 +34,7 @@ describe('VerificationCheck', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - code: 'code' - }; + var opts = {code: 'code'}; var promise = client.preview.acc_security.services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .verificationChecks.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('VerificationCheck', function() { }); promise.done(); - var solution = { - serviceSid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Verification/Services/<%= serviceSid %>/VerificationCheck')(solution); - var values = { - Code: 'code', - }; + var values = {Code: 'code',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -77,9 +71,7 @@ describe('VerificationCheck', function() { holodeck.mock(new Response(201, body)); - var opts = { - code: 'code' - }; + var opts = {code: 'code'}; var promise = client.preview.acc_security.services('VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .verificationChecks.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/preview/bulk_exports/export.spec.js b/spec/integration/rest/preview/bulk_exports/export.spec.js index 0cc853491f..ff0a6269cd 100644 --- a/spec/integration/rest/preview/bulk_exports/export.spec.js +++ b/spec/integration/rest/preview/bulk_exports/export.spec.js @@ -42,9 +42,7 @@ describe('Export', function() { }); promise.done(); - var solution = { - resourceType: 'resourceType' - }; + var solution = {resourceType: 'resourceType'}; var url = _.template('https://preview.twilio.com/BulkExports/Exports/<%= resourceType %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/bulk_exports/export/day.spec.js b/spec/integration/rest/preview/bulk_exports/export/day.spec.js index 0cd315955b..3f673dd7b1 100644 --- a/spec/integration/rest/preview/bulk_exports/export/day.spec.js +++ b/spec/integration/rest/preview/bulk_exports/export/day.spec.js @@ -43,9 +43,7 @@ describe('Day', function() { }); promise.done(); - var solution = { - resourceType: 'resourceType' - }; + var solution = {resourceType: 'resourceType'}; var url = _.template('https://preview.twilio.com/BulkExports/Exports/<%= resourceType %>/Days')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js b/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js index 3a74771302..b11609b070 100644 --- a/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js +++ b/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js @@ -42,9 +42,7 @@ describe('ExportConfiguration', function() { }); promise.done(); - var solution = { - resourceType: 'resourceType' - }; + var solution = {resourceType: 'resourceType'}; var url = _.template('https://preview.twilio.com/BulkExports/Exports/<%= resourceType %>/Configuration')(solution); holodeck.assertHasRequest(new Request({ @@ -87,9 +85,7 @@ describe('ExportConfiguration', function() { }); promise.done(); - var solution = { - resourceType: 'resourceType' - }; + var solution = {resourceType: 'resourceType'}; var url = _.template('https://preview.twilio.com/BulkExports/Exports/<%= resourceType %>/Configuration')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/deployed_devices/fleet.spec.js b/spec/integration/rest/preview/deployed_devices/fleet.spec.js index 93a77187aa..c66349bb6a 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet.spec.js @@ -42,9 +42,7 @@ describe('Fleet', function() { }); promise.done(); - var solution = { - sid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -96,9 +94,7 @@ describe('Fleet', function() { }); promise.done(); - var solution = { - sid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -277,9 +273,7 @@ describe('Fleet', function() { }); promise.done(); - var solution = { - sid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js index 446143326d..568d69fe0a 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js @@ -128,9 +128,7 @@ describe('Certificate', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - certificateData: 'certificateData' - }; + var opts = {certificateData: 'certificateData'}; var promise = client.preview.deployed_devices.fleets('FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .certificates.create(opts); promise = promise.then(function() { @@ -140,14 +138,10 @@ describe('Certificate', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Certificates')(solution); - var values = { - CertificateData: 'certificateData', - }; + var values = {CertificateData: 'certificateData',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -171,9 +165,7 @@ describe('Certificate', function() { holodeck.mock(new Response(201, body)); - var opts = { - certificateData: 'certificateData' - }; + var opts = {certificateData: 'certificateData'}; var promise = client.preview.deployed_devices.fleets('FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .certificates.create(opts); promise = promise.then(function(response) { @@ -198,9 +190,7 @@ describe('Certificate', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Certificates')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js index 4e39175454..7d5468e64d 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js @@ -136,9 +136,7 @@ describe('Deployment', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Deployments')(solution); holodeck.assertHasRequest(new Request({ @@ -186,9 +184,7 @@ describe('Deployment', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Deployments')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js index 691b9dec40..1a8460fd9d 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js @@ -140,9 +140,7 @@ describe('Device', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Devices')(solution); holodeck.assertHasRequest(new Request({ @@ -194,9 +192,7 @@ describe('Device', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Devices')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js index aad0fdb204..045d2cdb9f 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js @@ -137,9 +137,7 @@ describe('Key', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Keys')(solution); holodeck.assertHasRequest(new Request({ @@ -188,9 +186,7 @@ describe('Key', function() { }); promise.done(); - var solution = { - fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {fleetSid: 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/DeployedDevices/Fleets/<%= fleetSid %>/Keys')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js b/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js index d3d4670354..f8a57dae93 100644 --- a/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js +++ b/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js @@ -42,9 +42,7 @@ describe('AuthorizationDocument', function() { }); promise.done(); - var solution = { - sid: 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -93,9 +91,7 @@ describe('AuthorizationDocument', function() { }); promise.done(); - var solution = { - sid: 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js b/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js index 3f3a9eb65d..f688143b8e 100644 --- a/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js +++ b/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js @@ -44,9 +44,7 @@ describe('HostedNumberOrder', function() { }); promise.done(); - var solution = { - sid: 'HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/HostedNumbers/HostedNumberOrders/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -106,9 +104,7 @@ describe('HostedNumberOrder', function() { }); promise.done(); - var solution = { - sid: 'HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/HostedNumbers/HostedNumberOrders/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -145,9 +141,7 @@ describe('HostedNumberOrder', function() { }); promise.done(); - var solution = { - sid: 'HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/HostedNumbers/HostedNumberOrders/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -298,11 +292,7 @@ describe('HostedNumberOrder', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumber: '+987654321', - isoCountry: 'isoCountry', - smsCapability: true - }; + var opts = {phoneNumber: '+987654321', isoCountry: 'isoCountry', smsCapability: true}; var promise = client.preview.hosted_numbers.hostedNumberOrders.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -351,11 +341,7 @@ describe('HostedNumberOrder', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumber: '+987654321', - isoCountry: 'isoCountry', - smsCapability: true - }; + var opts = {phoneNumber: '+987654321', isoCountry: 'isoCountry', smsCapability: true}; var promise = client.preview.hosted_numbers.hostedNumberOrders.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -392,11 +378,7 @@ describe('HostedNumberOrder', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumber: '+987654321', - isoCountry: 'isoCountry', - smsCapability: true - }; + var opts = {phoneNumber: '+987654321', isoCountry: 'isoCountry', smsCapability: true}; var promise = client.preview.hosted_numbers.hostedNumberOrders.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); diff --git a/spec/integration/rest/preview/marketplace/availableAddOn.spec.js b/spec/integration/rest/preview/marketplace/availableAddOn.spec.js index f9a375a4da..b76882cc2f 100644 --- a/spec/integration/rest/preview/marketplace/availableAddOn.spec.js +++ b/spec/integration/rest/preview/marketplace/availableAddOn.spec.js @@ -42,9 +42,7 @@ describe('AvailableAddOn', function() { }); promise.done(); - var solution = { - sid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/marketplace/AvailableAddOns/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js b/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js index 98d0be5d51..902e7e23b7 100644 --- a/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js +++ b/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js @@ -92,9 +92,7 @@ describe('AvailableAddOnExtension', function() { }); promise.done(); - var solution = { - availableAddOnSid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {availableAddOnSid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/marketplace/AvailableAddOns/<%= availableAddOnSid %>/Extensions')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/marketplace/installedAddOn.spec.js b/spec/integration/rest/preview/marketplace/installedAddOn.spec.js index f2b7c99122..927af4629b 100644 --- a/spec/integration/rest/preview/marketplace/installedAddOn.spec.js +++ b/spec/integration/rest/preview/marketplace/installedAddOn.spec.js @@ -36,10 +36,7 @@ describe('InstalledAddOn', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - availableAddOnSid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - acceptTermsOfService: true - }; + var opts = {availableAddOnSid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', acceptTermsOfService: true}; var promise = client.preview.marketplace.installedAddOns.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -83,10 +80,7 @@ describe('InstalledAddOn', function() { holodeck.mock(new Response(201, body)); - var opts = { - availableAddOnSid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - acceptTermsOfService: true - }; + var opts = {availableAddOnSid: 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', acceptTermsOfService: true}; var promise = client.preview.marketplace.installedAddOns.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -109,9 +103,7 @@ describe('InstalledAddOn', function() { }); promise.done(); - var solution = { - sid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/marketplace/InstalledAddOns/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -148,9 +140,7 @@ describe('InstalledAddOn', function() { }); promise.done(); - var solution = { - sid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/marketplace/InstalledAddOns/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -203,9 +193,7 @@ describe('InstalledAddOn', function() { }); promise.done(); - var solution = { - sid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/marketplace/InstalledAddOns/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js b/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js index 2f9075a60e..ed9f5ef420 100644 --- a/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js +++ b/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js @@ -86,9 +86,7 @@ describe('InstalledAddOnExtension', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - enabled: true - }; + var opts = {enabled: true}; var promise = client.preview.marketplace.installedAddOns('XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .extensions('XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -104,9 +102,7 @@ describe('InstalledAddOnExtension', function() { }; var url = _.template('https://preview.twilio.com/marketplace/InstalledAddOns/<%= installedAddOnSid %>/Extensions/<%= sid %>')(solution); - var values = { - Enabled: serialize.bool(true), - }; + var values = {Enabled: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -128,9 +124,7 @@ describe('InstalledAddOnExtension', function() { holodeck.mock(new Response(200, body)); - var opts = { - enabled: true - }; + var opts = {enabled: true}; var promise = client.preview.marketplace.installedAddOns('XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .extensions('XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { @@ -155,9 +149,7 @@ describe('InstalledAddOnExtension', function() { }); promise.done(); - var solution = { - installedAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {installedAddOnSid: 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/marketplace/InstalledAddOns/<%= installedAddOnSid %>/Extensions')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/proxy/service.spec.js b/spec/integration/rest/preview/proxy/service.spec.js index f9f66a0642..b9cbe379e0 100644 --- a/spec/integration/rest/preview/proxy/service.spec.js +++ b/spec/integration/rest/preview/proxy/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -192,9 +190,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -231,9 +227,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/proxy/service/phoneNumber.spec.js b/spec/integration/rest/preview/proxy/service/phoneNumber.spec.js index 68398432d3..4df7dadc60 100644 --- a/spec/integration/rest/preview/proxy/service/phoneNumber.spec.js +++ b/spec/integration/rest/preview/proxy/service/phoneNumber.spec.js @@ -34,9 +34,7 @@ describe('PhoneNumber', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.preview.proxy.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/PhoneNumbers')(solution); - var values = { - Sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {Sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -77,9 +71,7 @@ describe('PhoneNumber', function() { holodeck.mock(new Response(201, body)); - var opts = { - sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.preview.proxy.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function(response) { @@ -146,9 +138,7 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/PhoneNumbers')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/proxy/service/session.spec.js b/spec/integration/rest/preview/proxy/service/session.spec.js index 5639e66cea..19f7c663c6 100644 --- a/spec/integration/rest/preview/proxy/service/session.spec.js +++ b/spec/integration/rest/preview/proxy/service/session.spec.js @@ -101,9 +101,7 @@ describe('Session', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/Sessions')(solution); holodeck.assertHasRequest(new Request({ @@ -153,9 +151,7 @@ describe('Session', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/Sessions')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/proxy/service/session/participant.spec.js b/spec/integration/rest/preview/proxy/service/session/participant.spec.js index c3f349ee3e..6115274a5d 100644 --- a/spec/integration/rest/preview/proxy/service/session/participant.spec.js +++ b/spec/integration/rest/preview/proxy/service/session/participant.spec.js @@ -149,9 +149,7 @@ describe('Participant', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identifier: 'identifier' - }; + var opts = {identifier: 'identifier'}; var promise = client.preview.proxy.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sessions('KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); @@ -168,9 +166,7 @@ describe('Participant', function() { }; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Participants')(solution); - var values = { - Identifier: 'identifier', - }; + var values = {Identifier: 'identifier',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -199,9 +195,7 @@ describe('Participant', function() { holodeck.mock(new Response(201, body)); - var opts = { - identifier: 'identifier' - }; + var opts = {identifier: 'identifier'}; var promise = client.preview.proxy.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sessions('KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); diff --git a/spec/integration/rest/preview/proxy/service/shortCode.spec.js b/spec/integration/rest/preview/proxy/service/shortCode.spec.js index 2aeb0db689..0f6d308294 100644 --- a/spec/integration/rest/preview/proxy/service/shortCode.spec.js +++ b/spec/integration/rest/preview/proxy/service/shortCode.spec.js @@ -34,9 +34,7 @@ describe('ShortCode', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.preview.proxy.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .shortCodes.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/ShortCodes')(solution); - var values = { - Sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {Sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -77,9 +71,7 @@ describe('ShortCode', function() { holodeck.mock(new Response(201, body)); - var opts = { - sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.preview.proxy.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .shortCodes.create(opts); promise = promise.then(function(response) { @@ -146,9 +138,7 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Proxy/Services/<%= serviceSid %>/ShortCodes')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/sync/service.spec.js b/spec/integration/rest/preview/sync/service.spec.js index b0bf65f90d..205c65639d 100644 --- a/spec/integration/rest/preview/sync/service.spec.js +++ b/spec/integration/rest/preview/sync/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -96,9 +94,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -277,9 +273,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/sync/service/document.spec.js b/spec/integration/rest/preview/sync/service/document.spec.js index d6a61e5f30..9185b35f44 100644 --- a/spec/integration/rest/preview/sync/service/document.spec.js +++ b/spec/integration/rest/preview/sync/service/document.spec.js @@ -143,9 +143,7 @@ describe('Document', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Documents')(solution); holodeck.assertHasRequest(new Request({ @@ -198,9 +196,7 @@ describe('Document', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Documents')(solution); holodeck.assertHasRequest(new Request({ @@ -285,9 +281,7 @@ describe('Document', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -303,9 +297,7 @@ describe('Document', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Documents/<%= sid %>')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -333,9 +325,7 @@ describe('Document', function() { holodeck.mock(new Response(200, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js b/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js index 6c708d9556..5e55684a05 100644 --- a/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js +++ b/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js @@ -230,11 +230,7 @@ describe('DocumentPermission', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documentPermissions('identity').update(opts); @@ -252,11 +248,7 @@ describe('DocumentPermission', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Documents/<%= documentSid %>/Permissions/<%= identity %>')(solution); - var values = { - Read: serialize.bool(true), - Write: serialize.bool(true), - Manage: serialize.bool(true), - }; + var values = {Read: serialize.bool(true), Write: serialize.bool(true), Manage: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -279,11 +271,7 @@ describe('DocumentPermission', function() { holodeck.mock(new Response(200, body)); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documentPermissions('identity').update(opts); diff --git a/spec/integration/rest/preview/sync/service/syncList.spec.js b/spec/integration/rest/preview/sync/service/syncList.spec.js index 4a0f0b2f8a..34984d8a33 100644 --- a/spec/integration/rest/preview/sync/service/syncList.spec.js +++ b/spec/integration/rest/preview/sync/service/syncList.spec.js @@ -141,9 +141,7 @@ describe('SyncList', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Lists')(solution); holodeck.assertHasRequest(new Request({ @@ -196,9 +194,7 @@ describe('SyncList', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Lists')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js b/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js index c1e1ac079a..2a630f7f48 100644 --- a/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js +++ b/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js @@ -137,9 +137,7 @@ describe('SyncListItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems.create(opts); @@ -156,9 +154,7 @@ describe('SyncListItem', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -183,9 +179,7 @@ describe('SyncListItem', function() { holodeck.mock(new Response(201, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems.create(opts); @@ -299,9 +293,7 @@ describe('SyncListItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems(1).update(opts); @@ -319,9 +311,7 @@ describe('SyncListItem', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items/<%= index %>')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -346,9 +336,7 @@ describe('SyncListItem', function() { holodeck.mock(new Response(200, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems(1).update(opts); diff --git a/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js b/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js index d6e60c37ff..e11f7eded2 100644 --- a/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js +++ b/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js @@ -230,11 +230,7 @@ describe('SyncListPermission', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListPermissions('identity').update(opts); @@ -252,11 +248,7 @@ describe('SyncListPermission', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Lists/<%= listSid %>/Permissions/<%= identity %>')(solution); - var values = { - Read: serialize.bool(true), - Write: serialize.bool(true), - Manage: serialize.bool(true), - }; + var values = {Read: serialize.bool(true), Write: serialize.bool(true), Manage: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -279,11 +271,7 @@ describe('SyncListPermission', function() { holodeck.mock(new Response(200, body)); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListPermissions('identity').update(opts); diff --git a/spec/integration/rest/preview/sync/service/syncMap.spec.js b/spec/integration/rest/preview/sync/service/syncMap.spec.js index 1c8a557bff..80ec4f2df6 100644 --- a/spec/integration/rest/preview/sync/service/syncMap.spec.js +++ b/spec/integration/rest/preview/sync/service/syncMap.spec.js @@ -141,9 +141,7 @@ describe('SyncMap', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Maps')(solution); holodeck.assertHasRequest(new Request({ @@ -196,9 +194,7 @@ describe('SyncMap', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Maps')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js b/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js index 155ff6b692..dbb8f3f4c8 100644 --- a/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js +++ b/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js @@ -137,10 +137,7 @@ describe('SyncMapItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - key: 'key', - data: '{}' - }; + var opts = {key: 'key', data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems.create(opts); @@ -157,10 +154,7 @@ describe('SyncMapItem', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items')(solution); - var values = { - Key: 'key', - Data: serialize.object('{}'), - }; + var values = {Key: 'key', Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,10 +179,7 @@ describe('SyncMapItem', function() { holodeck.mock(new Response(201, body)); - var opts = { - key: 'key', - data: '{}' - }; + var opts = {key: 'key', data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems.create(opts); @@ -302,9 +293,7 @@ describe('SyncMapItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems('key').update(opts); @@ -322,9 +311,7 @@ describe('SyncMapItem', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items/<%= key %>')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -349,9 +336,7 @@ describe('SyncMapItem', function() { holodeck.mock(new Response(200, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems('key').update(opts); diff --git a/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js b/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js index 02d8b29cf7..7e3f23cec1 100644 --- a/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js +++ b/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js @@ -230,11 +230,7 @@ describe('SyncMapPermission', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapPermissions('identity').update(opts); @@ -252,11 +248,7 @@ describe('SyncMapPermission', function() { }; var url = _.template('https://preview.twilio.com/Sync/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Permissions/<%= identity %>')(solution); - var values = { - Read: serialize.bool(true), - Write: serialize.bool(true), - Manage: serialize.bool(true), - }; + var values = {Read: serialize.bool(true), Write: serialize.bool(true), Manage: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -279,11 +271,7 @@ describe('SyncMapPermission', function() { holodeck.mock(new Response(200, body)); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapPermissions('identity').update(opts); diff --git a/spec/integration/rest/preview/wireless/command.spec.js b/spec/integration/rest/preview/wireless/command.spec.js index d57c04bb61..1397fdd11a 100644 --- a/spec/integration/rest/preview/wireless/command.spec.js +++ b/spec/integration/rest/preview/wireless/command.spec.js @@ -42,9 +42,7 @@ describe('Command', function() { }); promise.done(); - var solution = { - sid: 'DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/Commands/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -173,9 +171,7 @@ describe('Command', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - command: 'command' - }; + var opts = {command: 'command'}; var promise = client.preview.wireless.commands.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -186,9 +182,7 @@ describe('Command', function() { var url = 'https://preview.twilio.com/wireless/Commands'; - var values = { - Command: 'command', - }; + var values = {Command: 'command',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -214,9 +208,7 @@ describe('Command', function() { holodeck.mock(new Response(201, body)); - var opts = { - command: 'command' - }; + var opts = {command: 'command'}; var promise = client.preview.wireless.commands.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); diff --git a/spec/integration/rest/preview/wireless/ratePlan.spec.js b/spec/integration/rest/preview/wireless/ratePlan.spec.js index e4e795a57b..4e746db5aa 100644 --- a/spec/integration/rest/preview/wireless/ratePlan.spec.js +++ b/spec/integration/rest/preview/wireless/ratePlan.spec.js @@ -137,9 +137,7 @@ describe('RatePlan', function() { }); promise.done(); - var solution = { - sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/RatePlans/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -250,9 +248,7 @@ describe('RatePlan', function() { }); promise.done(); - var solution = { - sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/RatePlans/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -308,9 +304,7 @@ describe('RatePlan', function() { }); promise.done(); - var solution = { - sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/RatePlans/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/wireless/sim.spec.js b/spec/integration/rest/preview/wireless/sim.spec.js index d7b073d85f..2c8cb3fb09 100644 --- a/spec/integration/rest/preview/wireless/sim.spec.js +++ b/spec/integration/rest/preview/wireless/sim.spec.js @@ -42,9 +42,7 @@ describe('Sim', function() { }); promise.done(); - var solution = { - sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/Sims/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -209,9 +207,7 @@ describe('Sim', function() { }); promise.done(); - var solution = { - sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/Sims/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/preview/wireless/sim/usage.spec.js b/spec/integration/rest/preview/wireless/sim/usage.spec.js index 817b8f3fc0..de91482043 100644 --- a/spec/integration/rest/preview/wireless/sim/usage.spec.js +++ b/spec/integration/rest/preview/wireless/sim/usage.spec.js @@ -43,9 +43,7 @@ describe('Usage', function() { }); promise.done(); - var solution = { - simSid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {simSid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://preview.twilio.com/wireless/Sims/<%= simSid %>/Usage')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/pricing/v1/messaging/country.spec.js b/spec/integration/rest/pricing/v1/messaging/country.spec.js index 07b27f9dbb..29d2152a74 100644 --- a/spec/integration/rest/pricing/v1/messaging/country.spec.js +++ b/spec/integration/rest/pricing/v1/messaging/country.spec.js @@ -126,9 +126,7 @@ describe('Country', function() { }); promise.done(); - var solution = { - isoCountry: 'US' - }; + var solution = {isoCountry: 'US'}; var url = _.template('https://pricing.twilio.com/v1/Messaging/Countries/<%= isoCountry %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js b/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js index 40949dc4a3..f5998ce9a2 100644 --- a/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js +++ b/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js @@ -126,9 +126,7 @@ describe('Country', function() { }); promise.done(); - var solution = { - isoCountry: 'US' - }; + var solution = {isoCountry: 'US'}; var url = _.template('https://pricing.twilio.com/v1/PhoneNumbers/Countries/<%= isoCountry %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/pricing/v1/voice/country.spec.js b/spec/integration/rest/pricing/v1/voice/country.spec.js index 1817ce63c7..d0c48de36d 100644 --- a/spec/integration/rest/pricing/v1/voice/country.spec.js +++ b/spec/integration/rest/pricing/v1/voice/country.spec.js @@ -126,9 +126,7 @@ describe('Country', function() { }); promise.done(); - var solution = { - isoCountry: 'US' - }; + var solution = {isoCountry: 'US'}; var url = _.template('https://pricing.twilio.com/v1/Voice/Countries/<%= isoCountry %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/pricing/v1/voice/number.spec.js b/spec/integration/rest/pricing/v1/voice/number.spec.js index e7654e1e0d..882f4b8c4e 100644 --- a/spec/integration/rest/pricing/v1/voice/number.spec.js +++ b/spec/integration/rest/pricing/v1/voice/number.spec.js @@ -43,9 +43,7 @@ describe('Number', function() { }); promise.done(); - var solution = { - number: '+987654321' - }; + var solution = {number: '+987654321'}; var url = _.template('https://pricing.twilio.com/v1/Voice/Numbers/<%= number %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/proxy/v1/service.spec.js b/spec/integration/rest/proxy/v1/service.spec.js index 19a914b756..822ce5d082 100644 --- a/spec/integration/rest/proxy/v1/service.spec.js +++ b/spec/integration/rest/proxy/v1/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -192,9 +190,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -231,9 +227,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js b/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js index ea281e576d..fee3a0d207 100644 --- a/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js +++ b/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js @@ -34,9 +34,7 @@ describe('PhoneNumber', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.proxy.v1.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/PhoneNumbers')(solution); - var values = { - Sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {Sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -78,9 +72,7 @@ describe('PhoneNumber', function() { holodeck.mock(new Response(201, body)); - var opts = { - sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.proxy.v1.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function(response) { @@ -147,9 +139,7 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/PhoneNumbers')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/proxy/v1/service/session.spec.js b/spec/integration/rest/proxy/v1/service/session.spec.js index 41dcd777e1..dc46978962 100644 --- a/spec/integration/rest/proxy/v1/service/session.spec.js +++ b/spec/integration/rest/proxy/v1/service/session.spec.js @@ -104,9 +104,7 @@ describe('Session', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/Sessions')(solution); holodeck.assertHasRequest(new Request({ @@ -156,9 +154,7 @@ describe('Session', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/Sessions')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/proxy/v1/service/session/participant.spec.js b/spec/integration/rest/proxy/v1/service/session/participant.spec.js index c0da8944b8..67690062d5 100644 --- a/spec/integration/rest/proxy/v1/service/session/participant.spec.js +++ b/spec/integration/rest/proxy/v1/service/session/participant.spec.js @@ -151,9 +151,7 @@ describe('Participant', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - identifier: 'identifier' - }; + var opts = {identifier: 'identifier'}; var promise = client.proxy.v1.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sessions('KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); @@ -170,9 +168,7 @@ describe('Participant', function() { }; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/Sessions/<%= sessionSid %>/Participants')(solution); - var values = { - Identifier: 'identifier', - }; + var values = {Identifier: 'identifier',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -203,9 +199,7 @@ describe('Participant', function() { holodeck.mock(new Response(201, body)); - var opts = { - identifier: 'identifier' - }; + var opts = {identifier: 'identifier'}; var promise = client.proxy.v1.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .sessions('KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .participants.create(opts); diff --git a/spec/integration/rest/proxy/v1/service/shortCode.spec.js b/spec/integration/rest/proxy/v1/service/shortCode.spec.js index 702461f56d..ae3cf249b1 100644 --- a/spec/integration/rest/proxy/v1/service/shortCode.spec.js +++ b/spec/integration/rest/proxy/v1/service/shortCode.spec.js @@ -34,9 +34,7 @@ describe('ShortCode', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.proxy.v1.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .shortCodes.create(opts); promise = promise.then(function() { @@ -46,14 +44,10 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/ShortCodes')(solution); - var values = { - Sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {Sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -77,9 +71,7 @@ describe('ShortCode', function() { holodeck.mock(new Response(201, body)); - var opts = { - sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {sid: 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.proxy.v1.services('KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .shortCodes.create(opts); promise = promise.then(function(response) { @@ -146,9 +138,7 @@ describe('ShortCode', function() { }); promise.done(); - var solution = { - serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://proxy.twilio.com/v1/Services/<%= serviceSid %>/ShortCodes')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/sync/v1/service.spec.js b/spec/integration/rest/sync/v1/service.spec.js index 3eb7777201..d2fe572537 100644 --- a/spec/integration/rest/sync/v1/service.spec.js +++ b/spec/integration/rest/sync/v1/service.spec.js @@ -42,9 +42,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -98,9 +96,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -283,9 +279,7 @@ describe('Service', function() { }); promise.done(); - var solution = { - sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/sync/v1/service/document.spec.js b/spec/integration/rest/sync/v1/service/document.spec.js index f7ca3f51a0..4693c21c23 100644 --- a/spec/integration/rest/sync/v1/service/document.spec.js +++ b/spec/integration/rest/sync/v1/service/document.spec.js @@ -143,9 +143,7 @@ describe('Document', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Documents')(solution); holodeck.assertHasRequest(new Request({ @@ -198,9 +196,7 @@ describe('Document', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Documents')(solution); holodeck.assertHasRequest(new Request({ @@ -285,9 +281,7 @@ describe('Document', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { @@ -303,9 +297,7 @@ describe('Document', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Documents/<%= sid %>')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -333,9 +325,7 @@ describe('Document', function() { holodeck.mock(new Response(200, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js b/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js index f2db099444..6caf93b44b 100644 --- a/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js +++ b/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js @@ -230,11 +230,7 @@ describe('DocumentPermission', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documentPermissions('identity').update(opts); @@ -252,11 +248,7 @@ describe('DocumentPermission', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Documents/<%= documentSid %>/Permissions/<%= identity %>')(solution); - var values = { - Read: serialize.bool(true), - Write: serialize.bool(true), - Manage: serialize.bool(true), - }; + var values = {Read: serialize.bool(true), Write: serialize.bool(true), Manage: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -279,11 +271,7 @@ describe('DocumentPermission', function() { holodeck.mock(new Response(200, body)); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documents('ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .documentPermissions('identity').update(opts); diff --git a/spec/integration/rest/sync/v1/service/syncList.spec.js b/spec/integration/rest/sync/v1/service/syncList.spec.js index ecff44c28e..ec65858e97 100644 --- a/spec/integration/rest/sync/v1/service/syncList.spec.js +++ b/spec/integration/rest/sync/v1/service/syncList.spec.js @@ -141,9 +141,7 @@ describe('SyncList', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Lists')(solution); holodeck.assertHasRequest(new Request({ @@ -196,9 +194,7 @@ describe('SyncList', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Lists')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js b/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js index a7982dfaa2..b310aa20c7 100644 --- a/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js +++ b/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js @@ -137,9 +137,7 @@ describe('SyncListItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems.create(opts); @@ -156,9 +154,7 @@ describe('SyncListItem', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -183,9 +179,7 @@ describe('SyncListItem', function() { holodeck.mock(new Response(201, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems.create(opts); @@ -299,9 +293,7 @@ describe('SyncListItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems(1).update(opts); @@ -319,9 +311,7 @@ describe('SyncListItem', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Lists/<%= listSid %>/Items/<%= index %>')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -346,9 +336,7 @@ describe('SyncListItem', function() { holodeck.mock(new Response(200, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListItems(1).update(opts); diff --git a/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js b/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js index 3e0f3b6bc8..db857cb210 100644 --- a/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js +++ b/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js @@ -230,11 +230,7 @@ describe('SyncListPermission', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListPermissions('identity').update(opts); @@ -252,11 +248,7 @@ describe('SyncListPermission', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Lists/<%= listSid %>/Permissions/<%= identity %>')(solution); - var values = { - Read: serialize.bool(true), - Write: serialize.bool(true), - Manage: serialize.bool(true), - }; + var values = {Read: serialize.bool(true), Write: serialize.bool(true), Manage: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -279,11 +271,7 @@ describe('SyncListPermission', function() { holodeck.mock(new Response(200, body)); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncLists('ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncListPermissions('identity').update(opts); diff --git a/spec/integration/rest/sync/v1/service/syncMap.spec.js b/spec/integration/rest/sync/v1/service/syncMap.spec.js index 1bcf75bcf3..ce25df54c0 100644 --- a/spec/integration/rest/sync/v1/service/syncMap.spec.js +++ b/spec/integration/rest/sync/v1/service/syncMap.spec.js @@ -141,9 +141,7 @@ describe('SyncMap', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Maps')(solution); holodeck.assertHasRequest(new Request({ @@ -196,9 +194,7 @@ describe('SyncMap', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Maps')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js b/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js index 85c309e3d4..6911700f5b 100644 --- a/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js +++ b/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js @@ -137,10 +137,7 @@ describe('SyncMapItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - key: 'key', - data: '{}' - }; + var opts = {key: 'key', data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems.create(opts); @@ -157,10 +154,7 @@ describe('SyncMapItem', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items')(solution); - var values = { - Key: 'key', - Data: serialize.object('{}'), - }; + var values = {Key: 'key', Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -185,10 +179,7 @@ describe('SyncMapItem', function() { holodeck.mock(new Response(201, body)); - var opts = { - key: 'key', - data: '{}' - }; + var opts = {key: 'key', data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems.create(opts); @@ -302,9 +293,7 @@ describe('SyncMapItem', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems('key').update(opts); @@ -322,9 +311,7 @@ describe('SyncMapItem', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Items/<%= key %>')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -349,9 +336,7 @@ describe('SyncMapItem', function() { holodeck.mock(new Response(200, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapItems('key').update(opts); diff --git a/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js b/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js index 5e9278fc8d..6f403cf56a 100644 --- a/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js +++ b/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js @@ -230,11 +230,7 @@ describe('SyncMapPermission', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapPermissions('identity').update(opts); @@ -252,11 +248,7 @@ describe('SyncMapPermission', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Maps/<%= mapSid %>/Permissions/<%= identity %>')(solution); - var values = { - Read: serialize.bool(true), - Write: serialize.bool(true), - Manage: serialize.bool(true), - }; + var values = {Read: serialize.bool(true), Write: serialize.bool(true), Manage: serialize.bool(true),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -279,11 +271,7 @@ describe('SyncMapPermission', function() { holodeck.mock(new Response(200, body)); - var opts = { - read: true, - write: true, - manage: true - }; + var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMaps('MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncMapPermissions('identity').update(opts); diff --git a/spec/integration/rest/sync/v1/service/syncStream.spec.js b/spec/integration/rest/sync/v1/service/syncStream.spec.js index de7e8ba191..7a066c0059 100644 --- a/spec/integration/rest/sync/v1/service/syncStream.spec.js +++ b/spec/integration/rest/sync/v1/service/syncStream.spec.js @@ -139,9 +139,7 @@ describe('SyncStream', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Streams')(solution); holodeck.assertHasRequest(new Request({ @@ -192,9 +190,7 @@ describe('SyncStream', function() { }); promise.done(); - var solution = { - serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {serviceSid: 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Streams')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js b/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js index 016aba2038..0e83e7dc65 100644 --- a/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js +++ b/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js @@ -36,9 +36,7 @@ describe('StreamMessage', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncStreams('TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .streamMessages.create(opts); @@ -55,9 +53,7 @@ describe('StreamMessage', function() { }; var url = _.template('https://sync.twilio.com/v1/Services/<%= serviceSid %>/Streams/<%= streamSid %>/Messages')(solution); - var values = { - Data: serialize.object('{}'), - }; + var values = {Data: serialize.object('{}'),}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -74,9 +70,7 @@ describe('StreamMessage', function() { holodeck.mock(new Response(201, body)); - var opts = { - data: '{}' - }; + var opts = {data: '{}'}; var promise = client.sync.v1.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .syncStreams('TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .streamMessages.create(opts); diff --git a/spec/integration/rest/taskrouter/v1/workspace.spec.js b/spec/integration/rest/taskrouter/v1/workspace.spec.js index 1ac1ebf33f..a8d1f9e71a 100644 --- a/spec/integration/rest/taskrouter/v1/workspace.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace.spec.js @@ -42,9 +42,7 @@ describe('Workspace', function() { }); promise.done(); - var solution = { - sid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -108,9 +106,7 @@ describe('Workspace', function() { }); promise.done(); - var solution = { - sid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -269,9 +265,7 @@ describe('Workspace', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.taskrouter.v1.workspaces.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -282,9 +276,7 @@ describe('Workspace', function() { var url = 'https://taskrouter.twilio.com/v1/Workspaces'; - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -325,9 +317,7 @@ describe('Workspace', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.taskrouter.v1.workspaces.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); @@ -350,9 +340,7 @@ describe('Workspace', function() { }); promise.done(); - var solution = { - sid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js b/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js index 307026d94b..e1a027787f 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js @@ -187,9 +187,7 @@ describe('Activity', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Activities')(solution); holodeck.assertHasRequest(new Request({ @@ -271,9 +269,7 @@ describe('Activity', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.taskrouter.v1.workspaces('WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .activities.create(opts); promise = promise.then(function() { @@ -283,14 +279,10 @@ describe('Activity', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Activities')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -313,9 +305,7 @@ describe('Activity', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.taskrouter.v1.workspaces('WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .activities.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/taskrouter/v1/workspace/event.spec.js b/spec/integration/rest/taskrouter/v1/workspace/event.spec.js index 0961d349c9..062b8e03a9 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/event.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/event.spec.js @@ -110,9 +110,7 @@ describe('Event', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Events')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/task.spec.js b/spec/integration/rest/taskrouter/v1/workspace/task.spec.js index f8821a4519..39ca7c8588 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/task.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/task.spec.js @@ -221,9 +221,7 @@ describe('Task', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Tasks')(solution); holodeck.assertHasRequest(new Request({ @@ -357,9 +355,7 @@ describe('Task', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Tasks')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js index 199b196f13..541bd3919e 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js @@ -94,9 +94,7 @@ describe('TaskChannel', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/TaskChannels')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js index ad27ee76c7..23769cf527 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js @@ -175,9 +175,7 @@ describe('TaskQueue', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/TaskQueues')(solution); holodeck.assertHasRequest(new Request({ @@ -286,9 +284,7 @@ describe('TaskQueue', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/TaskQueues')(solution); var values = { diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js index 0e97e54d2d..4faf67ffeb 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js @@ -44,9 +44,7 @@ describe('TaskQueuesStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/TaskQueues/Statistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js index 0262fc66dc..a74cefb257 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js @@ -43,9 +43,7 @@ describe('Worker', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workers')(solution); holodeck.assertHasRequest(new Request({ @@ -140,9 +138,7 @@ describe('Worker', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.taskrouter.v1.workspaces('WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .workers.create(opts); promise = promise.then(function() { @@ -152,14 +148,10 @@ describe('Worker', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workers')(solution); - var values = { - FriendlyName: 'friendlyName', - }; + var values = {FriendlyName: 'friendlyName',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -197,9 +189,7 @@ describe('Worker', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName' - }; + var opts = {friendlyName: 'friendlyName'}; var promise = client.taskrouter.v1.workspaces('WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .workers.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js index 59e83f5f87..483e0a8687 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js @@ -44,9 +44,7 @@ describe('WorkersCumulativeStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workers/CumulativeStatistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js index 8a2a27e2c3..c5b833f7f6 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js @@ -44,9 +44,7 @@ describe('WorkersRealTimeStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workers/RealTimeStatistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js index 510e303e0d..fa3159f1ab 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js @@ -44,9 +44,7 @@ describe('WorkersStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workers/Statistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js index 95b10fd4f1..bd121544be 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js @@ -205,9 +205,7 @@ describe('Workflow', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workflows')(solution); holodeck.assertHasRequest(new Request({ @@ -298,10 +296,7 @@ describe('Workflow', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - friendlyName: 'friendlyName', - configuration: 'configuration' - }; + var opts = {friendlyName: 'friendlyName', configuration: 'configuration'}; var promise = client.taskrouter.v1.workspaces('WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .workflows.create(opts); promise = promise.then(function() { @@ -311,15 +306,10 @@ describe('Workflow', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Workflows')(solution); - var values = { - FriendlyName: 'friendlyName', - Configuration: 'configuration', - }; + var values = {FriendlyName: 'friendlyName', Configuration: 'configuration',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -351,10 +341,7 @@ describe('Workflow', function() { holodeck.mock(new Response(201, body)); - var opts = { - friendlyName: 'friendlyName', - configuration: 'configuration' - }; + var opts = {friendlyName: 'friendlyName', configuration: 'configuration'}; var promise = client.taskrouter.v1.workspaces('WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .workflows.create(opts); promise = promise.then(function(response) { diff --git a/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js index 8375b60e8d..5c670e7f6a 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js @@ -43,9 +43,7 @@ describe('WorkspaceCumulativeStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/CumulativeStatistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js index 3a449523dc..d7dd569eff 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js @@ -43,9 +43,7 @@ describe('WorkspaceRealTimeStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/RealTimeStatistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js index 7d29e38a39..4d0025969d 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js @@ -43,9 +43,7 @@ describe('WorkspaceStatistics', function() { }); promise.done(); - var solution = { - workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {workspaceSid: 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://taskrouter.twilio.com/v1/Workspaces/<%= workspaceSid %>/Statistics')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/trunking/v1/trunk.spec.js b/spec/integration/rest/trunking/v1/trunk.spec.js index b48e7bd009..78749ad67a 100644 --- a/spec/integration/rest/trunking/v1/trunk.spec.js +++ b/spec/integration/rest/trunking/v1/trunk.spec.js @@ -42,9 +42,7 @@ describe('Trunk', function() { }); promise.done(); - var solution = { - sid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -104,9 +102,7 @@ describe('Trunk', function() { }); promise.done(); - var solution = { - sid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -301,9 +297,7 @@ describe('Trunk', function() { }); promise.done(); - var solution = { - sid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js b/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js index 4f58d8a221..396a7357ee 100644 --- a/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js @@ -126,9 +126,7 @@ describe('CredentialList', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.trunking.v1.trunks('TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .credentialsLists.create(opts); promise = promise.then(function() { @@ -138,14 +136,10 @@ describe('CredentialList', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/CredentialLists')(solution); - var values = { - CredentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {CredentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -167,9 +161,7 @@ describe('CredentialList', function() { holodeck.mock(new Response(201, body)); - var opts = { - credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {credentialListSid: 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.trunking.v1.trunks('TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .credentialsLists.create(opts); promise = promise.then(function(response) { @@ -194,9 +186,7 @@ describe('CredentialList', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/CredentialLists')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js b/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js index c03b962ef2..e1f3bd1117 100644 --- a/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js @@ -126,9 +126,7 @@ describe('IpAccessControlList', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.trunking.v1.trunks('TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .ipAccessControlLists.create(opts); promise = promise.then(function() { @@ -138,14 +136,10 @@ describe('IpAccessControlList', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/IpAccessControlLists')(solution); - var values = { - IpAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {IpAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -167,9 +161,7 @@ describe('IpAccessControlList', function() { holodeck.mock(new Response(201, body)); - var opts = { - ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {ipAccessControlListSid: 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.trunking.v1.trunks('TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .ipAccessControlLists.create(opts); promise = promise.then(function(response) { @@ -194,9 +186,7 @@ describe('IpAccessControlList', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/IpAccessControlLists')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js b/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js index e36c04903a..d2d560168f 100644 --- a/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js @@ -148,9 +148,7 @@ describe('OriginationUrl', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/OriginationUrls')(solution); var values = { @@ -216,9 +214,7 @@ describe('OriginationUrl', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/OriginationUrls')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js b/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js index e62782270b..42959166f2 100644 --- a/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js @@ -151,9 +151,7 @@ describe('PhoneNumber', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.trunking.v1.trunks('TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function() { @@ -163,14 +161,10 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/PhoneNumbers')(solution); - var values = { - PhoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', - }; + var values = {PhoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -217,9 +211,7 @@ describe('PhoneNumber', function() { holodeck.mock(new Response(201, body)); - var opts = { - phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var opts = {phoneNumberSid: 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var promise = client.trunking.v1.trunks('TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') .phoneNumbers.create(opts); promise = promise.then(function(response) { @@ -244,9 +236,7 @@ describe('PhoneNumber', function() { }); promise.done(); - var solution = { - trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {trunkSid: 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://trunking.twilio.com/v1/Trunks/<%= trunkSid %>/PhoneNumbers')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/video/v1/recording.spec.js b/spec/integration/rest/video/v1/recording.spec.js index a0b00ebe22..a3dedb5073 100644 --- a/spec/integration/rest/video/v1/recording.spec.js +++ b/spec/integration/rest/video/v1/recording.spec.js @@ -42,9 +42,7 @@ describe('Recording', function() { }); promise.done(); - var solution = { - sid: 'RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://video.twilio.com/v1/Recordings/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -194,9 +192,7 @@ describe('Recording', function() { }); promise.done(); - var solution = { - sid: 'RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://video.twilio.com/v1/Recordings/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/video/v1/room.spec.js b/spec/integration/rest/video/v1/room.spec.js index 367496f569..9757233b61 100644 --- a/spec/integration/rest/video/v1/room.spec.js +++ b/spec/integration/rest/video/v1/room.spec.js @@ -42,9 +42,7 @@ describe('Room', function() { }); promise.done(); - var solution = { - sid: 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://video.twilio.com/v1/Rooms/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -251,9 +249,7 @@ describe('Room', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - status: 'in-progress' - }; + var opts = {status: 'in-progress'}; var promise = client.video.v1.rooms('RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function() { throw new Error('failed'); @@ -262,14 +258,10 @@ describe('Room', function() { }); promise.done(); - var solution = { - sid: 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://video.twilio.com/v1/Rooms/<%= sid %>')(solution); - var values = { - Status: 'in-progress', - }; + var values = {Status: 'in-progress',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -305,9 +297,7 @@ describe('Room', function() { holodeck.mock(new Response(200, body)); - var opts = { - status: 'in-progress' - }; + var opts = {status: 'in-progress'}; var promise = client.video.v1.rooms('RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa').update(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); diff --git a/spec/integration/rest/video/v1/room/recording.spec.js b/spec/integration/rest/video/v1/room/recording.spec.js index ea6f8e207f..36ffb1a366 100644 --- a/spec/integration/rest/video/v1/room/recording.spec.js +++ b/spec/integration/rest/video/v1/room/recording.spec.js @@ -104,9 +104,7 @@ describe('RoomRecording', function() { }); promise.done(); - var solution = { - roomSid: 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {roomSid: 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://video.twilio.com/v1/Rooms/<%= roomSid %>/Recordings')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/wireless/v1/command.spec.js b/spec/integration/rest/wireless/v1/command.spec.js index 0001e1304c..145cd8c778 100644 --- a/spec/integration/rest/wireless/v1/command.spec.js +++ b/spec/integration/rest/wireless/v1/command.spec.js @@ -42,9 +42,7 @@ describe('Command', function() { }); promise.done(); - var solution = { - sid: 'DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/Commands/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -171,9 +169,7 @@ describe('Command', function() { function() { holodeck.mock(new Response(500, '{}')); - var opts = { - command: 'command' - }; + var opts = {command: 'command'}; var promise = client.wireless.v1.commands.create(opts); promise = promise.then(function() { throw new Error('failed'); @@ -184,9 +180,7 @@ describe('Command', function() { var url = 'https://wireless.twilio.com/v1/Commands'; - var values = { - Command: 'command', - }; + var values = {Command: 'command',}; holodeck.assertHasRequest(new Request({ method: 'POST', url: url, @@ -211,9 +205,7 @@ describe('Command', function() { holodeck.mock(new Response(201, body)); - var opts = { - command: 'command' - }; + var opts = {command: 'command'}; var promise = client.wireless.v1.commands.create(opts); promise = promise.then(function(response) { expect(response).toBeDefined(); diff --git a/spec/integration/rest/wireless/v1/ratePlan.spec.js b/spec/integration/rest/wireless/v1/ratePlan.spec.js index 6ab0eaa66c..7810b20e22 100644 --- a/spec/integration/rest/wireless/v1/ratePlan.spec.js +++ b/spec/integration/rest/wireless/v1/ratePlan.spec.js @@ -139,9 +139,7 @@ describe('RatePlan', function() { }); promise.done(); - var solution = { - sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/RatePlans/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -256,9 +254,7 @@ describe('RatePlan', function() { }); promise.done(); - var solution = { - sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/RatePlans/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -316,9 +312,7 @@ describe('RatePlan', function() { }); promise.done(); - var solution = { - sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/RatePlans/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/wireless/v1/sim.spec.js b/spec/integration/rest/wireless/v1/sim.spec.js index 007291622a..bea38f1773 100644 --- a/spec/integration/rest/wireless/v1/sim.spec.js +++ b/spec/integration/rest/wireless/v1/sim.spec.js @@ -42,9 +42,7 @@ describe('Sim', function() { }); promise.done(); - var solution = { - sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/Sims/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ @@ -213,9 +211,7 @@ describe('Sim', function() { }); promise.done(); - var solution = { - sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {sid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/Sims/<%= sid %>')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/wireless/v1/sim/dataSession.spec.js b/spec/integration/rest/wireless/v1/sim/dataSession.spec.js index 4006576b55..4f96797279 100644 --- a/spec/integration/rest/wireless/v1/sim/dataSession.spec.js +++ b/spec/integration/rest/wireless/v1/sim/dataSession.spec.js @@ -43,9 +43,7 @@ describe('DataSession', function() { }); promise.done(); - var solution = { - simSid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {simSid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/Sims/<%= simSid %>/DataSessions')(solution); holodeck.assertHasRequest(new Request({ diff --git a/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js b/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js index 0887a9c061..fb8411b324 100644 --- a/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js +++ b/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js @@ -43,9 +43,7 @@ describe('UsageRecord', function() { }); promise.done(); - var solution = { - simSid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }; + var solution = {simSid: 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}; var url = _.template('https://wireless.twilio.com/v1/Sims/<%= simSid %>/UsageRecords')(solution); holodeck.assertHasRequest(new Request({