twilio 3.71.3 → 3.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/rest/Conversations.d.ts +2 -0
- package/lib/rest/Conversations.js +9 -0
- package/lib/rest/Insights.d.ts +4 -0
- package/lib/rest/Insights.js +16 -0
- package/lib/rest/Supersim.d.ts +2 -0
- package/lib/rest/Supersim.js +9 -0
- package/lib/rest/Voice.d.ts +2 -0
- package/lib/rest/Voice.js +9 -0
- package/lib/rest/accounts/v1/credential/aws.js +4 -2
- package/lib/rest/accounts/v1/credential/publicKey.js +4 -2
- package/lib/rest/api/v2010/account/address/dependentPhoneNumber.js +2 -0
- package/lib/rest/api/v2010/account/address.js +14 -12
- package/lib/rest/api/v2010/account/application.js +2 -0
- package/lib/rest/api/v2010/account/authorizedConnectApp.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/local.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/machineToMachine.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/national.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/sharedCost.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber/voip.js +2 -0
- package/lib/rest/api/v2010/account/availablePhoneNumber.js +2 -0
- package/lib/rest/api/v2010/account/call/event.js +2 -0
- package/lib/rest/api/v2010/account/call/feedback.js +2 -2
- package/lib/rest/api/v2010/account/call/feedbackSummary.js +4 -4
- package/lib/rest/api/v2010/account/call/notification.js +2 -0
- package/lib/rest/api/v2010/account/call/payment.js +8 -8
- package/lib/rest/api/v2010/account/call/recording.js +4 -2
- package/lib/rest/api/v2010/account/call/siprec.js +2 -2
- package/lib/rest/api/v2010/account/call/stream.d.ts +776 -0
- package/lib/rest/api/v2010/account/call/stream.js +810 -0
- package/lib/rest/api/v2010/account/call.d.ts +7 -0
- package/lib/rest/api/v2010/account/call.js +34 -4
- package/lib/rest/api/v2010/account/conference/participant.js +6 -4
- package/lib/rest/api/v2010/account/conference/recording.js +4 -2
- package/lib/rest/api/v2010/account/conference.js +2 -0
- package/lib/rest/api/v2010/account/connectApp.js +2 -0
- package/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js +2 -0
- package/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js +4 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +4 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +4 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +4 -2
- package/lib/rest/api/v2010/account/incomingPhoneNumber.js +2 -0
- package/lib/rest/api/v2010/account/key.js +2 -0
- package/lib/rest/api/v2010/account/message/media.js +2 -0
- package/lib/rest/api/v2010/account/message.d.ts +9 -1
- package/lib/rest/api/v2010/account/message.js +19 -4
- package/lib/rest/api/v2010/account/notification.js +2 -0
- package/lib/rest/api/v2010/account/outgoingCallerId.js +2 -0
- package/lib/rest/api/v2010/account/queue/member.js +4 -2
- package/lib/rest/api/v2010/account/queue.js +4 -2
- package/lib/rest/api/v2010/account/recording/addOnResult/payload.js +2 -0
- package/lib/rest/api/v2010/account/recording/addOnResult.js +2 -0
- package/lib/rest/api/v2010/account/recording/transcription.js +2 -0
- package/lib/rest/api/v2010/account/recording.js +2 -0
- package/lib/rest/api/v2010/account/shortCode.js +2 -0
- package/lib/rest/api/v2010/account/signingKey.js +2 -0
- package/lib/rest/api/v2010/account/sip/credentialList/credential.js +6 -4
- package/lib/rest/api/v2010/account/sip/credentialList.js +6 -4
- package/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.js +4 -2
- package/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.js +4 -2
- package/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.js +4 -2
- package/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js +4 -2
- package/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js +4 -2
- package/lib/rest/api/v2010/account/sip/domain.js +4 -2
- package/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js +6 -4
- package/lib/rest/api/v2010/account/sip/ipAccessControlList.js +6 -4
- package/lib/rest/api/v2010/account/transcription.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/allTime.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/daily.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/lastMonth.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/monthly.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/thisMonth.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/today.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/yearly.js +2 -0
- package/lib/rest/api/v2010/account/usage/record/yesterday.js +2 -0
- package/lib/rest/api/v2010/account/usage/record.js +2 -0
- package/lib/rest/api/v2010/account/usage/trigger.js +8 -6
- package/lib/rest/api/v2010/account/validationRequest.js +2 -2
- package/lib/rest/api/v2010/account.js +2 -0
- package/lib/rest/autopilot/v1/assistant/fieldType/fieldValue.js +6 -4
- package/lib/rest/autopilot/v1/assistant/fieldType.js +4 -2
- package/lib/rest/autopilot/v1/assistant/modelBuild.js +2 -0
- package/lib/rest/autopilot/v1/assistant/query.js +6 -4
- package/lib/rest/autopilot/v1/assistant/task/field.js +6 -4
- package/lib/rest/autopilot/v1/assistant/task/sample.js +6 -4
- package/lib/rest/autopilot/v1/assistant/task.js +4 -2
- package/lib/rest/autopilot/v1/assistant/webhook.js +8 -6
- package/lib/rest/autopilot/v1/assistant.js +2 -0
- package/lib/rest/autopilot/v1/restoreAssistant.js +2 -2
- package/lib/rest/bulkexports/v1/export/day.js +2 -0
- package/lib/rest/bulkexports/v1/export/exportCustomJob.js +8 -6
- package/lib/rest/chat/v1/credential.js +4 -2
- package/lib/rest/chat/v1/service/channel/invite.js +4 -2
- package/lib/rest/chat/v1/service/channel/member.js +4 -2
- package/lib/rest/chat/v1/service/channel/message.js +4 -2
- package/lib/rest/chat/v1/service/channel.js +2 -0
- package/lib/rest/chat/v1/service/role.js +10 -8
- package/lib/rest/chat/v1/service/user/userChannel.js +2 -0
- package/lib/rest/chat/v1/service/user.js +4 -2
- package/lib/rest/chat/v1/service.js +4 -2
- package/lib/rest/chat/v2/credential.js +4 -2
- package/lib/rest/chat/v2/service/binding.js +2 -0
- package/lib/rest/chat/v2/service/channel/invite.js +4 -2
- package/lib/rest/chat/v2/service/channel/member.js +4 -2
- package/lib/rest/chat/v2/service/channel/message.js +2 -0
- package/lib/rest/chat/v2/service/channel/webhook.js +4 -2
- package/lib/rest/chat/v2/service/channel.js +2 -0
- package/lib/rest/chat/v2/service/role.js +10 -8
- package/lib/rest/chat/v2/service/user/userBinding.js +2 -0
- package/lib/rest/chat/v2/service/user/userChannel.js +2 -0
- package/lib/rest/chat/v2/service/user.js +4 -2
- package/lib/rest/chat/v2/service.js +4 -2
- package/lib/rest/conversations/V1.d.ts +3 -0
- package/lib/rest/conversations/V1.js +13 -0
- package/lib/rest/conversations/v1/addressConfiguration.d.ts +397 -0
- package/lib/rest/conversations/v1/addressConfiguration.js +802 -0
- package/lib/rest/conversations/v1/conversation/message/deliveryReceipt.js +2 -0
- package/lib/rest/conversations/v1/conversation/message.js +2 -0
- package/lib/rest/conversations/v1/conversation/participant.js +2 -0
- package/lib/rest/conversations/v1/conversation/webhook.js +4 -2
- package/lib/rest/conversations/v1/conversation.js +2 -0
- package/lib/rest/conversations/v1/credential.js +4 -2
- package/lib/rest/conversations/v1/participantConversation.js +2 -0
- package/lib/rest/conversations/v1/role.js +10 -8
- package/lib/rest/conversations/v1/service/binding.js +2 -0
- package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +2 -2
- package/lib/rest/conversations/v1/service/configuration/webhook.js +6 -5
- package/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.js +2 -0
- package/lib/rest/conversations/v1/service/conversation/message.js +2 -0
- package/lib/rest/conversations/v1/service/conversation/participant.js +2 -0
- package/lib/rest/conversations/v1/service/conversation/webhook.js +4 -2
- package/lib/rest/conversations/v1/service/conversation.js +2 -0
- package/lib/rest/conversations/v1/service/participantConversation.js +2 -0
- package/lib/rest/conversations/v1/service/role.js +10 -8
- package/lib/rest/conversations/v1/service/user/userConversation.js +2 -0
- package/lib/rest/conversations/v1/service/user.js +4 -2
- package/lib/rest/conversations/v1/service.js +4 -2
- package/lib/rest/conversations/v1/user/userConversation.js +2 -0
- package/lib/rest/conversations/v1/user.js +4 -2
- package/lib/rest/events/v1/eventType.js +2 -0
- package/lib/rest/events/v1/schema/version.js +2 -0
- package/lib/rest/events/v1/sink/sinkValidate.js +2 -2
- package/lib/rest/events/v1/sink.js +10 -8
- package/lib/rest/events/v1/subscription/subscribedEvent.js +4 -2
- package/lib/rest/events/v1/subscription.js +8 -6
- package/lib/rest/fax/v1/fax/faxMedia.js +2 -0
- package/lib/rest/fax/v1/fax.d.ts +1 -68
- package/lib/rest/fax/v1/fax.js +2 -123
- package/lib/rest/flexApi/v1/channel.js +10 -8
- package/lib/rest/flexApi/v1/flexFlow.d.ts +2 -2
- package/lib/rest/flexApi/v1/flexFlow.js +11 -9
- package/lib/rest/flexApi/v1/webChannel.js +10 -8
- package/lib/rest/insights/V1.d.ts +6 -0
- package/lib/rest/insights/V1.js +22 -0
- package/lib/rest/insights/v1/call/event.js +2 -0
- package/lib/rest/insights/v1/call/metric.js +2 -0
- package/lib/rest/insights/v1/callSummaries.js +2 -0
- package/lib/rest/insights/v1/conference/conferenceParticipant.d.ts +383 -0
- package/lib/rest/insights/v1/conference/conferenceParticipant.js +671 -0
- package/lib/rest/insights/v1/conference.d.ts +391 -0
- package/lib/rest/insights/v1/conference.js +683 -0
- package/lib/rest/insights/v1/room/participant.js +2 -0
- package/lib/rest/insights/v1/room.js +2 -0
- package/lib/rest/insights/v1/setting.d.ts +181 -0
- package/lib/rest/insights/v1/setting.js +384 -0
- package/lib/rest/ipMessaging/v1/credential.js +4 -2
- package/lib/rest/ipMessaging/v1/service/channel/invite.js +4 -2
- package/lib/rest/ipMessaging/v1/service/channel/member.js +4 -2
- package/lib/rest/ipMessaging/v1/service/channel/message.js +4 -2
- package/lib/rest/ipMessaging/v1/service/channel.js +2 -0
- package/lib/rest/ipMessaging/v1/service/role.js +10 -8
- package/lib/rest/ipMessaging/v1/service/user/userChannel.js +2 -0
- package/lib/rest/ipMessaging/v1/service/user.js +4 -2
- package/lib/rest/ipMessaging/v1/service.js +4 -2
- package/lib/rest/ipMessaging/v2/credential.js +4 -2
- package/lib/rest/ipMessaging/v2/service/binding.js +2 -0
- package/lib/rest/ipMessaging/v2/service/channel/invite.js +4 -2
- package/lib/rest/ipMessaging/v2/service/channel/member.js +4 -2
- package/lib/rest/ipMessaging/v2/service/channel/message.js +2 -0
- package/lib/rest/ipMessaging/v2/service/channel/webhook.js +4 -2
- package/lib/rest/ipMessaging/v2/service/channel.js +2 -0
- package/lib/rest/ipMessaging/v2/service/role.js +10 -8
- package/lib/rest/ipMessaging/v2/service/user/userBinding.js +2 -0
- package/lib/rest/ipMessaging/v2/service/user/userChannel.js +2 -0
- package/lib/rest/ipMessaging/v2/service/user.js +4 -2
- package/lib/rest/ipMessaging/v2/service.js +4 -2
- package/lib/rest/media/v1/mediaProcessor.d.ts +4 -0
- package/lib/rest/media/v1/mediaProcessor.js +13 -7
- package/lib/rest/media/v1/playerStreamer.js +4 -2
- package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +4 -2
- package/lib/rest/messaging/v1/brandRegistration.d.ts +14 -0
- package/lib/rest/messaging/v1/brandRegistration.js +55 -4
- package/lib/rest/messaging/v1/externalCampaign.js +4 -4
- package/lib/rest/messaging/v1/service/alphaSender.js +4 -2
- package/lib/rest/messaging/v1/service/phoneNumber.js +4 -2
- package/lib/rest/messaging/v1/service/shortCode.js +4 -2
- package/lib/rest/messaging/v1/service/usAppToPerson.js +14 -12
- package/lib/rest/messaging/v1/service.js +4 -2
- package/lib/rest/monitor/v1/alert.js +2 -0
- package/lib/rest/monitor/v1/event.js +2 -0
- package/lib/rest/notify/v1/credential.js +4 -2
- package/lib/rest/notify/v1/service/binding.js +8 -6
- package/lib/rest/notify/v1/service.js +2 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +154 -1
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +244 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js +2 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js +4 -2
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +2 -2
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +41 -1
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +49 -4
- package/lib/rest/numbers/v2/regulatoryCompliance/endUser.js +6 -4
- package/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js +2 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/regulation.js +2 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js +6 -4
- package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js +2 -0
- package/lib/rest/preview/bulk_exports/export/day.js +2 -0
- package/lib/rest/preview/bulk_exports/export/exportCustomJob.js +8 -6
- package/lib/rest/preview/deployed_devices/fleet/certificate.js +4 -2
- package/lib/rest/preview/deployed_devices/fleet/deployment.js +2 -0
- package/lib/rest/preview/deployed_devices/fleet/device.js +2 -0
- package/lib/rest/preview/deployed_devices/fleet/key.js +2 -0
- package/lib/rest/preview/deployed_devices/fleet.js +2 -0
- package/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.js +2 -0
- package/lib/rest/preview/hosted_numbers/authorizationDocument.js +12 -10
- package/lib/rest/preview/hosted_numbers/hostedNumberOrder.js +6 -4
- package/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js +2 -0
- package/lib/rest/preview/marketplace/availableAddOn.js +2 -0
- package/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js +4 -2
- package/lib/rest/preview/marketplace/installedAddOn.js +6 -4
- package/lib/rest/preview/sync/service/document/documentPermission.js +8 -6
- package/lib/rest/preview/sync/service/document.js +4 -2
- package/lib/rest/preview/sync/service/syncList/syncListItem.js +6 -4
- package/lib/rest/preview/sync/service/syncList/syncListPermission.js +8 -6
- package/lib/rest/preview/sync/service/syncList.js +2 -0
- package/lib/rest/preview/sync/service/syncMap/syncMapItem.js +8 -6
- package/lib/rest/preview/sync/service/syncMap/syncMapPermission.js +8 -6
- package/lib/rest/preview/sync/service/syncMap.js +2 -0
- package/lib/rest/preview/sync/service.js +2 -0
- package/lib/rest/preview/trusted_comms/brandedChannel/channel.js +2 -2
- package/lib/rest/preview/understand/assistant/fieldType/fieldValue.js +6 -4
- package/lib/rest/preview/understand/assistant/fieldType.js +4 -2
- package/lib/rest/preview/understand/assistant/modelBuild.js +2 -0
- package/lib/rest/preview/understand/assistant/query.js +6 -4
- package/lib/rest/preview/understand/assistant/task/field.js +6 -4
- package/lib/rest/preview/understand/assistant/task/sample.js +6 -4
- package/lib/rest/preview/understand/assistant/task.js +4 -2
- package/lib/rest/preview/understand/assistant.js +2 -0
- package/lib/rest/preview/wireless/command.js +4 -2
- package/lib/rest/preview/wireless/ratePlan.js +2 -0
- package/lib/rest/preview/wireless/sim.js +2 -0
- package/lib/rest/pricing/v1/messaging/country.js +2 -0
- package/lib/rest/pricing/v1/phoneNumber/country.js +2 -0
- package/lib/rest/pricing/v1/voice/country.js +2 -0
- package/lib/rest/pricing/v2/country.js +2 -0
- package/lib/rest/pricing/v2/voice/country.js +2 -0
- package/lib/rest/proxy/v1/service/phoneNumber.js +2 -0
- package/lib/rest/proxy/v1/service/session/interaction.js +2 -0
- package/lib/rest/proxy/v1/service/session/participant/messageInteraction.js +2 -0
- package/lib/rest/proxy/v1/service/session/participant.js +4 -2
- package/lib/rest/proxy/v1/service/session.js +2 -0
- package/lib/rest/proxy/v1/service/shortCode.js +4 -2
- package/lib/rest/proxy/v1/service.js +4 -2
- package/lib/rest/serverless/v1/service/asset/assetVersion.js +2 -0
- package/lib/rest/serverless/v1/service/asset.js +6 -4
- package/lib/rest/serverless/v1/service/build.js +2 -0
- package/lib/rest/serverless/v1/service/environment/deployment.js +2 -0
- package/lib/rest/serverless/v1/service/environment/log.js +2 -0
- package/lib/rest/serverless/v1/service/environment/variable.js +6 -4
- package/lib/rest/serverless/v1/service/environment.js +4 -2
- package/lib/rest/serverless/v1/service/function/functionVersion.js +2 -0
- package/lib/rest/serverless/v1/service/function.js +6 -4
- package/lib/rest/serverless/v1/service.js +6 -4
- package/lib/rest/studio/v1/flow/engagement/step.js +2 -0
- package/lib/rest/studio/v1/flow/engagement.js +6 -4
- package/lib/rest/studio/v1/flow/execution/executionStep.js +2 -0
- package/lib/rest/studio/v1/flow/execution.js +8 -6
- package/lib/rest/studio/v1/flow.js +2 -0
- package/lib/rest/studio/v2/flow/execution/executionStep.js +2 -0
- package/lib/rest/studio/v2/flow/execution.js +8 -6
- package/lib/rest/studio/v2/flow/flowRevision.js +2 -0
- package/lib/rest/studio/v2/flow/testUser.js +2 -2
- package/lib/rest/studio/v2/flow.js +10 -8
- package/lib/rest/studio/v2/flowValidate.js +6 -6
- package/lib/rest/supersim/V1.d.ts +3 -0
- package/lib/rest/supersim/V1.js +12 -0
- package/lib/rest/supersim/v1/command.js +6 -4
- package/lib/rest/supersim/v1/esimProfile.d.ts +344 -0
- package/lib/rest/supersim/v1/esimProfile.js +664 -0
- package/lib/rest/supersim/v1/fleet.d.ts +17 -5
- package/lib/rest/supersim/v1/fleet.js +36 -22
- package/lib/rest/supersim/v1/ipCommand.js +8 -6
- package/lib/rest/supersim/v1/network.js +2 -0
- package/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.js +4 -2
- package/lib/rest/supersim/v1/networkAccessProfile.js +2 -0
- package/lib/rest/supersim/v1/sim/billingPeriod.js +2 -0
- package/lib/rest/supersim/v1/sim.js +6 -4
- package/lib/rest/supersim/v1/smsCommand.js +6 -4
- package/lib/rest/supersim/v1/usageRecord.js +2 -0
- package/lib/rest/sync/v1/service/document/documentPermission.js +8 -6
- package/lib/rest/sync/v1/service/document.js +2 -0
- package/lib/rest/sync/v1/service/syncList/syncListItem.js +4 -2
- package/lib/rest/sync/v1/service/syncList/syncListPermission.js +8 -6
- package/lib/rest/sync/v1/service/syncList.js +2 -0
- package/lib/rest/sync/v1/service/syncMap/syncMapItem.js +6 -4
- package/lib/rest/sync/v1/service/syncMap/syncMapPermission.js +8 -6
- package/lib/rest/sync/v1/service/syncMap.js +2 -0
- package/lib/rest/sync/v1/service/syncStream/streamMessage.js +2 -2
- package/lib/rest/sync/v1/service/syncStream.js +2 -0
- package/lib/rest/sync/v1/service.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/activity.js +4 -2
- package/lib/rest/taskrouter/v1/workspace/event.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/task.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/taskChannel.js +6 -4
- package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue.js +4 -2
- package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js +2 -0
- package/lib/rest/taskrouter/v1/workspace/worker.js +4 -2
- package/lib/rest/taskrouter/v1/workspace/workflow.js +6 -4
- package/lib/rest/taskrouter/v1/workspace.js +4 -2
- package/lib/rest/trunking/v1/trunk/credentialList.js +4 -2
- package/lib/rest/trunking/v1/trunk/ipAccessControlList.js +4 -2
- package/lib/rest/trunking/v1/trunk/originationUrl.js +12 -10
- package/lib/rest/trunking/v1/trunk/phoneNumber.js +4 -2
- package/lib/rest/trunking/v1/trunk.js +2 -0
- package/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.js +6 -4
- package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js +4 -2
- package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.js +4 -2
- package/lib/rest/trusthub/v1/customerProfiles.js +8 -6
- package/lib/rest/trusthub/v1/endUser.js +6 -4
- package/lib/rest/trusthub/v1/endUserType.js +2 -0
- package/lib/rest/trusthub/v1/policies.js +2 -0
- package/lib/rest/trusthub/v1/supportingDocument.js +6 -4
- package/lib/rest/trusthub/v1/supportingDocumentType.js +2 -0
- package/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.js +6 -4
- package/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js +4 -2
- package/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.js +4 -2
- package/lib/rest/trusthub/v1/trustProducts.js +8 -6
- package/lib/rest/verify/v2/service/accessToken.d.ts +62 -4
- package/lib/rest/verify/v2/service/accessToken.js +159 -11
- package/lib/rest/verify/v2/service/entity/challenge.js +4 -2
- package/lib/rest/verify/v2/service/entity/factor.js +2 -0
- package/lib/rest/verify/v2/service/entity/newFactor.js +4 -4
- package/lib/rest/verify/v2/service/entity.js +4 -2
- package/lib/rest/verify/v2/service/messagingConfiguration.js +8 -6
- package/lib/rest/verify/v2/service/rateLimit/bucket.js +6 -4
- package/lib/rest/verify/v2/service/rateLimit.js +4 -2
- package/lib/rest/verify/v2/service/verification.js +6 -6
- package/lib/rest/verify/v2/service/verificationCheck.js +2 -2
- package/lib/rest/verify/v2/service/webhook.js +8 -6
- package/lib/rest/verify/v2/service.js +4 -2
- package/lib/rest/verify/v2/template.js +3 -1
- package/lib/rest/verify/v2/verificationAttempt.d.ts +50 -10
- package/lib/rest/verify/v2/verificationAttempt.js +61 -15
- package/lib/rest/video/v1/composition.d.ts +2 -0
- package/lib/rest/video/v1/composition.js +7 -2
- package/lib/rest/video/v1/compositionHook.js +6 -4
- package/lib/rest/video/v1/compositionSettings.js +2 -2
- package/lib/rest/video/v1/recording.d.ts +2 -0
- package/lib/rest/video/v1/recording.js +5 -0
- package/lib/rest/video/v1/recordingSettings.js +2 -2
- package/lib/rest/video/v1/room/recording.d.ts +2 -0
- package/lib/rest/video/v1/room/recording.js +5 -0
- package/lib/rest/video/v1/room/roomParticipant/roomParticipantPublishedTrack.js +2 -0
- package/lib/rest/video/v1/room/roomParticipant/roomParticipantSubscribedTrack.js +2 -0
- package/lib/rest/video/v1/room/roomParticipant.js +2 -0
- package/lib/rest/video/v1/room.d.ts +8 -0
- package/lib/rest/video/v1/room.js +17 -3
- package/lib/rest/voice/V1.d.ts +3 -0
- package/lib/rest/voice/V1.js +12 -0
- package/lib/rest/voice/v1/archivedCall.d.ts +136 -0
- package/lib/rest/voice/v1/archivedCall.js +325 -0
- package/lib/rest/voice/v1/byocTrunk.js +2 -0
- package/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js +4 -2
- package/lib/rest/voice/v1/connectionPolicy.js +2 -0
- package/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js +2 -2
- package/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js +2 -0
- package/lib/rest/voice/v1/dialingPermissions/country.js +2 -0
- package/lib/rest/voice/v1/ipRecord.js +4 -2
- package/lib/rest/voice/v1/sourceIpMapping.js +8 -6
- package/lib/rest/wireless/v1/command.js +4 -2
- package/lib/rest/wireless/v1/ratePlan.js +2 -0
- package/lib/rest/wireless/v1/sim/dataSession.js +2 -0
- package/lib/rest/wireless/v1/sim/usageRecord.js +2 -0
- package/lib/rest/wireless/v1/sim.js +6 -8
- package/lib/rest/wireless/v1/usageRecord.js +2 -0
- package/package.json +3 -3
- package/CHANGES.md +0 -2517
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* jshint ignore:start */
|
|
4
|
+
/**
|
|
5
|
+
* This code was generated by
|
|
6
|
+
* \ / _ _ _| _ _
|
|
7
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
8
|
+
* / /
|
|
9
|
+
*/
|
|
10
|
+
/* jshint ignore:end */
|
|
11
|
+
|
|
12
|
+
var Q = require('q'); /* jshint ignore:line */
|
|
13
|
+
var _ = require('lodash'); /* jshint ignore:line */
|
|
14
|
+
var util = require('util'); /* jshint ignore:line */
|
|
15
|
+
var Page = require('../../../base/Page'); /* jshint ignore:line */
|
|
16
|
+
var deserialize = require(
|
|
17
|
+
'../../../base/deserialize'); /* jshint ignore:line */
|
|
18
|
+
var serialize = require('../../../base/serialize'); /* jshint ignore:line */
|
|
19
|
+
var values = require('../../../base/values'); /* jshint ignore:line */
|
|
20
|
+
|
|
21
|
+
var AddressConfigurationList;
|
|
22
|
+
var AddressConfigurationPage;
|
|
23
|
+
var AddressConfigurationInstance;
|
|
24
|
+
var AddressConfigurationContext;
|
|
25
|
+
|
|
26
|
+
/* jshint ignore:start */
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the AddressConfigurationList
|
|
29
|
+
*
|
|
30
|
+
* @constructor Twilio.Conversations.V1.AddressConfigurationList
|
|
31
|
+
*
|
|
32
|
+
* @param {Twilio.Conversations.V1} version - Version of the resource
|
|
33
|
+
*/
|
|
34
|
+
/* jshint ignore:end */
|
|
35
|
+
AddressConfigurationList = function AddressConfigurationList(version) {
|
|
36
|
+
/* jshint ignore:start */
|
|
37
|
+
/**
|
|
38
|
+
* @function addressConfigurations
|
|
39
|
+
* @memberof Twilio.Conversations.V1#
|
|
40
|
+
*
|
|
41
|
+
* @param {string} sid - sid of instance
|
|
42
|
+
*
|
|
43
|
+
* @returns {Twilio.Conversations.V1.AddressConfigurationContext}
|
|
44
|
+
*/
|
|
45
|
+
/* jshint ignore:end */
|
|
46
|
+
function AddressConfigurationListInstance(sid) {
|
|
47
|
+
return AddressConfigurationListInstance.get(sid);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
AddressConfigurationListInstance._version = version;
|
|
51
|
+
// Path Solution
|
|
52
|
+
AddressConfigurationListInstance._solution = {};
|
|
53
|
+
AddressConfigurationListInstance._uri = `/Configuration/Addresses`;
|
|
54
|
+
/* jshint ignore:start */
|
|
55
|
+
/**
|
|
56
|
+
* Streams AddressConfigurationInstance records from the API.
|
|
57
|
+
*
|
|
58
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
59
|
+
* is reached.
|
|
60
|
+
*
|
|
61
|
+
* The results are passed into the callback function, so this operation is memory
|
|
62
|
+
* efficient.
|
|
63
|
+
*
|
|
64
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
65
|
+
* function.
|
|
66
|
+
*
|
|
67
|
+
* @function each
|
|
68
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
69
|
+
*
|
|
70
|
+
* @param {object} [opts] - Options for request
|
|
71
|
+
* @param {number} [opts.limit] -
|
|
72
|
+
* Upper limit for the number of records to return.
|
|
73
|
+
* each() guarantees never to return more than limit.
|
|
74
|
+
* Default is no limit
|
|
75
|
+
* @param {number} [opts.pageSize] -
|
|
76
|
+
* Number of records to fetch per request,
|
|
77
|
+
* when not set will use the default value of 50 records.
|
|
78
|
+
* If no pageSize is defined but a limit is defined,
|
|
79
|
+
* each() will attempt to read the limit with the most efficient
|
|
80
|
+
* page size, i.e. min(limit, 1000)
|
|
81
|
+
* @param {Function} [opts.callback] -
|
|
82
|
+
* Function to process each record. If this and a positional
|
|
83
|
+
* callback are passed, this one will be used
|
|
84
|
+
* @param {Function} [opts.done] -
|
|
85
|
+
* Function to be called upon completion of streaming
|
|
86
|
+
* @param {Function} [callback] - Function to process each record
|
|
87
|
+
*/
|
|
88
|
+
/* jshint ignore:end */
|
|
89
|
+
AddressConfigurationListInstance.each = function each(opts, callback) {
|
|
90
|
+
if (_.isFunction(opts)) {
|
|
91
|
+
callback = opts;
|
|
92
|
+
opts = {};
|
|
93
|
+
}
|
|
94
|
+
opts = opts || {};
|
|
95
|
+
if (opts.callback) {
|
|
96
|
+
callback = opts.callback;
|
|
97
|
+
}
|
|
98
|
+
if (_.isUndefined(callback)) {
|
|
99
|
+
throw new Error('Callback function must be provided');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var done = false;
|
|
103
|
+
var currentPage = 1;
|
|
104
|
+
var currentResource = 0;
|
|
105
|
+
var limits = this._version.readLimits({
|
|
106
|
+
limit: opts.limit,
|
|
107
|
+
pageSize: opts.pageSize
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
function onComplete(error) {
|
|
111
|
+
done = true;
|
|
112
|
+
if (_.isFunction(opts.done)) {
|
|
113
|
+
opts.done(error);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function fetchNextPage(fn) {
|
|
118
|
+
var promise = fn();
|
|
119
|
+
if (_.isUndefined(promise)) {
|
|
120
|
+
onComplete();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
promise.then(function(page) {
|
|
125
|
+
_.each(page.instances, function(instance) {
|
|
126
|
+
if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) {
|
|
127
|
+
done = true;
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
currentResource++;
|
|
132
|
+
callback(instance, onComplete);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
if (!done) {
|
|
136
|
+
currentPage++;
|
|
137
|
+
fetchNextPage(_.bind(page.nextPage, page));
|
|
138
|
+
} else {
|
|
139
|
+
onComplete();
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
promise.catch(onComplete);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
fetchNextPage(_.bind(this.page, this, _.merge(opts, limits)));
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/* jshint ignore:start */
|
|
150
|
+
/**
|
|
151
|
+
* Lists AddressConfigurationInstance records from the API as a list.
|
|
152
|
+
*
|
|
153
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
154
|
+
* function.
|
|
155
|
+
*
|
|
156
|
+
* @function list
|
|
157
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
158
|
+
*
|
|
159
|
+
* @param {object} [opts] - Options for request
|
|
160
|
+
* @param {number} [opts.limit] -
|
|
161
|
+
* Upper limit for the number of records to return.
|
|
162
|
+
* list() guarantees never to return more than limit.
|
|
163
|
+
* Default is no limit
|
|
164
|
+
* @param {number} [opts.pageSize] -
|
|
165
|
+
* Number of records to fetch per request,
|
|
166
|
+
* when not set will use the default value of 50 records.
|
|
167
|
+
* If no page_size is defined but a limit is defined,
|
|
168
|
+
* list() will attempt to read the limit with the most
|
|
169
|
+
* efficient page size, i.e. min(limit, 1000)
|
|
170
|
+
* @param {function} [callback] - Callback to handle list of records
|
|
171
|
+
*
|
|
172
|
+
* @returns {Promise} Resolves to a list of records
|
|
173
|
+
*/
|
|
174
|
+
/* jshint ignore:end */
|
|
175
|
+
AddressConfigurationListInstance.list = function list(opts, callback) {
|
|
176
|
+
if (_.isFunction(opts)) {
|
|
177
|
+
callback = opts;
|
|
178
|
+
opts = {};
|
|
179
|
+
}
|
|
180
|
+
opts = opts || {};
|
|
181
|
+
var deferred = Q.defer();
|
|
182
|
+
var allResources = [];
|
|
183
|
+
opts.callback = function(resource, done) {
|
|
184
|
+
allResources.push(resource);
|
|
185
|
+
|
|
186
|
+
if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) {
|
|
187
|
+
done();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
opts.done = function(error) {
|
|
192
|
+
if (_.isUndefined(error)) {
|
|
193
|
+
deferred.resolve(allResources);
|
|
194
|
+
} else {
|
|
195
|
+
deferred.reject(error);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
if (_.isFunction(callback)) {
|
|
200
|
+
deferred.promise.nodeify(callback);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
this.each(opts);
|
|
204
|
+
return deferred.promise;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/* jshint ignore:start */
|
|
208
|
+
/**
|
|
209
|
+
* Retrieve a single page of AddressConfigurationInstance records from the API.
|
|
210
|
+
*
|
|
211
|
+
* The request is executed immediately.
|
|
212
|
+
*
|
|
213
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
214
|
+
* function.
|
|
215
|
+
*
|
|
216
|
+
* @function page
|
|
217
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
218
|
+
*
|
|
219
|
+
* @param {object} [opts] - Options for request
|
|
220
|
+
* @param {string} [opts.pageToken] - PageToken provided by the API
|
|
221
|
+
* @param {number} [opts.pageNumber] -
|
|
222
|
+
* Page Number, this value is simply for client state
|
|
223
|
+
* @param {number} [opts.pageSize] - Number of records to return, defaults to 50
|
|
224
|
+
* @param {function} [callback] - Callback to handle list of records
|
|
225
|
+
*
|
|
226
|
+
* @returns {Promise} Resolves to a list of records
|
|
227
|
+
*/
|
|
228
|
+
/* jshint ignore:end */
|
|
229
|
+
AddressConfigurationListInstance.page = function page(opts, callback) {
|
|
230
|
+
if (_.isFunction(opts)) {
|
|
231
|
+
callback = opts;
|
|
232
|
+
opts = {};
|
|
233
|
+
}
|
|
234
|
+
opts = opts || {};
|
|
235
|
+
|
|
236
|
+
var deferred = Q.defer();
|
|
237
|
+
var data = values.of({
|
|
238
|
+
'PageToken': opts.pageToken,
|
|
239
|
+
'Page': opts.pageNumber,
|
|
240
|
+
'PageSize': opts.pageSize
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
var promise = this._version.page({uri: this._uri, method: 'GET', params: data});
|
|
244
|
+
|
|
245
|
+
promise = promise.then(function(payload) {
|
|
246
|
+
deferred.resolve(new AddressConfigurationPage(this._version, payload, this._solution));
|
|
247
|
+
}.bind(this));
|
|
248
|
+
|
|
249
|
+
promise.catch(function(error) {
|
|
250
|
+
deferred.reject(error);
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
if (_.isFunction(callback)) {
|
|
254
|
+
deferred.promise.nodeify(callback);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return deferred.promise;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/* jshint ignore:start */
|
|
261
|
+
/**
|
|
262
|
+
* Retrieve a single target page of AddressConfigurationInstance records from the
|
|
263
|
+
* API.
|
|
264
|
+
*
|
|
265
|
+
* The request is executed immediately.
|
|
266
|
+
*
|
|
267
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
268
|
+
* function.
|
|
269
|
+
*
|
|
270
|
+
* @function getPage
|
|
271
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
272
|
+
*
|
|
273
|
+
* @param {string} [targetUrl] - API-generated URL for the requested results page
|
|
274
|
+
* @param {function} [callback] - Callback to handle list of records
|
|
275
|
+
*
|
|
276
|
+
* @returns {Promise} Resolves to a list of records
|
|
277
|
+
*/
|
|
278
|
+
/* jshint ignore:end */
|
|
279
|
+
AddressConfigurationListInstance.getPage = function getPage(targetUrl, callback)
|
|
280
|
+
{
|
|
281
|
+
var deferred = Q.defer();
|
|
282
|
+
|
|
283
|
+
var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});
|
|
284
|
+
|
|
285
|
+
promise = promise.then(function(payload) {
|
|
286
|
+
deferred.resolve(new AddressConfigurationPage(this._version, payload, this._solution));
|
|
287
|
+
}.bind(this));
|
|
288
|
+
|
|
289
|
+
promise.catch(function(error) {
|
|
290
|
+
deferred.reject(error);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
if (_.isFunction(callback)) {
|
|
294
|
+
deferred.promise.nodeify(callback);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return deferred.promise;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
/* jshint ignore:start */
|
|
301
|
+
/**
|
|
302
|
+
* create a AddressConfigurationInstance
|
|
303
|
+
*
|
|
304
|
+
* @function create
|
|
305
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
306
|
+
*
|
|
307
|
+
* @param {object} opts - Options for request
|
|
308
|
+
* @param {address_configuration.type} opts.type - Type of Address.
|
|
309
|
+
* @param {string} opts.address - The unique address to be configured.
|
|
310
|
+
* @param {string} [opts.friendlyName] -
|
|
311
|
+
* The human-readable name of this configuration.
|
|
312
|
+
* @param {boolean} [opts.autoCreation.enabled] -
|
|
313
|
+
* Enable/Disable auto-creating conversations for messages to this address
|
|
314
|
+
* @param {address_configuration.auto_creation_type} [opts.autoCreation.type] -
|
|
315
|
+
* Type of Auto Creation.
|
|
316
|
+
* @param {string} [opts.autoCreation.conversationServiceSid] -
|
|
317
|
+
* Conversation Service for the auto-created conversation.
|
|
318
|
+
* @param {string} [opts.autoCreation.webhookUrl] -
|
|
319
|
+
* For type `webhook`, the url for the webhook request.
|
|
320
|
+
* @param {address_configuration.method} [opts.autoCreation.webhookMethod] -
|
|
321
|
+
* For type `webhook`, the HTTP method to be used when sending a webhook request.
|
|
322
|
+
* @param {string|list} [opts.autoCreation.webhookFilters] -
|
|
323
|
+
* The list of events, firing webhook event for this Conversation.
|
|
324
|
+
* @param {string} [opts.autoCreation.studioFlowSid] -
|
|
325
|
+
* For type `studio`, the studio flow SID, where the webhook should be sent to.
|
|
326
|
+
* @param {number} [opts.autoCreation.studioRetryCount] -
|
|
327
|
+
* For type `studio`, number of times to retry the webhook request
|
|
328
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
329
|
+
*
|
|
330
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
331
|
+
*/
|
|
332
|
+
/* jshint ignore:end */
|
|
333
|
+
AddressConfigurationListInstance.create = function create(opts, callback) {
|
|
334
|
+
if (_.isUndefined(opts)) {
|
|
335
|
+
throw new Error('Required parameter "opts" missing.');
|
|
336
|
+
}
|
|
337
|
+
if (_.isUndefined(opts['type'])) {
|
|
338
|
+
throw new Error('Required parameter "opts[\'type\']" missing.');
|
|
339
|
+
}
|
|
340
|
+
if (_.isUndefined(opts['address'])) {
|
|
341
|
+
throw new Error('Required parameter "opts[\'address\']" missing.');
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
var deferred = Q.defer();
|
|
345
|
+
var data = values.of({
|
|
346
|
+
'Type': _.get(opts, 'type'),
|
|
347
|
+
'Address': _.get(opts, 'address'),
|
|
348
|
+
'FriendlyName': _.get(opts, 'friendlyName'),
|
|
349
|
+
'AutoCreation.Enabled': serialize.bool(_.get(opts, 'autoCreation.enabled')),
|
|
350
|
+
'AutoCreation.Type': _.get(opts, 'autoCreation.type'),
|
|
351
|
+
'AutoCreation.ConversationServiceSid': _.get(opts, 'autoCreation.conversationServiceSid'),
|
|
352
|
+
'AutoCreation.WebhookUrl': _.get(opts, 'autoCreation.webhookUrl'),
|
|
353
|
+
'AutoCreation.WebhookMethod': _.get(opts, 'autoCreation.webhookMethod'),
|
|
354
|
+
'AutoCreation.WebhookFilters': serialize.map(_.get(opts, 'autoCreation.webhookFilters'), function(e) { return e; }),
|
|
355
|
+
'AutoCreation.StudioFlowSid': _.get(opts, 'autoCreation.studioFlowSid'),
|
|
356
|
+
'AutoCreation.StudioRetryCount': _.get(opts, 'autoCreation.studioRetryCount')
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
360
|
+
|
|
361
|
+
promise = promise.then(function(payload) {
|
|
362
|
+
deferred.resolve(new AddressConfigurationInstance(this._version, payload, this._solution.sid));
|
|
363
|
+
}.bind(this));
|
|
364
|
+
|
|
365
|
+
promise.catch(function(error) {
|
|
366
|
+
deferred.reject(error);
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
if (_.isFunction(callback)) {
|
|
370
|
+
deferred.promise.nodeify(callback);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return deferred.promise;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
/* jshint ignore:start */
|
|
377
|
+
/**
|
|
378
|
+
* Constructs a address_configuration
|
|
379
|
+
*
|
|
380
|
+
* @function get
|
|
381
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
382
|
+
*
|
|
383
|
+
* @param {string} sid - The SID or Address of the Configuration.
|
|
384
|
+
*
|
|
385
|
+
* @returns {Twilio.Conversations.V1.AddressConfigurationContext}
|
|
386
|
+
*/
|
|
387
|
+
/* jshint ignore:end */
|
|
388
|
+
AddressConfigurationListInstance.get = function get(sid) {
|
|
389
|
+
return new AddressConfigurationContext(this._version, sid);
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
/* jshint ignore:start */
|
|
393
|
+
/**
|
|
394
|
+
* Provide a user-friendly representation
|
|
395
|
+
*
|
|
396
|
+
* @function toJSON
|
|
397
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationList#
|
|
398
|
+
*
|
|
399
|
+
* @returns Object
|
|
400
|
+
*/
|
|
401
|
+
/* jshint ignore:end */
|
|
402
|
+
AddressConfigurationListInstance.toJSON = function toJSON() {
|
|
403
|
+
return this._solution;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
AddressConfigurationListInstance[util.inspect.custom] = function inspect(depth,
|
|
407
|
+
options) {
|
|
408
|
+
return util.inspect(this.toJSON(), options);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
return AddressConfigurationListInstance;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
/* jshint ignore:start */
|
|
416
|
+
/**
|
|
417
|
+
* Initialize the AddressConfigurationPage
|
|
418
|
+
*
|
|
419
|
+
* @constructor Twilio.Conversations.V1.AddressConfigurationPage
|
|
420
|
+
*
|
|
421
|
+
* @param {V1} version - Version of the resource
|
|
422
|
+
* @param {Response<string>} response - Response from the API
|
|
423
|
+
* @param {AddressConfigurationSolution} solution - Path solution
|
|
424
|
+
*
|
|
425
|
+
* @returns AddressConfigurationPage
|
|
426
|
+
*/
|
|
427
|
+
/* jshint ignore:end */
|
|
428
|
+
AddressConfigurationPage = function AddressConfigurationPage(version, response,
|
|
429
|
+
solution) {
|
|
430
|
+
// Path Solution
|
|
431
|
+
this._solution = solution;
|
|
432
|
+
|
|
433
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
_.extend(AddressConfigurationPage.prototype, Page.prototype);
|
|
437
|
+
AddressConfigurationPage.prototype.constructor = AddressConfigurationPage;
|
|
438
|
+
|
|
439
|
+
/* jshint ignore:start */
|
|
440
|
+
/**
|
|
441
|
+
* Build an instance of AddressConfigurationInstance
|
|
442
|
+
*
|
|
443
|
+
* @function getInstance
|
|
444
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationPage#
|
|
445
|
+
*
|
|
446
|
+
* @param {AddressConfigurationPayload} payload - Payload response from the API
|
|
447
|
+
*
|
|
448
|
+
* @returns AddressConfigurationInstance
|
|
449
|
+
*/
|
|
450
|
+
/* jshint ignore:end */
|
|
451
|
+
AddressConfigurationPage.prototype.getInstance = function getInstance(payload) {
|
|
452
|
+
return new AddressConfigurationInstance(this._version, payload);
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
/* jshint ignore:start */
|
|
456
|
+
/**
|
|
457
|
+
* Provide a user-friendly representation
|
|
458
|
+
*
|
|
459
|
+
* @function toJSON
|
|
460
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationPage#
|
|
461
|
+
*
|
|
462
|
+
* @returns Object
|
|
463
|
+
*/
|
|
464
|
+
/* jshint ignore:end */
|
|
465
|
+
AddressConfigurationPage.prototype.toJSON = function toJSON() {
|
|
466
|
+
let clone = {};
|
|
467
|
+
_.forOwn(this, function(value, key) {
|
|
468
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
469
|
+
clone[key] = value;
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return clone;
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
AddressConfigurationPage.prototype[util.inspect.custom] = function
|
|
476
|
+
inspect(depth, options) {
|
|
477
|
+
return util.inspect(this.toJSON(), options);
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
/* jshint ignore:start */
|
|
482
|
+
/**
|
|
483
|
+
* Initialize the AddressConfigurationContext
|
|
484
|
+
*
|
|
485
|
+
* @constructor Twilio.Conversations.V1.AddressConfigurationInstance
|
|
486
|
+
*
|
|
487
|
+
* @property {string} sid -
|
|
488
|
+
* A 34 character string that uniquely identifies this resource.
|
|
489
|
+
* @property {string} accountSid -
|
|
490
|
+
* The unique ID of the Account the address belongs to.
|
|
491
|
+
* @property {string} type - Type of Address, value can be `whatsapp` or `sms`.
|
|
492
|
+
* @property {string} address - The unique address to be configured.
|
|
493
|
+
* @property {string} friendlyName - The human-readable name of this configuration.
|
|
494
|
+
* @property {object} autoCreation - Auto Creation configuration for the address.
|
|
495
|
+
* @property {Date} dateCreated - The date that this resource was created.
|
|
496
|
+
* @property {Date} dateUpdated - The date that this resource was last updated.
|
|
497
|
+
* @property {string} url - An absolute URL for this address configuration.
|
|
498
|
+
*
|
|
499
|
+
* @param {V1} version - Version of the resource
|
|
500
|
+
* @param {AddressConfigurationPayload} payload - The instance payload
|
|
501
|
+
* @param {sid_like} sid - The SID or Address of the Configuration.
|
|
502
|
+
*/
|
|
503
|
+
/* jshint ignore:end */
|
|
504
|
+
AddressConfigurationInstance = function AddressConfigurationInstance(version,
|
|
505
|
+
payload, sid) {
|
|
506
|
+
this._version = version;
|
|
507
|
+
|
|
508
|
+
// Marshaled Properties
|
|
509
|
+
this.sid = payload.sid; // jshint ignore:line
|
|
510
|
+
this.accountSid = payload.account_sid; // jshint ignore:line
|
|
511
|
+
this.type = payload.type; // jshint ignore:line
|
|
512
|
+
this.address = payload.address; // jshint ignore:line
|
|
513
|
+
this.friendlyName = payload.friendly_name; // jshint ignore:line
|
|
514
|
+
this.autoCreation = payload.auto_creation; // jshint ignore:line
|
|
515
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
|
|
516
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
|
|
517
|
+
this.url = payload.url; // jshint ignore:line
|
|
518
|
+
|
|
519
|
+
// Context
|
|
520
|
+
this._context = undefined;
|
|
521
|
+
this._solution = {sid: sid || this.sid, };
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
Object.defineProperty(AddressConfigurationInstance.prototype,
|
|
525
|
+
'_proxy', {
|
|
526
|
+
get: function() {
|
|
527
|
+
if (!this._context) {
|
|
528
|
+
this._context = new AddressConfigurationContext(this._version, this._solution.sid);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return this._context;
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
/* jshint ignore:start */
|
|
536
|
+
/**
|
|
537
|
+
* fetch a AddressConfigurationInstance
|
|
538
|
+
*
|
|
539
|
+
* @function fetch
|
|
540
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationInstance#
|
|
541
|
+
*
|
|
542
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
543
|
+
*
|
|
544
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
545
|
+
*/
|
|
546
|
+
/* jshint ignore:end */
|
|
547
|
+
AddressConfigurationInstance.prototype.fetch = function fetch(callback) {
|
|
548
|
+
return this._proxy.fetch(callback);
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
/* jshint ignore:start */
|
|
552
|
+
/**
|
|
553
|
+
* update a AddressConfigurationInstance
|
|
554
|
+
*
|
|
555
|
+
* @function update
|
|
556
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationInstance#
|
|
557
|
+
*
|
|
558
|
+
* @param {object} [opts] - Options for request
|
|
559
|
+
* @param {string} [opts.friendlyName] -
|
|
560
|
+
* The human-readable name of this configuration.
|
|
561
|
+
* @param {boolean} [opts.autoCreation.enabled] -
|
|
562
|
+
* Enable/Disable auto-creating conversations for messages to this address
|
|
563
|
+
* @param {address_configuration.auto_creation_type} [opts.autoCreation.type] -
|
|
564
|
+
* Type of Auto Creation.
|
|
565
|
+
* @param {string} [opts.autoCreation.conversationServiceSid] -
|
|
566
|
+
* Conversation Service for the auto-created conversation.
|
|
567
|
+
* @param {string} [opts.autoCreation.webhookUrl] -
|
|
568
|
+
* For type `webhook`, the url for the webhook request.
|
|
569
|
+
* @param {address_configuration.method} [opts.autoCreation.webhookMethod] -
|
|
570
|
+
* For type `webhook`, the HTTP method to be used when sending a webhook request.
|
|
571
|
+
* @param {string|list} [opts.autoCreation.webhookFilters] -
|
|
572
|
+
* The list of events, firing webhook event for this Conversation.
|
|
573
|
+
* @param {string} [opts.autoCreation.studioFlowSid] -
|
|
574
|
+
* For type `studio`, the studio flow SID, where the webhook should be sent to.
|
|
575
|
+
* @param {number} [opts.autoCreation.studioRetryCount] -
|
|
576
|
+
* For type `studio`, number of times to retry the webhook request
|
|
577
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
578
|
+
*
|
|
579
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
580
|
+
*/
|
|
581
|
+
/* jshint ignore:end */
|
|
582
|
+
AddressConfigurationInstance.prototype.update = function update(opts, callback)
|
|
583
|
+
{
|
|
584
|
+
return this._proxy.update(opts, callback);
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
/* jshint ignore:start */
|
|
588
|
+
/**
|
|
589
|
+
* remove a AddressConfigurationInstance
|
|
590
|
+
*
|
|
591
|
+
* @function remove
|
|
592
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationInstance#
|
|
593
|
+
*
|
|
594
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
595
|
+
*
|
|
596
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
597
|
+
*/
|
|
598
|
+
/* jshint ignore:end */
|
|
599
|
+
AddressConfigurationInstance.prototype.remove = function remove(callback) {
|
|
600
|
+
return this._proxy.remove(callback);
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
/* jshint ignore:start */
|
|
604
|
+
/**
|
|
605
|
+
* Provide a user-friendly representation
|
|
606
|
+
*
|
|
607
|
+
* @function toJSON
|
|
608
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationInstance#
|
|
609
|
+
*
|
|
610
|
+
* @returns Object
|
|
611
|
+
*/
|
|
612
|
+
/* jshint ignore:end */
|
|
613
|
+
AddressConfigurationInstance.prototype.toJSON = function toJSON() {
|
|
614
|
+
let clone = {};
|
|
615
|
+
_.forOwn(this, function(value, key) {
|
|
616
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
617
|
+
clone[key] = value;
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
return clone;
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
AddressConfigurationInstance.prototype[util.inspect.custom] = function
|
|
624
|
+
inspect(depth, options) {
|
|
625
|
+
return util.inspect(this.toJSON(), options);
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
/* jshint ignore:start */
|
|
630
|
+
/**
|
|
631
|
+
* Initialize the AddressConfigurationContext
|
|
632
|
+
*
|
|
633
|
+
* @constructor Twilio.Conversations.V1.AddressConfigurationContext
|
|
634
|
+
*
|
|
635
|
+
* @param {V1} version - Version of the resource
|
|
636
|
+
* @param {sid_like} sid - The SID or Address of the Configuration.
|
|
637
|
+
*/
|
|
638
|
+
/* jshint ignore:end */
|
|
639
|
+
AddressConfigurationContext = function AddressConfigurationContext(version, sid)
|
|
640
|
+
{
|
|
641
|
+
this._version = version;
|
|
642
|
+
|
|
643
|
+
// Path Solution
|
|
644
|
+
this._solution = {sid: sid, };
|
|
645
|
+
this._uri = `/Configuration/Addresses/${sid}`;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
/* jshint ignore:start */
|
|
649
|
+
/**
|
|
650
|
+
* fetch a AddressConfigurationInstance
|
|
651
|
+
*
|
|
652
|
+
* @function fetch
|
|
653
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationContext#
|
|
654
|
+
*
|
|
655
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
656
|
+
*
|
|
657
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
658
|
+
*/
|
|
659
|
+
/* jshint ignore:end */
|
|
660
|
+
AddressConfigurationContext.prototype.fetch = function fetch(callback) {
|
|
661
|
+
var deferred = Q.defer();
|
|
662
|
+
var promise = this._version.fetch({uri: this._uri, method: 'GET'});
|
|
663
|
+
|
|
664
|
+
promise = promise.then(function(payload) {
|
|
665
|
+
deferred.resolve(new AddressConfigurationInstance(this._version, payload, this._solution.sid));
|
|
666
|
+
}.bind(this));
|
|
667
|
+
|
|
668
|
+
promise.catch(function(error) {
|
|
669
|
+
deferred.reject(error);
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
if (_.isFunction(callback)) {
|
|
673
|
+
deferred.promise.nodeify(callback);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
return deferred.promise;
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
/* jshint ignore:start */
|
|
680
|
+
/**
|
|
681
|
+
* update a AddressConfigurationInstance
|
|
682
|
+
*
|
|
683
|
+
* @function update
|
|
684
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationContext#
|
|
685
|
+
*
|
|
686
|
+
* @param {object} [opts] - Options for request
|
|
687
|
+
* @param {string} [opts.friendlyName] -
|
|
688
|
+
* The human-readable name of this configuration.
|
|
689
|
+
* @param {boolean} [opts.autoCreation.enabled] -
|
|
690
|
+
* Enable/Disable auto-creating conversations for messages to this address
|
|
691
|
+
* @param {address_configuration.auto_creation_type} [opts.autoCreation.type] -
|
|
692
|
+
* Type of Auto Creation.
|
|
693
|
+
* @param {string} [opts.autoCreation.conversationServiceSid] -
|
|
694
|
+
* Conversation Service for the auto-created conversation.
|
|
695
|
+
* @param {string} [opts.autoCreation.webhookUrl] -
|
|
696
|
+
* For type `webhook`, the url for the webhook request.
|
|
697
|
+
* @param {address_configuration.method} [opts.autoCreation.webhookMethod] -
|
|
698
|
+
* For type `webhook`, the HTTP method to be used when sending a webhook request.
|
|
699
|
+
* @param {string|list} [opts.autoCreation.webhookFilters] -
|
|
700
|
+
* The list of events, firing webhook event for this Conversation.
|
|
701
|
+
* @param {string} [opts.autoCreation.studioFlowSid] -
|
|
702
|
+
* For type `studio`, the studio flow SID, where the webhook should be sent to.
|
|
703
|
+
* @param {number} [opts.autoCreation.studioRetryCount] -
|
|
704
|
+
* For type `studio`, number of times to retry the webhook request
|
|
705
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
706
|
+
*
|
|
707
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
708
|
+
*/
|
|
709
|
+
/* jshint ignore:end */
|
|
710
|
+
AddressConfigurationContext.prototype.update = function update(opts, callback) {
|
|
711
|
+
if (_.isFunction(opts)) {
|
|
712
|
+
callback = opts;
|
|
713
|
+
opts = {};
|
|
714
|
+
}
|
|
715
|
+
opts = opts || {};
|
|
716
|
+
|
|
717
|
+
var deferred = Q.defer();
|
|
718
|
+
var data = values.of({
|
|
719
|
+
'FriendlyName': _.get(opts, 'friendlyName'),
|
|
720
|
+
'AutoCreation.Enabled': serialize.bool(_.get(opts, 'autoCreation.enabled')),
|
|
721
|
+
'AutoCreation.Type': _.get(opts, 'autoCreation.type'),
|
|
722
|
+
'AutoCreation.ConversationServiceSid': _.get(opts, 'autoCreation.conversationServiceSid'),
|
|
723
|
+
'AutoCreation.WebhookUrl': _.get(opts, 'autoCreation.webhookUrl'),
|
|
724
|
+
'AutoCreation.WebhookMethod': _.get(opts, 'autoCreation.webhookMethod'),
|
|
725
|
+
'AutoCreation.WebhookFilters': serialize.map(_.get(opts, 'autoCreation.webhookFilters'), function(e) { return e; }),
|
|
726
|
+
'AutoCreation.StudioFlowSid': _.get(opts, 'autoCreation.studioFlowSid'),
|
|
727
|
+
'AutoCreation.StudioRetryCount': _.get(opts, 'autoCreation.studioRetryCount')
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
|
|
731
|
+
|
|
732
|
+
promise = promise.then(function(payload) {
|
|
733
|
+
deferred.resolve(new AddressConfigurationInstance(this._version, payload, this._solution.sid));
|
|
734
|
+
}.bind(this));
|
|
735
|
+
|
|
736
|
+
promise.catch(function(error) {
|
|
737
|
+
deferred.reject(error);
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
if (_.isFunction(callback)) {
|
|
741
|
+
deferred.promise.nodeify(callback);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
return deferred.promise;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
/* jshint ignore:start */
|
|
748
|
+
/**
|
|
749
|
+
* remove a AddressConfigurationInstance
|
|
750
|
+
*
|
|
751
|
+
* @function remove
|
|
752
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationContext#
|
|
753
|
+
*
|
|
754
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
755
|
+
*
|
|
756
|
+
* @returns {Promise} Resolves to processed AddressConfigurationInstance
|
|
757
|
+
*/
|
|
758
|
+
/* jshint ignore:end */
|
|
759
|
+
AddressConfigurationContext.prototype.remove = function remove(callback) {
|
|
760
|
+
var deferred = Q.defer();
|
|
761
|
+
var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
|
|
762
|
+
|
|
763
|
+
promise = promise.then(function(payload) {
|
|
764
|
+
deferred.resolve(payload);
|
|
765
|
+
}.bind(this));
|
|
766
|
+
|
|
767
|
+
promise.catch(function(error) {
|
|
768
|
+
deferred.reject(error);
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
if (_.isFunction(callback)) {
|
|
772
|
+
deferred.promise.nodeify(callback);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
return deferred.promise;
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/* jshint ignore:start */
|
|
779
|
+
/**
|
|
780
|
+
* Provide a user-friendly representation
|
|
781
|
+
*
|
|
782
|
+
* @function toJSON
|
|
783
|
+
* @memberof Twilio.Conversations.V1.AddressConfigurationContext#
|
|
784
|
+
*
|
|
785
|
+
* @returns Object
|
|
786
|
+
*/
|
|
787
|
+
/* jshint ignore:end */
|
|
788
|
+
AddressConfigurationContext.prototype.toJSON = function toJSON() {
|
|
789
|
+
return this._solution;
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
AddressConfigurationContext.prototype[util.inspect.custom] = function
|
|
793
|
+
inspect(depth, options) {
|
|
794
|
+
return util.inspect(this.toJSON(), options);
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
module.exports = {
|
|
798
|
+
AddressConfigurationList: AddressConfigurationList,
|
|
799
|
+
AddressConfigurationPage: AddressConfigurationPage,
|
|
800
|
+
AddressConfigurationInstance: AddressConfigurationInstance,
|
|
801
|
+
AddressConfigurationContext: AddressConfigurationContext
|
|
802
|
+
};
|