twilio-ruby 5.67.3 → 5.74.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/pr-lint.yml +8 -2
  3. data/.github/workflows/test-and-deploy.yml +3 -3
  4. data/CHANGES.md +288 -0
  5. data/LICENSE +1 -1
  6. data/Makefile +6 -2
  7. data/PULL_REQUEST_TEMPLATE.md +1 -1
  8. data/README.md +2 -2
  9. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +19 -3
  10. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +22 -3
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +2 -2
  12. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +2 -2
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +2 -2
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +2 -2
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +2 -2
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +2 -2
  17. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +2 -2
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +1 -1
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -2
  21. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +160 -0
  22. data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +251 -0
  23. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +59 -0
  24. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -17
  25. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  26. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +5 -5
  27. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -1
  28. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
  29. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
  30. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +1 -1
  31. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +1 -1
  32. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +5 -5
  33. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +3 -3
  34. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
  35. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
  36. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
  37. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
  38. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
  39. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
  40. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
  41. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
  42. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
  43. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
  44. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
  45. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
  46. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
  47. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
  48. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
  49. data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
  50. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
  51. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
  52. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  53. data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
  54. data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
  55. data/lib/twilio-ruby/rest/client.rb +28 -0
  56. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
  57. data/lib/twilio-ruby/rest/content/v1/content.rb +346 -0
  58. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +254 -0
  59. data/lib/twilio-ruby/rest/content/v1.rb +52 -0
  60. data/lib/twilio-ruby/rest/content.rb +53 -0
  61. data/lib/twilio-ruby/rest/conversations/v1/conversation/message/delivery_receipt.rb +1 -1
  62. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +17 -2
  63. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
  64. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +17 -2
  65. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
  66. data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
  67. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
  68. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +397 -0
  69. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  70. data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +314 -0
  71. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +394 -0
  72. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +313 -0
  73. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +390 -0
  74. data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +413 -0
  75. data/lib/twilio-ruby/rest/{preview/trusted_comms/brands_information.rb → flex_api/v1/insights_session.rb} +58 -55
  76. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answersets.rb +144 -0
  77. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +130 -0
  78. data/lib/twilio-ruby/rest/{preview/trusted_comms/cps.rb → flex_api/v1/insights_user_roles.rb} +42 -54
  79. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +22 -1
  80. data/lib/twilio-ruby/rest/flex_api/v1.rb +115 -0
  81. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +133 -0
  82. data/lib/twilio-ruby/rest/flex_api/v2.rb +35 -0
  83. data/lib/twilio-ruby/rest/flex_api.rb +83 -0
  84. data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +322 -0
  85. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +14 -0
  86. data/lib/twilio-ruby/rest/insights/v1/call.rb +16 -8
  87. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
  88. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  89. data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
  90. data/lib/twilio-ruby/rest/insights/v1.rb +0 -16
  91. data/lib/twilio-ruby/rest/insights.rb +0 -8
  92. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
  93. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
  94. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
  95. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
  97. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
  98. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  99. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
  100. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +94 -12
  101. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  102. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -9
  103. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +5 -5
  104. data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
  105. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +267 -0
  106. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +2 -2
  107. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +98 -3
  108. data/lib/twilio-ruby/rest/messaging/v1/service.rb +1 -1
  109. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +709 -0
  110. data/lib/twilio-ruby/rest/messaging/v1.rb +50 -0
  111. data/lib/twilio-ruby/rest/messaging.rb +26 -0
  112. data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +317 -0
  113. data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +310 -0
  114. data/lib/twilio-ruby/rest/microvisor/v1/app/app_manifest.rb +192 -0
  115. data/lib/twilio-ruby/rest/microvisor/v1/app.rb +330 -0
  116. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +342 -0
  117. data/lib/twilio-ruby/rest/{preview/bulk_exports/export/day.rb → microvisor/v1/device/device_secret.rb} +125 -84
  118. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +393 -0
  119. data/lib/twilio-ruby/rest/microvisor/v1.rb +92 -0
  120. data/lib/twilio-ruby/rest/microvisor.rb +70 -0
  121. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  122. data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +153 -0
  123. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
  124. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
  125. data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
  126. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
  127. data/lib/twilio-ruby/rest/oauth/v1.rb +63 -0
  128. data/lib/twilio-ruby/rest/oauth.rb +68 -0
  129. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  130. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
  131. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
  132. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
  133. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
  134. data/lib/twilio-ruby/rest/preview.rb +0 -58
  135. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
  136. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -14
  137. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -46
  138. data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
  139. data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +235 -0
  140. data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +231 -0
  141. data/lib/twilio-ruby/rest/routes/v2/trunk.rb +235 -0
  142. data/lib/twilio-ruby/rest/routes/v2.rb +76 -0
  143. data/lib/twilio-ruby/rest/routes.rb +62 -0
  144. data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
  145. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  146. data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
  147. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
  148. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +17 -7
  149. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +5 -2
  150. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +247 -0
  151. data/lib/twilio-ruby/rest/supersim/v1/sim/sim_ip_address.rb +195 -0
  152. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +20 -0
  153. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +3 -3
  154. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
  155. data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
  156. data/lib/twilio-ruby/rest/supersim.rb +6 -0
  157. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
  158. data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
  159. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
  160. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +18 -5
  161. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  162. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
  163. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
  164. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -4
  165. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
  166. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  167. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  168. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +9 -3
  169. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
  170. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
  171. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
  172. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
  173. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
  174. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
  175. data/lib/twilio-ruby/rest/verify/v2/safelist.rb +215 -0
  176. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
  177. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
  178. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
  179. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
  180. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
  181. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
  182. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
  183. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +14 -10
  184. data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +8 -1
  185. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
  186. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  187. data/lib/twilio-ruby/rest/verify/v2/template.rb +7 -0
  188. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
  189. data/lib/twilio-ruby/rest/verify/v2.rb +18 -0
  190. data/lib/twilio-ruby/rest/verify.rb +8 -0
  191. data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
  192. data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
  193. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
  194. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_anonymize.rb +240 -0
  195. data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +16 -0
  196. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
  197. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
  198. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
  199. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
  200. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  201. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
  202. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  203. data/lib/twilio-ruby/twiml/voice_response.rb +135 -35
  204. data/lib/twilio-ruby/version.rb +1 -1
  205. data/twilio-ruby.gemspec +1 -1
  206. metadata +52 -17
  207. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +0 -271
  208. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +0 -275
  209. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +0 -249
  210. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -251
  211. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -234
  212. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -62
  213. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
  214. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
  215. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
  216. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -0,0 +1,393 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Microvisor < Domain
12
+ class V1 < Version
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 DeviceList < ListResource
16
+ ##
17
+ # Initialize the DeviceList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [DeviceList] DeviceList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/Devices"
26
+ end
27
+
28
+ ##
29
+ # Lists DeviceInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
33
+ # guarantees to never return more than limit. Default is no limit
34
+ # @param [Integer] page_size Number of records to fetch per request, when
35
+ # not set will use the default value of 50 records. If no page_size is defined
36
+ # but a limit is defined, stream() will attempt to read the limit with the most
37
+ # efficient page size, i.e. min(limit, 1000)
38
+ # @return [Array] Array of up to limit results
39
+ def list(limit: nil, page_size: nil)
40
+ self.stream(limit: limit, page_size: page_size).entries
41
+ end
42
+
43
+ ##
44
+ # Streams DeviceInstance records from the API as an Enumerable.
45
+ # This operation lazily loads records as efficiently as possible until the limit
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
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
+ # @return [Enumerable] Enumerable that will yield up to limit results
54
+ def stream(limit: nil, page_size: nil)
55
+ limits = @version.read_limits(limit, page_size)
56
+
57
+ page = self.page(page_size: limits[:page_size], )
58
+
59
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
60
+ end
61
+
62
+ ##
63
+ # When passed a block, yields DeviceInstance records from the API.
64
+ # This operation lazily loads records as efficiently as possible until the limit
65
+ # is reached.
66
+ def each
67
+ limits = @version.read_limits
68
+
69
+ page = self.page(page_size: limits[:page_size], )
70
+
71
+ @version.stream(page,
72
+ limit: limits[:limit],
73
+ page_limit: limits[:page_limit]).each {|x| yield x}
74
+ end
75
+
76
+ ##
77
+ # Retrieve a single page of DeviceInstance records from the API.
78
+ # Request is executed immediately.
79
+ # @param [String] page_token PageToken provided by the API
80
+ # @param [Integer] page_number Page Number, this value is simply for client state
81
+ # @param [Integer] page_size Number of records to return, defaults to 50
82
+ # @return [Page] Page of DeviceInstance
83
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
84
+ params = Twilio::Values.of({
85
+ 'PageToken' => page_token,
86
+ 'Page' => page_number,
87
+ 'PageSize' => page_size,
88
+ })
89
+
90
+ response = @version.page('GET', @uri, params: params)
91
+
92
+ DevicePage.new(@version, response, @solution)
93
+ end
94
+
95
+ ##
96
+ # Retrieve a single page of DeviceInstance records from the API.
97
+ # Request is executed immediately.
98
+ # @param [String] target_url API-generated URL for the requested results page
99
+ # @return [Page] Page of DeviceInstance
100
+ def get_page(target_url)
101
+ response = @version.domain.request(
102
+ 'GET',
103
+ target_url
104
+ )
105
+ DevicePage.new(@version, response, @solution)
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ '#<Twilio.Microvisor.V1.DeviceList>'
112
+ end
113
+ end
114
+
115
+ ##
116
+ # 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.
117
+ class DevicePage < Page
118
+ ##
119
+ # Initialize the DevicePage
120
+ # @param [Version] version Version that contains the resource
121
+ # @param [Response] response Response from the API
122
+ # @param [Hash] solution Path solution for the resource
123
+ # @return [DevicePage] DevicePage
124
+ def initialize(version, response, solution)
125
+ super(version, response)
126
+
127
+ # Path Solution
128
+ @solution = solution
129
+ end
130
+
131
+ ##
132
+ # Build an instance of DeviceInstance
133
+ # @param [Hash] payload Payload response from the API
134
+ # @return [DeviceInstance] DeviceInstance
135
+ def get_instance(payload)
136
+ DeviceInstance.new(@version, payload, )
137
+ end
138
+
139
+ ##
140
+ # Provide a user friendly representation
141
+ def to_s
142
+ '<Twilio.Microvisor.V1.DevicePage>'
143
+ end
144
+ end
145
+
146
+ ##
147
+ # 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.
148
+ class DeviceContext < InstanceContext
149
+ ##
150
+ # Initialize the DeviceContext
151
+ # @param [Version] version Version that contains the resource
152
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
153
+ # @return [DeviceContext] DeviceContext
154
+ def initialize(version, sid)
155
+ super(version)
156
+
157
+ # Path Solution
158
+ @solution = {sid: sid, }
159
+ @uri = "/Devices/#{@solution[:sid]}"
160
+
161
+ # Dependents
162
+ @device_configs = nil
163
+ @device_secrets = nil
164
+ end
165
+
166
+ ##
167
+ # Fetch the DeviceInstance
168
+ # @return [DeviceInstance] Fetched DeviceInstance
169
+ def fetch
170
+ payload = @version.fetch('GET', @uri)
171
+
172
+ DeviceInstance.new(@version, payload, sid: @solution[:sid], )
173
+ end
174
+
175
+ ##
176
+ # Update the DeviceInstance
177
+ # @param [String] unique_name A unique and addressable name to be assigned to this
178
+ # Device by the developer. It may be used in place of the Device SID.
179
+ # @param [String] target_app The SID or unique name of the App to be targeted to
180
+ # the Device.
181
+ # @param [Boolean] logging_enabled A Boolean flag specifying whether to enable
182
+ # application logging. Logs will be enabled or extended for 24 hours.
183
+ # @return [DeviceInstance] Updated DeviceInstance
184
+ def update(unique_name: :unset, target_app: :unset, logging_enabled: :unset)
185
+ data = Twilio::Values.of({
186
+ 'UniqueName' => unique_name,
187
+ 'TargetApp' => target_app,
188
+ 'LoggingEnabled' => logging_enabled,
189
+ })
190
+
191
+ payload = @version.update('POST', @uri, data: data)
192
+
193
+ DeviceInstance.new(@version, payload, sid: @solution[:sid], )
194
+ end
195
+
196
+ ##
197
+ # Access the device_configs
198
+ # @return [DeviceConfigList]
199
+ # @return [DeviceConfigContext] if key was passed.
200
+ def device_configs(key=:unset)
201
+ raise ArgumentError, 'key cannot be nil' if key.nil?
202
+
203
+ if key != :unset
204
+ return DeviceConfigContext.new(@version, @solution[:sid], key, )
205
+ end
206
+
207
+ unless @device_configs
208
+ @device_configs = DeviceConfigList.new(@version, device_sid: @solution[:sid], )
209
+ end
210
+
211
+ @device_configs
212
+ end
213
+
214
+ ##
215
+ # Access the device_secrets
216
+ # @return [DeviceSecretList]
217
+ # @return [DeviceSecretContext] if key was passed.
218
+ def device_secrets(key=:unset)
219
+ raise ArgumentError, 'key cannot be nil' if key.nil?
220
+
221
+ if key != :unset
222
+ return DeviceSecretContext.new(@version, @solution[:sid], key, )
223
+ end
224
+
225
+ unless @device_secrets
226
+ @device_secrets = DeviceSecretList.new(@version, device_sid: @solution[:sid], )
227
+ end
228
+
229
+ @device_secrets
230
+ end
231
+
232
+ ##
233
+ # Provide a user friendly representation
234
+ def to_s
235
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
236
+ "#<Twilio.Microvisor.V1.DeviceContext #{context}>"
237
+ end
238
+
239
+ ##
240
+ # Provide a detailed, user friendly representation
241
+ def inspect
242
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
243
+ "#<Twilio.Microvisor.V1.DeviceContext #{context}>"
244
+ end
245
+ end
246
+
247
+ ##
248
+ # 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.
249
+ class DeviceInstance < InstanceResource
250
+ ##
251
+ # Initialize the DeviceInstance
252
+ # @param [Version] version Version that contains the resource
253
+ # @param [Hash] payload payload that contains response from Twilio
254
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
255
+ # @return [DeviceInstance] DeviceInstance
256
+ def initialize(version, payload, sid: nil)
257
+ super(version)
258
+
259
+ # Marshaled Properties
260
+ @properties = {
261
+ 'sid' => payload['sid'],
262
+ 'unique_name' => payload['unique_name'],
263
+ 'account_sid' => payload['account_sid'],
264
+ 'app' => payload['app'],
265
+ 'logging' => payload['logging'],
266
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
267
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
268
+ 'url' => payload['url'],
269
+ 'links' => payload['links'],
270
+ }
271
+
272
+ # Context
273
+ @instance_context = nil
274
+ @params = {'sid' => sid || @properties['sid'], }
275
+ end
276
+
277
+ ##
278
+ # Generate an instance context for the instance, the context is capable of
279
+ # performing various actions. All instance actions are proxied to the context
280
+ # @return [DeviceContext] DeviceContext for this DeviceInstance
281
+ def context
282
+ unless @instance_context
283
+ @instance_context = DeviceContext.new(@version, @params['sid'], )
284
+ end
285
+ @instance_context
286
+ end
287
+
288
+ ##
289
+ # @return [String] A string that uniquely identifies this Device.
290
+ def sid
291
+ @properties['sid']
292
+ end
293
+
294
+ ##
295
+ # @return [String] A developer-defined string that uniquely identifies the Device.
296
+ def unique_name
297
+ @properties['unique_name']
298
+ end
299
+
300
+ ##
301
+ # @return [String] Account SID.
302
+ def account_sid
303
+ @properties['account_sid']
304
+ end
305
+
306
+ ##
307
+ # @return [Hash] Information about the target App and the App reported by this Device.
308
+ def app
309
+ @properties['app']
310
+ end
311
+
312
+ ##
313
+ # @return [Hash] Object specifying whether application logging is enabled for this Device.
314
+ def logging
315
+ @properties['logging']
316
+ end
317
+
318
+ ##
319
+ # @return [Time] The date that this Device was created.
320
+ def date_created
321
+ @properties['date_created']
322
+ end
323
+
324
+ ##
325
+ # @return [Time] The date that this Device was last updated.
326
+ def date_updated
327
+ @properties['date_updated']
328
+ end
329
+
330
+ ##
331
+ # @return [String] The URL of this resource.
332
+ def url
333
+ @properties['url']
334
+ end
335
+
336
+ ##
337
+ # @return [String] The absolute URLs of related resources
338
+ def links
339
+ @properties['links']
340
+ end
341
+
342
+ ##
343
+ # Fetch the DeviceInstance
344
+ # @return [DeviceInstance] Fetched DeviceInstance
345
+ def fetch
346
+ context.fetch
347
+ end
348
+
349
+ ##
350
+ # Update the DeviceInstance
351
+ # @param [String] unique_name A unique and addressable name to be assigned to this
352
+ # Device by the developer. It may be used in place of the Device SID.
353
+ # @param [String] target_app The SID or unique name of the App to be targeted to
354
+ # the Device.
355
+ # @param [Boolean] logging_enabled A Boolean flag specifying whether to enable
356
+ # application logging. Logs will be enabled or extended for 24 hours.
357
+ # @return [DeviceInstance] Updated DeviceInstance
358
+ def update(unique_name: :unset, target_app: :unset, logging_enabled: :unset)
359
+ context.update(unique_name: unique_name, target_app: target_app, logging_enabled: logging_enabled, )
360
+ end
361
+
362
+ ##
363
+ # Access the device_configs
364
+ # @return [device_configs] device_configs
365
+ def device_configs
366
+ context.device_configs
367
+ end
368
+
369
+ ##
370
+ # Access the device_secrets
371
+ # @return [device_secrets] device_secrets
372
+ def device_secrets
373
+ context.device_secrets
374
+ end
375
+
376
+ ##
377
+ # Provide a user friendly representation
378
+ def to_s
379
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
380
+ "<Twilio.Microvisor.V1.DeviceInstance #{values}>"
381
+ end
382
+
383
+ ##
384
+ # Provide a detailed, user friendly representation
385
+ def inspect
386
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
387
+ "<Twilio.Microvisor.V1.DeviceInstance #{values}>"
388
+ end
389
+ end
390
+ end
391
+ end
392
+ end
393
+ end
@@ -0,0 +1,92 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Microvisor
12
+ class V1 < Version
13
+ ##
14
+ # Initialize the V1 version of Microvisor
15
+ def initialize(domain)
16
+ super
17
+ @version = 'v1'
18
+ @account_configs = nil
19
+ @account_secrets = nil
20
+ @apps = nil
21
+ @devices = nil
22
+ end
23
+
24
+ ##
25
+ # @param [String] key The config key; up to 100 characters.
26
+ # @return [Twilio::REST::Microvisor::V1::AccountConfigContext] if key was passed.
27
+ # @return [Twilio::REST::Microvisor::V1::AccountConfigList]
28
+ def account_configs(key=:unset)
29
+ if key.nil?
30
+ raise ArgumentError, 'key cannot be nil'
31
+ end
32
+ if key == :unset
33
+ @account_configs ||= AccountConfigList.new self
34
+ else
35
+ AccountConfigContext.new(self, key)
36
+ end
37
+ end
38
+
39
+ ##
40
+ # @param [String] key The secret key; up to 100 characters.
41
+ # @return [Twilio::REST::Microvisor::V1::AccountSecretContext] if key was passed.
42
+ # @return [Twilio::REST::Microvisor::V1::AccountSecretList]
43
+ def account_secrets(key=:unset)
44
+ if key.nil?
45
+ raise ArgumentError, 'key cannot be nil'
46
+ end
47
+ if key == :unset
48
+ @account_secrets ||= AccountSecretList.new self
49
+ else
50
+ AccountSecretContext.new(self, key)
51
+ end
52
+ end
53
+
54
+ ##
55
+ # @param [String] sid A 34-character string that uniquely identifies this App.
56
+ # @return [Twilio::REST::Microvisor::V1::AppContext] if sid was passed.
57
+ # @return [Twilio::REST::Microvisor::V1::AppList]
58
+ def apps(sid=:unset)
59
+ if sid.nil?
60
+ raise ArgumentError, 'sid cannot be nil'
61
+ end
62
+ if sid == :unset
63
+ @apps ||= AppList.new self
64
+ else
65
+ AppContext.new(self, sid)
66
+ end
67
+ end
68
+
69
+ ##
70
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
71
+ # @return [Twilio::REST::Microvisor::V1::DeviceContext] if sid was passed.
72
+ # @return [Twilio::REST::Microvisor::V1::DeviceList]
73
+ def devices(sid=:unset)
74
+ if sid.nil?
75
+ raise ArgumentError, 'sid cannot be nil'
76
+ end
77
+ if sid == :unset
78
+ @devices ||= DeviceList.new self
79
+ else
80
+ DeviceContext.new(self, sid)
81
+ end
82
+ end
83
+
84
+ ##
85
+ # Provide a user friendly representation
86
+ def to_s
87
+ '<Twilio::REST::Microvisor::V1>'
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,70 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Microvisor < Domain
12
+ ##
13
+ # Initialize the Microvisor Domain
14
+ def initialize(twilio)
15
+ super
16
+
17
+ @base_url = 'https://microvisor.twilio.com'
18
+ @host = 'microvisor.twilio.com'
19
+ @port = 443
20
+
21
+ # Versions
22
+ @v1 = nil
23
+ end
24
+
25
+ ##
26
+ # Version v1 of microvisor
27
+ def v1
28
+ @v1 ||= V1.new self
29
+ end
30
+
31
+ ##
32
+ # @param [String] key The config key; up to 100 characters.
33
+ # @return [Twilio::REST::Microvisor::V1::AccountConfigInstance] if key was passed.
34
+ # @return [Twilio::REST::Microvisor::V1::AccountConfigList]
35
+ def account_configs(key=:unset)
36
+ self.v1.account_configs(key)
37
+ end
38
+
39
+ ##
40
+ # @param [String] key The secret key; up to 100 characters.
41
+ # @return [Twilio::REST::Microvisor::V1::AccountSecretInstance] if key was passed.
42
+ # @return [Twilio::REST::Microvisor::V1::AccountSecretList]
43
+ def account_secrets(key=:unset)
44
+ self.v1.account_secrets(key)
45
+ end
46
+
47
+ ##
48
+ # @param [String] sid A 34-character string that uniquely identifies this App.
49
+ # @return [Twilio::REST::Microvisor::V1::AppInstance] if sid was passed.
50
+ # @return [Twilio::REST::Microvisor::V1::AppList]
51
+ def apps(sid=:unset)
52
+ self.v1.apps(sid)
53
+ end
54
+
55
+ ##
56
+ # @param [String] sid A 34-character string that uniquely identifies this Device.
57
+ # @return [Twilio::REST::Microvisor::V1::DeviceInstance] if sid was passed.
58
+ # @return [Twilio::REST::Microvisor::V1::DeviceList]
59
+ def devices(sid=:unset)
60
+ self.v1.devices(sid)
61
+ end
62
+
63
+ ##
64
+ # Provide a user friendly representation
65
+ def to_s
66
+ '#<Twilio::REST::Microvisor>'
67
+ end
68
+ end
69
+ end
70
+ end
@@ -215,7 +215,7 @@ module Twilio
215
215
  'tags' => payload['tags'],
216
216
  'segments' => payload['segments'],
217
217
  'priority' => payload['priority'],
218
- 'ttl' => payload['ttl'].to_i,
218
+ 'ttl' => payload['ttl'] == nil ? payload['ttl'] : payload['ttl'].to_i,
219
219
  'title' => payload['title'],
220
220
  'body' => payload['body'],
221
221
  'sound' => payload['sound'],