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,257 @@
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 DomainCertsList < ListResource
16
+ ##
17
+ # Initialize the DomainCertsList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [DomainCertsList] DomainCertsList
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.DomainCertsList>'
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 DomainCertsPage < Page
37
+ ##
38
+ # Initialize the DomainCertsPage
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 [DomainCertsPage] DomainCertsPage
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 DomainCertsInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [DomainCertsInstance] DomainCertsInstance
54
+ def get_instance(payload)
55
+ DomainCertsInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Messaging.V1.DomainCertsPage>'
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 DomainCertsContext < InstanceContext
68
+ ##
69
+ # Initialize the DomainCertsContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] domain_sid Unique string used to identify the domain that this
72
+ # certificate should be associated with.
73
+ # @return [DomainCertsContext] DomainCertsContext
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]}/Certificate"
80
+ end
81
+
82
+ ##
83
+ # Update the DomainCertsInstance
84
+ # @param [String] tls_cert Contains the full TLS certificate and private for this
85
+ # domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail.
86
+ # Twilio uses this information to process HTTPS traffic sent to your domain.
87
+ # @return [DomainCertsInstance] Updated DomainCertsInstance
88
+ def update(tls_cert: nil)
89
+ data = Twilio::Values.of({'TlsCert' => tls_cert, })
90
+
91
+ payload = @version.update('POST', @uri, data: data)
92
+
93
+ DomainCertsInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
94
+ end
95
+
96
+ ##
97
+ # Fetch the DomainCertsInstance
98
+ # @return [DomainCertsInstance] Fetched DomainCertsInstance
99
+ def fetch
100
+ payload = @version.fetch('GET', @uri)
101
+
102
+ DomainCertsInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
103
+ end
104
+
105
+ ##
106
+ # Delete the DomainCertsInstance
107
+ # @return [Boolean] true if delete succeeds, false otherwise
108
+ def delete
109
+ @version.delete('DELETE', @uri)
110
+ end
111
+
112
+ ##
113
+ # Provide a user friendly representation
114
+ def to_s
115
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
116
+ "#<Twilio.Messaging.V1.DomainCertsContext #{context}>"
117
+ end
118
+
119
+ ##
120
+ # Provide a detailed, user friendly representation
121
+ def inspect
122
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
123
+ "#<Twilio.Messaging.V1.DomainCertsContext #{context}>"
124
+ end
125
+ end
126
+
127
+ ##
128
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
129
+ class DomainCertsInstance < InstanceResource
130
+ ##
131
+ # Initialize the DomainCertsInstance
132
+ # @param [Version] version Version that contains the resource
133
+ # @param [Hash] payload payload that contains response from Twilio
134
+ # @param [String] domain_sid Unique string used to identify the domain that this
135
+ # certificate should be associated with.
136
+ # @return [DomainCertsInstance] DomainCertsInstance
137
+ def initialize(version, payload, domain_sid: nil)
138
+ super(version)
139
+
140
+ # Marshaled Properties
141
+ @properties = {
142
+ 'domain_sid' => payload['domain_sid'],
143
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
144
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
145
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
146
+ 'domain_name' => payload['domain_name'],
147
+ 'certificate_sid' => payload['certificate_sid'],
148
+ 'url' => payload['url'],
149
+ 'validated' => payload['validated'],
150
+ }
151
+
152
+ # Context
153
+ @instance_context = nil
154
+ @params = {'domain_sid' => domain_sid || @properties['domain_sid'], }
155
+ end
156
+
157
+ ##
158
+ # Generate an instance context for the instance, the context is capable of
159
+ # performing various actions. All instance actions are proxied to the context
160
+ # @return [DomainCertsContext] DomainCertsContext for this DomainCertsInstance
161
+ def context
162
+ unless @instance_context
163
+ @instance_context = DomainCertsContext.new(@version, @params['domain_sid'], )
164
+ end
165
+ @instance_context
166
+ end
167
+
168
+ ##
169
+ # @return [String] The unique string that we created to identify the Domain resource.
170
+ def domain_sid
171
+ @properties['domain_sid']
172
+ end
173
+
174
+ ##
175
+ # @return [Time] Date that this Domain was last updated.
176
+ def date_updated
177
+ @properties['date_updated']
178
+ end
179
+
180
+ ##
181
+ # @return [Time] Expiration date for your private certificate.
182
+ def date_expires
183
+ @properties['date_expires']
184
+ end
185
+
186
+ ##
187
+ # @return [Time] Date this Domain SID was created.
188
+ def date_created
189
+ @properties['date_created']
190
+ end
191
+
192
+ ##
193
+ # @return [String] Full url path for this domain.
194
+ def domain_name
195
+ @properties['domain_name']
196
+ end
197
+
198
+ ##
199
+ # @return [String] The unique string that we created to identify this Certificate resource.
200
+ def certificate_sid
201
+ @properties['certificate_sid']
202
+ end
203
+
204
+ ##
205
+ # @return [String] The url
206
+ def url
207
+ @properties['url']
208
+ end
209
+
210
+ ##
211
+ # @return [Boolean] Certificate validation field
212
+ def validated
213
+ @properties['validated']
214
+ end
215
+
216
+ ##
217
+ # Update the DomainCertsInstance
218
+ # @param [String] tls_cert Contains the full TLS certificate and private for this
219
+ # domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail.
220
+ # Twilio uses this information to process HTTPS traffic sent to your domain.
221
+ # @return [DomainCertsInstance] Updated DomainCertsInstance
222
+ def update(tls_cert: nil)
223
+ context.update(tls_cert: tls_cert, )
224
+ end
225
+
226
+ ##
227
+ # Fetch the DomainCertsInstance
228
+ # @return [DomainCertsInstance] Fetched DomainCertsInstance
229
+ def fetch
230
+ context.fetch
231
+ end
232
+
233
+ ##
234
+ # Delete the DomainCertsInstance
235
+ # @return [Boolean] true if delete succeeds, false otherwise
236
+ def delete
237
+ context.delete
238
+ end
239
+
240
+ ##
241
+ # Provide a user friendly representation
242
+ def to_s
243
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
244
+ "<Twilio.Messaging.V1.DomainCertsInstance #{values}>"
245
+ end
246
+
247
+ ##
248
+ # Provide a detailed, user friendly representation
249
+ def inspect
250
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
251
+ "<Twilio.Messaging.V1.DomainCertsInstance #{values}>"
252
+ end
253
+ end
254
+ end
255
+ end
256
+ end
257
+ end
@@ -0,0 +1,267 @@
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 [Array[String]] messaging_service_sids A list of messagingServiceSids
85
+ # (with prefix MG)
86
+ # @param [String] fallback_url Any requests we receive to this domain that do not
87
+ # match an existing shortened message will be redirected to the fallback url.
88
+ # These will likely be either expired messages, random misdirected traffic, or
89
+ # intentional scraping.
90
+ # @param [String] callback_url URL to receive click events to your webhook
91
+ # whenever the recipients click on the shortened links
92
+ # @param [String] messaging_service_sids_action An action type for
93
+ # messaging_service_sids operation (ADD, DELETE, REPLACE)
94
+ # @return [DomainConfigInstance] Updated DomainConfigInstance
95
+ def update(messaging_service_sids: nil, fallback_url: :unset, callback_url: :unset, messaging_service_sids_action: :unset)
96
+ data = Twilio::Values.of({
97
+ 'MessagingServiceSids' => Twilio.serialize_list(messaging_service_sids) { |e| e },
98
+ 'FallbackUrl' => fallback_url,
99
+ 'CallbackUrl' => callback_url,
100
+ 'MessagingServiceSidsAction' => messaging_service_sids_action,
101
+ })
102
+
103
+ payload = @version.update('POST', @uri, data: data)
104
+
105
+ DomainConfigInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
106
+ end
107
+
108
+ ##
109
+ # Fetch the DomainConfigInstance
110
+ # @return [DomainConfigInstance] Fetched DomainConfigInstance
111
+ def fetch
112
+ payload = @version.fetch('GET', @uri)
113
+
114
+ DomainConfigInstance.new(@version, payload, domain_sid: @solution[:domain_sid], )
115
+ end
116
+
117
+ ##
118
+ # Provide a user friendly representation
119
+ def to_s
120
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
121
+ "#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
122
+ end
123
+
124
+ ##
125
+ # Provide a detailed, user friendly representation
126
+ def inspect
127
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
128
+ "#<Twilio.Messaging.V1.DomainConfigContext #{context}>"
129
+ end
130
+ end
131
+
132
+ ##
133
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
134
+ class DomainConfigInstance < InstanceResource
135
+ ##
136
+ # Initialize the DomainConfigInstance
137
+ # @param [Version] version Version that contains the resource
138
+ # @param [Hash] payload payload that contains response from Twilio
139
+ # @param [String] domain_sid Unique string used to identify the domain that this
140
+ # config should be associated with.
141
+ # @return [DomainConfigInstance] DomainConfigInstance
142
+ def initialize(version, payload, domain_sid: nil)
143
+ super(version)
144
+
145
+ # Marshaled Properties
146
+ @properties = {
147
+ 'domain_sid' => payload['domain_sid'],
148
+ 'config_sid' => payload['config_sid'],
149
+ 'messaging_service_sids' => payload['messaging_service_sids'],
150
+ 'fallback_url' => payload['fallback_url'],
151
+ 'callback_url' => payload['callback_url'],
152
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
153
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
154
+ 'url' => payload['url'],
155
+ }
156
+
157
+ # Context
158
+ @instance_context = nil
159
+ @params = {'domain_sid' => domain_sid || @properties['domain_sid'], }
160
+ end
161
+
162
+ ##
163
+ # Generate an instance context for the instance, the context is capable of
164
+ # performing various actions. All instance actions are proxied to the context
165
+ # @return [DomainConfigContext] DomainConfigContext for this DomainConfigInstance
166
+ def context
167
+ unless @instance_context
168
+ @instance_context = DomainConfigContext.new(@version, @params['domain_sid'], )
169
+ end
170
+ @instance_context
171
+ end
172
+
173
+ ##
174
+ # @return [String] The unique string that we created to identify the Domain resource.
175
+ def domain_sid
176
+ @properties['domain_sid']
177
+ end
178
+
179
+ ##
180
+ # @return [String] The unique string that we created to identify the Domain config (prefix ZK).
181
+ def config_sid
182
+ @properties['config_sid']
183
+ end
184
+
185
+ ##
186
+ # @return [Array[String]] A list of messagingServiceSids (with prefix MG).
187
+ def messaging_service_sids
188
+ @properties['messaging_service_sids']
189
+ end
190
+
191
+ ##
192
+ # @return [String] We will redirect requests to urls we are unable to identify to this url.
193
+ def fallback_url
194
+ @properties['fallback_url']
195
+ end
196
+
197
+ ##
198
+ # @return [String] URL to receive click events to your webhook whenever the recipients click on the shortened links.
199
+ def callback_url
200
+ @properties['callback_url']
201
+ end
202
+
203
+ ##
204
+ # @return [Time] Date this Domain Config was created.
205
+ def date_created
206
+ @properties['date_created']
207
+ end
208
+
209
+ ##
210
+ # @return [Time] Date that this Domain Config was last updated.
211
+ def date_updated
212
+ @properties['date_updated']
213
+ end
214
+
215
+ ##
216
+ # @return [String] The url
217
+ def url
218
+ @properties['url']
219
+ end
220
+
221
+ ##
222
+ # Update the DomainConfigInstance
223
+ # @param [Array[String]] messaging_service_sids A list of messagingServiceSids
224
+ # (with prefix MG)
225
+ # @param [String] fallback_url Any requests we receive to this domain that do not
226
+ # match an existing shortened message will be redirected to the fallback url.
227
+ # These will likely be either expired messages, random misdirected traffic, or
228
+ # intentional scraping.
229
+ # @param [String] callback_url URL to receive click events to your webhook
230
+ # whenever the recipients click on the shortened links
231
+ # @param [String] messaging_service_sids_action An action type for
232
+ # messaging_service_sids operation (ADD, DELETE, REPLACE)
233
+ # @return [DomainConfigInstance] Updated DomainConfigInstance
234
+ def update(messaging_service_sids: nil, fallback_url: :unset, callback_url: :unset, messaging_service_sids_action: :unset)
235
+ context.update(
236
+ messaging_service_sids: messaging_service_sids,
237
+ fallback_url: fallback_url,
238
+ callback_url: callback_url,
239
+ messaging_service_sids_action: messaging_service_sids_action,
240
+ )
241
+ end
242
+
243
+ ##
244
+ # Fetch the DomainConfigInstance
245
+ # @return [DomainConfigInstance] Fetched DomainConfigInstance
246
+ def fetch
247
+ context.fetch
248
+ end
249
+
250
+ ##
251
+ # Provide a user friendly representation
252
+ def to_s
253
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
254
+ "<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
255
+ end
256
+
257
+ ##
258
+ # Provide a detailed, user friendly representation
259
+ def inspect
260
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
261
+ "<Twilio.Messaging.V1.DomainConfigInstance #{values}>"
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
@@ -32,8 +32,8 @@ module Twilio
32
32
  ##
33
33
  # Create the AlphaSenderInstance
34
34
  # @param [String] alpha_sender The Alphanumeric Sender ID string. Can be up to 11
35
- # characters long. Valid characters are A-Z, a-z, 0-9, space, and hyphen `-`. This
36
- # value cannot contain only numbers.
35
+ # characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus
36
+ # `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers.
37
37
  # @return [AlphaSenderInstance] Created AlphaSenderInstance
38
38
  def create(alpha_sender: nil)
39
39
  data = Twilio::Values.of({'AlphaSender' => alpha_sender, })
@@ -33,23 +33,69 @@ module Twilio
33
33
  # Create the UsAppToPersonInstance
34
34
  # @param [String] brand_registration_sid A2P Brand Registration SID
35
35
  # @param [String] description A short description of what this SMS campaign does.
36
- # @param [Array[String]] message_samples Message samples, at least 2 and up to 5
37
- # sample messages, <=1024 chars each.
36
+ # Min length: 40 characters. Max length: 4096 characters.
37
+ # @param [String] message_flow Required for all Campaigns. Details around how a
38
+ # consumer opts-in to their campaign, therefore giving consent to receive their
39
+ # messages. If multiple opt-in methods can be used for the same campaign, they
40
+ # must all be listed. 40 character minimum. 2048 character maximum.
41
+ # @param [Array[String]] message_samples Message samples, at least 1 and up to 5
42
+ # sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each.
38
43
  # @param [String] us_app_to_person_usecase A2P Campaign Use Case. Examples: [ 2FA,
39
44
  # EMERGENCY, MARKETING..]
40
45
  # @param [Boolean] has_embedded_links Indicates that this SMS campaign will send
41
46
  # messages that contain links.
42
47
  # @param [Boolean] has_embedded_phone Indicates that this SMS campaign will send
43
48
  # messages that contain phone numbers.
49
+ # @param [String] opt_in_message If end users can text in a keyword to start
50
+ # receiving messages from this campaign, the auto-reply messages sent to the end
51
+ # users must be provided. The opt-in response should include the Brand name,
52
+ # confirmation of opt-in enrollment to a recurring message campaign, how to get
53
+ # help, and clear description of how to opt-out. This field is required if end
54
+ # users can text in a keyword to start receiving messages from this campaign. 20
55
+ # character minimum. 320 character maximum.
56
+ # @param [String] opt_out_message Upon receiving the opt-out keywords from the end
57
+ # users, Twilio customers are expected to send back an auto-generated response,
58
+ # which must provide acknowledgment of the opt-out request and confirmation that
59
+ # no further messages will be sent. It is also recommended that these opt-out
60
+ # messages include the brand name. This field is required if managing opt out
61
+ # keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out
62
+ # features). 20 character minimum. 320 character maximum.
63
+ # @param [String] help_message When customers receive the help keywords from their
64
+ # end users, Twilio customers are expected to send back an auto-generated
65
+ # response; this may include the brand name and additional support contact
66
+ # information. This field is required if managing help keywords yourself (i.e. not
67
+ # using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320
68
+ # character maximum.
69
+ # @param [Array[String]] opt_in_keywords If end users can text in a keyword to
70
+ # start receiving messages from this campaign, those keywords must be provided.
71
+ # This field is required if end users can text in a keyword to start receiving
72
+ # messages from this campaign. Values must be alphanumeric. 255 character maximum.
73
+ # @param [Array[String]] opt_out_keywords End users should be able to text in a
74
+ # keyword to stop receiving messages from this campaign. Those keywords must be
75
+ # provided. This field is required if managing opt out keywords yourself (i.e. not
76
+ # using Twilio's Default or Advanced Opt Out features). Values must be
77
+ # alphanumeric. 255 character maximum.
78
+ # @param [Array[String]] help_keywords End users should be able to text in a
79
+ # keyword to receive help. Those keywords must be provided as part of the campaign
80
+ # registration request. This field is required if managing help keywords yourself
81
+ # (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be
82
+ # alphanumeric. 255 character maximum.
44
83
  # @return [UsAppToPersonInstance] Created UsAppToPersonInstance
45
- def create(brand_registration_sid: nil, description: nil, message_samples: nil, us_app_to_person_usecase: nil, has_embedded_links: nil, has_embedded_phone: nil)
84
+ def create(brand_registration_sid: nil, description: nil, message_flow: nil, message_samples: nil, us_app_to_person_usecase: nil, has_embedded_links: nil, has_embedded_phone: nil, opt_in_message: :unset, opt_out_message: :unset, help_message: :unset, opt_in_keywords: :unset, opt_out_keywords: :unset, help_keywords: :unset)
46
85
  data = Twilio::Values.of({
47
86
  'BrandRegistrationSid' => brand_registration_sid,
48
87
  'Description' => description,
88
+ 'MessageFlow' => message_flow,
49
89
  'MessageSamples' => Twilio.serialize_list(message_samples) { |e| e },
50
90
  'UsAppToPersonUsecase' => us_app_to_person_usecase,
51
91
  'HasEmbeddedLinks' => has_embedded_links,
52
92
  'HasEmbeddedPhone' => has_embedded_phone,
93
+ 'OptInMessage' => opt_in_message,
94
+ 'OptOutMessage' => opt_out_message,
95
+ 'HelpMessage' => help_message,
96
+ 'OptInKeywords' => Twilio.serialize_list(opt_in_keywords) { |e| e },
97
+ 'OptOutKeywords' => Twilio.serialize_list(opt_out_keywords) { |e| e },
98
+ 'HelpKeywords' => Twilio.serialize_list(help_keywords) { |e| e },
53
99
  })
54
100
 
55
101
  payload = @version.create('POST', @uri, data: data)
@@ -270,6 +316,13 @@ module Twilio
270
316
  'campaign_id' => payload['campaign_id'],
271
317
  'is_externally_registered' => payload['is_externally_registered'],
272
318
  'rate_limits' => payload['rate_limits'],
319
+ 'message_flow' => payload['message_flow'],
320
+ 'opt_in_message' => payload['opt_in_message'],
321
+ 'opt_out_message' => payload['opt_out_message'],
322
+ 'help_message' => payload['help_message'],
323
+ 'opt_in_keywords' => payload['opt_in_keywords'],
324
+ 'opt_out_keywords' => payload['opt_out_keywords'],
325
+ 'help_keywords' => payload['help_keywords'],
273
326
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
274
327
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
275
328
  'url' => payload['url'],
@@ -374,6 +427,48 @@ module Twilio
374
427
  @properties['rate_limits']
375
428
  end
376
429
 
430
+ ##
431
+ # @return [String] Consumer opt-in flow
432
+ def message_flow
433
+ @properties['message_flow']
434
+ end
435
+
436
+ ##
437
+ # @return [String] Opt In Message
438
+ def opt_in_message
439
+ @properties['opt_in_message']
440
+ end
441
+
442
+ ##
443
+ # @return [String] Opt Out Message
444
+ def opt_out_message
445
+ @properties['opt_out_message']
446
+ end
447
+
448
+ ##
449
+ # @return [String] Help Message
450
+ def help_message
451
+ @properties['help_message']
452
+ end
453
+
454
+ ##
455
+ # @return [Array[String]] Opt In Keywords
456
+ def opt_in_keywords
457
+ @properties['opt_in_keywords']
458
+ end
459
+
460
+ ##
461
+ # @return [Array[String]] Opt Out Keywords
462
+ def opt_out_keywords
463
+ @properties['opt_out_keywords']
464
+ end
465
+
466
+ ##
467
+ # @return [Array[String]] Help Keywords
468
+ def help_keywords
469
+ @properties['help_keywords']
470
+ end
471
+
377
472
  ##
378
473
  # @return [Time] The ISO 8601 date and time in GMT when the resource was created
379
474
  def date_created
@@ -469,7 +469,7 @@ module Twilio
469
469
  'fallback_to_long_code' => payload['fallback_to_long_code'],
470
470
  'area_code_geomatch' => payload['area_code_geomatch'],
471
471
  'synchronous_validation' => payload['synchronous_validation'],
472
- 'validity_period' => payload['validity_period'].to_i,
472
+ 'validity_period' => payload['validity_period'] == nil ? payload['validity_period'] : payload['validity_period'].to_i,
473
473
  'url' => payload['url'],
474
474
  'links' => payload['links'],
475
475
  'usecase' => payload['usecase'],