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
@@ -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'],
@@ -173,8 +173,10 @@ module Twilio
173
173
  # business or organization using the Tollfree number.
174
174
  # @param [String] business_contact_phone The phone number of the contact for the
175
175
  # business or organization using the Tollfree number.
176
+ # @param [String] external_reference_id An optional external reference ID supplied
177
+ # by customer and echoed back on status retrieval.
176
178
  # @return [TollfreeVerificationInstance] Created TollfreeVerificationInstance
177
- def create(business_name: nil, business_website: nil, notification_email: nil, use_case_categories: nil, use_case_summary: nil, production_message_sample: nil, opt_in_image_urls: nil, opt_in_type: nil, message_volume: nil, tollfree_phone_number_sid: nil, customer_profile_sid: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset)
179
+ def create(business_name: nil, business_website: nil, notification_email: nil, use_case_categories: nil, use_case_summary: nil, production_message_sample: nil, opt_in_image_urls: nil, opt_in_type: nil, message_volume: nil, tollfree_phone_number_sid: nil, customer_profile_sid: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset, external_reference_id: :unset)
178
180
  data = Twilio::Values.of({
179
181
  'BusinessName' => business_name,
180
182
  'BusinessWebsite' => business_website,
@@ -198,6 +200,7 @@ module Twilio
198
200
  'BusinessContactLastName' => business_contact_last_name,
199
201
  'BusinessContactEmail' => business_contact_email,
200
202
  'BusinessContactPhone' => business_contact_phone,
203
+ 'ExternalReferenceId' => external_reference_id,
201
204
  })
202
205
 
203
206
  payload = @version.create('POST', @uri, data: data)
@@ -268,6 +271,78 @@ module Twilio
268
271
  TollfreeVerificationInstance.new(@version, payload, sid: @solution[:sid], )
269
272
  end
270
273
 
274
+ ##
275
+ # Update the TollfreeVerificationInstance
276
+ # @param [String] business_name The name of the business or organization using the
277
+ # Tollfree number.
278
+ # @param [String] business_website The website of the business or organization
279
+ # using the Tollfree number.
280
+ # @param [String] notification_email The email address to receive the notification
281
+ # about the verification result. .
282
+ # @param [Array[String]] use_case_categories The category of the use case for the
283
+ # Tollfree Number. List as many are applicable..
284
+ # @param [String] use_case_summary Use this to further explain how messaging is
285
+ # used by the business or organization.
286
+ # @param [String] production_message_sample An example of message content, i.e. a
287
+ # sample message.
288
+ # @param [Array[String]] opt_in_image_urls Link to an image that shows the opt-in
289
+ # workflow. Multiple images allowed and must be a publicly hosted URL.
290
+ # @param [tollfree_verification.OptInType] opt_in_type Describe how a user opts-in
291
+ # to text messages.
292
+ # @param [String] message_volume Estimate monthly volume of messages from the
293
+ # Tollfree Number.
294
+ # @param [String] business_street_address The address of the business or
295
+ # organization using the Tollfree number.
296
+ # @param [String] business_street_address2 The address of the business or
297
+ # organization using the Tollfree number.
298
+ # @param [String] business_city The city of the business or organization using the
299
+ # Tollfree number.
300
+ # @param [String] business_state_province_region The state/province/region of the
301
+ # business or organization using the Tollfree number.
302
+ # @param [String] business_postal_code The postal code of the business or
303
+ # organization using the Tollfree number.
304
+ # @param [String] business_country The country of the business or organization
305
+ # using the Tollfree number.
306
+ # @param [String] additional_information Additional information to be provided for
307
+ # verification.
308
+ # @param [String] business_contact_first_name The first name of the contact for
309
+ # the business or organization using the Tollfree number.
310
+ # @param [String] business_contact_last_name The last name of the contact for the
311
+ # business or organization using the Tollfree number.
312
+ # @param [String] business_contact_email The email address of the contact for the
313
+ # business or organization using the Tollfree number.
314
+ # @param [String] business_contact_phone The phone number of the contact for the
315
+ # business or organization using the Tollfree number.
316
+ # @return [TollfreeVerificationInstance] Updated TollfreeVerificationInstance
317
+ def update(business_name: :unset, business_website: :unset, notification_email: :unset, use_case_categories: :unset, use_case_summary: :unset, production_message_sample: :unset, opt_in_image_urls: :unset, opt_in_type: :unset, message_volume: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset)
318
+ data = Twilio::Values.of({
319
+ 'BusinessName' => business_name,
320
+ 'BusinessWebsite' => business_website,
321
+ 'NotificationEmail' => notification_email,
322
+ 'UseCaseCategories' => Twilio.serialize_list(use_case_categories) { |e| e },
323
+ 'UseCaseSummary' => use_case_summary,
324
+ 'ProductionMessageSample' => production_message_sample,
325
+ 'OptInImageUrls' => Twilio.serialize_list(opt_in_image_urls) { |e| e },
326
+ 'OptInType' => opt_in_type,
327
+ 'MessageVolume' => message_volume,
328
+ 'BusinessStreetAddress' => business_street_address,
329
+ 'BusinessStreetAddress2' => business_street_address2,
330
+ 'BusinessCity' => business_city,
331
+ 'BusinessStateProvinceRegion' => business_state_province_region,
332
+ 'BusinessPostalCode' => business_postal_code,
333
+ 'BusinessCountry' => business_country,
334
+ 'AdditionalInformation' => additional_information,
335
+ 'BusinessContactFirstName' => business_contact_first_name,
336
+ 'BusinessContactLastName' => business_contact_last_name,
337
+ 'BusinessContactEmail' => business_contact_email,
338
+ 'BusinessContactPhone' => business_contact_phone,
339
+ })
340
+
341
+ payload = @version.update('POST', @uri, data: data)
342
+
343
+ TollfreeVerificationInstance.new(@version, payload, sid: @solution[:sid], )
344
+ end
345
+
271
346
  ##
272
347
  # Provide a user friendly representation
273
348
  def to_s
@@ -327,7 +402,10 @@ module Twilio
327
402
  'tollfree_phone_number_sid' => payload['tollfree_phone_number_sid'],
328
403
  'status' => payload['status'],
329
404
  'url' => payload['url'],
405
+ 'rejection_reason' => payload['rejection_reason'],
406
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
330
407
  'resource_links' => payload['resource_links'],
408
+ 'external_reference_id' => payload['external_reference_id'],
331
409
  }
332
410
 
333
411
  # Context
@@ -526,12 +604,30 @@ module Twilio
526
604
  @properties['url']
527
605
  end
528
606
 
607
+ ##
608
+ # @return [String] The rejection reason given when a Tollfree Verification has been rejected.
609
+ def rejection_reason
610
+ @properties['rejection_reason']
611
+ end
612
+
613
+ ##
614
+ # @return [String] The error code given when a Tollfree Verification has been rejected.
615
+ def error_code
616
+ @properties['error_code']
617
+ end
618
+
529
619
  ##
530
620
  # @return [Hash] The URLs of the documents associated with the Tollfree Verification resource
531
621
  def resource_links
532
622
  @properties['resource_links']
533
623
  end
534
624
 
625
+ ##
626
+ # @return [String] An optional external reference ID supplied by customer and echoed back on status retrieval
627
+ def external_reference_id
628
+ @properties['external_reference_id']
629
+ end
630
+
535
631
  ##
536
632
  # Fetch the TollfreeVerificationInstance
537
633
  # @return [TollfreeVerificationInstance] Fetched TollfreeVerificationInstance
@@ -539,6 +635,74 @@ module Twilio
539
635
  context.fetch
540
636
  end
541
637
 
638
+ ##
639
+ # Update the TollfreeVerificationInstance
640
+ # @param [String] business_name The name of the business or organization using the
641
+ # Tollfree number.
642
+ # @param [String] business_website The website of the business or organization
643
+ # using the Tollfree number.
644
+ # @param [String] notification_email The email address to receive the notification
645
+ # about the verification result. .
646
+ # @param [Array[String]] use_case_categories The category of the use case for the
647
+ # Tollfree Number. List as many are applicable..
648
+ # @param [String] use_case_summary Use this to further explain how messaging is
649
+ # used by the business or organization.
650
+ # @param [String] production_message_sample An example of message content, i.e. a
651
+ # sample message.
652
+ # @param [Array[String]] opt_in_image_urls Link to an image that shows the opt-in
653
+ # workflow. Multiple images allowed and must be a publicly hosted URL.
654
+ # @param [tollfree_verification.OptInType] opt_in_type Describe how a user opts-in
655
+ # to text messages.
656
+ # @param [String] message_volume Estimate monthly volume of messages from the
657
+ # Tollfree Number.
658
+ # @param [String] business_street_address The address of the business or
659
+ # organization using the Tollfree number.
660
+ # @param [String] business_street_address2 The address of the business or
661
+ # organization using the Tollfree number.
662
+ # @param [String] business_city The city of the business or organization using the
663
+ # Tollfree number.
664
+ # @param [String] business_state_province_region The state/province/region of the
665
+ # business or organization using the Tollfree number.
666
+ # @param [String] business_postal_code The postal code of the business or
667
+ # organization using the Tollfree number.
668
+ # @param [String] business_country The country of the business or organization
669
+ # using the Tollfree number.
670
+ # @param [String] additional_information Additional information to be provided for
671
+ # verification.
672
+ # @param [String] business_contact_first_name The first name of the contact for
673
+ # the business or organization using the Tollfree number.
674
+ # @param [String] business_contact_last_name The last name of the contact for the
675
+ # business or organization using the Tollfree number.
676
+ # @param [String] business_contact_email The email address of the contact for the
677
+ # business or organization using the Tollfree number.
678
+ # @param [String] business_contact_phone The phone number of the contact for the
679
+ # business or organization using the Tollfree number.
680
+ # @return [TollfreeVerificationInstance] Updated TollfreeVerificationInstance
681
+ def update(business_name: :unset, business_website: :unset, notification_email: :unset, use_case_categories: :unset, use_case_summary: :unset, production_message_sample: :unset, opt_in_image_urls: :unset, opt_in_type: :unset, message_volume: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset)
682
+ context.update(
683
+ business_name: business_name,
684
+ business_website: business_website,
685
+ notification_email: notification_email,
686
+ use_case_categories: use_case_categories,
687
+ use_case_summary: use_case_summary,
688
+ production_message_sample: production_message_sample,
689
+ opt_in_image_urls: opt_in_image_urls,
690
+ opt_in_type: opt_in_type,
691
+ message_volume: message_volume,
692
+ business_street_address: business_street_address,
693
+ business_street_address2: business_street_address2,
694
+ business_city: business_city,
695
+ business_state_province_region: business_state_province_region,
696
+ business_postal_code: business_postal_code,
697
+ business_country: business_country,
698
+ additional_information: additional_information,
699
+ business_contact_first_name: business_contact_first_name,
700
+ business_contact_last_name: business_contact_last_name,
701
+ business_contact_email: business_contact_email,
702
+ business_contact_phone: business_contact_phone,
703
+ )
704
+ end
705
+
542
706
  ##
543
707
  # Provide a user friendly representation
544
708
  def to_s
@@ -17,7 +17,11 @@ module Twilio
17
17
  @version = 'v1'
18
18
  @brand_registrations = nil
19
19
  @deactivations = nil
20
+ @domain_certs = nil
21
+ @domain_config = nil
22
+ @domain_config_messaging_service = nil
20
23
  @external_campaign = nil
24
+ @linkshortening_messaging_service = nil
21
25
  @services = nil
22
26
  @tollfree_verifications = nil
23
27
  @usecases = nil
@@ -44,12 +48,83 @@ module Twilio
44
48
  @deactivations ||= DeactivationsContext.new self
45
49
  end
46
50
 
51
+ ##
52
+ # @param [String] domain_sid Unique string used to identify the domain that this
53
+ # certificate should be associated with.
54
+ # @return [Twilio::REST::Messaging::V1::DomainCertsContext] if domain_sid was passed.
55
+ # @return [Twilio::REST::Messaging::V1::DomainCertsList]
56
+ def domain_certs(domain_sid=:unset)
57
+ if domain_sid.nil?
58
+ raise ArgumentError, 'domain_sid cannot be nil'
59
+ end
60
+ if domain_sid == :unset
61
+ @domain_certs ||= DomainCertsList.new self
62
+ else
63
+ DomainCertsContext.new(self, domain_sid)
64
+ end
65
+ end
66
+
67
+ ##
68
+ # @param [String] domain_sid Unique string used to identify the domain that this
69
+ # config should be associated with.
70
+ # @return [Twilio::REST::Messaging::V1::DomainConfigContext] if domain_sid was passed.
71
+ # @return [Twilio::REST::Messaging::V1::DomainConfigList]
72
+ def domain_config(domain_sid=:unset)
73
+ if domain_sid.nil?
74
+ raise ArgumentError, 'domain_sid cannot be nil'
75
+ end
76
+ if domain_sid == :unset
77
+ @domain_config ||= DomainConfigList.new self
78
+ else
79
+ DomainConfigContext.new(self, domain_sid)
80
+ end
81
+ end
82
+
83
+ ##
84
+ # @param [String] messaging_service_sid Unique string used to identify the
85
+ # Messaging service that this domain should be associated with.
86
+ # @return [Twilio::REST::Messaging::V1::DomainConfigMessagingServiceContext] if messaging_service_sid was passed.
87
+ # @return [Twilio::REST::Messaging::V1::DomainConfigMessagingServiceList]
88
+ def domain_config_messaging_service(messaging_service_sid=:unset)
89
+ if messaging_service_sid.nil?
90
+ raise ArgumentError, 'messaging_service_sid cannot be nil'
91
+ end
92
+ if messaging_service_sid == :unset
93
+ @domain_config_messaging_service ||= DomainConfigMessagingServiceList.new self
94
+ else
95
+ DomainConfigMessagingServiceContext.new(self, messaging_service_sid)
96
+ end
97
+ end
98
+
47
99
  ##
48
100
  # @return [Twilio::REST::Messaging::V1::ExternalCampaignContext]
49
101
  def external_campaign
50
102
  @external_campaign ||= ExternalCampaignList.new self
51
103
  end
52
104
 
105
+ ##
106
+ # @param [String] domain_sid The domain SID to dissociate from a messaging
107
+ # service. With URL shortening enabled, links in messages sent with the associated
108
+ # messaging service will be shortened to the provided domain
109
+ # @param [String] messaging_service_sid A messaging service SID to dissociate from
110
+ # a domain. With URL shortening enabled, links in messages sent with the provided
111
+ # messaging service will be shortened to the associated domain
112
+ # @return [Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceContext] if messaging_service_sid was passed.
113
+ # @return [Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceList]
114
+ def linkshortening_messaging_service(domain_sid=:unset, messaging_service_sid=:unset)
115
+ if domain_sid.nil?
116
+ raise ArgumentError, 'domain_sid cannot be nil'
117
+ end
118
+ if messaging_service_sid.nil?
119
+ raise ArgumentError, 'messaging_service_sid cannot be nil'
120
+ end
121
+ if domain_sid == :unset && messaging_service_sid == :unset
122
+ @linkshortening_messaging_service ||= LinkshorteningMessagingServiceList.new self
123
+ else
124
+ LinkshorteningMessagingServiceContext.new(self, domain_sid, messaging_service_sid)
125
+ end
126
+ end
127
+
53
128
  ##
54
129
  # @param [String] sid The SID of the Service resource to fetch.
55
130
  # @return [Twilio::REST::Messaging::V1::ServiceContext] if sid was passed.
@@ -42,12 +42,48 @@ module Twilio
42
42
  self.v1.deactivations()
43
43
  end
44
44
 
45
+ ##
46
+ # @param [String] domain_sid The unique string that we created to identify the
47
+ # Domain resource.
48
+ # @return [Twilio::REST::Messaging::V1::DomainCertsInstance] if domain_sid was passed.
49
+ # @return [Twilio::REST::Messaging::V1::DomainCertsList]
50
+ def domain_certs(domain_sid=:unset)
51
+ self.v1.domain_certs(domain_sid)
52
+ end
53
+
54
+ ##
55
+ # @param [String] domain_sid The unique string that we created to identify the
56
+ # Domain resource.
57
+ # @return [Twilio::REST::Messaging::V1::DomainConfigInstance] if domain_sid was passed.
58
+ # @return [Twilio::REST::Messaging::V1::DomainConfigList]
59
+ def domain_config(domain_sid=:unset)
60
+ self.v1.domain_config(domain_sid)
61
+ end
62
+
63
+ ##
64
+ # @param [String] messaging_service_sid The unique string that identifies the
65
+ # messaging service
66
+ # @return [Twilio::REST::Messaging::V1::DomainConfigMessagingServiceInstance] if messaging_service_sid was passed.
67
+ # @return [Twilio::REST::Messaging::V1::DomainConfigMessagingServiceList]
68
+ def domain_config_messaging_service(messaging_service_sid=:unset)
69
+ self.v1.domain_config_messaging_service(messaging_service_sid)
70
+ end
71
+
45
72
  ##
46
73
  # @return [Twilio::REST::Messaging::V1::ExternalCampaignInstance]
47
74
  def external_campaign
48
75
  self.v1.external_campaign()
49
76
  end
50
77
 
78
+ ##
79
+ # @param [String] messaging_service_sid The unique string that identifies the
80
+ # messaging service
81
+ # @return [Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceInstance] if messaging_service_sid was passed.
82
+ # @return [Twilio::REST::Messaging::V1::LinkshorteningMessagingServiceList]
83
+ def linkshortening_messaging_service(domain_sid=:unset, messaging_service_sid=:unset)
84
+ self.v1.linkshortening_messaging_service(domain_sid, messaging_service_sid)
85
+ end
86
+
51
87
  ##
52
88
  # @param [String] sid The unique string that we created to identify the Service
53
89
  # resource.