twilio-ruby 5.0.0 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +30 -2
  3. data/CONTRIBUTING.md +159 -0
  4. data/ISSUE_TEMPLATE.md +26 -0
  5. data/LICENSE.md +1 -1
  6. data/README.md +6 -7
  7. data/VERSIONS.md +21 -49
  8. data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +11 -11
  9. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +11 -11
  10. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +11 -11
  11. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +11 -11
  12. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +11 -11
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +11 -11
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +11 -11
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +11 -11
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +11 -11
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +11 -11
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +11 -18
  19. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +11 -11
  20. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +11 -11
  21. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +11 -11
  22. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +11 -11
  23. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +358 -0
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +439 -0
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -11
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -11
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -11
  28. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +48 -11
  29. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +11 -11
  30. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +22 -12
  32. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +11 -11
  33. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +11 -11
  34. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +11 -11
  35. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +11 -11
  36. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +11 -11
  37. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +11 -11
  38. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +11 -11
  39. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +11 -18
  40. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +11 -11
  41. data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +11 -11
  42. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +11 -11
  43. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -11
  44. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  45. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  46. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +11 -11
  47. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +11 -11
  48. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +11 -11
  49. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +11 -11
  50. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +11 -11
  51. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +11 -11
  52. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +11 -11
  53. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +11 -11
  54. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +11 -11
  55. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +11 -11
  56. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +11 -11
  57. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +11 -11
  58. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +11 -11
  59. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +11 -11
  60. data/lib/twilio-ruby/rest/api/v2010/account.rb +11 -11
  61. data/lib/twilio-ruby/rest/chat/v1/credential.rb +11 -11
  62. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +11 -11
  63. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +11 -11
  64. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +11 -11
  65. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +11 -11
  66. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +11 -11
  67. data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +11 -11
  68. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +11 -11
  69. data/lib/twilio-ruby/rest/chat/v1/service.rb +11 -11
  70. data/lib/twilio-ruby/rest/chat/v2/credential.rb +11 -11
  71. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +11 -11
  72. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +11 -11
  73. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +11 -11
  74. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +11 -11
  75. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +11 -11
  76. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +11 -11
  77. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +11 -11
  78. data/lib/twilio-ruby/rest/chat/v2/service.rb +11 -11
  79. data/lib/twilio-ruby/rest/client.rb +42 -0
  80. data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +334 -0
  81. data/lib/twilio-ruby/rest/fax/v1/fax.rb +549 -0
  82. data/lib/twilio-ruby/rest/fax/v1.rb +41 -0
  83. data/lib/twilio-ruby/rest/fax.rb +44 -0
  84. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +11 -11
  85. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +11 -11
  86. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -11
  87. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +11 -11
  88. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +11 -11
  89. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +11 -11
  90. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +11 -11
  91. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +11 -11
  92. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +11 -11
  93. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +11 -11
  94. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +11 -11
  95. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +11 -11
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +11 -11
  97. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +11 -11
  98. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +11 -11
  99. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +11 -11
  100. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +11 -11
  101. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +11 -11
  102. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +360 -0
  103. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +367 -0
  104. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +367 -0
  105. data/lib/twilio-ruby/rest/messaging/v1/service.rb +645 -0
  106. data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
  107. data/lib/twilio-ruby/rest/messaging.rb +44 -0
  108. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +11 -11
  109. data/lib/twilio-ruby/rest/monitor/v1/event.rb +11 -11
  110. data/lib/twilio-ruby/rest/notify/v1/credential.rb +411 -0
  111. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +438 -0
  112. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +294 -0
  113. data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +230 -0
  114. data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +262 -0
  115. data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +442 -0
  116. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +453 -0
  117. data/lib/twilio-ruby/rest/notify/v1/service.rb +647 -0
  118. data/lib/twilio-ruby/rest/notify/v1.rb +56 -0
  119. data/lib/twilio-ruby/rest/notify.rb +52 -0
  120. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +216 -0
  121. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +211 -0
  122. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +251 -0
  123. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +56 -0
  124. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +570 -0
  125. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +42 -0
  126. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +309 -0
  127. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +341 -0
  128. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +349 -0
  129. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +448 -0
  130. data/lib/twilio-ruby/rest/preview/marketplace.rb +58 -0
  131. data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +367 -0
  132. data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +437 -0
  133. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +460 -0
  134. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +514 -0
  135. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +544 -0
  136. data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +367 -0
  137. data/lib/twilio-ruby/rest/preview/proxy/service.rb +508 -0
  138. data/lib/twilio-ruby/rest/preview/proxy.rb +41 -0
  139. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +403 -0
  140. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +453 -0
  141. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +438 -0
  142. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +403 -0
  143. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +446 -0
  144. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +440 -0
  145. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +403 -0
  146. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +446 -0
  147. data/lib/twilio-ruby/rest/preview/sync/service.rb +512 -0
  148. data/lib/twilio-ruby/rest/preview/sync.rb +41 -0
  149. data/lib/twilio-ruby/rest/preview/wireless/command.rb +390 -0
  150. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +443 -0
  151. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +244 -0
  152. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +552 -0
  153. data/lib/twilio-ruby/rest/preview/wireless.rb +71 -0
  154. data/lib/twilio-ruby/rest/preview.rb +145 -0
  155. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +11 -11
  156. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +11 -11
  157. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +11 -11
  158. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +403 -0
  159. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +453 -0
  160. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +438 -0
  161. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +403 -0
  162. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +446 -0
  163. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +440 -0
  164. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +403 -0
  165. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +446 -0
  166. data/lib/twilio-ruby/rest/sync/v1/service.rb +512 -0
  167. data/lib/twilio-ruby/rest/sync/v1.rb +41 -0
  168. data/lib/twilio-ruby/rest/sync.rb +44 -0
  169. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +11 -11
  170. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +11 -11
  171. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +143 -13
  172. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +11 -11
  173. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +11 -11
  174. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +11 -11
  175. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +11 -11
  176. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +143 -13
  177. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +11 -11
  178. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +11 -11
  179. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +11 -11
  180. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +11 -11
  181. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +11 -11
  182. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +11 -11
  183. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +11 -11
  184. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +11 -11
  185. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +11 -11
  186. data/lib/twilio-ruby/rest/video/v1/recording.rb +11 -11
  187. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +11 -11
  188. data/lib/twilio-ruby/rest/video/v1/room.rb +11 -11
  189. data/lib/twilio-ruby/rest/wireless/v1/command.rb +375 -0
  190. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +460 -0
  191. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +241 -0
  192. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +556 -0
  193. data/lib/twilio-ruby/rest/wireless/v1.rb +71 -0
  194. data/lib/twilio-ruby/rest/wireless.rb +60 -0
  195. data/lib/twilio-ruby/version.rb +1 -1
  196. data/spec/integration/api/v2010/account/call/recording_spec.rb +0 -2
  197. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +135 -0
  198. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +223 -0
  199. data/spec/integration/api/v2010/account/recording_spec.rb +0 -2
  200. data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
  201. data/spec/integration/fax/v1/fax_spec.rb +272 -0
  202. data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +170 -0
  203. data/spec/integration/messaging/v1/service/phone_number_spec.rb +201 -0
  204. data/spec/integration/messaging/v1/service/short_code_spec.rb +173 -0
  205. data/spec/integration/messaging/v1/service_spec.rb +263 -0
  206. data/spec/integration/notify/v1/credential_spec.rb +223 -0
  207. data/spec/integration/notify/v1/service/binding_spec.rb +227 -0
  208. data/spec/integration/notify/v1/service/notification_spec.rb +97 -0
  209. data/spec/integration/notify/v1/service/segment_spec.rb +84 -0
  210. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +118 -0
  211. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +269 -0
  212. data/spec/integration/notify/v1/service/user_spec.rb +213 -0
  213. data/spec/integration/notify/v1/service_spec.rb +280 -0
  214. data/spec/integration/preview/bulk_exports/export/day_spec.rb +56 -0
  215. data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +79 -0
  216. data/spec/integration/preview/bulk_exports/export_spec.rb +43 -0
  217. data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +280 -0
  218. data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +121 -0
  219. data/spec/integration/preview/marketplace/available_add_on_spec.rb +142 -0
  220. data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +164 -0
  221. data/spec/integration/preview/marketplace/installed_add_on_spec.rb +252 -0
  222. data/spec/integration/preview/proxy/service/phone_number_spec.rb +173 -0
  223. data/spec/integration/preview/proxy/service/session/interaction_spec.rb +104 -0
  224. data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +164 -0
  225. data/spec/integration/preview/proxy/service/session/participant_spec.rb +226 -0
  226. data/spec/integration/preview/proxy/service/session_spec.rb +216 -0
  227. data/spec/integration/preview/proxy/service/short_code_spec.rb +173 -0
  228. data/spec/integration/preview/proxy/service_spec.rb +200 -0
  229. data/spec/integration/preview/sync/service/document/document_permission_spec.rb +206 -0
  230. data/spec/integration/preview/sync/service/document_spec.rb +254 -0
  231. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +256 -0
  232. data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +206 -0
  233. data/spec/integration/preview/sync/service/sync_list_spec.rb +207 -0
  234. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +257 -0
  235. data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +206 -0
  236. data/spec/integration/preview/sync/service/sync_map_spec.rb +207 -0
  237. data/spec/integration/preview/sync/service_spec.rb +244 -0
  238. data/spec/integration/preview/wireless/command_spec.rb +169 -0
  239. data/spec/integration/preview/wireless/rate_plan_spec.rb +260 -0
  240. data/spec/integration/preview/wireless/sim/usage_spec.rb +49 -0
  241. data/spec/integration/preview/wireless/sim_spec.rb +208 -0
  242. data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
  243. data/spec/integration/sync/v1/service/document_spec.rb +254 -0
  244. data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
  245. data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
  246. data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
  247. data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
  248. data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
  249. data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
  250. data/spec/integration/sync/v1/service_spec.rb +244 -0
  251. data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +5 -5
  252. data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +5 -5
  253. data/spec/integration/wireless/v1/command_spec.rb +166 -0
  254. data/spec/integration/wireless/v1/rate_plan_spec.rb +268 -0
  255. data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
  256. data/spec/integration/wireless/v1/sim_spec.rb +208 -0
  257. data/twilio-ruby.gemspec +1 -3
  258. metadata +192 -2
@@ -0,0 +1,251 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class BulkExports < Version
11
+ ##
12
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
13
+ class ExportConfigurationList < ListResource
14
+ ##
15
+ # Initialize the ExportConfigurationList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [ExportConfigurationList] ExportConfigurationList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Preview.BulkExports.ExportConfigurationList>'
29
+ end
30
+ end
31
+
32
+ ##
33
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
34
+ class ExportConfigurationPage < Page
35
+ ##
36
+ # Initialize the ExportConfigurationPage
37
+ # @param [Version] version Version that contains the resource
38
+ # @param [Response] response Response from the API
39
+ # @param [Hash] solution Path solution for the resource
40
+ # @return [ExportConfigurationPage] ExportConfigurationPage
41
+ def initialize(version, response, solution)
42
+ super(version, response)
43
+
44
+ # Path Solution
45
+ @solution = solution
46
+ end
47
+
48
+ ##
49
+ # Build an instance of ExportConfigurationInstance
50
+ # @param [Hash] payload Payload response from the API
51
+ # @return [ExportConfigurationInstance] ExportConfigurationInstance
52
+ def get_instance(payload)
53
+ ExportConfigurationInstance.new(
54
+ @version,
55
+ payload,
56
+ )
57
+ end
58
+
59
+ ##
60
+ # Provide a user friendly representation
61
+ def to_s
62
+ '<Twilio.Preview.BulkExports.ExportConfigurationPage>'
63
+ end
64
+ end
65
+
66
+ ##
67
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
68
+ class ExportConfigurationContext < InstanceContext
69
+ ##
70
+ # Initialize the ExportConfigurationContext
71
+ # @param [Version] version Version that contains the resource
72
+ # @param [String] resource_type The resource_type
73
+ # @return [ExportConfigurationContext] ExportConfigurationContext
74
+ def initialize(version, resource_type)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {
79
+ resource_type: resource_type,
80
+ }
81
+ @uri = "/Exports/#{@solution[:resource_type]}/Configuration"
82
+ end
83
+
84
+ ##
85
+ # Fetch a ExportConfigurationInstance
86
+ # @return [ExportConfigurationInstance] Fetched ExportConfigurationInstance
87
+ def fetch
88
+ params = Twilio::Values.of({})
89
+
90
+ payload = @version.fetch(
91
+ 'GET',
92
+ @uri,
93
+ params,
94
+ )
95
+
96
+ ExportConfigurationInstance.new(
97
+ @version,
98
+ payload,
99
+ resource_type: @solution[:resource_type],
100
+ )
101
+ end
102
+
103
+ ##
104
+ # Update the ExportConfigurationInstance
105
+ # @param [Boolean] enabled The enabled
106
+ # @param [String] webhook_url The webhook_url
107
+ # @param [String] webhook_method The webhook_method
108
+ # @param [String] email The email
109
+ # @return [ExportConfigurationInstance] Updated ExportConfigurationInstance
110
+ def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset, email: :unset)
111
+ data = Twilio::Values.of({
112
+ 'Enabled' => enabled,
113
+ 'WebhookUrl' => webhook_url,
114
+ 'WebhookMethod' => webhook_method,
115
+ 'Email' => email,
116
+ })
117
+
118
+ payload = @version.update(
119
+ 'POST',
120
+ @uri,
121
+ data: data,
122
+ )
123
+
124
+ ExportConfigurationInstance.new(
125
+ @version,
126
+ payload,
127
+ resource_type: @solution[:resource_type],
128
+ )
129
+ end
130
+
131
+ ##
132
+ # Provide a user friendly representation
133
+ def to_s
134
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
135
+ "#<Twilio.Preview.BulkExports.ExportConfigurationContext #{context}>"
136
+ end
137
+ end
138
+
139
+ ##
140
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
141
+ class ExportConfigurationInstance < InstanceResource
142
+ ##
143
+ # Initialize the ExportConfigurationInstance
144
+ # @param [Version] version Version that contains the resource
145
+ # @param [Hash] payload payload that contains response from Twilio
146
+ # @param [String] resource_type The resource_type
147
+ # @return [ExportConfigurationInstance] ExportConfigurationInstance
148
+ def initialize(version, payload, resource_type: nil)
149
+ super(version)
150
+
151
+ # Marshaled Properties
152
+ @properties = {
153
+ 'enabled' => payload['enabled'],
154
+ 'webhook_url' => payload['webhook_url'],
155
+ 'webhook_method' => payload['webhook_method'],
156
+ 'email' => payload['email'],
157
+ 'resource_type' => payload['resource_type'],
158
+ 'url' => payload['url'],
159
+ }
160
+
161
+ # Context
162
+ @instance_context = nil
163
+ @params = {
164
+ 'resource_type' => resource_type || @properties['resource_type'],
165
+ }
166
+ end
167
+
168
+ ##
169
+ # Generate an instance context for the instance, the context is capable of
170
+ # performing various actions. All instance actions are proxied to the context
171
+ # @return [ExportConfigurationContext] ExportConfigurationContext for this ExportConfigurationInstance
172
+ def context
173
+ unless @instance_context
174
+ @instance_context = ExportConfigurationContext.new(
175
+ @version,
176
+ @params['resource_type'],
177
+ )
178
+ end
179
+ @instance_context
180
+ end
181
+
182
+ ##
183
+ # @return [Boolean] The enabled
184
+ def enabled
185
+ @properties['enabled']
186
+ end
187
+
188
+ ##
189
+ # @return [String] The webhook_url
190
+ def webhook_url
191
+ @properties['webhook_url']
192
+ end
193
+
194
+ ##
195
+ # @return [String] The webhook_method
196
+ def webhook_method
197
+ @properties['webhook_method']
198
+ end
199
+
200
+ ##
201
+ # @return [String] The email
202
+ def email
203
+ @properties['email']
204
+ end
205
+
206
+ ##
207
+ # @return [String] The resource_type
208
+ def resource_type
209
+ @properties['resource_type']
210
+ end
211
+
212
+ ##
213
+ # @return [String] The url
214
+ def url
215
+ @properties['url']
216
+ end
217
+
218
+ ##
219
+ # Fetch a ExportConfigurationInstance
220
+ # @return [ExportConfigurationInstance] Fetched ExportConfigurationInstance
221
+ def fetch
222
+ context.fetch
223
+ end
224
+
225
+ ##
226
+ # Update the ExportConfigurationInstance
227
+ # @param [Boolean] enabled The enabled
228
+ # @param [String] webhook_url The webhook_url
229
+ # @param [String] webhook_method The webhook_method
230
+ # @param [String] email The email
231
+ # @return [ExportConfigurationInstance] Updated ExportConfigurationInstance
232
+ def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset, email: :unset)
233
+ context.update(
234
+ enabled: enabled,
235
+ webhook_url: webhook_url,
236
+ webhook_method: webhook_method,
237
+ email: email,
238
+ )
239
+ end
240
+
241
+ ##
242
+ # Provide a user friendly representation
243
+ def to_s
244
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
245
+ "<Twilio.Preview.BulkExports.ExportConfigurationInstance #{values}>"
246
+ end
247
+ end
248
+ end
249
+ end
250
+ end
251
+ end
@@ -0,0 +1,56 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview
10
+ class BulkExports < Version
11
+ ##
12
+ # Initialize the BulkExports version of Preview
13
+ def initialize(domain)
14
+ super
15
+ @version = 'BulkExports'
16
+ @exports = nil
17
+ @export_configuration = nil
18
+ end
19
+
20
+ ##
21
+ # @param [String] resource_type The resource_type
22
+ # @return [Twilio::REST::Preview::BulkExports::ExportInstance] if resource_type was passed.
23
+ # @return [Twilio::REST::Preview::BulkExports::ExportList]
24
+ def exports(resource_type=:unset)
25
+ if resource_type.nil?
26
+ raise ArgumentError, 'resource_type cannot be nil'
27
+ elsif resource_type == :unset
28
+ @exports ||= ExportList.new self
29
+ else
30
+ ExportContext.new(self, resource_type)
31
+ end
32
+ end
33
+
34
+ ##
35
+ # @param [String] resource_type The resource_type
36
+ # @return [Twilio::REST::Preview::BulkExports::ExportConfigurationInstance] if resource_type was passed.
37
+ # @return [Twilio::REST::Preview::BulkExports::ExportConfigurationList]
38
+ def export_configuration(resource_type=:unset)
39
+ if resource_type.nil?
40
+ raise ArgumentError, 'resource_type cannot be nil'
41
+ elsif resource_type == :unset
42
+ @export_configuration ||= ExportConfigurationList.new self
43
+ else
44
+ ExportConfigurationContext.new(self, resource_type)
45
+ end
46
+ end
47
+
48
+ ##
49
+ # Provide a user friendly representation
50
+ def to_s
51
+ '<Twilio::REST::Preview::BulkExports>'
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,570 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class HostedNumbers < Version
11
+ ##
12
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
13
+ class HostedNumberOrderList < ListResource
14
+ ##
15
+ # Initialize the HostedNumberOrderList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [HostedNumberOrderList] HostedNumberOrderList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/HostedNumberOrders"
24
+ end
25
+
26
+ ##
27
+ # Lists HostedNumberOrderInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
31
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
32
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
33
+ # @param [String] phone_number An E164 formatted phone number hosted by this
34
+ # HostedNumberOrder.
35
+ # @param [String] incoming_phone_number_sid A 34 character string that uniquely
36
+ # identifies the IncomingPhoneNumber resource created by this HostedNumberOrder.
37
+ # @param [String] friendly_name A human readable description of this resource, up
38
+ # to 64 characters.
39
+ # @param [String] unique_name Provides a unique and addressable name to be
40
+ # assigned to this HostedNumberOrder, assigned by the developer, to be optionally
41
+ # used in addition to SID.
42
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
43
+ # guarantees to never return more than limit. Default is no limit
44
+ # @param [Integer] page_size Number of records to fetch per request, when
45
+ # not set will use the default value of 50 records. If no page_size is defined
46
+ # but a limit is defined, stream() will attempt to read the limit with the most
47
+ # efficient page size, i.e. min(limit, 1000)
48
+ # @return [Array] Array of up to limit results
49
+ def list(status: :unset, phone_number: :unset, incoming_phone_number_sid: :unset, friendly_name: :unset, unique_name: :unset, limit: nil, page_size: nil)
50
+ self.stream(
51
+ status: status,
52
+ phone_number: phone_number,
53
+ incoming_phone_number_sid: incoming_phone_number_sid,
54
+ friendly_name: friendly_name,
55
+ unique_name: unique_name,
56
+ limit: limit,
57
+ page_size: page_size
58
+ ).entries
59
+ end
60
+
61
+ ##
62
+ # Streams HostedNumberOrderInstance records from the API as an Enumerable.
63
+ # This operation lazily loads records as efficiently as possible until the limit
64
+ # is reached.
65
+ # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
66
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
67
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
68
+ # @param [String] phone_number An E164 formatted phone number hosted by this
69
+ # HostedNumberOrder.
70
+ # @param [String] incoming_phone_number_sid A 34 character string that uniquely
71
+ # identifies the IncomingPhoneNumber resource created by this HostedNumberOrder.
72
+ # @param [String] friendly_name A human readable description of this resource, up
73
+ # to 64 characters.
74
+ # @param [String] unique_name Provides a unique and addressable name to be
75
+ # assigned to this HostedNumberOrder, assigned by the developer, to be optionally
76
+ # used in addition to SID.
77
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
78
+ # guarantees to never return more than limit. Default is no limit.
79
+ # @param [Integer] page_size Number of records to fetch per request, when
80
+ # not set will use the default value of 50 records. If no page_size is defined
81
+ # but a limit is defined, stream() will attempt to read the limit with the most
82
+ # efficient page size, i.e. min(limit, 1000)
83
+ # @return [Enumerable] Enumerable that will yield up to limit results
84
+ def stream(status: :unset, phone_number: :unset, incoming_phone_number_sid: :unset, friendly_name: :unset, unique_name: :unset, limit: nil, page_size: nil)
85
+ limits = @version.read_limits(limit, page_size)
86
+
87
+ page = self.page(
88
+ status: status,
89
+ phone_number: phone_number,
90
+ incoming_phone_number_sid: incoming_phone_number_sid,
91
+ friendly_name: friendly_name,
92
+ unique_name: unique_name,
93
+ page_size: limits[:page_size],
94
+ )
95
+
96
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
97
+ end
98
+
99
+ ##
100
+ # When passed a block, yields HostedNumberOrderInstance records from the API.
101
+ # This operation lazily loads records as efficiently as possible until the limit
102
+ # is reached.
103
+ def each
104
+ limits = @version.read_limits
105
+
106
+ page = self.page(
107
+ page_size: limits[:page_size],
108
+ )
109
+
110
+ @version.stream(page,
111
+ limit: limits[:limit],
112
+ page_limit: limits[:page_limit]).each {|x| yield x}
113
+ end
114
+
115
+ ##
116
+ # Retrieve a single page of HostedNumberOrderInstance records from the API.
117
+ # Request is executed immediately.
118
+ # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
119
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
120
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
121
+ # @param [String] phone_number An E164 formatted phone number hosted by this
122
+ # HostedNumberOrder.
123
+ # @param [String] incoming_phone_number_sid A 34 character string that uniquely
124
+ # identifies the IncomingPhoneNumber resource created by this HostedNumberOrder.
125
+ # @param [String] friendly_name A human readable description of this resource, up
126
+ # to 64 characters.
127
+ # @param [String] unique_name Provides a unique and addressable name to be
128
+ # assigned to this HostedNumberOrder, assigned by the developer, to be optionally
129
+ # used in addition to SID.
130
+ # @param [String] page_token PageToken provided by the API
131
+ # @param [Integer] page_number Page Number, this value is simply for client state
132
+ # @param [Integer] page_size Number of records to return, defaults to 50
133
+ # @return [Page] Page of HostedNumberOrderInstance
134
+ def page(status: :unset, phone_number: :unset, incoming_phone_number_sid: :unset, friendly_name: :unset, unique_name: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
135
+ params = Twilio::Values.of({
136
+ 'Status' => status,
137
+ 'PhoneNumber' => phone_number,
138
+ 'IncomingPhoneNumberSid' => incoming_phone_number_sid,
139
+ 'FriendlyName' => friendly_name,
140
+ 'UniqueName' => unique_name,
141
+ 'PageToken' => page_token,
142
+ 'Page' => page_number,
143
+ 'PageSize' => page_size,
144
+ })
145
+ response = @version.page(
146
+ 'GET',
147
+ @uri,
148
+ params
149
+ )
150
+ HostedNumberOrderPage.new(@version, response, @solution)
151
+ end
152
+
153
+ ##
154
+ # Retrieve a single page of HostedNumberOrderInstance records from the API.
155
+ # Request is executed immediately.
156
+ # @param [String] target_url API-generated URL for the requested results page
157
+ # @return [Page] Page of HostedNumberOrderInstance
158
+ def get_page(target_url)
159
+ response = @version.domain.request(
160
+ 'GET',
161
+ target_url
162
+ )
163
+ HostedNumberOrderPage.new(@version, response, @solution)
164
+ end
165
+
166
+ ##
167
+ # Retrieve a single page of HostedNumberOrderInstance records from the API.
168
+ # Request is executed immediately.
169
+ # @param [String] address_sid A 34 character string that uniquely identifies the
170
+ # Address resource that represents the address of the owner of this phone number.
171
+ # @param [String] phone_number An E164 formatted phone number hosted by this
172
+ # HostedNumberOrder.
173
+ # @param [String] iso_country The ISO country code of the phone_number.
174
+ # @param [Boolean] sms_capability Used to specify that the SMS capability will be
175
+ # hosted on Twilio's platform.
176
+ # @param [String] email Email of the owner of this phone number that is being
177
+ # hosted.
178
+ # @param [String] account_sid Optional. The unique SID identifier of the Account
179
+ # or Sub-Account to create this HostedNumberOrder on.
180
+ # @param [String] friendly_name Optional. A human readable description of this
181
+ # resource, up to 64 characters.
182
+ # @param [String] unique_name Optional. Provides a unique and addressable name to
183
+ # be assigned to this HostedNumberOrder, assigned by the developer, to be
184
+ # optionally used in addition to SID.
185
+ # @param [String] cc_emails Optional. A list of emails that LOA document for this
186
+ # HostedNumberOrder will be carbon copied to.
187
+ # @param [String] sms_url Optional. The SMS URL attached to the
188
+ # IncomingPhoneNumber resource.
189
+ # @param [String] sms_method Optional. The SMS Method attached to the
190
+ # IncomingPhoneNumber resource.
191
+ # @param [String] sms_fallback_url Optional. The SMS Fallback URL attached to the
192
+ # IncomingPhoneNumber resource.
193
+ # @param [String] sms_fallback_method Optional. The SMS Fallback Method attached
194
+ # to the IncomingPhoneNumber resource.
195
+ # @param [String] status_callback_url Optional. The Status Callback URL attached
196
+ # to the IncomingPhoneNumber resource.
197
+ # @param [String] status_callback_method Optional. The Status Callback Method
198
+ # attached to the IncomingPhoneNumber resource.
199
+ # @param [String] sms_application_sid Optional. The 34 character sid of the
200
+ # application Twilio should use to handle SMS messages sent to this number. If a
201
+ # `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and
202
+ # use those set on the application.
203
+ # @return [HostedNumberOrderInstance] Newly created HostedNumberOrderInstance
204
+ def create(address_sid: nil, phone_number: nil, iso_country: nil, sms_capability: nil, email: nil, account_sid: :unset, friendly_name: :unset, unique_name: :unset, cc_emails: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, sms_application_sid: :unset)
205
+ data = Twilio::Values.of({
206
+ 'AddressSid' => address_sid,
207
+ 'PhoneNumber' => phone_number,
208
+ 'IsoCountry' => iso_country,
209
+ 'SmsCapability' => sms_capability,
210
+ 'Email' => email,
211
+ 'AccountSid' => account_sid,
212
+ 'FriendlyName' => friendly_name,
213
+ 'UniqueName' => unique_name,
214
+ 'CcEmails' => cc_emails,
215
+ 'SmsUrl' => sms_url,
216
+ 'SmsMethod' => sms_method,
217
+ 'SmsFallbackUrl' => sms_fallback_url,
218
+ 'SmsFallbackMethod' => sms_fallback_method,
219
+ 'StatusCallbackUrl' => status_callback_url,
220
+ 'StatusCallbackMethod' => status_callback_method,
221
+ 'SmsApplicationSid' => sms_application_sid,
222
+ })
223
+
224
+ payload = @version.create(
225
+ 'POST',
226
+ @uri,
227
+ data: data
228
+ )
229
+
230
+ HostedNumberOrderInstance.new(
231
+ @version,
232
+ payload,
233
+ )
234
+ end
235
+
236
+ ##
237
+ # Provide a user friendly representation
238
+ def to_s
239
+ '#<Twilio.Preview.HostedNumbers.HostedNumberOrderList>'
240
+ end
241
+ end
242
+
243
+ ##
244
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
245
+ class HostedNumberOrderPage < Page
246
+ ##
247
+ # Initialize the HostedNumberOrderPage
248
+ # @param [Version] version Version that contains the resource
249
+ # @param [Response] response Response from the API
250
+ # @param [Hash] solution Path solution for the resource
251
+ # @return [HostedNumberOrderPage] HostedNumberOrderPage
252
+ def initialize(version, response, solution)
253
+ super(version, response)
254
+
255
+ # Path Solution
256
+ @solution = solution
257
+ end
258
+
259
+ ##
260
+ # Build an instance of HostedNumberOrderInstance
261
+ # @param [Hash] payload Payload response from the API
262
+ # @return [HostedNumberOrderInstance] HostedNumberOrderInstance
263
+ def get_instance(payload)
264
+ HostedNumberOrderInstance.new(
265
+ @version,
266
+ payload,
267
+ )
268
+ end
269
+
270
+ ##
271
+ # Provide a user friendly representation
272
+ def to_s
273
+ '<Twilio.Preview.HostedNumbers.HostedNumberOrderPage>'
274
+ end
275
+ end
276
+
277
+ ##
278
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
279
+ class HostedNumberOrderContext < InstanceContext
280
+ ##
281
+ # Initialize the HostedNumberOrderContext
282
+ # @param [Version] version Version that contains the resource
283
+ # @param [String] sid A 34 character string that uniquely identifies this
284
+ # HostedNumberOrder.
285
+ # @return [HostedNumberOrderContext] HostedNumberOrderContext
286
+ def initialize(version, sid)
287
+ super(version)
288
+
289
+ # Path Solution
290
+ @solution = {
291
+ sid: sid,
292
+ }
293
+ @uri = "/HostedNumberOrders/#{@solution[:sid]}"
294
+ end
295
+
296
+ ##
297
+ # Fetch a HostedNumberOrderInstance
298
+ # @return [HostedNumberOrderInstance] Fetched HostedNumberOrderInstance
299
+ def fetch
300
+ params = Twilio::Values.of({})
301
+
302
+ payload = @version.fetch(
303
+ 'GET',
304
+ @uri,
305
+ params,
306
+ )
307
+
308
+ HostedNumberOrderInstance.new(
309
+ @version,
310
+ payload,
311
+ sid: @solution[:sid],
312
+ )
313
+ end
314
+
315
+ ##
316
+ # Deletes the HostedNumberOrderInstance
317
+ # @return [Boolean] true if delete succeeds, true otherwise
318
+ def delete
319
+ @version.delete('delete', @uri)
320
+ end
321
+
322
+ ##
323
+ # Update the HostedNumberOrderInstance
324
+ # @param [String] friendly_name A human readable description of this resource, up
325
+ # to 64 characters.
326
+ # @param [String] unique_name Provides a unique and addressable name to be
327
+ # assigned to this HostedNumberOrder, assigned by the developer, to be optionally
328
+ # used in addition to SID.
329
+ # @param [String] email Email of the owner of this phone number that is being
330
+ # hosted.
331
+ # @param [String] cc_emails Optional. A list of emails that LOA document for this
332
+ # HostedNumberOrder will be carbon copied to.
333
+ # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
334
+ # User can only update this to `pending-loa` or `pending-verification`.
335
+ # @param [String] verification_code A verification code that is given to the user
336
+ # via a phone call to the phone number that is being hosted.
337
+ # @return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance
338
+ def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset)
339
+ data = Twilio::Values.of({
340
+ 'FriendlyName' => friendly_name,
341
+ 'UniqueName' => unique_name,
342
+ 'Email' => email,
343
+ 'CcEmails' => cc_emails,
344
+ 'Status' => status,
345
+ 'VerificationCode' => verification_code,
346
+ })
347
+
348
+ payload = @version.update(
349
+ 'POST',
350
+ @uri,
351
+ data: data,
352
+ )
353
+
354
+ HostedNumberOrderInstance.new(
355
+ @version,
356
+ payload,
357
+ sid: @solution[:sid],
358
+ )
359
+ end
360
+
361
+ ##
362
+ # Provide a user friendly representation
363
+ def to_s
364
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
365
+ "#<Twilio.Preview.HostedNumbers.HostedNumberOrderContext #{context}>"
366
+ end
367
+ end
368
+
369
+ ##
370
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
371
+ class HostedNumberOrderInstance < InstanceResource
372
+ ##
373
+ # Initialize the HostedNumberOrderInstance
374
+ # @param [Version] version Version that contains the resource
375
+ # @param [Hash] payload payload that contains response from Twilio
376
+ # @param [String] sid A 34 character string that uniquely identifies this
377
+ # HostedNumberOrder.
378
+ # @return [HostedNumberOrderInstance] HostedNumberOrderInstance
379
+ def initialize(version, payload, sid: nil)
380
+ super(version)
381
+
382
+ # Marshaled Properties
383
+ @properties = {
384
+ 'sid' => payload['sid'],
385
+ 'account_sid' => payload['account_sid'],
386
+ 'incoming_phone_number_sid' => payload['incoming_phone_number_sid'],
387
+ 'address_sid' => payload['address_sid'],
388
+ 'signing_document_sid' => payload['signing_document_sid'],
389
+ 'phone_number' => payload['phone_number'],
390
+ 'capabilities' => payload['capabilities'],
391
+ 'friendly_name' => payload['friendly_name'],
392
+ 'unique_name' => payload['unique_name'],
393
+ 'status' => payload['status'],
394
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
395
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
396
+ 'verification_attempts' => payload['verification_attempts'].to_i,
397
+ 'email' => payload['email'],
398
+ 'cc_emails' => payload['cc_emails'],
399
+ 'url' => payload['url'],
400
+ }
401
+
402
+ # Context
403
+ @instance_context = nil
404
+ @params = {
405
+ 'sid' => sid || @properties['sid'],
406
+ }
407
+ end
408
+
409
+ ##
410
+ # Generate an instance context for the instance, the context is capable of
411
+ # performing various actions. All instance actions are proxied to the context
412
+ # @return [HostedNumberOrderContext] HostedNumberOrderContext for this HostedNumberOrderInstance
413
+ def context
414
+ unless @instance_context
415
+ @instance_context = HostedNumberOrderContext.new(
416
+ @version,
417
+ @params['sid'],
418
+ )
419
+ end
420
+ @instance_context
421
+ end
422
+
423
+ ##
424
+ # @return [String] HostedNumberOrder sid.
425
+ def sid
426
+ @properties['sid']
427
+ end
428
+
429
+ ##
430
+ # @return [String] Account Sid.
431
+ def account_sid
432
+ @properties['account_sid']
433
+ end
434
+
435
+ ##
436
+ # @return [String] IncomingPhoneNumber sid.
437
+ def incoming_phone_number_sid
438
+ @properties['incoming_phone_number_sid']
439
+ end
440
+
441
+ ##
442
+ # @return [String] Address sid.
443
+ def address_sid
444
+ @properties['address_sid']
445
+ end
446
+
447
+ ##
448
+ # @return [String] LOA document sid.
449
+ def signing_document_sid
450
+ @properties['signing_document_sid']
451
+ end
452
+
453
+ ##
454
+ # @return [String] An E164 formatted phone number.
455
+ def phone_number
456
+ @properties['phone_number']
457
+ end
458
+
459
+ ##
460
+ # @return [String] A mapping of phone number capabilities.
461
+ def capabilities
462
+ @properties['capabilities']
463
+ end
464
+
465
+ ##
466
+ # @return [String] A human readable description of this resource.
467
+ def friendly_name
468
+ @properties['friendly_name']
469
+ end
470
+
471
+ ##
472
+ # @return [String] A unique, developer assigned name of this HostedNumberOrder.
473
+ def unique_name
474
+ @properties['unique_name']
475
+ end
476
+
477
+ ##
478
+ # @return [hosted_number_order.Status] The Status of this HostedNumberOrder.
479
+ def status
480
+ @properties['status']
481
+ end
482
+
483
+ ##
484
+ # @return [Time] The date this HostedNumberOrder was created.
485
+ def date_created
486
+ @properties['date_created']
487
+ end
488
+
489
+ ##
490
+ # @return [Time] The date this HostedNumberOrder was updated.
491
+ def date_updated
492
+ @properties['date_updated']
493
+ end
494
+
495
+ ##
496
+ # @return [String] The number of verification attempts made to verify ownership of the phone number.
497
+ def verification_attempts
498
+ @properties['verification_attempts']
499
+ end
500
+
501
+ ##
502
+ # @return [String] Email.
503
+ def email
504
+ @properties['email']
505
+ end
506
+
507
+ ##
508
+ # @return [String] A list of emails.
509
+ def cc_emails
510
+ @properties['cc_emails']
511
+ end
512
+
513
+ ##
514
+ # @return [String] The URL of this HostedNumberOrder.
515
+ def url
516
+ @properties['url']
517
+ end
518
+
519
+ ##
520
+ # Fetch a HostedNumberOrderInstance
521
+ # @return [HostedNumberOrderInstance] Fetched HostedNumberOrderInstance
522
+ def fetch
523
+ context.fetch
524
+ end
525
+
526
+ ##
527
+ # Deletes the HostedNumberOrderInstance
528
+ # @return [Boolean] true if delete succeeds, true otherwise
529
+ def delete
530
+ context.delete
531
+ end
532
+
533
+ ##
534
+ # Update the HostedNumberOrderInstance
535
+ # @param [String] friendly_name A human readable description of this resource, up
536
+ # to 64 characters.
537
+ # @param [String] unique_name Provides a unique and addressable name to be
538
+ # assigned to this HostedNumberOrder, assigned by the developer, to be optionally
539
+ # used in addition to SID.
540
+ # @param [String] email Email of the owner of this phone number that is being
541
+ # hosted.
542
+ # @param [String] cc_emails Optional. A list of emails that LOA document for this
543
+ # HostedNumberOrder will be carbon copied to.
544
+ # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
545
+ # User can only update this to `pending-loa` or `pending-verification`.
546
+ # @param [String] verification_code A verification code that is given to the user
547
+ # via a phone call to the phone number that is being hosted.
548
+ # @return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance
549
+ def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset)
550
+ context.update(
551
+ friendly_name: friendly_name,
552
+ unique_name: unique_name,
553
+ email: email,
554
+ cc_emails: cc_emails,
555
+ status: status,
556
+ verification_code: verification_code,
557
+ )
558
+ end
559
+
560
+ ##
561
+ # Provide a user friendly representation
562
+ def to_s
563
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
564
+ "<Twilio.Preview.HostedNumbers.HostedNumberOrderInstance #{values}>"
565
+ end
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end