twilio-ruby 5.0.0 → 5.1.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 (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,41 @@
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 Sync < Version
11
+ ##
12
+ # Initialize the Sync version of Preview
13
+ def initialize(domain)
14
+ super
15
+ @version = 'Sync'
16
+ @services = nil
17
+ end
18
+
19
+ ##
20
+ # @param [String] sid The sid
21
+ # @return [Twilio::REST::Preview::Sync::ServiceInstance] if sid was passed.
22
+ # @return [Twilio::REST::Preview::Sync::ServiceList]
23
+ def services(sid=:unset)
24
+ if sid.nil?
25
+ raise ArgumentError, 'sid cannot be nil'
26
+ elsif sid == :unset
27
+ @services ||= ServiceList.new self
28
+ else
29
+ ServiceContext.new(self, sid)
30
+ end
31
+ end
32
+
33
+ ##
34
+ # Provide a user friendly representation
35
+ def to_s
36
+ '<Twilio::REST::Preview::Sync>'
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,390 @@
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 Wireless < 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 CommandList < ListResource
14
+ ##
15
+ # Initialize the CommandList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [CommandList] CommandList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Commands"
24
+ end
25
+
26
+ ##
27
+ # Lists CommandInstance 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 [String] device The device
31
+ # @param [String] sim The sim
32
+ # @param [String] status The status
33
+ # @param [String] direction The direction
34
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
35
+ # guarantees to never return more than limit. Default is no limit
36
+ # @param [Integer] page_size Number of records to fetch per request, when
37
+ # not set will use the default value of 50 records. If no page_size is defined
38
+ # but a limit is defined, stream() will attempt to read the limit with the most
39
+ # efficient page size, i.e. min(limit, 1000)
40
+ # @return [Array] Array of up to limit results
41
+ def list(device: :unset, sim: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
42
+ self.stream(
43
+ device: device,
44
+ sim: sim,
45
+ status: status,
46
+ direction: direction,
47
+ limit: limit,
48
+ page_size: page_size
49
+ ).entries
50
+ end
51
+
52
+ ##
53
+ # Streams CommandInstance records from the API as an Enumerable.
54
+ # This operation lazily loads records as efficiently as possible until the limit
55
+ # is reached.
56
+ # @param [String] device The device
57
+ # @param [String] sim The sim
58
+ # @param [String] status The status
59
+ # @param [String] direction The direction
60
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
61
+ # guarantees to never return more than limit. Default is no limit.
62
+ # @param [Integer] page_size Number of records to fetch per request, when
63
+ # not set will use the default value of 50 records. If no page_size is defined
64
+ # but a limit is defined, stream() will attempt to read the limit with the most
65
+ # efficient page size, i.e. min(limit, 1000)
66
+ # @return [Enumerable] Enumerable that will yield up to limit results
67
+ def stream(device: :unset, sim: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
68
+ limits = @version.read_limits(limit, page_size)
69
+
70
+ page = self.page(
71
+ device: device,
72
+ sim: sim,
73
+ status: status,
74
+ direction: direction,
75
+ page_size: limits[:page_size],
76
+ )
77
+
78
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
79
+ end
80
+
81
+ ##
82
+ # When passed a block, yields CommandInstance records from the API.
83
+ # This operation lazily loads records as efficiently as possible until the limit
84
+ # is reached.
85
+ def each
86
+ limits = @version.read_limits
87
+
88
+ page = self.page(
89
+ page_size: limits[:page_size],
90
+ )
91
+
92
+ @version.stream(page,
93
+ limit: limits[:limit],
94
+ page_limit: limits[:page_limit]).each {|x| yield x}
95
+ end
96
+
97
+ ##
98
+ # Retrieve a single page of CommandInstance records from the API.
99
+ # Request is executed immediately.
100
+ # @param [String] device The device
101
+ # @param [String] sim The sim
102
+ # @param [String] status The status
103
+ # @param [String] direction The direction
104
+ # @param [String] page_token PageToken provided by the API
105
+ # @param [Integer] page_number Page Number, this value is simply for client state
106
+ # @param [Integer] page_size Number of records to return, defaults to 50
107
+ # @return [Page] Page of CommandInstance
108
+ def page(device: :unset, sim: :unset, status: :unset, direction: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
109
+ params = Twilio::Values.of({
110
+ 'Device' => device,
111
+ 'Sim' => sim,
112
+ 'Status' => status,
113
+ 'Direction' => direction,
114
+ 'PageToken' => page_token,
115
+ 'Page' => page_number,
116
+ 'PageSize' => page_size,
117
+ })
118
+ response = @version.page(
119
+ 'GET',
120
+ @uri,
121
+ params
122
+ )
123
+ CommandPage.new(@version, response, @solution)
124
+ end
125
+
126
+ ##
127
+ # Retrieve a single page of CommandInstance records from the API.
128
+ # Request is executed immediately.
129
+ # @param [String] target_url API-generated URL for the requested results page
130
+ # @return [Page] Page of CommandInstance
131
+ def get_page(target_url)
132
+ response = @version.domain.request(
133
+ 'GET',
134
+ target_url
135
+ )
136
+ CommandPage.new(@version, response, @solution)
137
+ end
138
+
139
+ ##
140
+ # Retrieve a single page of CommandInstance records from the API.
141
+ # Request is executed immediately.
142
+ # @param [String] command The command
143
+ # @param [String] device The device
144
+ # @param [String] sim The sim
145
+ # @param [String] callback_method The callback_method
146
+ # @param [String] callback_url The callback_url
147
+ # @param [String] command_mode The command_mode
148
+ # @param [String] include_sid The include_sid
149
+ # @return [CommandInstance] Newly created CommandInstance
150
+ def create(command: nil, device: :unset, sim: :unset, callback_method: :unset, callback_url: :unset, command_mode: :unset, include_sid: :unset)
151
+ data = Twilio::Values.of({
152
+ 'Command' => command,
153
+ 'Device' => device,
154
+ 'Sim' => sim,
155
+ 'CallbackMethod' => callback_method,
156
+ 'CallbackUrl' => callback_url,
157
+ 'CommandMode' => command_mode,
158
+ 'IncludeSid' => include_sid,
159
+ })
160
+
161
+ payload = @version.create(
162
+ 'POST',
163
+ @uri,
164
+ data: data
165
+ )
166
+
167
+ CommandInstance.new(
168
+ @version,
169
+ payload,
170
+ )
171
+ end
172
+
173
+ ##
174
+ # Provide a user friendly representation
175
+ def to_s
176
+ '#<Twilio.Preview.Wireless.CommandList>'
177
+ end
178
+ end
179
+
180
+ ##
181
+ # 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.
182
+ class CommandPage < Page
183
+ ##
184
+ # Initialize the CommandPage
185
+ # @param [Version] version Version that contains the resource
186
+ # @param [Response] response Response from the API
187
+ # @param [Hash] solution Path solution for the resource
188
+ # @return [CommandPage] CommandPage
189
+ def initialize(version, response, solution)
190
+ super(version, response)
191
+
192
+ # Path Solution
193
+ @solution = solution
194
+ end
195
+
196
+ ##
197
+ # Build an instance of CommandInstance
198
+ # @param [Hash] payload Payload response from the API
199
+ # @return [CommandInstance] CommandInstance
200
+ def get_instance(payload)
201
+ CommandInstance.new(
202
+ @version,
203
+ payload,
204
+ )
205
+ end
206
+
207
+ ##
208
+ # Provide a user friendly representation
209
+ def to_s
210
+ '<Twilio.Preview.Wireless.CommandPage>'
211
+ end
212
+ end
213
+
214
+ ##
215
+ # 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.
216
+ class CommandContext < InstanceContext
217
+ ##
218
+ # Initialize the CommandContext
219
+ # @param [Version] version Version that contains the resource
220
+ # @param [String] sid The sid
221
+ # @return [CommandContext] CommandContext
222
+ def initialize(version, sid)
223
+ super(version)
224
+
225
+ # Path Solution
226
+ @solution = {
227
+ sid: sid,
228
+ }
229
+ @uri = "/Commands/#{@solution[:sid]}"
230
+ end
231
+
232
+ ##
233
+ # Fetch a CommandInstance
234
+ # @return [CommandInstance] Fetched CommandInstance
235
+ def fetch
236
+ params = Twilio::Values.of({})
237
+
238
+ payload = @version.fetch(
239
+ 'GET',
240
+ @uri,
241
+ params,
242
+ )
243
+
244
+ CommandInstance.new(
245
+ @version,
246
+ payload,
247
+ sid: @solution[:sid],
248
+ )
249
+ end
250
+
251
+ ##
252
+ # Provide a user friendly representation
253
+ def to_s
254
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
255
+ "#<Twilio.Preview.Wireless.CommandContext #{context}>"
256
+ end
257
+ end
258
+
259
+ ##
260
+ # 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.
261
+ class CommandInstance < InstanceResource
262
+ ##
263
+ # Initialize the CommandInstance
264
+ # @param [Version] version Version that contains the resource
265
+ # @param [Hash] payload payload that contains response from Twilio
266
+ # @param [String] sid The sid
267
+ # @return [CommandInstance] CommandInstance
268
+ def initialize(version, payload, sid: nil)
269
+ super(version)
270
+
271
+ # Marshaled Properties
272
+ @properties = {
273
+ 'sid' => payload['sid'],
274
+ 'account_sid' => payload['account_sid'],
275
+ 'device_sid' => payload['device_sid'],
276
+ 'sim_sid' => payload['sim_sid'],
277
+ 'command' => payload['command'],
278
+ 'command_mode' => payload['command_mode'],
279
+ 'status' => payload['status'],
280
+ 'direction' => payload['direction'],
281
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
282
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
283
+ 'url' => payload['url'],
284
+ }
285
+
286
+ # Context
287
+ @instance_context = nil
288
+ @params = {
289
+ 'sid' => sid || @properties['sid'],
290
+ }
291
+ end
292
+
293
+ ##
294
+ # Generate an instance context for the instance, the context is capable of
295
+ # performing various actions. All instance actions are proxied to the context
296
+ # @return [CommandContext] CommandContext for this CommandInstance
297
+ def context
298
+ unless @instance_context
299
+ @instance_context = CommandContext.new(
300
+ @version,
301
+ @params['sid'],
302
+ )
303
+ end
304
+ @instance_context
305
+ end
306
+
307
+ ##
308
+ # @return [String] The sid
309
+ def sid
310
+ @properties['sid']
311
+ end
312
+
313
+ ##
314
+ # @return [String] The account_sid
315
+ def account_sid
316
+ @properties['account_sid']
317
+ end
318
+
319
+ ##
320
+ # @return [String] The device_sid
321
+ def device_sid
322
+ @properties['device_sid']
323
+ end
324
+
325
+ ##
326
+ # @return [String] The sim_sid
327
+ def sim_sid
328
+ @properties['sim_sid']
329
+ end
330
+
331
+ ##
332
+ # @return [String] The command
333
+ def command
334
+ @properties['command']
335
+ end
336
+
337
+ ##
338
+ # @return [String] The command_mode
339
+ def command_mode
340
+ @properties['command_mode']
341
+ end
342
+
343
+ ##
344
+ # @return [String] The status
345
+ def status
346
+ @properties['status']
347
+ end
348
+
349
+ ##
350
+ # @return [String] The direction
351
+ def direction
352
+ @properties['direction']
353
+ end
354
+
355
+ ##
356
+ # @return [Time] The date_created
357
+ def date_created
358
+ @properties['date_created']
359
+ end
360
+
361
+ ##
362
+ # @return [Time] The date_updated
363
+ def date_updated
364
+ @properties['date_updated']
365
+ end
366
+
367
+ ##
368
+ # @return [String] The url
369
+ def url
370
+ @properties['url']
371
+ end
372
+
373
+ ##
374
+ # Fetch a CommandInstance
375
+ # @return [CommandInstance] Fetched CommandInstance
376
+ def fetch
377
+ context.fetch
378
+ end
379
+
380
+ ##
381
+ # Provide a user friendly representation
382
+ def to_s
383
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
384
+ "<Twilio.Preview.Wireless.CommandInstance #{values}>"
385
+ end
386
+ end
387
+ end
388
+ end
389
+ end
390
+ end
@@ -0,0 +1,443 @@
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 Wireless < 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 RatePlanList < ListResource
14
+ ##
15
+ # Initialize the RatePlanList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [RatePlanList] RatePlanList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/RatePlans"
24
+ end
25
+
26
+ ##
27
+ # Lists RatePlanInstance 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 [Integer] limit Upper limit for the number of records to return. stream()
31
+ # guarantees to never return more than limit. Default is no limit
32
+ # @param [Integer] page_size Number of records to fetch per request, when
33
+ # not set will use the default value of 50 records. If no page_size is defined
34
+ # but a limit is defined, stream() will attempt to read the limit with the most
35
+ # efficient page size, i.e. min(limit, 1000)
36
+ # @return [Array] Array of up to limit results
37
+ def list(limit: nil, page_size: nil)
38
+ self.stream(
39
+ limit: limit,
40
+ page_size: page_size
41
+ ).entries
42
+ end
43
+
44
+ ##
45
+ # Streams RatePlanInstance records from the API as an Enumerable.
46
+ # This operation lazily loads records as efficiently as possible until the limit
47
+ # is reached.
48
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
49
+ # guarantees to never return more than limit. Default is no limit.
50
+ # @param [Integer] page_size Number of records to fetch per request, when
51
+ # not set will use the default value of 50 records. If no page_size is defined
52
+ # but a limit is defined, stream() will attempt to read the limit with the most
53
+ # efficient page size, i.e. min(limit, 1000)
54
+ # @return [Enumerable] Enumerable that will yield up to limit results
55
+ def stream(limit: nil, page_size: nil)
56
+ limits = @version.read_limits(limit, page_size)
57
+
58
+ page = self.page(
59
+ page_size: limits[:page_size],
60
+ )
61
+
62
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
63
+ end
64
+
65
+ ##
66
+ # When passed a block, yields RatePlanInstance records from the API.
67
+ # This operation lazily loads records as efficiently as possible until the limit
68
+ # is reached.
69
+ def each
70
+ limits = @version.read_limits
71
+
72
+ page = self.page(
73
+ page_size: limits[:page_size],
74
+ )
75
+
76
+ @version.stream(page,
77
+ limit: limits[:limit],
78
+ page_limit: limits[:page_limit]).each {|x| yield x}
79
+ end
80
+
81
+ ##
82
+ # Retrieve a single page of RatePlanInstance records from the API.
83
+ # Request is executed immediately.
84
+ # @param [String] page_token PageToken provided by the API
85
+ # @param [Integer] page_number Page Number, this value is simply for client state
86
+ # @param [Integer] page_size Number of records to return, defaults to 50
87
+ # @return [Page] Page of RatePlanInstance
88
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
89
+ params = Twilio::Values.of({
90
+ 'PageToken' => page_token,
91
+ 'Page' => page_number,
92
+ 'PageSize' => page_size,
93
+ })
94
+ response = @version.page(
95
+ 'GET',
96
+ @uri,
97
+ params
98
+ )
99
+ RatePlanPage.new(@version, response, @solution)
100
+ end
101
+
102
+ ##
103
+ # Retrieve a single page of RatePlanInstance records from the API.
104
+ # Request is executed immediately.
105
+ # @param [String] target_url API-generated URL for the requested results page
106
+ # @return [Page] Page of RatePlanInstance
107
+ def get_page(target_url)
108
+ response = @version.domain.request(
109
+ 'GET',
110
+ target_url
111
+ )
112
+ RatePlanPage.new(@version, response, @solution)
113
+ end
114
+
115
+ ##
116
+ # Retrieve a single page of RatePlanInstance records from the API.
117
+ # Request is executed immediately.
118
+ # @param [String] unique_name The unique_name
119
+ # @param [String] friendly_name The friendly_name
120
+ # @param [Boolean] data_enabled The data_enabled
121
+ # @param [String] data_limit The data_limit
122
+ # @param [String] data_metering The data_metering
123
+ # @param [Boolean] messaging_enabled The messaging_enabled
124
+ # @param [Boolean] voice_enabled The voice_enabled
125
+ # @param [Boolean] commands_enabled The commands_enabled
126
+ # @param [Boolean] national_roaming_enabled The national_roaming_enabled
127
+ # @param [String] international_roaming The international_roaming
128
+ # @return [RatePlanInstance] Newly created RatePlanInstance
129
+ def create(unique_name: :unset, friendly_name: :unset, data_enabled: :unset, data_limit: :unset, data_metering: :unset, messaging_enabled: :unset, voice_enabled: :unset, commands_enabled: :unset, national_roaming_enabled: :unset, international_roaming: :unset)
130
+ data = Twilio::Values.of({
131
+ 'UniqueName' => unique_name,
132
+ 'FriendlyName' => friendly_name,
133
+ 'DataEnabled' => data_enabled,
134
+ 'DataLimit' => data_limit,
135
+ 'DataMetering' => data_metering,
136
+ 'MessagingEnabled' => messaging_enabled,
137
+ 'VoiceEnabled' => voice_enabled,
138
+ 'CommandsEnabled' => commands_enabled,
139
+ 'NationalRoamingEnabled' => national_roaming_enabled,
140
+ 'InternationalRoaming' => international_roaming,
141
+ })
142
+
143
+ payload = @version.create(
144
+ 'POST',
145
+ @uri,
146
+ data: data
147
+ )
148
+
149
+ RatePlanInstance.new(
150
+ @version,
151
+ payload,
152
+ )
153
+ end
154
+
155
+ ##
156
+ # Provide a user friendly representation
157
+ def to_s
158
+ '#<Twilio.Preview.Wireless.RatePlanList>'
159
+ end
160
+ end
161
+
162
+ ##
163
+ # 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.
164
+ class RatePlanPage < Page
165
+ ##
166
+ # Initialize the RatePlanPage
167
+ # @param [Version] version Version that contains the resource
168
+ # @param [Response] response Response from the API
169
+ # @param [Hash] solution Path solution for the resource
170
+ # @return [RatePlanPage] RatePlanPage
171
+ def initialize(version, response, solution)
172
+ super(version, response)
173
+
174
+ # Path Solution
175
+ @solution = solution
176
+ end
177
+
178
+ ##
179
+ # Build an instance of RatePlanInstance
180
+ # @param [Hash] payload Payload response from the API
181
+ # @return [RatePlanInstance] RatePlanInstance
182
+ def get_instance(payload)
183
+ RatePlanInstance.new(
184
+ @version,
185
+ payload,
186
+ )
187
+ end
188
+
189
+ ##
190
+ # Provide a user friendly representation
191
+ def to_s
192
+ '<Twilio.Preview.Wireless.RatePlanPage>'
193
+ end
194
+ end
195
+
196
+ ##
197
+ # 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.
198
+ class RatePlanContext < InstanceContext
199
+ ##
200
+ # Initialize the RatePlanContext
201
+ # @param [Version] version Version that contains the resource
202
+ # @param [String] sid The sid
203
+ # @return [RatePlanContext] RatePlanContext
204
+ def initialize(version, sid)
205
+ super(version)
206
+
207
+ # Path Solution
208
+ @solution = {
209
+ sid: sid,
210
+ }
211
+ @uri = "/RatePlans/#{@solution[:sid]}"
212
+ end
213
+
214
+ ##
215
+ # Fetch a RatePlanInstance
216
+ # @return [RatePlanInstance] Fetched RatePlanInstance
217
+ def fetch
218
+ params = Twilio::Values.of({})
219
+
220
+ payload = @version.fetch(
221
+ 'GET',
222
+ @uri,
223
+ params,
224
+ )
225
+
226
+ RatePlanInstance.new(
227
+ @version,
228
+ payload,
229
+ sid: @solution[:sid],
230
+ )
231
+ end
232
+
233
+ ##
234
+ # Update the RatePlanInstance
235
+ # @param [String] unique_name The unique_name
236
+ # @param [String] friendly_name The friendly_name
237
+ # @return [RatePlanInstance] Updated RatePlanInstance
238
+ def update(unique_name: :unset, friendly_name: :unset)
239
+ data = Twilio::Values.of({
240
+ 'UniqueName' => unique_name,
241
+ 'FriendlyName' => friendly_name,
242
+ })
243
+
244
+ payload = @version.update(
245
+ 'POST',
246
+ @uri,
247
+ data: data,
248
+ )
249
+
250
+ RatePlanInstance.new(
251
+ @version,
252
+ payload,
253
+ sid: @solution[:sid],
254
+ )
255
+ end
256
+
257
+ ##
258
+ # Deletes the RatePlanInstance
259
+ # @return [Boolean] true if delete succeeds, true otherwise
260
+ def delete
261
+ @version.delete('delete', @uri)
262
+ end
263
+
264
+ ##
265
+ # Provide a user friendly representation
266
+ def to_s
267
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
268
+ "#<Twilio.Preview.Wireless.RatePlanContext #{context}>"
269
+ end
270
+ end
271
+
272
+ ##
273
+ # 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.
274
+ class RatePlanInstance < InstanceResource
275
+ ##
276
+ # Initialize the RatePlanInstance
277
+ # @param [Version] version Version that contains the resource
278
+ # @param [Hash] payload payload that contains response from Twilio
279
+ # @param [String] sid The sid
280
+ # @return [RatePlanInstance] RatePlanInstance
281
+ def initialize(version, payload, sid: nil)
282
+ super(version)
283
+
284
+ # Marshaled Properties
285
+ @properties = {
286
+ 'sid' => payload['sid'],
287
+ 'unique_name' => payload['unique_name'],
288
+ 'account_sid' => payload['account_sid'],
289
+ 'friendly_name' => payload['friendly_name'],
290
+ 'data_enabled' => payload['data_enabled'],
291
+ 'data_metering' => payload['data_metering'],
292
+ 'data_limit' => payload['data_limit'].to_i,
293
+ 'messaging_enabled' => payload['messaging_enabled'],
294
+ 'voice_enabled' => payload['voice_enabled'],
295
+ 'national_roaming_enabled' => payload['national_roaming_enabled'],
296
+ 'international_roaming' => payload['international_roaming'],
297
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
298
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
299
+ 'url' => payload['url'],
300
+ }
301
+
302
+ # Context
303
+ @instance_context = nil
304
+ @params = {
305
+ 'sid' => sid || @properties['sid'],
306
+ }
307
+ end
308
+
309
+ ##
310
+ # Generate an instance context for the instance, the context is capable of
311
+ # performing various actions. All instance actions are proxied to the context
312
+ # @return [RatePlanContext] RatePlanContext for this RatePlanInstance
313
+ def context
314
+ unless @instance_context
315
+ @instance_context = RatePlanContext.new(
316
+ @version,
317
+ @params['sid'],
318
+ )
319
+ end
320
+ @instance_context
321
+ end
322
+
323
+ ##
324
+ # @return [String] The sid
325
+ def sid
326
+ @properties['sid']
327
+ end
328
+
329
+ ##
330
+ # @return [String] The unique_name
331
+ def unique_name
332
+ @properties['unique_name']
333
+ end
334
+
335
+ ##
336
+ # @return [String] The account_sid
337
+ def account_sid
338
+ @properties['account_sid']
339
+ end
340
+
341
+ ##
342
+ # @return [String] The friendly_name
343
+ def friendly_name
344
+ @properties['friendly_name']
345
+ end
346
+
347
+ ##
348
+ # @return [Boolean] The data_enabled
349
+ def data_enabled
350
+ @properties['data_enabled']
351
+ end
352
+
353
+ ##
354
+ # @return [String] The data_metering
355
+ def data_metering
356
+ @properties['data_metering']
357
+ end
358
+
359
+ ##
360
+ # @return [String] The data_limit
361
+ def data_limit
362
+ @properties['data_limit']
363
+ end
364
+
365
+ ##
366
+ # @return [Boolean] The messaging_enabled
367
+ def messaging_enabled
368
+ @properties['messaging_enabled']
369
+ end
370
+
371
+ ##
372
+ # @return [Boolean] The voice_enabled
373
+ def voice_enabled
374
+ @properties['voice_enabled']
375
+ end
376
+
377
+ ##
378
+ # @return [Boolean] The national_roaming_enabled
379
+ def national_roaming_enabled
380
+ @properties['national_roaming_enabled']
381
+ end
382
+
383
+ ##
384
+ # @return [String] The international_roaming
385
+ def international_roaming
386
+ @properties['international_roaming']
387
+ end
388
+
389
+ ##
390
+ # @return [Time] The date_created
391
+ def date_created
392
+ @properties['date_created']
393
+ end
394
+
395
+ ##
396
+ # @return [Time] The date_updated
397
+ def date_updated
398
+ @properties['date_updated']
399
+ end
400
+
401
+ ##
402
+ # @return [String] The url
403
+ def url
404
+ @properties['url']
405
+ end
406
+
407
+ ##
408
+ # Fetch a RatePlanInstance
409
+ # @return [RatePlanInstance] Fetched RatePlanInstance
410
+ def fetch
411
+ context.fetch
412
+ end
413
+
414
+ ##
415
+ # Update the RatePlanInstance
416
+ # @param [String] unique_name The unique_name
417
+ # @param [String] friendly_name The friendly_name
418
+ # @return [RatePlanInstance] Updated RatePlanInstance
419
+ def update(unique_name: :unset, friendly_name: :unset)
420
+ context.update(
421
+ unique_name: unique_name,
422
+ friendly_name: friendly_name,
423
+ )
424
+ end
425
+
426
+ ##
427
+ # Deletes the RatePlanInstance
428
+ # @return [Boolean] true if delete succeeds, true otherwise
429
+ def delete
430
+ context.delete
431
+ end
432
+
433
+ ##
434
+ # Provide a user friendly representation
435
+ def to_s
436
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
437
+ "<Twilio.Preview.Wireless.RatePlanInstance #{values}>"
438
+ end
439
+ end
440
+ end
441
+ end
442
+ end
443
+ end