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