twilio-ruby 5.72.0 → 5.77.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 (199) 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 +234 -0
  5. data/CONTRIBUTING.md +1 -7
  6. data/LICENSE +1 -1
  7. data/README.md +132 -45
  8. data/advanced-examples/custom-http-client.md +170 -0
  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 +6 -6
  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 +1 -1
  33. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +1 -1
  34. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +1 -1
  35. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +1 -1
  36. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +1 -1
  37. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +1 -1
  38. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +1 -1
  39. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +1 -1
  40. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +1 -1
  41. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +1 -1
  42. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +1 -1
  43. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +2 -2
  44. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +1 -1
  45. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +1 -1
  46. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +2 -2
  47. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +1 -1
  48. data/lib/twilio-ruby/rest/chat/v1/service.rb +2 -2
  49. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +1 -1
  50. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +2 -2
  51. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  52. data/lib/twilio-ruby/rest/chat/v2/service.rb +4 -4
  53. data/lib/twilio-ruby/rest/chat/v3/channel.rb +2 -2
  54. data/lib/twilio-ruby/rest/client.rb +14 -0
  55. data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +195 -0
  56. data/lib/twilio-ruby/rest/content/v1/content.rb +346 -0
  57. data/lib/twilio-ruby/rest/content/v1/content_and_approvals.rb +240 -0
  58. data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +254 -0
  59. data/lib/twilio-ruby/rest/content/v1.rb +59 -0
  60. data/lib/twilio-ruby/rest/content.rb +59 -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/conversation.rb +43 -5
  64. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb +1 -1
  65. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +17 -2
  66. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +43 -5
  67. data/lib/twilio-ruby/rest/events/v1/schema/version.rb +1 -1
  68. data/lib/twilio-ruby/rest/events/v1/schema.rb +1 -1
  69. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +1 -1
  70. data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +397 -0
  71. data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +314 -0
  72. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +216 -0
  73. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +394 -0
  74. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +313 -0
  75. data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +390 -0
  76. data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +413 -0
  77. data/lib/twilio-ruby/rest/{preview/trusted_comms/brands_information.rb → flex_api/v1/insights_session.rb} +58 -55
  78. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answersets.rb +144 -0
  79. data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +130 -0
  80. data/lib/twilio-ruby/rest/{preview/trusted_comms/cps.rb → flex_api/v1/insights_user_roles.rb} +42 -54
  81. data/lib/twilio-ruby/rest/flex_api/v1.rb +122 -0
  82. data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +133 -0
  83. data/lib/twilio-ruby/rest/flex_api/v2.rb +35 -0
  84. data/lib/twilio-ruby/rest/flex_api.rb +89 -0
  85. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +7 -0
  86. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +16 -3
  87. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  88. data/lib/twilio-ruby/rest/insights/v1/room.rb +3 -3
  89. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +1 -1
  90. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +2 -2
  91. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +1 -1
  92. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +2 -2
  93. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +1 -1
  94. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +2 -2
  95. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +4 -4
  97. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +88 -6
  98. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +1 -1
  99. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +2 -2
  100. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +1 -1
  101. data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb +134 -0
  102. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +26 -3
  103. data/lib/twilio-ruby/rest/messaging/v1/domain_cert.rb +257 -0
  104. data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +242 -0
  105. data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +226 -0
  106. data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +218 -0
  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 +165 -1
  110. data/lib/twilio-ruby/rest/messaging/v1.rb +75 -0
  111. data/lib/twilio-ruby/rest/messaging.rb +36 -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 +25 -0
  116. data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +342 -0
  117. data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +335 -0
  118. data/lib/twilio-ruby/rest/microvisor/v1/device.rb +61 -0
  119. data/lib/twilio-ruby/rest/microvisor/v1.rb +32 -0
  120. data/lib/twilio-ruby/rest/microvisor.rb +16 -0
  121. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  122. data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +111 -0
  123. data/lib/twilio-ruby/rest/numbers/v1.rb +35 -0
  124. data/lib/twilio-ruby/rest/numbers.rb +13 -0
  125. data/lib/twilio-ruby/rest/oauth/v1/device_code.rb +153 -0
  126. data/lib/twilio-ruby/rest/oauth/v1/oauth.rb +162 -0
  127. data/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +242 -0
  128. data/lib/twilio-ruby/rest/oauth/v1/token.rb +157 -0
  129. data/lib/twilio-ruby/rest/oauth/v1/user_info.rb +193 -0
  130. data/lib/twilio-ruby/rest/oauth/v1.rb +63 -0
  131. data/lib/twilio-ruby/rest/oauth.rb +68 -0
  132. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  133. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
  134. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +1 -1
  135. data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +2 -2
  136. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
  137. data/lib/twilio-ruby/rest/preview.rb +0 -33
  138. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +1 -1
  139. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +1 -14
  140. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +5 -46
  141. data/lib/twilio-ruby/rest/proxy/v1/service.rb +1 -1
  142. data/lib/twilio-ruby/rest/studio/v1/flow.rb +1 -1
  143. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +1 -1
  144. data/lib/twilio-ruby/rest/studio/v2/flow.rb +1 -1
  145. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +21 -1
  146. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +1 -1
  147. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +5 -2
  148. data/lib/twilio-ruby/rest/supersim/v1/settings_update.rb +247 -0
  149. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +3 -3
  150. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +4 -4
  151. data/lib/twilio-ruby/rest/supersim/v1.rb +7 -0
  152. data/lib/twilio-ruby/rest/supersim.rb +6 -0
  153. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +1 -1
  154. data/lib/twilio-ruby/rest/sync/v1/service.rb +1 -1
  155. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +1 -1
  156. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +18 -5
  157. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +3 -3
  158. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +12 -12
  159. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +5 -5
  160. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -4
  161. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +3 -3
  162. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  163. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  164. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +9 -3
  165. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +13 -13
  166. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +2 -2
  167. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +1 -1
  168. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +13 -13
  169. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +3 -3
  170. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +2 -2
  171. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +1 -9
  172. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +1 -7
  173. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +0 -8
  174. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +0 -8
  175. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -6
  176. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +0 -8
  177. data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +2 -2
  178. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +12 -6
  179. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +0 -8
  180. data/lib/twilio-ruby/rest/verify/v2/service.rb +4 -4
  181. data/lib/twilio-ruby/rest/verify/v2/template.rb +10 -3
  182. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +4 -4
  183. data/lib/twilio-ruby/rest/video/v1/composition.rb +3 -3
  184. data/lib/twilio-ruby/rest/video/v1/recording.rb +2 -2
  185. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +2 -2
  186. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -4
  187. data/lib/twilio-ruby/rest/voice/v1/connection_policy/connection_policy_target.rb +2 -2
  188. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +1 -1
  189. data/lib/twilio-ruby/rest/voice/v1/ip_record.rb +1 -1
  190. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  191. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +2 -2
  192. data/lib/twilio-ruby/twiml/voice_response.rb +132 -33
  193. data/lib/twilio-ruby/version.rb +1 -1
  194. data/twilio-ruby.gemspec +1 -1
  195. metadata +48 -12
  196. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel/channel.rb +0 -165
  197. data/lib/twilio-ruby/rest/preview/trusted_comms/branded_channel.rb +0 -225
  198. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +0 -277
  199. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +0 -65
@@ -0,0 +1,242 @@
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 Messaging < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class DomainConfigList < ListResource
16
+ ##
17
+ # Initialize the DomainConfigList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [DomainConfigList] DomainConfigList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ end
26
+
27
+ ##
28
+ # Provide a user friendly representation
29
+ def to_s
30
+ '#<Twilio.Messaging.V1.DomainConfigList>'
31
+ end
32
+ end
33
+
34
+ ##
35
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
+ class DomainConfigPage < Page
37
+ ##
38
+ # Initialize the DomainConfigPage
39
+ # @param [Version] version Version that contains the resource
40
+ # @param [Response] response Response from the API
41
+ # @param [Hash] solution Path solution for the resource
42
+ # @return [DomainConfigPage] DomainConfigPage
43
+ def initialize(version, response, solution)
44
+ super(version, response)
45
+
46
+ # Path Solution
47
+ @solution = solution
48
+ end
49
+
50
+ ##
51
+ # Build an instance of DomainConfigInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [DomainConfigInstance] DomainConfigInstance
54
+ def get_instance(payload)
55
+ DomainConfigInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Messaging.V1.DomainConfigPage>'
62
+ end
63
+ end
64
+
65
+ ##
66
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
+ class DomainConfigContext < InstanceContext
68
+ ##
69
+ # Initialize the DomainConfigContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] domain_sid Unique string used to identify the domain that this
72
+ # config should be associated with.
73
+ # @return [DomainConfigContext] DomainConfigContext
74
+ def initialize(version, domain_sid)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {domain_sid: domain_sid, }
79
+ @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Config"
80
+ end
81
+
82
+ ##
83
+ # Update the DomainConfigInstance
84
+ # @param [String] fallback_url Any requests we receive to this domain that do not
85
+ # match an existing shortened message will be redirected to the fallback url.
86
+ # These will likely be either expired messages, random misdirected traffic, or
87
+ # intentional scraping.
88
+ # @param [String] callback_url URL to receive click events to your webhook
89
+ # whenever the recipients click on the shortened links
90
+ # @return [DomainConfigInstance] Updated DomainConfigInstance
91
+ def update(fallback_url: :unset, callback_url: :unset)
92
+ data = Twilio::Values.of({'FallbackUrl' => fallback_url, 'CallbackUrl' => callback_url, })
93
+
94
+ payload = @version.update('POST', @uri, data: data)
95
+
96
+ DomainConfigInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
97
+ end
98
+
99
+ ##
100
+ # Fetch the DomainConfigInstance
101
+ # @return [DomainConfigInstance] Fetched DomainConfigInstance
102
+ def fetch
103
+ payload = @version.fetch('GET', @uri)
104
+
105
+ DomainConfigInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
112
+ "#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
113
+ end
114
+
115
+ ##
116
+ # Provide a detailed, user friendly representation
117
+ def inspect
118
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
119
+ "#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
120
+ end
121
+ end
122
+
123
+ ##
124
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
125
+ class DomainConfigInstance < InstanceResource
126
+ ##
127
+ # Initialize the DomainConfigInstance
128
+ # @param [Version] version Version that contains the resource
129
+ # @param [Hash] payload payload that contains response from Twilio
130
+ # @param [String] domain_sid Unique string used to identify the domain that this
131
+ # config should be associated with.
132
+ # @return [DomainConfigInstance] DomainConfigInstance
133
+ def initialize(version, payload, domain_sid: nil)
134
+ super(version)
135
+
136
+ # Marshaled Properties
137
+ @properties = {
138
+ 'domain_sid' => payload['domain_sid'],
139
+ 'config_sid' => payload['config_sid'],
140
+ 'fallback_url' => payload['fallback_url'],
141
+ 'callback_url' => payload['callback_url'],
142
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
143
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
144
+ 'url' => payload['url'],
145
+ }
146
+
147
+ # Context
148
+ @instance_context = nil
149
+ @params = {'domain_sid' => domain_sid || @properties['domain_sid'], }
150
+ end
151
+
152
+ ##
153
+ # Generate an instance context for the instance, the context is capable of
154
+ # performing various actions. All instance actions are proxied to the context
155
+ # @return [DomainConfigContext] DomainConfigContext for this DomainConfigInstance
156
+ def context
157
+ unless @instance_context
158
+ @instance_context = DomainConfigContext.new(@version, @params['domain_sid'], )
159
+ end
160
+ @instance_context
161
+ end
162
+
163
+ ##
164
+ # @return [String] The unique string that we created to identify the Domain resource.
165
+ def domain_sid
166
+ @properties['domain_sid']
167
+ end
168
+
169
+ ##
170
+ # @return [String] The unique string that we created to identify the Domain config (prefix ZK).
171
+ def config_sid
172
+ @properties['config_sid']
173
+ end
174
+
175
+ ##
176
+ # @return [String] We will redirect requests to urls we are unable to identify to this url.
177
+ def fallback_url
178
+ @properties['fallback_url']
179
+ end
180
+
181
+ ##
182
+ # @return [String] URL to receive click events to your webhook whenever the recipients click on the shortened links.
183
+ def callback_url
184
+ @properties['callback_url']
185
+ end
186
+
187
+ ##
188
+ # @return [Time] Date this Domain Config was created.
189
+ def date_created
190
+ @properties['date_created']
191
+ end
192
+
193
+ ##
194
+ # @return [Time] Date that this Domain Config was last updated.
195
+ def date_updated
196
+ @properties['date_updated']
197
+ end
198
+
199
+ ##
200
+ # @return [String] The url
201
+ def url
202
+ @properties['url']
203
+ end
204
+
205
+ ##
206
+ # Update the DomainConfigInstance
207
+ # @param [String] fallback_url Any requests we receive to this domain that do not
208
+ # match an existing shortened message will be redirected to the fallback url.
209
+ # These will likely be either expired messages, random misdirected traffic, or
210
+ # intentional scraping.
211
+ # @param [String] callback_url URL to receive click events to your webhook
212
+ # whenever the recipients click on the shortened links
213
+ # @return [DomainConfigInstance] Updated DomainConfigInstance
214
+ def update(fallback_url: :unset, callback_url: :unset)
215
+ context.update(fallback_url: fallback_url, callback_url: callback_url, )
216
+ end
217
+
218
+ ##
219
+ # Fetch the DomainConfigInstance
220
+ # @return [DomainConfigInstance] Fetched DomainConfigInstance
221
+ def fetch
222
+ context.fetch
223
+ end
224
+
225
+ ##
226
+ # Provide a user friendly representation
227
+ def to_s
228
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
229
+ "<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
230
+ end
231
+
232
+ ##
233
+ # Provide a detailed, user friendly representation
234
+ def inspect
235
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
236
+ "<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end
242
+ end
@@ -0,0 +1,226 @@
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 Messaging < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class DomainConfigMessagingServiceList < ListResource
16
+ ##
17
+ # Initialize the DomainConfigMessagingServiceList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [DomainConfigMessagingServiceList] DomainConfigMessagingServiceList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ end
26
+
27
+ ##
28
+ # Provide a user friendly representation
29
+ def to_s
30
+ '#<Twilio.Messaging.V1.DomainConfigMessagingServiceList>'
31
+ end
32
+ end
33
+
34
+ ##
35
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
+ class DomainConfigMessagingServicePage < Page
37
+ ##
38
+ # Initialize the DomainConfigMessagingServicePage
39
+ # @param [Version] version Version that contains the resource
40
+ # @param [Response] response Response from the API
41
+ # @param [Hash] solution Path solution for the resource
42
+ # @return [DomainConfigMessagingServicePage] DomainConfigMessagingServicePage
43
+ def initialize(version, response, solution)
44
+ super(version, response)
45
+
46
+ # Path Solution
47
+ @solution = solution
48
+ end
49
+
50
+ ##
51
+ # Build an instance of DomainConfigMessagingServiceInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [DomainConfigMessagingServiceInstance] DomainConfigMessagingServiceInstance
54
+ def get_instance(payload)
55
+ DomainConfigMessagingServiceInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Messaging.V1.DomainConfigMessagingServicePage>'
62
+ end
63
+ end
64
+
65
+ ##
66
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
+ class DomainConfigMessagingServiceContext < InstanceContext
68
+ ##
69
+ # Initialize the DomainConfigMessagingServiceContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] messaging_service_sid Unique string used to identify the
72
+ # Messaging service that this domain should be associated with.
73
+ # @return [DomainConfigMessagingServiceContext] DomainConfigMessagingServiceContext
74
+ def initialize(version, messaging_service_sid)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {messaging_service_sid: messaging_service_sid, }
79
+ @uri = "/LinkShortening/MessagingService/#{@solution[:messaging_service_sid]}/DomainConfig"
80
+ end
81
+
82
+ ##
83
+ # Fetch the DomainConfigMessagingServiceInstance
84
+ # @return [DomainConfigMessagingServiceInstance] Fetched DomainConfigMessagingServiceInstance
85
+ def fetch
86
+ payload = @version.fetch('GET', @uri)
87
+
88
+ DomainConfigMessagingServiceInstance.new(
89
+ @version,
90
+ payload,
91
+ messaging_service_sid: @solution[:messaging_service_sid],
92
+ )
93
+ end
94
+
95
+ ##
96
+ # Provide a user friendly representation
97
+ def to_s
98
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
99
+ "#<Twilio.Messaging.V1.DomainConfigMessagingServiceContext #{context}>"
100
+ end
101
+
102
+ ##
103
+ # Provide a detailed, user friendly representation
104
+ def inspect
105
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
106
+ "#<Twilio.Messaging.V1.DomainConfigMessagingServiceContext #{context}>"
107
+ end
108
+ end
109
+
110
+ ##
111
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
112
+ class DomainConfigMessagingServiceInstance < InstanceResource
113
+ ##
114
+ # Initialize the DomainConfigMessagingServiceInstance
115
+ # @param [Version] version Version that contains the resource
116
+ # @param [Hash] payload payload that contains response from Twilio
117
+ # @param [String] messaging_service_sid Unique string used to identify the
118
+ # Messaging service that this domain should be associated with.
119
+ # @return [DomainConfigMessagingServiceInstance] DomainConfigMessagingServiceInstance
120
+ def initialize(version, payload, messaging_service_sid: nil)
121
+ super(version)
122
+
123
+ # Marshaled Properties
124
+ @properties = {
125
+ 'domain_sid' => payload['domain_sid'],
126
+ 'config_sid' => payload['config_sid'],
127
+ 'messaging_service_sid' => payload['messaging_service_sid'],
128
+ 'fallback_url' => payload['fallback_url'],
129
+ 'callback_url' => payload['callback_url'],
130
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
131
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
132
+ 'url' => payload['url'],
133
+ }
134
+
135
+ # Context
136
+ @instance_context = nil
137
+ @params = {'messaging_service_sid' => messaging_service_sid || @properties['messaging_service_sid'], }
138
+ end
139
+
140
+ ##
141
+ # Generate an instance context for the instance, the context is capable of
142
+ # performing various actions. All instance actions are proxied to the context
143
+ # @return [DomainConfigMessagingServiceContext] DomainConfigMessagingServiceContext for this DomainConfigMessagingServiceInstance
144
+ def context
145
+ unless @instance_context
146
+ @instance_context = DomainConfigMessagingServiceContext.new(
147
+ @version,
148
+ @params['messaging_service_sid'],
149
+ )
150
+ end
151
+ @instance_context
152
+ end
153
+
154
+ ##
155
+ # @return [String] The unique string that we created to identify the Domain resource.
156
+ def domain_sid
157
+ @properties['domain_sid']
158
+ end
159
+
160
+ ##
161
+ # @return [String] The unique string that we created to identify the Domain config (prefix ZK).
162
+ def config_sid
163
+ @properties['config_sid']
164
+ end
165
+
166
+ ##
167
+ # @return [String] The unique string that identifies the messaging service
168
+ def messaging_service_sid
169
+ @properties['messaging_service_sid']
170
+ end
171
+
172
+ ##
173
+ # @return [String] We will redirect requests to urls we are unable to identify to this url.
174
+ def fallback_url
175
+ @properties['fallback_url']
176
+ end
177
+
178
+ ##
179
+ # @return [String] URL to receive click events to your webhook whenever the recipients click on the shortened links.
180
+ def callback_url
181
+ @properties['callback_url']
182
+ end
183
+
184
+ ##
185
+ # @return [Time] Date this Domain Config was created.
186
+ def date_created
187
+ @properties['date_created']
188
+ end
189
+
190
+ ##
191
+ # @return [Time] Date that this Domain Config was last updated.
192
+ def date_updated
193
+ @properties['date_updated']
194
+ end
195
+
196
+ ##
197
+ # @return [String] The url
198
+ def url
199
+ @properties['url']
200
+ end
201
+
202
+ ##
203
+ # Fetch the DomainConfigMessagingServiceInstance
204
+ # @return [DomainConfigMessagingServiceInstance] Fetched DomainConfigMessagingServiceInstance
205
+ def fetch
206
+ context.fetch
207
+ end
208
+
209
+ ##
210
+ # Provide a user friendly representation
211
+ def to_s
212
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
213
+ "<Twilio.Messaging.V1.DomainConfigMessagingServiceInstance #{values}>"
214
+ end
215
+
216
+ ##
217
+ # Provide a detailed, user friendly representation
218
+ def inspect
219
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
220
+ "<Twilio.Messaging.V1.DomainConfigMessagingServiceInstance #{values}>"
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
@@ -0,0 +1,218 @@
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 Messaging < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class LinkshorteningMessagingServiceList < ListResource
16
+ ##
17
+ # Initialize the LinkshorteningMessagingServiceList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [LinkshorteningMessagingServiceList] LinkshorteningMessagingServiceList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ end
26
+
27
+ ##
28
+ # Provide a user friendly representation
29
+ def to_s
30
+ '#<Twilio.Messaging.V1.LinkshorteningMessagingServiceList>'
31
+ end
32
+ end
33
+
34
+ ##
35
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
+ class LinkshorteningMessagingServicePage < Page
37
+ ##
38
+ # Initialize the LinkshorteningMessagingServicePage
39
+ # @param [Version] version Version that contains the resource
40
+ # @param [Response] response Response from the API
41
+ # @param [Hash] solution Path solution for the resource
42
+ # @return [LinkshorteningMessagingServicePage] LinkshorteningMessagingServicePage
43
+ def initialize(version, response, solution)
44
+ super(version, response)
45
+
46
+ # Path Solution
47
+ @solution = solution
48
+ end
49
+
50
+ ##
51
+ # Build an instance of LinkshorteningMessagingServiceInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [LinkshorteningMessagingServiceInstance] LinkshorteningMessagingServiceInstance
54
+ def get_instance(payload)
55
+ LinkshorteningMessagingServiceInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Messaging.V1.LinkshorteningMessagingServicePage>'
62
+ end
63
+ end
64
+
65
+ ##
66
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
+ class LinkshorteningMessagingServiceContext < InstanceContext
68
+ ##
69
+ # Initialize the LinkshorteningMessagingServiceContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] domain_sid The domain SID to dissociate from a messaging
72
+ # service. With URL shortening enabled, links in messages sent with the associated
73
+ # messaging service will be shortened to the provided domain
74
+ # @param [String] messaging_service_sid A messaging service SID to dissociate from
75
+ # a domain. With URL shortening enabled, links in messages sent with the provided
76
+ # messaging service will be shortened to the associated domain
77
+ # @return [LinkshorteningMessagingServiceContext] LinkshorteningMessagingServiceContext
78
+ def initialize(version, domain_sid, messaging_service_sid)
79
+ super(version)
80
+
81
+ # Path Solution
82
+ @solution = {domain_sid: domain_sid, messaging_service_sid: messaging_service_sid, }
83
+ @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/MessagingServices/#{@solution[:messaging_service_sid]}"
84
+ end
85
+
86
+ ##
87
+ # Create the LinkshorteningMessagingServiceInstance
88
+ # @return [LinkshorteningMessagingServiceInstance] Created LinkshorteningMessagingServiceInstance
89
+ def create
90
+ payload = @version.create('POST', @uri)
91
+
92
+ LinkshorteningMessagingServiceInstance.new(
93
+ @version,
94
+ payload,
95
+ domain_sid: @solution[:domain_sid],
96
+ messaging_service_sid: @solution[:messaging_service_sid],
97
+ )
98
+ end
99
+
100
+ ##
101
+ # Delete the LinkshorteningMessagingServiceInstance
102
+ # @return [Boolean] true if delete succeeds, false otherwise
103
+ def delete
104
+ @version.delete('DELETE', @uri)
105
+ end
106
+
107
+ ##
108
+ # Provide a user friendly representation
109
+ def to_s
110
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
111
+ "#<Twilio.Messaging.V1.LinkshorteningMessagingServiceContext #{context}>"
112
+ end
113
+
114
+ ##
115
+ # Provide a detailed, user friendly representation
116
+ def inspect
117
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
118
+ "#<Twilio.Messaging.V1.LinkshorteningMessagingServiceContext #{context}>"
119
+ end
120
+ end
121
+
122
+ ##
123
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
124
+ class LinkshorteningMessagingServiceInstance < InstanceResource
125
+ ##
126
+ # Initialize the LinkshorteningMessagingServiceInstance
127
+ # @param [Version] version Version that contains the resource
128
+ # @param [Hash] payload payload that contains response from Twilio
129
+ # @param [String] domain_sid The domain SID to dissociate from a messaging
130
+ # service. With URL shortening enabled, links in messages sent with the associated
131
+ # messaging service will be shortened to the provided domain
132
+ # @param [String] messaging_service_sid A messaging service SID to dissociate from
133
+ # a domain. With URL shortening enabled, links in messages sent with the provided
134
+ # messaging service will be shortened to the associated domain
135
+ # @return [LinkshorteningMessagingServiceInstance] LinkshorteningMessagingServiceInstance
136
+ def initialize(version, payload, domain_sid: nil, messaging_service_sid: nil)
137
+ super(version)
138
+
139
+ # Marshaled Properties
140
+ @properties = {
141
+ 'domain_sid' => payload['domain_sid'],
142
+ 'messaging_service_sid' => payload['messaging_service_sid'],
143
+ 'url' => payload['url'],
144
+ }
145
+
146
+ # Context
147
+ @instance_context = nil
148
+ @params = {
149
+ 'domain_sid' => domain_sid || @properties['domain_sid'],
150
+ 'messaging_service_sid' => messaging_service_sid || @properties['messaging_service_sid'],
151
+ }
152
+ end
153
+
154
+ ##
155
+ # Generate an instance context for the instance, the context is capable of
156
+ # performing various actions. All instance actions are proxied to the context
157
+ # @return [LinkshorteningMessagingServiceContext] LinkshorteningMessagingServiceContext for this LinkshorteningMessagingServiceInstance
158
+ def context
159
+ unless @instance_context
160
+ @instance_context = LinkshorteningMessagingServiceContext.new(
161
+ @version,
162
+ @params['domain_sid'],
163
+ @params['messaging_service_sid'],
164
+ )
165
+ end
166
+ @instance_context
167
+ end
168
+
169
+ ##
170
+ # @return [String] The unique string that identifies the domain resource
171
+ def domain_sid
172
+ @properties['domain_sid']
173
+ end
174
+
175
+ ##
176
+ # @return [String] The unique string that identifies the messaging service
177
+ def messaging_service_sid
178
+ @properties['messaging_service_sid']
179
+ end
180
+
181
+ ##
182
+ # @return [String] The url
183
+ def url
184
+ @properties['url']
185
+ end
186
+
187
+ ##
188
+ # Create the LinkshorteningMessagingServiceInstance
189
+ # @return [LinkshorteningMessagingServiceInstance] Created LinkshorteningMessagingServiceInstance
190
+ def create
191
+ context.create
192
+ end
193
+
194
+ ##
195
+ # Delete the LinkshorteningMessagingServiceInstance
196
+ # @return [Boolean] true if delete succeeds, false otherwise
197
+ def delete
198
+ context.delete
199
+ end
200
+
201
+ ##
202
+ # Provide a user friendly representation
203
+ def to_s
204
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
205
+ "<Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance #{values}>"
206
+ end
207
+
208
+ ##
209
+ # Provide a detailed, user friendly representation
210
+ def inspect
211
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
212
+ "<Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance #{values}>"
213
+ end
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end