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,71 @@
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 Wireless < Version
11
+ ##
12
+ # Initialize the Wireless version of Preview
13
+ def initialize(domain)
14
+ super
15
+ @version = 'wireless'
16
+ @commands = nil
17
+ @rate_plans = nil
18
+ @sims = nil
19
+ end
20
+
21
+ ##
22
+ # @param [String] sid The sid
23
+ # @return [Twilio::REST::Preview::Wireless::CommandInstance] if sid was passed.
24
+ # @return [Twilio::REST::Preview::Wireless::CommandList]
25
+ def commands(sid=:unset)
26
+ if sid.nil?
27
+ raise ArgumentError, 'sid cannot be nil'
28
+ elsif sid == :unset
29
+ @commands ||= CommandList.new self
30
+ else
31
+ CommandContext.new(self, sid)
32
+ end
33
+ end
34
+
35
+ ##
36
+ # @param [String] sid The sid
37
+ # @return [Twilio::REST::Preview::Wireless::RatePlanInstance] if sid was passed.
38
+ # @return [Twilio::REST::Preview::Wireless::RatePlanList]
39
+ def rate_plans(sid=:unset)
40
+ if sid.nil?
41
+ raise ArgumentError, 'sid cannot be nil'
42
+ elsif sid == :unset
43
+ @rate_plans ||= RatePlanList.new self
44
+ else
45
+ RatePlanContext.new(self, sid)
46
+ end
47
+ end
48
+
49
+ ##
50
+ # @param [String] sid The sid
51
+ # @return [Twilio::REST::Preview::Wireless::SimInstance] if sid was passed.
52
+ # @return [Twilio::REST::Preview::Wireless::SimList]
53
+ def sims(sid=:unset)
54
+ if sid.nil?
55
+ raise ArgumentError, 'sid cannot be nil'
56
+ elsif sid == :unset
57
+ @sims ||= SimList.new self
58
+ else
59
+ SimContext.new(self, sid)
60
+ end
61
+ end
62
+
63
+ ##
64
+ # Provide a user friendly representation
65
+ def to_s
66
+ '<Twilio::REST::Preview::Wireless>'
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,145 @@
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
+ ##
11
+ # Initialize the Preview Domain
12
+ def initialize(twilio)
13
+ super
14
+
15
+ @base_url = 'https://preview.twilio.com'
16
+ @host = 'preview.twilio.com'
17
+ @port = 443
18
+
19
+ # Versions
20
+ @sync = nil
21
+ @wireless = nil
22
+ @marketplace = nil
23
+ @bulk_exports = nil
24
+ @proxy = nil
25
+ @hosted_numbers = nil
26
+ end
27
+
28
+ ##
29
+ # Version sync of preview
30
+ def sync
31
+ @sync ||= Sync.new self
32
+ end
33
+
34
+ ##
35
+ # Version wireless of preview
36
+ def wireless
37
+ @wireless ||= Wireless.new self
38
+ end
39
+
40
+ ##
41
+ # Version marketplace of preview
42
+ def marketplace
43
+ @marketplace ||= Marketplace.new self
44
+ end
45
+
46
+ ##
47
+ # Version bulk_exports of preview
48
+ def bulk_exports
49
+ @bulk_exports ||= BulkExports.new self
50
+ end
51
+
52
+ ##
53
+ # Version proxy of preview
54
+ def proxy
55
+ @proxy ||= Proxy.new self
56
+ end
57
+
58
+ ##
59
+ # Version hosted_numbers of preview
60
+ def hosted_numbers
61
+ @hosted_numbers ||= HostedNumbers.new self
62
+ end
63
+
64
+ ##
65
+ # @param [String] sid A 34 character string that uniquely identifies this Service.
66
+ # @return [Twilio::REST::Preview::Proxy::ServiceInstance] if sid was passed.
67
+ # @return [Twilio::REST::Preview::Proxy::ServiceList]
68
+ def services(sid=:unset)
69
+ self.proxy.services(sid)
70
+ end
71
+
72
+ ##
73
+ # @param [String] sid The sid
74
+ # @return [Twilio::REST::Preview::Wireless::CommandInstance] if sid was passed.
75
+ # @return [Twilio::REST::Preview::Wireless::CommandList]
76
+ def commands(sid=:unset)
77
+ self.wireless.commands(sid)
78
+ end
79
+
80
+ ##
81
+ # @param [String] sid The sid
82
+ # @return [Twilio::REST::Preview::Wireless::RatePlanInstance] if sid was passed.
83
+ # @return [Twilio::REST::Preview::Wireless::RatePlanList]
84
+ def rate_plans(sid=:unset)
85
+ self.wireless.rate_plans(sid)
86
+ end
87
+
88
+ ##
89
+ # @param [String] sid The sid
90
+ # @return [Twilio::REST::Preview::Wireless::SimInstance] if sid was passed.
91
+ # @return [Twilio::REST::Preview::Wireless::SimList]
92
+ def sims(sid=:unset)
93
+ self.wireless.sims(sid)
94
+ end
95
+
96
+ ##
97
+ # @param [String] sid A 34 character string that uniquely identifies this Add-on.
98
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnInstance] if sid was passed.
99
+ # @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
100
+ def available_add_ons(sid=:unset)
101
+ self.marketplace.available_add_ons(sid)
102
+ end
103
+
104
+ ##
105
+ # @param [String] sid A 34 character string that uniquely identifies this Add-on
106
+ # installation.
107
+ # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnInstance] if sid was passed.
108
+ # @return [Twilio::REST::Preview::Marketplace::InstalledAddOnList]
109
+ def installed_add_ons(sid=:unset)
110
+ self.marketplace.installed_add_ons(sid)
111
+ end
112
+
113
+ ##
114
+ # @param [String] resource_type The resource_type
115
+ # @return [Twilio::REST::Preview::BulkExports::ExportInstance] if resource_type was passed.
116
+ # @return [Twilio::REST::Preview::BulkExports::ExportList]
117
+ def exports(resource_type=:unset)
118
+ self.bulk_exports.exports(resource_type)
119
+ end
120
+
121
+ ##
122
+ # @param [String] resource_type The resource_type
123
+ # @return [Twilio::REST::Preview::BulkExports::ExportConfigurationInstance] if resource_type was passed.
124
+ # @return [Twilio::REST::Preview::BulkExports::ExportConfigurationList]
125
+ def export_configuration(resource_type=:unset)
126
+ self.bulk_exports.export_configuration(resource_type)
127
+ end
128
+
129
+ ##
130
+ # @param [String] sid A 34 character string that uniquely identifies this
131
+ # HostedNumberOrder.
132
+ # @return [Twilio::REST::Preview::HostedNumbers::HostedNumberOrderInstance] if sid was passed.
133
+ # @return [Twilio::REST::Preview::HostedNumbers::HostedNumberOrderList]
134
+ def hosted_number_orders(sid=:unset)
135
+ self.hosted_numbers.hosted_number_orders(sid)
136
+ end
137
+
138
+ ##
139
+ # Provide a user friendly representation
140
+ def to_s
141
+ '#<Twilio::REST::Preview>'
142
+ end
143
+ end
144
+ end
145
+ end
@@ -27,11 +27,11 @@ module Twilio
27
27
  # Unlike stream(), this operation is eager and will load `limit` records into
28
28
  # memory before returning.
29
29
  # @param [Integer] limit Upper limit for the number of records to return. stream()
30
- # guarantees to never return more than limit. Default is no limit
31
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
32
- # the default value of 50 records. If no page_size is defined
33
- # but a limit is defined, stream() will attempt to read the
34
- # limit with the most efficient page size, i.e. min(limit, 1000)
30
+ # guarantees to never return more than limit. Default is no limit
31
+ # @param [Integer] page_size Number of records to fetch per request, when
32
+ # not set will use the default value of 50 records. If no page_size is defined
33
+ # but a limit is defined, stream() will attempt to read the limit with the most
34
+ # efficient page size, i.e. min(limit, 1000)
35
35
  # @return [Array] Array of up to limit results
36
36
  def list(limit: nil, page_size: nil)
37
37
  self.stream(
@@ -44,12 +44,12 @@ module Twilio
44
44
  # Streams CountryInstance records from the API as an Enumerable.
45
45
  # This operation lazily loads records as efficiently as possible until the limit
46
46
  # is reached.
47
- # @param [Integer] limit Upper limit for the number of records to return. stream()
48
- # guarantees to never return more than limit. Default is no limit
49
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
50
- # the default value of 50 records. If no page_size is defined
51
- # but a limit is defined, stream() will attempt to read the
52
- # limit with the most efficient page size, i.e. min(limit, 1000)
47
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
48
+ # guarantees to never return more than limit. Default is no limit.
49
+ # @param [Integer] page_size Number of records to fetch per request, when
50
+ # not set will use the default value of 50 records. If no page_size is defined
51
+ # but a limit is defined, stream() will attempt to read the limit with the most
52
+ # efficient page size, i.e. min(limit, 1000)
53
53
  # @return [Enumerable] Enumerable that will yield up to limit results
54
54
  def stream(limit: nil, page_size: nil)
55
55
  limits = @version.read_limits(limit, page_size)
@@ -27,11 +27,11 @@ module Twilio
27
27
  # Unlike stream(), this operation is eager and will load `limit` records into
28
28
  # memory before returning.
29
29
  # @param [Integer] limit Upper limit for the number of records to return. stream()
30
- # guarantees to never return more than limit. Default is no limit
31
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
32
- # the default value of 50 records. If no page_size is defined
33
- # but a limit is defined, stream() will attempt to read the
34
- # limit with the most efficient page size, i.e. min(limit, 1000)
30
+ # guarantees to never return more than limit. Default is no limit
31
+ # @param [Integer] page_size Number of records to fetch per request, when
32
+ # not set will use the default value of 50 records. If no page_size is defined
33
+ # but a limit is defined, stream() will attempt to read the limit with the most
34
+ # efficient page size, i.e. min(limit, 1000)
35
35
  # @return [Array] Array of up to limit results
36
36
  def list(limit: nil, page_size: nil)
37
37
  self.stream(
@@ -44,12 +44,12 @@ module Twilio
44
44
  # Streams CountryInstance records from the API as an Enumerable.
45
45
  # This operation lazily loads records as efficiently as possible until the limit
46
46
  # is reached.
47
- # @param [Integer] limit Upper limit for the number of records to return. stream()
48
- # guarantees to never return more than limit. Default is no limit
49
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
50
- # the default value of 50 records. If no page_size is defined
51
- # but a limit is defined, stream() will attempt to read the
52
- # limit with the most efficient page size, i.e. min(limit, 1000)
47
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
48
+ # guarantees to never return more than limit. Default is no limit.
49
+ # @param [Integer] page_size Number of records to fetch per request, when
50
+ # not set will use the default value of 50 records. If no page_size is defined
51
+ # but a limit is defined, stream() will attempt to read the limit with the most
52
+ # efficient page size, i.e. min(limit, 1000)
53
53
  # @return [Enumerable] Enumerable that will yield up to limit results
54
54
  def stream(limit: nil, page_size: nil)
55
55
  limits = @version.read_limits(limit, page_size)
@@ -27,11 +27,11 @@ module Twilio
27
27
  # Unlike stream(), this operation is eager and will load `limit` records into
28
28
  # memory before returning.
29
29
  # @param [Integer] limit Upper limit for the number of records to return. stream()
30
- # guarantees to never return more than limit. Default is no limit
31
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
32
- # the default value of 50 records. If no page_size is defined
33
- # but a limit is defined, stream() will attempt to read the
34
- # limit with the most efficient page size, i.e. min(limit, 1000)
30
+ # guarantees to never return more than limit. Default is no limit
31
+ # @param [Integer] page_size Number of records to fetch per request, when
32
+ # not set will use the default value of 50 records. If no page_size is defined
33
+ # but a limit is defined, stream() will attempt to read the limit with the most
34
+ # efficient page size, i.e. min(limit, 1000)
35
35
  # @return [Array] Array of up to limit results
36
36
  def list(limit: nil, page_size: nil)
37
37
  self.stream(
@@ -44,12 +44,12 @@ module Twilio
44
44
  # Streams CountryInstance records from the API as an Enumerable.
45
45
  # This operation lazily loads records as efficiently as possible until the limit
46
46
  # is reached.
47
- # @param [Integer] limit Upper limit for the number of records to return. stream()
48
- # guarantees to never return more than limit. Default is no limit
49
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
50
- # the default value of 50 records. If no page_size is defined
51
- # but a limit is defined, stream() will attempt to read the
52
- # limit with the most efficient page size, i.e. min(limit, 1000)
47
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
48
+ # guarantees to never return more than limit. Default is no limit.
49
+ # @param [Integer] page_size Number of records to fetch per request, when
50
+ # not set will use the default value of 50 records. If no page_size is defined
51
+ # but a limit is defined, stream() will attempt to read the limit with the most
52
+ # efficient page size, i.e. min(limit, 1000)
53
53
  # @return [Enumerable] Enumerable that will yield up to limit results
54
54
  def stream(limit: nil, page_size: nil)
55
55
  limits = @version.read_limits(limit, page_size)
@@ -0,0 +1,403 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Sync < Domain
10
+ class V1 < Version
11
+ class ServiceContext < InstanceContext
12
+ class DocumentContext < InstanceContext
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class DocumentPermissionList < ListResource
16
+ ##
17
+ # Initialize the DocumentPermissionList
18
+ # @param [Version] version Version that contains the resource
19
+ # @param [String] service_sid The unique SID identifier of the Sync Service
20
+ # Instance.
21
+ # @param [String] document_sid The unique SID identifier of the Sync Document to
22
+ # which the Permission applies.
23
+ # @return [DocumentPermissionList] DocumentPermissionList
24
+ def initialize(version, service_sid: nil, document_sid: nil)
25
+ super(version)
26
+
27
+ # Path Solution
28
+ @solution = {
29
+ service_sid: service_sid,
30
+ document_sid: document_sid
31
+ }
32
+ @uri = "/Services/#{@solution[:service_sid]}/Documents/#{@solution[:document_sid]}/Permissions"
33
+ end
34
+
35
+ ##
36
+ # Lists DocumentPermissionInstance records from the API as a list.
37
+ # Unlike stream(), this operation is eager and will load `limit` records into
38
+ # memory before returning.
39
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
40
+ # guarantees to never return more than limit. Default is no limit
41
+ # @param [Integer] page_size Number of records to fetch per request, when
42
+ # not set will use the default value of 50 records. If no page_size is defined
43
+ # but a limit is defined, stream() will attempt to read the limit with the most
44
+ # efficient page size, i.e. min(limit, 1000)
45
+ # @return [Array] Array of up to limit results
46
+ def list(limit: nil, page_size: nil)
47
+ self.stream(
48
+ limit: limit,
49
+ page_size: page_size
50
+ ).entries
51
+ end
52
+
53
+ ##
54
+ # Streams DocumentPermissionInstance records from the API as an Enumerable.
55
+ # This operation lazily loads records as efficiently as possible until the limit
56
+ # is reached.
57
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
58
+ # guarantees to never return more than limit. Default is no limit.
59
+ # @param [Integer] page_size Number of records to fetch per request, when
60
+ # not set will use the default value of 50 records. If no page_size is defined
61
+ # but a limit is defined, stream() will attempt to read the limit with the most
62
+ # efficient page size, i.e. min(limit, 1000)
63
+ # @return [Enumerable] Enumerable that will yield up to limit results
64
+ def stream(limit: nil, page_size: nil)
65
+ limits = @version.read_limits(limit, page_size)
66
+
67
+ page = self.page(
68
+ page_size: limits[:page_size],
69
+ )
70
+
71
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
72
+ end
73
+
74
+ ##
75
+ # When passed a block, yields DocumentPermissionInstance records from the API.
76
+ # This operation lazily loads records as efficiently as possible until the limit
77
+ # is reached.
78
+ def each
79
+ limits = @version.read_limits
80
+
81
+ page = self.page(
82
+ page_size: limits[:page_size],
83
+ )
84
+
85
+ @version.stream(page,
86
+ limit: limits[:limit],
87
+ page_limit: limits[:page_limit]).each {|x| yield x}
88
+ end
89
+
90
+ ##
91
+ # Retrieve a single page of DocumentPermissionInstance records from the API.
92
+ # Request is executed immediately.
93
+ # @param [String] page_token PageToken provided by the API
94
+ # @param [Integer] page_number Page Number, this value is simply for client state
95
+ # @param [Integer] page_size Number of records to return, defaults to 50
96
+ # @return [Page] Page of DocumentPermissionInstance
97
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
98
+ params = Twilio::Values.of({
99
+ 'PageToken' => page_token,
100
+ 'Page' => page_number,
101
+ 'PageSize' => page_size,
102
+ })
103
+ response = @version.page(
104
+ 'GET',
105
+ @uri,
106
+ params
107
+ )
108
+ DocumentPermissionPage.new(@version, response, @solution)
109
+ end
110
+
111
+ ##
112
+ # Retrieve a single page of DocumentPermissionInstance records from the API.
113
+ # Request is executed immediately.
114
+ # @param [String] target_url API-generated URL for the requested results page
115
+ # @return [Page] Page of DocumentPermissionInstance
116
+ def get_page(target_url)
117
+ response = @version.domain.request(
118
+ 'GET',
119
+ target_url
120
+ )
121
+ DocumentPermissionPage.new(@version, response, @solution)
122
+ end
123
+
124
+ ##
125
+ # Provide a user friendly representation
126
+ def to_s
127
+ '#<Twilio.Sync.V1.DocumentPermissionList>'
128
+ end
129
+ end
130
+
131
+ ##
132
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
133
+ class DocumentPermissionPage < Page
134
+ ##
135
+ # Initialize the DocumentPermissionPage
136
+ # @param [Version] version Version that contains the resource
137
+ # @param [Response] response Response from the API
138
+ # @param [Hash] solution Path solution for the resource
139
+ # @return [DocumentPermissionPage] DocumentPermissionPage
140
+ def initialize(version, response, solution)
141
+ super(version, response)
142
+
143
+ # Path Solution
144
+ @solution = solution
145
+ end
146
+
147
+ ##
148
+ # Build an instance of DocumentPermissionInstance
149
+ # @param [Hash] payload Payload response from the API
150
+ # @return [DocumentPermissionInstance] DocumentPermissionInstance
151
+ def get_instance(payload)
152
+ DocumentPermissionInstance.new(
153
+ @version,
154
+ payload,
155
+ service_sid: @solution[:service_sid],
156
+ document_sid: @solution[:document_sid],
157
+ )
158
+ end
159
+
160
+ ##
161
+ # Provide a user friendly representation
162
+ def to_s
163
+ '<Twilio.Sync.V1.DocumentPermissionPage>'
164
+ end
165
+ end
166
+
167
+ ##
168
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
169
+ class DocumentPermissionContext < InstanceContext
170
+ ##
171
+ # Initialize the DocumentPermissionContext
172
+ # @param [Version] version Version that contains the resource
173
+ # @param [String] service_sid The service_sid
174
+ # @param [String] document_sid Identifier of the Sync Document. Either a SID or a
175
+ # unique name.
176
+ # @param [String] identity Arbitrary string identifier representing a user
177
+ # associated with an FPA token, assigned by the developer.
178
+ # @return [DocumentPermissionContext] DocumentPermissionContext
179
+ def initialize(version, service_sid, document_sid, identity)
180
+ super(version)
181
+
182
+ # Path Solution
183
+ @solution = {
184
+ service_sid: service_sid,
185
+ document_sid: document_sid,
186
+ identity: identity,
187
+ }
188
+ @uri = "/Services/#{@solution[:service_sid]}/Documents/#{@solution[:document_sid]}/Permissions/#{@solution[:identity]}"
189
+ end
190
+
191
+ ##
192
+ # Fetch a DocumentPermissionInstance
193
+ # @return [DocumentPermissionInstance] Fetched DocumentPermissionInstance
194
+ def fetch
195
+ params = Twilio::Values.of({})
196
+
197
+ payload = @version.fetch(
198
+ 'GET',
199
+ @uri,
200
+ params,
201
+ )
202
+
203
+ DocumentPermissionInstance.new(
204
+ @version,
205
+ payload,
206
+ service_sid: @solution[:service_sid],
207
+ document_sid: @solution[:document_sid],
208
+ identity: @solution[:identity],
209
+ )
210
+ end
211
+
212
+ ##
213
+ # Deletes the DocumentPermissionInstance
214
+ # @return [Boolean] true if delete succeeds, true otherwise
215
+ def delete
216
+ @version.delete('delete', @uri)
217
+ end
218
+
219
+ ##
220
+ # Update the DocumentPermissionInstance
221
+ # @param [Boolean] read Boolean flag specifying whether the identity can read the
222
+ # Sync Document.
223
+ # @param [Boolean] write Boolean flag specifying whether the identity can update
224
+ # the Sync Document.
225
+ # @param [Boolean] manage Boolean flag specifying whether the identity can delete
226
+ # the Sync Document.
227
+ # @return [DocumentPermissionInstance] Updated DocumentPermissionInstance
228
+ def update(read: nil, write: nil, manage: nil)
229
+ data = Twilio::Values.of({
230
+ 'Read' => read,
231
+ 'Write' => write,
232
+ 'Manage' => manage,
233
+ })
234
+
235
+ payload = @version.update(
236
+ 'POST',
237
+ @uri,
238
+ data: data,
239
+ )
240
+
241
+ DocumentPermissionInstance.new(
242
+ @version,
243
+ payload,
244
+ service_sid: @solution[:service_sid],
245
+ document_sid: @solution[:document_sid],
246
+ identity: @solution[:identity],
247
+ )
248
+ end
249
+
250
+ ##
251
+ # Provide a user friendly representation
252
+ def to_s
253
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
254
+ "#<Twilio.Sync.V1.DocumentPermissionContext #{context}>"
255
+ end
256
+ end
257
+
258
+ ##
259
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
260
+ class DocumentPermissionInstance < InstanceResource
261
+ ##
262
+ # Initialize the DocumentPermissionInstance
263
+ # @param [Version] version Version that contains the resource
264
+ # @param [Hash] payload payload that contains response from Twilio
265
+ # @param [String] service_sid The unique SID identifier of the Sync Service
266
+ # Instance.
267
+ # @param [String] document_sid The unique SID identifier of the Sync Document to
268
+ # which the Permission applies.
269
+ # @param [String] identity Arbitrary string identifier representing a user
270
+ # associated with an FPA token, assigned by the developer.
271
+ # @return [DocumentPermissionInstance] DocumentPermissionInstance
272
+ def initialize(version, payload, service_sid: nil, document_sid: nil, identity: nil)
273
+ super(version)
274
+
275
+ # Marshaled Properties
276
+ @properties = {
277
+ 'account_sid' => payload['account_sid'],
278
+ 'service_sid' => payload['service_sid'],
279
+ 'document_sid' => payload['document_sid'],
280
+ 'identity' => payload['identity'],
281
+ 'read' => payload['read'],
282
+ 'write' => payload['write'],
283
+ 'manage' => payload['manage'],
284
+ 'url' => payload['url'],
285
+ }
286
+
287
+ # Context
288
+ @instance_context = nil
289
+ @params = {
290
+ 'service_sid' => service_sid,
291
+ 'document_sid' => document_sid,
292
+ 'identity' => identity || @properties['identity'],
293
+ }
294
+ end
295
+
296
+ ##
297
+ # Generate an instance context for the instance, the context is capable of
298
+ # performing various actions. All instance actions are proxied to the context
299
+ # @return [DocumentPermissionContext] DocumentPermissionContext for this DocumentPermissionInstance
300
+ def context
301
+ unless @instance_context
302
+ @instance_context = DocumentPermissionContext.new(
303
+ @version,
304
+ @params['service_sid'],
305
+ @params['document_sid'],
306
+ @params['identity'],
307
+ )
308
+ end
309
+ @instance_context
310
+ end
311
+
312
+ ##
313
+ # @return [String] Twilio Account SID.
314
+ def account_sid
315
+ @properties['account_sid']
316
+ end
317
+
318
+ ##
319
+ # @return [String] Sync Service Instance SID.
320
+ def service_sid
321
+ @properties['service_sid']
322
+ end
323
+
324
+ ##
325
+ # @return [String] Sync Document SID.
326
+ def document_sid
327
+ @properties['document_sid']
328
+ end
329
+
330
+ ##
331
+ # @return [String] Identity of the user to whom the Sync Document Permission applies.
332
+ def identity
333
+ @properties['identity']
334
+ end
335
+
336
+ ##
337
+ # @return [Boolean] Read access.
338
+ def read
339
+ @properties['read']
340
+ end
341
+
342
+ ##
343
+ # @return [Boolean] Write access.
344
+ def write
345
+ @properties['write']
346
+ end
347
+
348
+ ##
349
+ # @return [Boolean] Manage access.
350
+ def manage
351
+ @properties['manage']
352
+ end
353
+
354
+ ##
355
+ # @return [String] URL of this Sync Document Permission.
356
+ def url
357
+ @properties['url']
358
+ end
359
+
360
+ ##
361
+ # Fetch a DocumentPermissionInstance
362
+ # @return [DocumentPermissionInstance] Fetched DocumentPermissionInstance
363
+ def fetch
364
+ context.fetch
365
+ end
366
+
367
+ ##
368
+ # Deletes the DocumentPermissionInstance
369
+ # @return [Boolean] true if delete succeeds, true otherwise
370
+ def delete
371
+ context.delete
372
+ end
373
+
374
+ ##
375
+ # Update the DocumentPermissionInstance
376
+ # @param [Boolean] read Boolean flag specifying whether the identity can read the
377
+ # Sync Document.
378
+ # @param [Boolean] write Boolean flag specifying whether the identity can update
379
+ # the Sync Document.
380
+ # @param [Boolean] manage Boolean flag specifying whether the identity can delete
381
+ # the Sync Document.
382
+ # @return [DocumentPermissionInstance] Updated DocumentPermissionInstance
383
+ def update(read: nil, write: nil, manage: nil)
384
+ context.update(
385
+ read: read,
386
+ write: write,
387
+ manage: manage,
388
+ )
389
+ end
390
+
391
+ ##
392
+ # Provide a user friendly representation
393
+ def to_s
394
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
395
+ "<Twilio.Sync.V1.DocumentPermissionInstance #{values}>"
396
+ end
397
+ end
398
+ end
399
+ end
400
+ end
401
+ end
402
+ end
403
+ end