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.
Files changed (391) hide show
  1. package/README.md +2 -1
  2. package/lib/rest/Conversations.d.ts +2 -0
  3. package/lib/rest/Conversations.js +9 -0
  4. package/lib/rest/Insights.d.ts +4 -0
  5. package/lib/rest/Insights.js +16 -0
  6. package/lib/rest/Supersim.d.ts +2 -0
  7. package/lib/rest/Supersim.js +9 -0
  8. package/lib/rest/Voice.d.ts +2 -0
  9. package/lib/rest/Voice.js +9 -0
  10. package/lib/rest/accounts/v1/credential/aws.js +4 -2
  11. package/lib/rest/accounts/v1/credential/publicKey.js +4 -2
  12. package/lib/rest/api/v2010/account/address/dependentPhoneNumber.js +2 -0
  13. package/lib/rest/api/v2010/account/address.js +14 -12
  14. package/lib/rest/api/v2010/account/application.js +2 -0
  15. package/lib/rest/api/v2010/account/authorizedConnectApp.js +2 -0
  16. package/lib/rest/api/v2010/account/availablePhoneNumber/local.js +2 -0
  17. package/lib/rest/api/v2010/account/availablePhoneNumber/machineToMachine.js +2 -0
  18. package/lib/rest/api/v2010/account/availablePhoneNumber/mobile.js +2 -0
  19. package/lib/rest/api/v2010/account/availablePhoneNumber/national.js +2 -0
  20. package/lib/rest/api/v2010/account/availablePhoneNumber/sharedCost.js +2 -0
  21. package/lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js +2 -0
  22. package/lib/rest/api/v2010/account/availablePhoneNumber/voip.js +2 -0
  23. package/lib/rest/api/v2010/account/availablePhoneNumber.js +2 -0
  24. package/lib/rest/api/v2010/account/call/event.js +2 -0
  25. package/lib/rest/api/v2010/account/call/feedback.js +2 -2
  26. package/lib/rest/api/v2010/account/call/feedbackSummary.js +4 -4
  27. package/lib/rest/api/v2010/account/call/notification.js +2 -0
  28. package/lib/rest/api/v2010/account/call/payment.js +8 -8
  29. package/lib/rest/api/v2010/account/call/recording.js +4 -2
  30. package/lib/rest/api/v2010/account/call/siprec.js +2 -2
  31. package/lib/rest/api/v2010/account/call/stream.d.ts +776 -0
  32. package/lib/rest/api/v2010/account/call/stream.js +810 -0
  33. package/lib/rest/api/v2010/account/call.d.ts +7 -0
  34. package/lib/rest/api/v2010/account/call.js +34 -4
  35. package/lib/rest/api/v2010/account/conference/participant.js +6 -4
  36. package/lib/rest/api/v2010/account/conference/recording.js +4 -2
  37. package/lib/rest/api/v2010/account/conference.js +2 -0
  38. package/lib/rest/api/v2010/account/connectApp.js +2 -0
  39. package/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.js +2 -0
  40. package/lib/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.js +4 -2
  41. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +4 -2
  42. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +4 -2
  43. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +4 -2
  44. package/lib/rest/api/v2010/account/incomingPhoneNumber.js +2 -0
  45. package/lib/rest/api/v2010/account/key.js +2 -0
  46. package/lib/rest/api/v2010/account/message/media.js +2 -0
  47. package/lib/rest/api/v2010/account/message.d.ts +9 -1
  48. package/lib/rest/api/v2010/account/message.js +19 -4
  49. package/lib/rest/api/v2010/account/notification.js +2 -0
  50. package/lib/rest/api/v2010/account/outgoingCallerId.js +2 -0
  51. package/lib/rest/api/v2010/account/queue/member.js +4 -2
  52. package/lib/rest/api/v2010/account/queue.js +4 -2
  53. package/lib/rest/api/v2010/account/recording/addOnResult/payload.js +2 -0
  54. package/lib/rest/api/v2010/account/recording/addOnResult.js +2 -0
  55. package/lib/rest/api/v2010/account/recording/transcription.js +2 -0
  56. package/lib/rest/api/v2010/account/recording.js +2 -0
  57. package/lib/rest/api/v2010/account/shortCode.js +2 -0
  58. package/lib/rest/api/v2010/account/signingKey.js +2 -0
  59. package/lib/rest/api/v2010/account/sip/credentialList/credential.js +6 -4
  60. package/lib/rest/api/v2010/account/sip/credentialList.js +6 -4
  61. package/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.js +4 -2
  62. package/lib/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.js +4 -2
  63. package/lib/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.js +4 -2
  64. package/lib/rest/api/v2010/account/sip/domain/credentialListMapping.js +4 -2
  65. package/lib/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.js +4 -2
  66. package/lib/rest/api/v2010/account/sip/domain.js +4 -2
  67. package/lib/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.js +6 -4
  68. package/lib/rest/api/v2010/account/sip/ipAccessControlList.js +6 -4
  69. package/lib/rest/api/v2010/account/transcription.js +2 -0
  70. package/lib/rest/api/v2010/account/usage/record/allTime.js +2 -0
  71. package/lib/rest/api/v2010/account/usage/record/daily.js +2 -0
  72. package/lib/rest/api/v2010/account/usage/record/lastMonth.js +2 -0
  73. package/lib/rest/api/v2010/account/usage/record/monthly.js +2 -0
  74. package/lib/rest/api/v2010/account/usage/record/thisMonth.js +2 -0
  75. package/lib/rest/api/v2010/account/usage/record/today.js +2 -0
  76. package/lib/rest/api/v2010/account/usage/record/yearly.js +2 -0
  77. package/lib/rest/api/v2010/account/usage/record/yesterday.js +2 -0
  78. package/lib/rest/api/v2010/account/usage/record.js +2 -0
  79. package/lib/rest/api/v2010/account/usage/trigger.js +8 -6
  80. package/lib/rest/api/v2010/account/validationRequest.js +2 -2
  81. package/lib/rest/api/v2010/account.js +2 -0
  82. package/lib/rest/autopilot/v1/assistant/fieldType/fieldValue.js +6 -4
  83. package/lib/rest/autopilot/v1/assistant/fieldType.js +4 -2
  84. package/lib/rest/autopilot/v1/assistant/modelBuild.js +2 -0
  85. package/lib/rest/autopilot/v1/assistant/query.js +6 -4
  86. package/lib/rest/autopilot/v1/assistant/task/field.js +6 -4
  87. package/lib/rest/autopilot/v1/assistant/task/sample.js +6 -4
  88. package/lib/rest/autopilot/v1/assistant/task.js +4 -2
  89. package/lib/rest/autopilot/v1/assistant/webhook.js +8 -6
  90. package/lib/rest/autopilot/v1/assistant.js +2 -0
  91. package/lib/rest/autopilot/v1/restoreAssistant.js +2 -2
  92. package/lib/rest/bulkexports/v1/export/day.js +2 -0
  93. package/lib/rest/bulkexports/v1/export/exportCustomJob.js +8 -6
  94. package/lib/rest/chat/v1/credential.js +4 -2
  95. package/lib/rest/chat/v1/service/channel/invite.js +4 -2
  96. package/lib/rest/chat/v1/service/channel/member.js +4 -2
  97. package/lib/rest/chat/v1/service/channel/message.js +4 -2
  98. package/lib/rest/chat/v1/service/channel.js +2 -0
  99. package/lib/rest/chat/v1/service/role.js +10 -8
  100. package/lib/rest/chat/v1/service/user/userChannel.js +2 -0
  101. package/lib/rest/chat/v1/service/user.js +4 -2
  102. package/lib/rest/chat/v1/service.js +4 -2
  103. package/lib/rest/chat/v2/credential.js +4 -2
  104. package/lib/rest/chat/v2/service/binding.js +2 -0
  105. package/lib/rest/chat/v2/service/channel/invite.js +4 -2
  106. package/lib/rest/chat/v2/service/channel/member.js +4 -2
  107. package/lib/rest/chat/v2/service/channel/message.js +2 -0
  108. package/lib/rest/chat/v2/service/channel/webhook.js +4 -2
  109. package/lib/rest/chat/v2/service/channel.js +2 -0
  110. package/lib/rest/chat/v2/service/role.js +10 -8
  111. package/lib/rest/chat/v2/service/user/userBinding.js +2 -0
  112. package/lib/rest/chat/v2/service/user/userChannel.js +2 -0
  113. package/lib/rest/chat/v2/service/user.js +4 -2
  114. package/lib/rest/chat/v2/service.js +4 -2
  115. package/lib/rest/conversations/V1.d.ts +3 -0
  116. package/lib/rest/conversations/V1.js +13 -0
  117. package/lib/rest/conversations/v1/addressConfiguration.d.ts +397 -0
  118. package/lib/rest/conversations/v1/addressConfiguration.js +802 -0
  119. package/lib/rest/conversations/v1/conversation/message/deliveryReceipt.js +2 -0
  120. package/lib/rest/conversations/v1/conversation/message.js +2 -0
  121. package/lib/rest/conversations/v1/conversation/participant.js +2 -0
  122. package/lib/rest/conversations/v1/conversation/webhook.js +4 -2
  123. package/lib/rest/conversations/v1/conversation.js +2 -0
  124. package/lib/rest/conversations/v1/credential.js +4 -2
  125. package/lib/rest/conversations/v1/participantConversation.js +2 -0
  126. package/lib/rest/conversations/v1/role.js +10 -8
  127. package/lib/rest/conversations/v1/service/binding.js +2 -0
  128. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +2 -2
  129. package/lib/rest/conversations/v1/service/configuration/webhook.js +6 -5
  130. package/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.js +2 -0
  131. package/lib/rest/conversations/v1/service/conversation/message.js +2 -0
  132. package/lib/rest/conversations/v1/service/conversation/participant.js +2 -0
  133. package/lib/rest/conversations/v1/service/conversation/webhook.js +4 -2
  134. package/lib/rest/conversations/v1/service/conversation.js +2 -0
  135. package/lib/rest/conversations/v1/service/participantConversation.js +2 -0
  136. package/lib/rest/conversations/v1/service/role.js +10 -8
  137. package/lib/rest/conversations/v1/service/user/userConversation.js +2 -0
  138. package/lib/rest/conversations/v1/service/user.js +4 -2
  139. package/lib/rest/conversations/v1/service.js +4 -2
  140. package/lib/rest/conversations/v1/user/userConversation.js +2 -0
  141. package/lib/rest/conversations/v1/user.js +4 -2
  142. package/lib/rest/events/v1/eventType.js +2 -0
  143. package/lib/rest/events/v1/schema/version.js +2 -0
  144. package/lib/rest/events/v1/sink/sinkValidate.js +2 -2
  145. package/lib/rest/events/v1/sink.js +10 -8
  146. package/lib/rest/events/v1/subscription/subscribedEvent.js +4 -2
  147. package/lib/rest/events/v1/subscription.js +8 -6
  148. package/lib/rest/fax/v1/fax/faxMedia.js +2 -0
  149. package/lib/rest/fax/v1/fax.d.ts +1 -68
  150. package/lib/rest/fax/v1/fax.js +2 -123
  151. package/lib/rest/flexApi/v1/channel.js +10 -8
  152. package/lib/rest/flexApi/v1/flexFlow.d.ts +2 -2
  153. package/lib/rest/flexApi/v1/flexFlow.js +11 -9
  154. package/lib/rest/flexApi/v1/webChannel.js +10 -8
  155. package/lib/rest/insights/V1.d.ts +6 -0
  156. package/lib/rest/insights/V1.js +22 -0
  157. package/lib/rest/insights/v1/call/event.js +2 -0
  158. package/lib/rest/insights/v1/call/metric.js +2 -0
  159. package/lib/rest/insights/v1/callSummaries.js +2 -0
  160. package/lib/rest/insights/v1/conference/conferenceParticipant.d.ts +383 -0
  161. package/lib/rest/insights/v1/conference/conferenceParticipant.js +671 -0
  162. package/lib/rest/insights/v1/conference.d.ts +391 -0
  163. package/lib/rest/insights/v1/conference.js +683 -0
  164. package/lib/rest/insights/v1/room/participant.js +2 -0
  165. package/lib/rest/insights/v1/room.js +2 -0
  166. package/lib/rest/insights/v1/setting.d.ts +181 -0
  167. package/lib/rest/insights/v1/setting.js +384 -0
  168. package/lib/rest/ipMessaging/v1/credential.js +4 -2
  169. package/lib/rest/ipMessaging/v1/service/channel/invite.js +4 -2
  170. package/lib/rest/ipMessaging/v1/service/channel/member.js +4 -2
  171. package/lib/rest/ipMessaging/v1/service/channel/message.js +4 -2
  172. package/lib/rest/ipMessaging/v1/service/channel.js +2 -0
  173. package/lib/rest/ipMessaging/v1/service/role.js +10 -8
  174. package/lib/rest/ipMessaging/v1/service/user/userChannel.js +2 -0
  175. package/lib/rest/ipMessaging/v1/service/user.js +4 -2
  176. package/lib/rest/ipMessaging/v1/service.js +4 -2
  177. package/lib/rest/ipMessaging/v2/credential.js +4 -2
  178. package/lib/rest/ipMessaging/v2/service/binding.js +2 -0
  179. package/lib/rest/ipMessaging/v2/service/channel/invite.js +4 -2
  180. package/lib/rest/ipMessaging/v2/service/channel/member.js +4 -2
  181. package/lib/rest/ipMessaging/v2/service/channel/message.js +2 -0
  182. package/lib/rest/ipMessaging/v2/service/channel/webhook.js +4 -2
  183. package/lib/rest/ipMessaging/v2/service/channel.js +2 -0
  184. package/lib/rest/ipMessaging/v2/service/role.js +10 -8
  185. package/lib/rest/ipMessaging/v2/service/user/userBinding.js +2 -0
  186. package/lib/rest/ipMessaging/v2/service/user/userChannel.js +2 -0
  187. package/lib/rest/ipMessaging/v2/service/user.js +4 -2
  188. package/lib/rest/ipMessaging/v2/service.js +4 -2
  189. package/lib/rest/media/v1/mediaProcessor.d.ts +4 -0
  190. package/lib/rest/media/v1/mediaProcessor.js +13 -7
  191. package/lib/rest/media/v1/playerStreamer.js +4 -2
  192. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +4 -2
  193. package/lib/rest/messaging/v1/brandRegistration.d.ts +14 -0
  194. package/lib/rest/messaging/v1/brandRegistration.js +55 -4
  195. package/lib/rest/messaging/v1/externalCampaign.js +4 -4
  196. package/lib/rest/messaging/v1/service/alphaSender.js +4 -2
  197. package/lib/rest/messaging/v1/service/phoneNumber.js +4 -2
  198. package/lib/rest/messaging/v1/service/shortCode.js +4 -2
  199. package/lib/rest/messaging/v1/service/usAppToPerson.js +14 -12
  200. package/lib/rest/messaging/v1/service.js +4 -2
  201. package/lib/rest/monitor/v1/alert.js +2 -0
  202. package/lib/rest/monitor/v1/event.js +2 -0
  203. package/lib/rest/notify/v1/credential.js +4 -2
  204. package/lib/rest/notify/v1/service/binding.js +8 -6
  205. package/lib/rest/notify/v1/service.js +2 -0
  206. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +154 -1
  207. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +244 -0
  208. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.js +2 -0
  209. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.js +4 -2
  210. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +2 -2
  211. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +41 -1
  212. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +49 -4
  213. package/lib/rest/numbers/v2/regulatoryCompliance/endUser.js +6 -4
  214. package/lib/rest/numbers/v2/regulatoryCompliance/endUserType.js +2 -0
  215. package/lib/rest/numbers/v2/regulatoryCompliance/regulation.js +2 -0
  216. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.js +6 -4
  217. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.js +2 -0
  218. package/lib/rest/preview/bulk_exports/export/day.js +2 -0
  219. package/lib/rest/preview/bulk_exports/export/exportCustomJob.js +8 -6
  220. package/lib/rest/preview/deployed_devices/fleet/certificate.js +4 -2
  221. package/lib/rest/preview/deployed_devices/fleet/deployment.js +2 -0
  222. package/lib/rest/preview/deployed_devices/fleet/device.js +2 -0
  223. package/lib/rest/preview/deployed_devices/fleet/key.js +2 -0
  224. package/lib/rest/preview/deployed_devices/fleet.js +2 -0
  225. package/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.js +2 -0
  226. package/lib/rest/preview/hosted_numbers/authorizationDocument.js +12 -10
  227. package/lib/rest/preview/hosted_numbers/hostedNumberOrder.js +6 -4
  228. package/lib/rest/preview/marketplace/availableAddOn/availableAddOnExtension.js +2 -0
  229. package/lib/rest/preview/marketplace/availableAddOn.js +2 -0
  230. package/lib/rest/preview/marketplace/installedAddOn/installedAddOnExtension.js +4 -2
  231. package/lib/rest/preview/marketplace/installedAddOn.js +6 -4
  232. package/lib/rest/preview/sync/service/document/documentPermission.js +8 -6
  233. package/lib/rest/preview/sync/service/document.js +4 -2
  234. package/lib/rest/preview/sync/service/syncList/syncListItem.js +6 -4
  235. package/lib/rest/preview/sync/service/syncList/syncListPermission.js +8 -6
  236. package/lib/rest/preview/sync/service/syncList.js +2 -0
  237. package/lib/rest/preview/sync/service/syncMap/syncMapItem.js +8 -6
  238. package/lib/rest/preview/sync/service/syncMap/syncMapPermission.js +8 -6
  239. package/lib/rest/preview/sync/service/syncMap.js +2 -0
  240. package/lib/rest/preview/sync/service.js +2 -0
  241. package/lib/rest/preview/trusted_comms/brandedChannel/channel.js +2 -2
  242. package/lib/rest/preview/understand/assistant/fieldType/fieldValue.js +6 -4
  243. package/lib/rest/preview/understand/assistant/fieldType.js +4 -2
  244. package/lib/rest/preview/understand/assistant/modelBuild.js +2 -0
  245. package/lib/rest/preview/understand/assistant/query.js +6 -4
  246. package/lib/rest/preview/understand/assistant/task/field.js +6 -4
  247. package/lib/rest/preview/understand/assistant/task/sample.js +6 -4
  248. package/lib/rest/preview/understand/assistant/task.js +4 -2
  249. package/lib/rest/preview/understand/assistant.js +2 -0
  250. package/lib/rest/preview/wireless/command.js +4 -2
  251. package/lib/rest/preview/wireless/ratePlan.js +2 -0
  252. package/lib/rest/preview/wireless/sim.js +2 -0
  253. package/lib/rest/pricing/v1/messaging/country.js +2 -0
  254. package/lib/rest/pricing/v1/phoneNumber/country.js +2 -0
  255. package/lib/rest/pricing/v1/voice/country.js +2 -0
  256. package/lib/rest/pricing/v2/country.js +2 -0
  257. package/lib/rest/pricing/v2/voice/country.js +2 -0
  258. package/lib/rest/proxy/v1/service/phoneNumber.js +2 -0
  259. package/lib/rest/proxy/v1/service/session/interaction.js +2 -0
  260. package/lib/rest/proxy/v1/service/session/participant/messageInteraction.js +2 -0
  261. package/lib/rest/proxy/v1/service/session/participant.js +4 -2
  262. package/lib/rest/proxy/v1/service/session.js +2 -0
  263. package/lib/rest/proxy/v1/service/shortCode.js +4 -2
  264. package/lib/rest/proxy/v1/service.js +4 -2
  265. package/lib/rest/serverless/v1/service/asset/assetVersion.js +2 -0
  266. package/lib/rest/serverless/v1/service/asset.js +6 -4
  267. package/lib/rest/serverless/v1/service/build.js +2 -0
  268. package/lib/rest/serverless/v1/service/environment/deployment.js +2 -0
  269. package/lib/rest/serverless/v1/service/environment/log.js +2 -0
  270. package/lib/rest/serverless/v1/service/environment/variable.js +6 -4
  271. package/lib/rest/serverless/v1/service/environment.js +4 -2
  272. package/lib/rest/serverless/v1/service/function/functionVersion.js +2 -0
  273. package/lib/rest/serverless/v1/service/function.js +6 -4
  274. package/lib/rest/serverless/v1/service.js +6 -4
  275. package/lib/rest/studio/v1/flow/engagement/step.js +2 -0
  276. package/lib/rest/studio/v1/flow/engagement.js +6 -4
  277. package/lib/rest/studio/v1/flow/execution/executionStep.js +2 -0
  278. package/lib/rest/studio/v1/flow/execution.js +8 -6
  279. package/lib/rest/studio/v1/flow.js +2 -0
  280. package/lib/rest/studio/v2/flow/execution/executionStep.js +2 -0
  281. package/lib/rest/studio/v2/flow/execution.js +8 -6
  282. package/lib/rest/studio/v2/flow/flowRevision.js +2 -0
  283. package/lib/rest/studio/v2/flow/testUser.js +2 -2
  284. package/lib/rest/studio/v2/flow.js +10 -8
  285. package/lib/rest/studio/v2/flowValidate.js +6 -6
  286. package/lib/rest/supersim/V1.d.ts +3 -0
  287. package/lib/rest/supersim/V1.js +12 -0
  288. package/lib/rest/supersim/v1/command.js +6 -4
  289. package/lib/rest/supersim/v1/esimProfile.d.ts +344 -0
  290. package/lib/rest/supersim/v1/esimProfile.js +664 -0
  291. package/lib/rest/supersim/v1/fleet.d.ts +17 -5
  292. package/lib/rest/supersim/v1/fleet.js +36 -22
  293. package/lib/rest/supersim/v1/ipCommand.js +8 -6
  294. package/lib/rest/supersim/v1/network.js +2 -0
  295. package/lib/rest/supersim/v1/networkAccessProfile/networkAccessProfileNetwork.js +4 -2
  296. package/lib/rest/supersim/v1/networkAccessProfile.js +2 -0
  297. package/lib/rest/supersim/v1/sim/billingPeriod.js +2 -0
  298. package/lib/rest/supersim/v1/sim.js +6 -4
  299. package/lib/rest/supersim/v1/smsCommand.js +6 -4
  300. package/lib/rest/supersim/v1/usageRecord.js +2 -0
  301. package/lib/rest/sync/v1/service/document/documentPermission.js +8 -6
  302. package/lib/rest/sync/v1/service/document.js +2 -0
  303. package/lib/rest/sync/v1/service/syncList/syncListItem.js +4 -2
  304. package/lib/rest/sync/v1/service/syncList/syncListPermission.js +8 -6
  305. package/lib/rest/sync/v1/service/syncList.js +2 -0
  306. package/lib/rest/sync/v1/service/syncMap/syncMapItem.js +6 -4
  307. package/lib/rest/sync/v1/service/syncMap/syncMapPermission.js +8 -6
  308. package/lib/rest/sync/v1/service/syncMap.js +2 -0
  309. package/lib/rest/sync/v1/service/syncStream/streamMessage.js +2 -2
  310. package/lib/rest/sync/v1/service/syncStream.js +2 -0
  311. package/lib/rest/sync/v1/service.js +2 -0
  312. package/lib/rest/taskrouter/v1/workspace/activity.js +4 -2
  313. package/lib/rest/taskrouter/v1/workspace/event.js +2 -0
  314. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +2 -0
  315. package/lib/rest/taskrouter/v1/workspace/task.js +2 -0
  316. package/lib/rest/taskrouter/v1/workspace/taskChannel.js +6 -4
  317. package/lib/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.js +2 -0
  318. package/lib/rest/taskrouter/v1/workspace/taskQueue.js +4 -2
  319. package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +2 -0
  320. package/lib/rest/taskrouter/v1/workspace/worker/workerChannel.js +2 -0
  321. package/lib/rest/taskrouter/v1/workspace/worker.js +4 -2
  322. package/lib/rest/taskrouter/v1/workspace/workflow.js +6 -4
  323. package/lib/rest/taskrouter/v1/workspace.js +4 -2
  324. package/lib/rest/trunking/v1/trunk/credentialList.js +4 -2
  325. package/lib/rest/trunking/v1/trunk/ipAccessControlList.js +4 -2
  326. package/lib/rest/trunking/v1/trunk/originationUrl.js +12 -10
  327. package/lib/rest/trunking/v1/trunk/phoneNumber.js +4 -2
  328. package/lib/rest/trunking/v1/trunk.js +2 -0
  329. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesChannelEndpointAssignment.js +6 -4
  330. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js +4 -2
  331. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.js +4 -2
  332. package/lib/rest/trusthub/v1/customerProfiles.js +8 -6
  333. package/lib/rest/trusthub/v1/endUser.js +6 -4
  334. package/lib/rest/trusthub/v1/endUserType.js +2 -0
  335. package/lib/rest/trusthub/v1/policies.js +2 -0
  336. package/lib/rest/trusthub/v1/supportingDocument.js +6 -4
  337. package/lib/rest/trusthub/v1/supportingDocumentType.js +2 -0
  338. package/lib/rest/trusthub/v1/trustProducts/trustProductsChannelEndpointAssignment.js +6 -4
  339. package/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js +4 -2
  340. package/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.js +4 -2
  341. package/lib/rest/trusthub/v1/trustProducts.js +8 -6
  342. package/lib/rest/verify/v2/service/accessToken.d.ts +62 -4
  343. package/lib/rest/verify/v2/service/accessToken.js +159 -11
  344. package/lib/rest/verify/v2/service/entity/challenge.js +4 -2
  345. package/lib/rest/verify/v2/service/entity/factor.js +2 -0
  346. package/lib/rest/verify/v2/service/entity/newFactor.js +4 -4
  347. package/lib/rest/verify/v2/service/entity.js +4 -2
  348. package/lib/rest/verify/v2/service/messagingConfiguration.js +8 -6
  349. package/lib/rest/verify/v2/service/rateLimit/bucket.js +6 -4
  350. package/lib/rest/verify/v2/service/rateLimit.js +4 -2
  351. package/lib/rest/verify/v2/service/verification.js +6 -6
  352. package/lib/rest/verify/v2/service/verificationCheck.js +2 -2
  353. package/lib/rest/verify/v2/service/webhook.js +8 -6
  354. package/lib/rest/verify/v2/service.js +4 -2
  355. package/lib/rest/verify/v2/template.js +3 -1
  356. package/lib/rest/verify/v2/verificationAttempt.d.ts +50 -10
  357. package/lib/rest/verify/v2/verificationAttempt.js +61 -15
  358. package/lib/rest/video/v1/composition.d.ts +2 -0
  359. package/lib/rest/video/v1/composition.js +7 -2
  360. package/lib/rest/video/v1/compositionHook.js +6 -4
  361. package/lib/rest/video/v1/compositionSettings.js +2 -2
  362. package/lib/rest/video/v1/recording.d.ts +2 -0
  363. package/lib/rest/video/v1/recording.js +5 -0
  364. package/lib/rest/video/v1/recordingSettings.js +2 -2
  365. package/lib/rest/video/v1/room/recording.d.ts +2 -0
  366. package/lib/rest/video/v1/room/recording.js +5 -0
  367. package/lib/rest/video/v1/room/roomParticipant/roomParticipantPublishedTrack.js +2 -0
  368. package/lib/rest/video/v1/room/roomParticipant/roomParticipantSubscribedTrack.js +2 -0
  369. package/lib/rest/video/v1/room/roomParticipant.js +2 -0
  370. package/lib/rest/video/v1/room.d.ts +8 -0
  371. package/lib/rest/video/v1/room.js +17 -3
  372. package/lib/rest/voice/V1.d.ts +3 -0
  373. package/lib/rest/voice/V1.js +12 -0
  374. package/lib/rest/voice/v1/archivedCall.d.ts +136 -0
  375. package/lib/rest/voice/v1/archivedCall.js +325 -0
  376. package/lib/rest/voice/v1/byocTrunk.js +2 -0
  377. package/lib/rest/voice/v1/connectionPolicy/connectionPolicyTarget.js +4 -2
  378. package/lib/rest/voice/v1/connectionPolicy.js +2 -0
  379. package/lib/rest/voice/v1/dialingPermissions/bulkCountryUpdate.js +2 -2
  380. package/lib/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.js +2 -0
  381. package/lib/rest/voice/v1/dialingPermissions/country.js +2 -0
  382. package/lib/rest/voice/v1/ipRecord.js +4 -2
  383. package/lib/rest/voice/v1/sourceIpMapping.js +8 -6
  384. package/lib/rest/wireless/v1/command.js +4 -2
  385. package/lib/rest/wireless/v1/ratePlan.js +2 -0
  386. package/lib/rest/wireless/v1/sim/dataSession.js +2 -0
  387. package/lib/rest/wireless/v1/sim/usageRecord.js +2 -0
  388. package/lib/rest/wireless/v1/sim.js +6 -8
  389. package/lib/rest/wireless/v1/usageRecord.js +2 -0
  390. package/package.json +3 -3
  391. package/CHANGES.md +0 -2517
@@ -82,23 +82,23 @@ UsAppToPersonList = function UsAppToPersonList(version, messagingServiceSid) {
82
82
  if (_.isUndefined(opts)) {
83
83
  throw new Error('Required parameter "opts" missing.');
84
84
  }
85
- if (_.isUndefined(opts.brandRegistrationSid)) {
86
- throw new Error('Required parameter "opts.brandRegistrationSid" missing.');
85
+ if (_.isUndefined(opts['brandRegistrationSid'])) {
86
+ throw new Error('Required parameter "opts[\'brandRegistrationSid\']" missing.');
87
87
  }
88
- if (_.isUndefined(opts.description)) {
89
- throw new Error('Required parameter "opts.description" missing.');
88
+ if (_.isUndefined(opts['description'])) {
89
+ throw new Error('Required parameter "opts[\'description\']" missing.');
90
90
  }
91
- if (_.isUndefined(opts.messageSamples)) {
92
- throw new Error('Required parameter "opts.messageSamples" missing.');
91
+ if (_.isUndefined(opts['messageSamples'])) {
92
+ throw new Error('Required parameter "opts[\'messageSamples\']" missing.');
93
93
  }
94
- if (_.isUndefined(opts.usAppToPersonUsecase)) {
95
- throw new Error('Required parameter "opts.usAppToPersonUsecase" missing.');
94
+ if (_.isUndefined(opts['usAppToPersonUsecase'])) {
95
+ throw new Error('Required parameter "opts[\'usAppToPersonUsecase\']" missing.');
96
96
  }
97
- if (_.isUndefined(opts.hasEmbeddedLinks)) {
98
- throw new Error('Required parameter "opts.hasEmbeddedLinks" missing.');
97
+ if (_.isUndefined(opts['hasEmbeddedLinks'])) {
98
+ throw new Error('Required parameter "opts[\'hasEmbeddedLinks\']" missing.');
99
99
  }
100
- if (_.isUndefined(opts.hasEmbeddedPhone)) {
101
- throw new Error('Required parameter "opts.hasEmbeddedPhone" missing.');
100
+ if (_.isUndefined(opts['hasEmbeddedPhone'])) {
101
+ throw new Error('Required parameter "opts[\'hasEmbeddedPhone\']" missing.');
102
102
  }
103
103
 
104
104
  var deferred = Q.defer();
@@ -217,6 +217,8 @@ UsAppToPersonList = function UsAppToPersonList(version, messagingServiceSid) {
217
217
  if (!done) {
218
218
  currentPage++;
219
219
  fetchNextPage(_.bind(page.nextPage, page));
220
+ } else {
221
+ onComplete();
220
222
  }
221
223
  });
222
224
 
@@ -106,8 +106,8 @@ ServiceList = function ServiceList(version) {
106
106
  if (_.isUndefined(opts)) {
107
107
  throw new Error('Required parameter "opts" missing.');
108
108
  }
109
- if (_.isUndefined(opts.friendlyName)) {
110
- throw new Error('Required parameter "opts.friendlyName" missing.');
109
+ if (_.isUndefined(opts['friendlyName'])) {
110
+ throw new Error('Required parameter "opts[\'friendlyName\']" missing.');
111
111
  }
112
112
 
113
113
  var deferred = Q.defer();
@@ -231,6 +231,8 @@ ServiceList = function ServiceList(version) {
231
231
  if (!done) {
232
232
  currentPage++;
233
233
  fetchNextPage(_.bind(page.nextPage, page));
234
+ } else {
235
+ onComplete();
234
236
  }
235
237
  });
236
238
 
@@ -140,6 +140,8 @@ AlertList = function AlertList(version) {
140
140
  if (!done) {
141
141
  currentPage++;
142
142
  fetchNextPage(_.bind(page.nextPage, page));
143
+ } else {
144
+ onComplete();
143
145
  }
144
146
  });
145
147
 
@@ -145,6 +145,8 @@ EventList = function EventList(version) {
145
145
  if (!done) {
146
146
  currentPage++;
147
147
  fetchNextPage(_.bind(page.nextPage, page));
148
+ } else {
149
+ onComplete();
148
150
  }
149
151
  });
150
152
 
@@ -138,6 +138,8 @@ CredentialList = function CredentialList(version) {
138
138
  if (!done) {
139
139
  currentPage++;
140
140
  fetchNextPage(_.bind(page.nextPage, page));
141
+ } else {
142
+ onComplete();
141
143
  }
142
144
  });
143
145
 
@@ -325,8 +327,8 @@ CredentialList = function CredentialList(version) {
325
327
  if (_.isUndefined(opts)) {
326
328
  throw new Error('Required parameter "opts" missing.');
327
329
  }
328
- if (_.isUndefined(opts.type)) {
329
- throw new Error('Required parameter "opts.type" missing.');
330
+ if (_.isUndefined(opts['type'])) {
331
+ throw new Error('Required parameter "opts[\'type\']" missing.');
330
332
  }
331
333
 
332
334
  var deferred = Q.defer();
@@ -84,14 +84,14 @@ BindingList = function BindingList(version, serviceSid) {
84
84
  if (_.isUndefined(opts)) {
85
85
  throw new Error('Required parameter "opts" missing.');
86
86
  }
87
- if (_.isUndefined(opts.identity)) {
88
- throw new Error('Required parameter "opts.identity" missing.');
87
+ if (_.isUndefined(opts['identity'])) {
88
+ throw new Error('Required parameter "opts[\'identity\']" missing.');
89
89
  }
90
- if (_.isUndefined(opts.bindingType)) {
91
- throw new Error('Required parameter "opts.bindingType" missing.');
90
+ if (_.isUndefined(opts['bindingType'])) {
91
+ throw new Error('Required parameter "opts[\'bindingType\']" missing.');
92
92
  }
93
- if (_.isUndefined(opts.address)) {
94
- throw new Error('Required parameter "opts.address" missing.');
93
+ if (_.isUndefined(opts['address'])) {
94
+ throw new Error('Required parameter "opts[\'address\']" missing.');
95
95
  }
96
96
 
97
97
  var deferred = Q.defer();
@@ -219,6 +219,8 @@ BindingList = function BindingList(version, serviceSid) {
219
219
  if (!done) {
220
220
  currentPage++;
221
221
  fetchNextPage(_.bind(page.nextPage, page));
222
+ } else {
223
+ onComplete();
222
224
  }
223
225
  });
224
226
 
@@ -218,6 +218,8 @@ ServiceList = function ServiceList(version) {
218
218
  if (!done) {
219
219
  currentPage++;
220
220
  fetchNextPage(_.bind(page.nextPage, page));
221
+ } else {
222
+ onComplete();
221
223
  }
222
224
  });
223
225
 
@@ -39,6 +39,102 @@ interface BundleCopyListInstance {
39
39
  * @param callback - Callback to handle processed record
40
40
  */
41
41
  create(opts?: BundleCopyListInstanceCreateOptions, callback?: (error: Error | null, item: BundleCopyInstance) => any): Promise<BundleCopyInstance>;
42
+ /**
43
+ * Streams BundleCopyInstance records from the API.
44
+ *
45
+ * This operation lazily loads records as efficiently as possible until the limit
46
+ * is reached.
47
+ *
48
+ * The results are passed into the callback function, so this operation is memory
49
+ * efficient.
50
+ *
51
+ * If a function is passed as the first argument, it will be used as the callback
52
+ * function.
53
+ *
54
+ * @param callback - Function to process each record
55
+ */
56
+ each(callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void;
57
+ /**
58
+ * Streams BundleCopyInstance records from the API.
59
+ *
60
+ * This operation lazily loads records as efficiently as possible until the limit
61
+ * is reached.
62
+ *
63
+ * The results are passed into the callback function, so this operation is memory
64
+ * efficient.
65
+ *
66
+ * If a function is passed as the first argument, it will be used as the callback
67
+ * function.
68
+ *
69
+ * @param opts - Options for request
70
+ * @param callback - Function to process each record
71
+ */
72
+ each(opts?: BundleCopyListInstanceEachOptions, callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void): void;
73
+ /**
74
+ * Retrieve a single target page of BundleCopyInstance records from the API.
75
+ *
76
+ * The request is executed immediately.
77
+ *
78
+ * If a function is passed as the first argument, it will be used as the callback
79
+ * function.
80
+ *
81
+ * @param callback - Callback to handle list of records
82
+ */
83
+ getPage(callback?: (error: Error | null, items: BundleCopyPage) => any): Promise<BundleCopyPage>;
84
+ /**
85
+ * Retrieve a single target page of BundleCopyInstance records from the API.
86
+ *
87
+ * The request is executed immediately.
88
+ *
89
+ * If a function is passed as the first argument, it will be used as the callback
90
+ * function.
91
+ *
92
+ * @param targetUrl - API-generated URL for the requested results page
93
+ * @param callback - Callback to handle list of records
94
+ */
95
+ getPage(targetUrl?: string, callback?: (error: Error | null, items: BundleCopyPage) => any): Promise<BundleCopyPage>;
96
+ /**
97
+ * Lists BundleCopyInstance records from the API as a list.
98
+ *
99
+ * If a function is passed as the first argument, it will be used as the callback
100
+ * function.
101
+ *
102
+ * @param callback - Callback to handle list of records
103
+ */
104
+ list(callback?: (error: Error | null, items: BundleCopyInstance[]) => any): Promise<BundleCopyInstance[]>;
105
+ /**
106
+ * Lists BundleCopyInstance records from the API as a list.
107
+ *
108
+ * If a function is passed as the first argument, it will be used as the callback
109
+ * function.
110
+ *
111
+ * @param opts - Options for request
112
+ * @param callback - Callback to handle list of records
113
+ */
114
+ list(opts?: BundleCopyListInstanceOptions, callback?: (error: Error | null, items: BundleCopyInstance[]) => any): Promise<BundleCopyInstance[]>;
115
+ /**
116
+ * Retrieve a single page of BundleCopyInstance records from the API.
117
+ *
118
+ * The request is executed immediately.
119
+ *
120
+ * If a function is passed as the first argument, it will be used as the callback
121
+ * function.
122
+ *
123
+ * @param callback - Callback to handle list of records
124
+ */
125
+ page(callback?: (error: Error | null, items: BundleCopyPage) => any): Promise<BundleCopyPage>;
126
+ /**
127
+ * Retrieve a single page of BundleCopyInstance records from the API.
128
+ *
129
+ * The request is executed immediately.
130
+ *
131
+ * If a function is passed as the first argument, it will be used as the callback
132
+ * function.
133
+ *
134
+ * @param opts - Options for request
135
+ * @param callback - Callback to handle list of records
136
+ */
137
+ page(opts?: BundleCopyListInstancePageOptions, callback?: (error: Error | null, items: BundleCopyPage) => any): Promise<BundleCopyPage>;
42
138
  /**
43
139
  * Provide a user-friendly representation
44
140
  */
@@ -54,6 +150,63 @@ interface BundleCopyListInstanceCreateOptions {
54
150
  friendlyName?: string;
55
151
  }
56
152
 
153
+ /**
154
+ * Options to pass to each
155
+ *
156
+ * @property callback -
157
+ * Function to process each record. If this and a positional
158
+ * callback are passed, this one will be used
159
+ * @property done - Function to be called upon completion of streaming
160
+ * @property limit -
161
+ * Upper limit for the number of records to return.
162
+ * each() guarantees never to return more than limit.
163
+ * Default is no limit
164
+ * @property pageSize -
165
+ * Number of records to fetch per request,
166
+ * when not set will use the default value of 50 records.
167
+ * If no pageSize is defined but a limit is defined,
168
+ * each() will attempt to read the limit with the most efficient
169
+ * page size, i.e. min(limit, 1000)
170
+ */
171
+ interface BundleCopyListInstanceEachOptions {
172
+ callback?: (item: BundleCopyInstance, done: (err?: Error) => void) => void;
173
+ done?: Function;
174
+ limit?: number;
175
+ pageSize?: number;
176
+ }
177
+
178
+ /**
179
+ * Options to pass to list
180
+ *
181
+ * @property limit -
182
+ * Upper limit for the number of records to return.
183
+ * list() guarantees never to return more than limit.
184
+ * Default is no limit
185
+ * @property pageSize -
186
+ * Number of records to fetch per request,
187
+ * when not set will use the default value of 50 records.
188
+ * If no page_size is defined but a limit is defined,
189
+ * list() will attempt to read the limit with the most
190
+ * efficient page size, i.e. min(limit, 1000)
191
+ */
192
+ interface BundleCopyListInstanceOptions {
193
+ limit?: number;
194
+ pageSize?: number;
195
+ }
196
+
197
+ /**
198
+ * Options to pass to page
199
+ *
200
+ * @property pageNumber - Page Number, this value is simply for client state
201
+ * @property pageSize - Number of records to return, defaults to 50
202
+ * @property pageToken - PageToken provided by the API
203
+ */
204
+ interface BundleCopyListInstancePageOptions {
205
+ pageNumber?: number;
206
+ pageSize?: number;
207
+ pageToken?: string;
208
+ }
209
+
57
210
  interface BundleCopyPayload extends BundleCopyResource, Page.TwilioResponsePayload {
58
211
  }
59
212
 
@@ -130,4 +283,4 @@ declare class BundleCopyPage extends Page<V2, BundleCopyPayload, BundleCopyResou
130
283
  toJSON(): any;
131
284
  }
132
285
 
133
- export { BundleCopyEndUserType, BundleCopyInstance, BundleCopyList, BundleCopyListInstance, BundleCopyListInstanceCreateOptions, BundleCopyPage, BundleCopyPayload, BundleCopyResource, BundleCopySolution, BundleCopyStatus }
286
+ export { BundleCopyEndUserType, BundleCopyInstance, BundleCopyList, BundleCopyListInstance, BundleCopyListInstanceCreateOptions, BundleCopyListInstanceEachOptions, BundleCopyListInstanceOptions, BundleCopyListInstancePageOptions, BundleCopyPage, BundleCopyPayload, BundleCopyResource, BundleCopySolution, BundleCopyStatus }
@@ -95,6 +95,250 @@ BundleCopyList = function BundleCopyList(version, bundleSid) {
95
95
  return deferred.promise;
96
96
  };
97
97
 
98
+ /* jshint ignore:start */
99
+ /**
100
+ * Streams BundleCopyInstance records from the API.
101
+ *
102
+ * This operation lazily loads records as efficiently as possible until the limit
103
+ * is reached.
104
+ *
105
+ * The results are passed into the callback function, so this operation is memory
106
+ * efficient.
107
+ *
108
+ * If a function is passed as the first argument, it will be used as the callback
109
+ * function.
110
+ *
111
+ * @function each
112
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList#
113
+ *
114
+ * @param {object} [opts] - Options for request
115
+ * @param {number} [opts.limit] -
116
+ * Upper limit for the number of records to return.
117
+ * each() guarantees never to return more than limit.
118
+ * Default is no limit
119
+ * @param {number} [opts.pageSize] -
120
+ * Number of records to fetch per request,
121
+ * when not set will use the default value of 50 records.
122
+ * If no pageSize is defined but a limit is defined,
123
+ * each() will attempt to read the limit with the most efficient
124
+ * page size, i.e. min(limit, 1000)
125
+ * @param {Function} [opts.callback] -
126
+ * Function to process each record. If this and a positional
127
+ * callback are passed, this one will be used
128
+ * @param {Function} [opts.done] -
129
+ * Function to be called upon completion of streaming
130
+ * @param {Function} [callback] - Function to process each record
131
+ */
132
+ /* jshint ignore:end */
133
+ BundleCopyListInstance.each = function each(opts, callback) {
134
+ if (_.isFunction(opts)) {
135
+ callback = opts;
136
+ opts = {};
137
+ }
138
+ opts = opts || {};
139
+ if (opts.callback) {
140
+ callback = opts.callback;
141
+ }
142
+ if (_.isUndefined(callback)) {
143
+ throw new Error('Callback function must be provided');
144
+ }
145
+
146
+ var done = false;
147
+ var currentPage = 1;
148
+ var currentResource = 0;
149
+ var limits = this._version.readLimits({
150
+ limit: opts.limit,
151
+ pageSize: opts.pageSize
152
+ });
153
+
154
+ function onComplete(error) {
155
+ done = true;
156
+ if (_.isFunction(opts.done)) {
157
+ opts.done(error);
158
+ }
159
+ }
160
+
161
+ function fetchNextPage(fn) {
162
+ var promise = fn();
163
+ if (_.isUndefined(promise)) {
164
+ onComplete();
165
+ return;
166
+ }
167
+
168
+ promise.then(function(page) {
169
+ _.each(page.instances, function(instance) {
170
+ if (done || (!_.isUndefined(opts.limit) && currentResource >= opts.limit)) {
171
+ done = true;
172
+ return false;
173
+ }
174
+
175
+ currentResource++;
176
+ callback(instance, onComplete);
177
+ });
178
+
179
+ if (!done) {
180
+ currentPage++;
181
+ fetchNextPage(_.bind(page.nextPage, page));
182
+ } else {
183
+ onComplete();
184
+ }
185
+ });
186
+
187
+ promise.catch(onComplete);
188
+ }
189
+
190
+ fetchNextPage(_.bind(this.page, this, _.merge(opts, limits)));
191
+ };
192
+
193
+ /* jshint ignore:start */
194
+ /**
195
+ * Lists BundleCopyInstance records from the API as a list.
196
+ *
197
+ * If a function is passed as the first argument, it will be used as the callback
198
+ * function.
199
+ *
200
+ * @function list
201
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList#
202
+ *
203
+ * @param {object} [opts] - Options for request
204
+ * @param {number} [opts.limit] -
205
+ * Upper limit for the number of records to return.
206
+ * list() guarantees never to return more than limit.
207
+ * Default is no limit
208
+ * @param {number} [opts.pageSize] -
209
+ * Number of records to fetch per request,
210
+ * when not set will use the default value of 50 records.
211
+ * If no page_size is defined but a limit is defined,
212
+ * list() will attempt to read the limit with the most
213
+ * efficient page size, i.e. min(limit, 1000)
214
+ * @param {function} [callback] - Callback to handle list of records
215
+ *
216
+ * @returns {Promise} Resolves to a list of records
217
+ */
218
+ /* jshint ignore:end */
219
+ BundleCopyListInstance.list = function list(opts, callback) {
220
+ if (_.isFunction(opts)) {
221
+ callback = opts;
222
+ opts = {};
223
+ }
224
+ opts = opts || {};
225
+ var deferred = Q.defer();
226
+ var allResources = [];
227
+ opts.callback = function(resource, done) {
228
+ allResources.push(resource);
229
+
230
+ if (!_.isUndefined(opts.limit) && allResources.length === opts.limit) {
231
+ done();
232
+ }
233
+ };
234
+
235
+ opts.done = function(error) {
236
+ if (_.isUndefined(error)) {
237
+ deferred.resolve(allResources);
238
+ } else {
239
+ deferred.reject(error);
240
+ }
241
+ };
242
+
243
+ if (_.isFunction(callback)) {
244
+ deferred.promise.nodeify(callback);
245
+ }
246
+
247
+ this.each(opts);
248
+ return deferred.promise;
249
+ };
250
+
251
+ /* jshint ignore:start */
252
+ /**
253
+ * Retrieve a single page of BundleCopyInstance records from the API.
254
+ *
255
+ * The request is executed immediately.
256
+ *
257
+ * If a function is passed as the first argument, it will be used as the callback
258
+ * function.
259
+ *
260
+ * @function page
261
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList#
262
+ *
263
+ * @param {object} [opts] - Options for request
264
+ * @param {string} [opts.pageToken] - PageToken provided by the API
265
+ * @param {number} [opts.pageNumber] -
266
+ * Page Number, this value is simply for client state
267
+ * @param {number} [opts.pageSize] - Number of records to return, defaults to 50
268
+ * @param {function} [callback] - Callback to handle list of records
269
+ *
270
+ * @returns {Promise} Resolves to a list of records
271
+ */
272
+ /* jshint ignore:end */
273
+ BundleCopyListInstance.page = function page(opts, callback) {
274
+ if (_.isFunction(opts)) {
275
+ callback = opts;
276
+ opts = {};
277
+ }
278
+ opts = opts || {};
279
+
280
+ var deferred = Q.defer();
281
+ var data = values.of({
282
+ 'PageToken': opts.pageToken,
283
+ 'Page': opts.pageNumber,
284
+ 'PageSize': opts.pageSize
285
+ });
286
+
287
+ var promise = this._version.page({uri: this._uri, method: 'GET', params: data});
288
+
289
+ promise = promise.then(function(payload) {
290
+ deferred.resolve(new BundleCopyPage(this._version, payload, this._solution));
291
+ }.bind(this));
292
+
293
+ promise.catch(function(error) {
294
+ deferred.reject(error);
295
+ });
296
+
297
+ if (_.isFunction(callback)) {
298
+ deferred.promise.nodeify(callback);
299
+ }
300
+
301
+ return deferred.promise;
302
+ };
303
+
304
+ /* jshint ignore:start */
305
+ /**
306
+ * Retrieve a single target page of BundleCopyInstance records from the API.
307
+ *
308
+ * The request is executed immediately.
309
+ *
310
+ * If a function is passed as the first argument, it will be used as the callback
311
+ * function.
312
+ *
313
+ * @function getPage
314
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList#
315
+ *
316
+ * @param {string} [targetUrl] - API-generated URL for the requested results page
317
+ * @param {function} [callback] - Callback to handle list of records
318
+ *
319
+ * @returns {Promise} Resolves to a list of records
320
+ */
321
+ /* jshint ignore:end */
322
+ BundleCopyListInstance.getPage = function getPage(targetUrl, callback) {
323
+ var deferred = Q.defer();
324
+
325
+ var promise = this._version._domain.twilio.request({method: 'GET', uri: targetUrl});
326
+
327
+ promise = promise.then(function(payload) {
328
+ deferred.resolve(new BundleCopyPage(this._version, payload, this._solution));
329
+ }.bind(this));
330
+
331
+ promise.catch(function(error) {
332
+ deferred.reject(error);
333
+ });
334
+
335
+ if (_.isFunction(callback)) {
336
+ deferred.promise.nodeify(callback);
337
+ }
338
+
339
+ return deferred.promise;
340
+ };
341
+
98
342
  /* jshint ignore:start */
99
343
  /**
100
344
  * Provide a user-friendly representation
@@ -171,6 +171,8 @@ EvaluationList = function EvaluationList(version, bundleSid) {
171
171
  if (!done) {
172
172
  currentPage++;
173
173
  fetchNextPage(_.bind(page.nextPage, page));
174
+ } else {
175
+ onComplete();
174
176
  }
175
177
  });
176
178
 
@@ -70,8 +70,8 @@ ItemAssignmentList = function ItemAssignmentList(version, bundleSid) {
70
70
  if (_.isUndefined(opts)) {
71
71
  throw new Error('Required parameter "opts" missing.');
72
72
  }
73
- if (_.isUndefined(opts.objectSid)) {
74
- throw new Error('Required parameter "opts.objectSid" missing.');
73
+ if (_.isUndefined(opts['objectSid'])) {
74
+ throw new Error('Required parameter "opts[\'objectSid\']" missing.');
75
75
  }
76
76
 
77
77
  var deferred = Q.defer();
@@ -183,6 +183,8 @@ ItemAssignmentList = function ItemAssignmentList(version, bundleSid) {
183
183
  if (!done) {
184
184
  currentPage++;
185
185
  fetchNextPage(_.bind(page.nextPage, page));
186
+ } else {
187
+ onComplete();
186
188
  }
187
189
  });
188
190
 
@@ -72,8 +72,8 @@ ReplaceItemsList = function ReplaceItemsList(version, bundleSid) {
72
72
  if (_.isUndefined(opts)) {
73
73
  throw new Error('Required parameter "opts" missing.');
74
74
  }
75
- if (_.isUndefined(opts.fromBundleSid)) {
76
- throw new Error('Required parameter "opts.fromBundleSid" missing.');
75
+ if (_.isUndefined(opts['fromBundleSid'])) {
76
+ throw new Error('Required parameter "opts[\'fromBundleSid\']" missing.');
77
77
  }
78
78
 
79
79
  var deferred = Q.defer();