twilio-ruby 5.52.0 → 5.67.3

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 (163) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/pr-lint.yml +15 -0
  3. data/.github/workflows/test-and-deploy.yml +129 -0
  4. data/.gitignore +5 -1
  5. data/.rubocop.yml +1 -1
  6. data/.rubocop_todo.yml +91 -28
  7. data/CHANGES.md +563 -0
  8. data/Gemfile +1 -0
  9. data/Makefile +8 -11
  10. data/README.md +13 -6
  11. data/examples/examples.rb +1 -1
  12. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  13. data/lib/twilio-ruby/http/http_client.rb +20 -4
  14. data/lib/twilio-ruby/http.rb +5 -0
  15. data/lib/twilio-ruby/jwt/access_token.rb +13 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +8 -8
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +674 -0
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  21. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +68 -14
  22. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
  23. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -4
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -4
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -4
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +17 -10
  28. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +18 -5
  29. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +34 -7
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  32. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
  33. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +0 -6
  34. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -8
  35. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
  36. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
  37. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  38. data/lib/twilio-ruby/rest/chat/v3/channel.rb +275 -0
  39. data/lib/twilio-ruby/rest/chat/v3.rb +48 -0
  40. data/lib/twilio-ruby/rest/chat.rb +16 -0
  41. data/lib/twilio-ruby/rest/client.rb +21 -12
  42. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +454 -0
  43. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
  44. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
  45. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  46. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +18 -2
  47. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  48. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  49. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
  50. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
  51. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  52. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  53. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  54. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  55. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  56. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  57. data/lib/twilio-ruby/rest/conversations/v1.rb +24 -0
  58. data/lib/twilio-ruby/rest/conversations.rb +15 -0
  59. data/lib/twilio-ruby/rest/events/v1/event_type.rb +12 -5
  60. data/lib/twilio-ruby/rest/events/v1/sink.rb +41 -5
  61. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +28 -0
  62. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +55 -34
  63. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb +236 -0
  64. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +330 -0
  65. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +384 -0
  66. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +233 -0
  67. data/lib/twilio-ruby/rest/flex_api/v1.rb +16 -0
  68. data/lib/twilio-ruby/rest/flex_api.rb +9 -0
  69. data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +258 -0
  70. data/lib/twilio-ruby/rest/{fax → frontline_api}/v1.rb +11 -11
  71. data/lib/twilio-ruby/rest/{fax.rb → frontline_api.rb} +11 -11
  72. data/lib/twilio-ruby/rest/insights/v1/annotation.rb +271 -0
  73. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
  74. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  75. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  76. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  77. data/lib/twilio-ruby/rest/insights/v1.rb +46 -0
  78. data/lib/twilio-ruby/rest/insights.rb +28 -0
  79. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +268 -0
  80. data/lib/twilio-ruby/rest/lookups/v2.rb +45 -0
  81. data/lib/twilio-ruby/rest/lookups.rb +7 -0
  82. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +397 -0
  83. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +406 -0
  84. data/lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb +221 -0
  85. data/lib/twilio-ruby/rest/media/v1/player_streamer.rb +403 -0
  86. data/lib/twilio-ruby/rest/media/v1.rb +76 -0
  87. data/lib/twilio-ruby/rest/media.rb +65 -0
  88. data/lib/twilio-ruby/rest/{fax/v1/fax/fax_media.rb → messaging/v1/brand_registration/brand_vetting.rb} +134 -95
  89. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +127 -2
  90. data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +7 -0
  91. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +187 -20
  92. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
  93. data/lib/twilio-ruby/rest/messaging/v1/service.rb +37 -5
  94. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +268 -0
  95. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +188 -0
  96. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +128 -26
  97. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  98. data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
  99. data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
  100. data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
  101. data/lib/twilio-ruby/rest/pricing.rb +19 -0
  102. data/lib/twilio-ruby/rest/serverless/v1/service/environment.rb +1 -1
  103. data/lib/twilio-ruby/rest/serverless/v1/service.rb +7 -0
  104. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  105. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
  106. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  107. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +44 -55
  108. data/lib/twilio-ruby/rest/supersim/v1/{command.rb → ip_command.rb} +132 -84
  109. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
  110. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +30 -1
  111. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  112. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +23 -9
  113. data/lib/twilio-ruby/rest/supersim/v1.rb +23 -7
  114. data/lib/twilio-ruby/rest/supersim.rb +15 -6
  115. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  116. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +7 -3
  117. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +6 -2
  118. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +7 -3
  119. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +23 -11
  120. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +4 -2
  121. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +4 -2
  122. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +38 -22
  123. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +19 -3
  124. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +155 -10
  125. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +12 -9
  126. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +74 -22
  127. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +34 -15
  128. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +66 -31
  129. data/lib/twilio-ruby/rest/verify/v2/service/entity.rb +7 -3
  130. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +25 -7
  131. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  132. data/lib/twilio-ruby/rest/verify/v2/service.rb +40 -11
  133. data/lib/twilio-ruby/rest/verify/v2/template.rb +206 -0
  134. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  135. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
  136. data/lib/twilio-ruby/rest/verify/v2.rb +14 -0
  137. data/lib/twilio-ruby/rest/verify.rb +14 -2
  138. data/lib/twilio-ruby/rest/video/v1/composition.rb +21 -8
  139. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +0 -8
  140. data/lib/twilio-ruby/rest/video/v1/recording.rb +21 -0
  141. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  142. data/lib/twilio-ruby/rest/video/v1/room.rb +62 -5
  143. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  144. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  145. data/lib/twilio-ruby/rest/voice.rb +8 -0
  146. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +3 -3
  147. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +16 -26
  148. data/lib/twilio-ruby/rest.rb +13 -0
  149. data/lib/twilio-ruby/twiml/voice_response.rb +727 -87
  150. data/lib/twilio-ruby/version.rb +1 -1
  151. data/lib/twilio-ruby.rb +6 -16
  152. data/sonar-project.properties +13 -0
  153. data/twilio-ruby.gemspec +1 -2
  154. metadata +59 -32
  155. data/.travis.yml +0 -45
  156. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -536
  157. /data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
  158. /data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
  159. /data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
  160. /data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
  161. /data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
  162. /data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
  163. /data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
@@ -8,30 +8,45 @@
8
8
 
9
9
  module Twilio
10
10
  module REST
11
- class Fax < Domain
11
+ class Messaging < Domain
12
12
  class V1 < Version
13
- class FaxContext < InstanceContext
13
+ class BrandRegistrationContext < InstanceContext
14
14
  ##
15
15
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
- class FaxMediaList < ListResource
16
+ class BrandVettingList < ListResource
17
17
  ##
18
- # Initialize the FaxMediaList
18
+ # Initialize the BrandVettingList
19
19
  # @param [Version] version Version that contains the resource
20
- # @param [String] fax_sid The SID of the fax the FaxMedia resource is associated
21
- # with.
22
- # @return [FaxMediaList] FaxMediaList
23
- def initialize(version, fax_sid: nil)
20
+ # @param [String] brand_sid The unique string to identify Brand Registration.
21
+ # @return [BrandVettingList] BrandVettingList
22
+ def initialize(version, brand_sid: nil)
24
23
  super(version)
25
24
 
26
25
  # Path Solution
27
- @solution = {fax_sid: fax_sid}
28
- @uri = "/Faxes/#{@solution[:fax_sid]}/Media"
26
+ @solution = {brand_sid: brand_sid}
27
+ @uri = "/a2p/BrandRegistrations/#{@solution[:brand_sid]}/Vettings"
29
28
  end
30
29
 
31
30
  ##
32
- # Lists FaxMediaInstance records from the API as a list.
31
+ # Create the BrandVettingInstance
32
+ # @param [brand_vetting.VettingProvider] vetting_provider The third-party provider
33
+ # of the vettings to create .
34
+ # @param [String] vetting_id The unique ID of the vetting
35
+ # @return [BrandVettingInstance] Created BrandVettingInstance
36
+ def create(vetting_provider: nil, vetting_id: :unset)
37
+ data = Twilio::Values.of({'VettingProvider' => vetting_provider, 'VettingId' => vetting_id, })
38
+
39
+ payload = @version.create('POST', @uri, data: data)
40
+
41
+ BrandVettingInstance.new(@version, payload, brand_sid: @solution[:brand_sid], )
42
+ end
43
+
44
+ ##
45
+ # Lists BrandVettingInstance records from the API as a list.
33
46
  # Unlike stream(), this operation is eager and will load `limit` records into
34
47
  # memory before returning.
48
+ # @param [brand_vetting.VettingProvider] vetting_provider The third-party provider
49
+ # of the vettings to read
35
50
  # @param [Integer] limit Upper limit for the number of records to return. stream()
36
51
  # guarantees to never return more than limit. Default is no limit
37
52
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -39,14 +54,16 @@ module Twilio
39
54
  # but a limit is defined, stream() will attempt to read the limit with the most
40
55
  # efficient page size, i.e. min(limit, 1000)
41
56
  # @return [Array] Array of up to limit results
42
- def list(limit: nil, page_size: nil)
43
- self.stream(limit: limit, page_size: page_size).entries
57
+ def list(vetting_provider: :unset, limit: nil, page_size: nil)
58
+ self.stream(vetting_provider: vetting_provider, limit: limit, page_size: page_size).entries
44
59
  end
45
60
 
46
61
  ##
47
- # Streams FaxMediaInstance records from the API as an Enumerable.
62
+ # Streams BrandVettingInstance records from the API as an Enumerable.
48
63
  # This operation lazily loads records as efficiently as possible until the limit
49
64
  # is reached.
65
+ # @param [brand_vetting.VettingProvider] vetting_provider The third-party provider
66
+ # of the vettings to read
50
67
  # @param [Integer] limit Upper limit for the number of records to return. stream()
51
68
  # guarantees to never return more than limit. Default is no limit.
52
69
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -54,16 +71,16 @@ module Twilio
54
71
  # but a limit is defined, stream() will attempt to read the limit with the most
55
72
  # efficient page size, i.e. min(limit, 1000)
56
73
  # @return [Enumerable] Enumerable that will yield up to limit results
57
- def stream(limit: nil, page_size: nil)
74
+ def stream(vetting_provider: :unset, limit: nil, page_size: nil)
58
75
  limits = @version.read_limits(limit, page_size)
59
76
 
60
- page = self.page(page_size: limits[:page_size], )
77
+ page = self.page(vetting_provider: vetting_provider, page_size: limits[:page_size], )
61
78
 
62
79
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
63
80
  end
64
81
 
65
82
  ##
66
- # When passed a block, yields FaxMediaInstance records from the API.
83
+ # When passed a block, yields BrandVettingInstance records from the API.
67
84
  # This operation lazily loads records as efficiently as possible until the limit
68
85
  # is reached.
69
86
  def each
@@ -77,14 +94,17 @@ module Twilio
77
94
  end
78
95
 
79
96
  ##
80
- # Retrieve a single page of FaxMediaInstance records from the API.
97
+ # Retrieve a single page of BrandVettingInstance records from the API.
81
98
  # Request is executed immediately.
99
+ # @param [brand_vetting.VettingProvider] vetting_provider The third-party provider
100
+ # of the vettings to read
82
101
  # @param [String] page_token PageToken provided by the API
83
102
  # @param [Integer] page_number Page Number, this value is simply for client state
84
103
  # @param [Integer] page_size Number of records to return, defaults to 50
85
- # @return [Page] Page of FaxMediaInstance
86
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
104
+ # @return [Page] Page of BrandVettingInstance
105
+ def page(vetting_provider: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
87
106
  params = Twilio::Values.of({
107
+ 'VettingProvider' => vetting_provider,
88
108
  'PageToken' => page_token,
89
109
  'Page' => page_number,
90
110
  'PageSize' => page_size,
@@ -92,38 +112,38 @@ module Twilio
92
112
 
93
113
  response = @version.page('GET', @uri, params: params)
94
114
 
95
- FaxMediaPage.new(@version, response, @solution)
115
+ BrandVettingPage.new(@version, response, @solution)
96
116
  end
97
117
 
98
118
  ##
99
- # Retrieve a single page of FaxMediaInstance records from the API.
119
+ # Retrieve a single page of BrandVettingInstance records from the API.
100
120
  # Request is executed immediately.
101
121
  # @param [String] target_url API-generated URL for the requested results page
102
- # @return [Page] Page of FaxMediaInstance
122
+ # @return [Page] Page of BrandVettingInstance
103
123
  def get_page(target_url)
104
124
  response = @version.domain.request(
105
125
  'GET',
106
126
  target_url
107
127
  )
108
- FaxMediaPage.new(@version, response, @solution)
128
+ BrandVettingPage.new(@version, response, @solution)
109
129
  end
110
130
 
111
131
  ##
112
132
  # Provide a user friendly representation
113
133
  def to_s
114
- '#<Twilio.Fax.V1.FaxMediaList>'
134
+ '#<Twilio.Messaging.V1.BrandVettingList>'
115
135
  end
116
136
  end
117
137
 
118
138
  ##
119
139
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
120
- class FaxMediaPage < Page
140
+ class BrandVettingPage < Page
121
141
  ##
122
- # Initialize the FaxMediaPage
142
+ # Initialize the BrandVettingPage
123
143
  # @param [Version] version Version that contains the resource
124
144
  # @param [Response] response Response from the API
125
145
  # @param [Hash] solution Path solution for the resource
126
- # @return [FaxMediaPage] FaxMediaPage
146
+ # @return [BrandVettingPage] BrandVettingPage
127
147
  def initialize(version, response, solution)
128
148
  super(version, response)
129
149
 
@@ -132,133 +152,141 @@ module Twilio
132
152
  end
133
153
 
134
154
  ##
135
- # Build an instance of FaxMediaInstance
155
+ # Build an instance of BrandVettingInstance
136
156
  # @param [Hash] payload Payload response from the API
137
- # @return [FaxMediaInstance] FaxMediaInstance
157
+ # @return [BrandVettingInstance] BrandVettingInstance
138
158
  def get_instance(payload)
139
- FaxMediaInstance.new(@version, payload, fax_sid: @solution[:fax_sid], )
159
+ BrandVettingInstance.new(@version, payload, brand_sid: @solution[:brand_sid], )
140
160
  end
141
161
 
142
162
  ##
143
163
  # Provide a user friendly representation
144
164
  def to_s
145
- '<Twilio.Fax.V1.FaxMediaPage>'
165
+ '<Twilio.Messaging.V1.BrandVettingPage>'
146
166
  end
147
167
  end
148
168
 
149
169
  ##
150
170
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
151
- class FaxMediaContext < InstanceContext
171
+ class BrandVettingContext < InstanceContext
152
172
  ##
153
- # Initialize the FaxMediaContext
173
+ # Initialize the BrandVettingContext
154
174
  # @param [Version] version Version that contains the resource
155
- # @param [String] fax_sid The SID of the fax with the FaxMedia resource to fetch.
156
- # @param [String] sid The Twilio-provided string that uniquely identifies the
157
- # FaxMedia resource to fetch.
158
- # @return [FaxMediaContext] FaxMediaContext
159
- def initialize(version, fax_sid, sid)
175
+ # @param [String] brand_sid The SID of the Brand Registration resource of the
176
+ # vettings to read .
177
+ # @param [String] brand_vetting_sid The Twilio SID of the third-party vetting
178
+ # record.
179
+ # @return [BrandVettingContext] BrandVettingContext
180
+ def initialize(version, brand_sid, brand_vetting_sid)
160
181
  super(version)
161
182
 
162
183
  # Path Solution
163
- @solution = {fax_sid: fax_sid, sid: sid, }
164
- @uri = "/Faxes/#{@solution[:fax_sid]}/Media/#{@solution[:sid]}"
184
+ @solution = {brand_sid: brand_sid, brand_vetting_sid: brand_vetting_sid, }
185
+ @uri = "/a2p/BrandRegistrations/#{@solution[:brand_sid]}/Vettings/#{@solution[:brand_vetting_sid]}"
165
186
  end
166
187
 
167
188
  ##
168
- # Fetch the FaxMediaInstance
169
- # @return [FaxMediaInstance] Fetched FaxMediaInstance
189
+ # Fetch the BrandVettingInstance
190
+ # @return [BrandVettingInstance] Fetched BrandVettingInstance
170
191
  def fetch
171
192
  payload = @version.fetch('GET', @uri)
172
193
 
173
- FaxMediaInstance.new(@version, payload, fax_sid: @solution[:fax_sid], sid: @solution[:sid], )
174
- end
175
-
176
- ##
177
- # Delete the FaxMediaInstance
178
- # @return [Boolean] true if delete succeeds, false otherwise
179
- def delete
180
- @version.delete('DELETE', @uri)
194
+ BrandVettingInstance.new(
195
+ @version,
196
+ payload,
197
+ brand_sid: @solution[:brand_sid],
198
+ brand_vetting_sid: @solution[:brand_vetting_sid],
199
+ )
181
200
  end
182
201
 
183
202
  ##
184
203
  # Provide a user friendly representation
185
204
  def to_s
186
205
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
187
- "#<Twilio.Fax.V1.FaxMediaContext #{context}>"
206
+ "#<Twilio.Messaging.V1.BrandVettingContext #{context}>"
188
207
  end
189
208
 
190
209
  ##
191
210
  # Provide a detailed, user friendly representation
192
211
  def inspect
193
212
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
194
- "#<Twilio.Fax.V1.FaxMediaContext #{context}>"
213
+ "#<Twilio.Messaging.V1.BrandVettingContext #{context}>"
195
214
  end
196
215
  end
197
216
 
198
217
  ##
199
218
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
200
- class FaxMediaInstance < InstanceResource
219
+ class BrandVettingInstance < InstanceResource
201
220
  ##
202
- # Initialize the FaxMediaInstance
221
+ # Initialize the BrandVettingInstance
203
222
  # @param [Version] version Version that contains the resource
204
223
  # @param [Hash] payload payload that contains response from Twilio
205
- # @param [String] fax_sid The SID of the fax the FaxMedia resource is associated
206
- # with.
207
- # @param [String] sid The Twilio-provided string that uniquely identifies the
208
- # FaxMedia resource to fetch.
209
- # @return [FaxMediaInstance] FaxMediaInstance
210
- def initialize(version, payload, fax_sid: nil, sid: nil)
224
+ # @param [String] brand_sid The unique string to identify Brand Registration.
225
+ # @param [String] brand_vetting_sid The Twilio SID of the third-party vetting
226
+ # record.
227
+ # @return [BrandVettingInstance] BrandVettingInstance
228
+ def initialize(version, payload, brand_sid: nil, brand_vetting_sid: nil)
211
229
  super(version)
212
230
 
213
231
  # Marshaled Properties
214
232
  @properties = {
215
- 'sid' => payload['sid'],
216
233
  'account_sid' => payload['account_sid'],
217
- 'fax_sid' => payload['fax_sid'],
218
- 'content_type' => payload['content_type'],
219
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
234
+ 'brand_sid' => payload['brand_sid'],
235
+ 'brand_vetting_sid' => payload['brand_vetting_sid'],
220
236
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
237
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
238
+ 'vetting_id' => payload['vetting_id'],
239
+ 'vetting_class' => payload['vetting_class'],
240
+ 'vetting_status' => payload['vetting_status'],
241
+ 'vetting_provider' => payload['vetting_provider'],
221
242
  'url' => payload['url'],
222
243
  }
223
244
 
224
245
  # Context
225
246
  @instance_context = nil
226
- @params = {'fax_sid' => fax_sid, 'sid' => sid || @properties['sid'], }
247
+ @params = {
248
+ 'brand_sid' => brand_sid,
249
+ 'brand_vetting_sid' => brand_vetting_sid || @properties['brand_vetting_sid'],
250
+ }
227
251
  end
228
252
 
229
253
  ##
230
254
  # Generate an instance context for the instance, the context is capable of
231
255
  # performing various actions. All instance actions are proxied to the context
232
- # @return [FaxMediaContext] FaxMediaContext for this FaxMediaInstance
256
+ # @return [BrandVettingContext] BrandVettingContext for this BrandVettingInstance
233
257
  def context
234
258
  unless @instance_context
235
- @instance_context = FaxMediaContext.new(@version, @params['fax_sid'], @params['sid'], )
259
+ @instance_context = BrandVettingContext.new(
260
+ @version,
261
+ @params['brand_sid'],
262
+ @params['brand_vetting_sid'],
263
+ )
236
264
  end
237
265
  @instance_context
238
266
  end
239
267
 
240
268
  ##
241
- # @return [String] The unique string that identifies the resource
242
- def sid
243
- @properties['sid']
269
+ # @return [String] The SID of the Account that created the vetting
270
+ def account_sid
271
+ @properties['account_sid']
244
272
  end
245
273
 
246
274
  ##
247
- # @return [String] The SID of the Account that created the resource
248
- def account_sid
249
- @properties['account_sid']
275
+ # @return [String] A2P BrandRegistration Sid
276
+ def brand_sid
277
+ @properties['brand_sid']
250
278
  end
251
279
 
252
280
  ##
253
- # @return [String] The SID of the fax the FaxMedia resource is associated with
254
- def fax_sid
255
- @properties['fax_sid']
281
+ # @return [String] SID for third-party vetting record
282
+ def brand_vetting_sid
283
+ @properties['brand_vetting_sid']
256
284
  end
257
285
 
258
286
  ##
259
- # @return [String] The content type of the stored fax media
260
- def content_type
261
- @properties['content_type']
287
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
288
+ def date_updated
289
+ @properties['date_updated']
262
290
  end
263
291
 
264
292
  ##
@@ -268,43 +296,54 @@ module Twilio
268
296
  end
269
297
 
270
298
  ##
271
- # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
272
- def date_updated
273
- @properties['date_updated']
299
+ # @return [String] The unique ID of the vetting
300
+ def vetting_id
301
+ @properties['vetting_id']
274
302
  end
275
303
 
276
304
  ##
277
- # @return [String] The absolute URL of the FaxMedia resource
305
+ # @return [String] The type of vetting
306
+ def vetting_class
307
+ @properties['vetting_class']
308
+ end
309
+
310
+ ##
311
+ # @return [String] Status of vetting attempt
312
+ def vetting_status
313
+ @properties['vetting_status']
314
+ end
315
+
316
+ ##
317
+ # @return [brand_vetting.VettingProvider] Third-party provider that has conducted the vetting
318
+ def vetting_provider
319
+ @properties['vetting_provider']
320
+ end
321
+
322
+ ##
323
+ # @return [String] The absolute URL of the Brand Vetting
278
324
  def url
279
325
  @properties['url']
280
326
  end
281
327
 
282
328
  ##
283
- # Fetch the FaxMediaInstance
284
- # @return [FaxMediaInstance] Fetched FaxMediaInstance
329
+ # Fetch the BrandVettingInstance
330
+ # @return [BrandVettingInstance] Fetched BrandVettingInstance
285
331
  def fetch
286
332
  context.fetch
287
333
  end
288
334
 
289
- ##
290
- # Delete the FaxMediaInstance
291
- # @return [Boolean] true if delete succeeds, false otherwise
292
- def delete
293
- context.delete
294
- end
295
-
296
335
  ##
297
336
  # Provide a user friendly representation
298
337
  def to_s
299
338
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
300
- "<Twilio.Fax.V1.FaxMediaInstance #{values}>"
339
+ "<Twilio.Messaging.V1.BrandVettingInstance #{values}>"
301
340
  end
302
341
 
303
342
  ##
304
343
  # Provide a detailed, user friendly representation
305
344
  def inspect
306
345
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
307
- "<Twilio.Fax.V1.FaxMediaInstance #{values}>"
346
+ "<Twilio.Messaging.V1.BrandVettingInstance #{values}>"
308
347
  end
309
348
  end
310
349
  end
@@ -109,11 +109,22 @@ module Twilio
109
109
  # Create the BrandRegistrationInstance
110
110
  # @param [String] customer_profile_bundle_sid Customer Profile Bundle Sid.
111
111
  # @param [String] a2p_profile_bundle_sid A2P Messaging Profile Bundle Sid.
112
+ # @param [String] brand_type Type of brand being created. One of: "STANDARD",
113
+ # "STARTER". STARTER is for low volume, starter use cases. STANDARD is for all
114
+ # other use cases.
115
+ # @param [Boolean] mock A boolean that specifies whether brand should be a mock or
116
+ # not. If true, brand will be registered as a mock brand. Defaults to false if no
117
+ # value is provided.
118
+ # @param [Boolean] skip_automatic_sec_vet A flag to disable automatic secondary
119
+ # vetting for brands which it would otherwise be done.
112
120
  # @return [BrandRegistrationInstance] Created BrandRegistrationInstance
113
- def create(customer_profile_bundle_sid: nil, a2p_profile_bundle_sid: nil)
121
+ def create(customer_profile_bundle_sid: nil, a2p_profile_bundle_sid: nil, brand_type: :unset, mock: :unset, skip_automatic_sec_vet: :unset)
114
122
  data = Twilio::Values.of({
115
123
  'CustomerProfileBundleSid' => customer_profile_bundle_sid,
116
124
  'A2PProfileBundleSid' => a2p_profile_bundle_sid,
125
+ 'BrandType' => brand_type,
126
+ 'Mock' => mock,
127
+ 'SkipAutomaticSecVet' => skip_automatic_sec_vet,
117
128
  })
118
129
 
119
130
  payload = @version.create('POST', @uri, data: data)
@@ -173,6 +184,9 @@ module Twilio
173
184
  # Path Solution
174
185
  @solution = {sid: sid, }
175
186
  @uri = "/a2p/BrandRegistrations/#{@solution[:sid]}"
187
+
188
+ # Dependents
189
+ @brand_vettings = nil
176
190
  end
177
191
 
178
192
  ##
@@ -184,6 +198,33 @@ module Twilio
184
198
  BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
185
199
  end
186
200
 
201
+ ##
202
+ # Update the BrandRegistrationInstance
203
+ # @return [BrandRegistrationInstance] Updated BrandRegistrationInstance
204
+ def update
205
+ payload = @version.update('POST', @uri)
206
+
207
+ BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
208
+ end
209
+
210
+ ##
211
+ # Access the brand_vettings
212
+ # @return [BrandVettingList]
213
+ # @return [BrandVettingContext] if brand_vetting_sid was passed.
214
+ def brand_vettings(brand_vetting_sid=:unset)
215
+ raise ArgumentError, 'brand_vetting_sid cannot be nil' if brand_vetting_sid.nil?
216
+
217
+ if brand_vetting_sid != :unset
218
+ return BrandVettingContext.new(@version, @solution[:sid], brand_vetting_sid, )
219
+ end
220
+
221
+ unless @brand_vettings
222
+ @brand_vettings = BrandVettingList.new(@version, brand_sid: @solution[:sid], )
223
+ end
224
+
225
+ @brand_vettings
226
+ end
227
+
187
228
  ##
188
229
  # Provide a user friendly representation
189
230
  def to_s
@@ -219,10 +260,20 @@ module Twilio
219
260
  'a2p_profile_bundle_sid' => payload['a2p_profile_bundle_sid'],
220
261
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
221
262
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
263
+ 'brand_type' => payload['brand_type'],
222
264
  'status' => payload['status'],
223
265
  'tcr_id' => payload['tcr_id'],
224
266
  'failure_reason' => payload['failure_reason'],
225
267
  'url' => payload['url'],
268
+ 'brand_score' => payload['brand_score'] == nil ? payload['brand_score'] : payload['brand_score'].to_i,
269
+ 'brand_feedback' => payload['brand_feedback'],
270
+ 'identity_status' => payload['identity_status'],
271
+ 'russell_3000' => payload['russell_3000'],
272
+ 'government_entity' => payload['government_entity'],
273
+ 'tax_exempt_status' => payload['tax_exempt_status'],
274
+ 'skip_automatic_sec_vet' => payload['skip_automatic_sec_vet'],
275
+ 'mock' => payload['mock'],
276
+ 'links' => payload['links'],
226
277
  }
227
278
 
228
279
  # Context
@@ -278,7 +329,13 @@ module Twilio
278
329
  end
279
330
 
280
331
  ##
281
- # @return [brand_registration.Status] Brand Registration status
332
+ # @return [String] Type of brand. One of: "STANDARD", "STARTER".
333
+ def brand_type
334
+ @properties['brand_type']
335
+ end
336
+
337
+ ##
338
+ # @return [brand_registration.Status] Brand Registration status.
282
339
  def status
283
340
  @properties['status']
284
341
  end
@@ -301,6 +358,60 @@ module Twilio
301
358
  @properties['url']
302
359
  end
303
360
 
361
+ ##
362
+ # @return [String] Brand score
363
+ def brand_score
364
+ @properties['brand_score']
365
+ end
366
+
367
+ ##
368
+ # @return [Array[brand_registration.BrandFeedback]] Brand feedback
369
+ def brand_feedback
370
+ @properties['brand_feedback']
371
+ end
372
+
373
+ ##
374
+ # @return [brand_registration.IdentityStatus] Identity Status
375
+ def identity_status
376
+ @properties['identity_status']
377
+ end
378
+
379
+ ##
380
+ # @return [Boolean] Russell 3000
381
+ def russell_3000
382
+ @properties['russell_3000']
383
+ end
384
+
385
+ ##
386
+ # @return [Boolean] Government Entity
387
+ def government_entity
388
+ @properties['government_entity']
389
+ end
390
+
391
+ ##
392
+ # @return [String] Tax Exempt Status
393
+ def tax_exempt_status
394
+ @properties['tax_exempt_status']
395
+ end
396
+
397
+ ##
398
+ # @return [Boolean] Skip Automatic Secondary Vetting
399
+ def skip_automatic_sec_vet
400
+ @properties['skip_automatic_sec_vet']
401
+ end
402
+
403
+ ##
404
+ # @return [Boolean] A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided.
405
+ def mock
406
+ @properties['mock']
407
+ end
408
+
409
+ ##
410
+ # @return [String] The links
411
+ def links
412
+ @properties['links']
413
+ end
414
+
304
415
  ##
305
416
  # Fetch the BrandRegistrationInstance
306
417
  # @return [BrandRegistrationInstance] Fetched BrandRegistrationInstance
@@ -308,6 +419,20 @@ module Twilio
308
419
  context.fetch
309
420
  end
310
421
 
422
+ ##
423
+ # Update the BrandRegistrationInstance
424
+ # @return [BrandRegistrationInstance] Updated BrandRegistrationInstance
425
+ def update
426
+ context.update
427
+ end
428
+
429
+ ##
430
+ # Access the brand_vettings
431
+ # @return [brand_vettings] brand_vettings
432
+ def brand_vettings
433
+ context.brand_vettings
434
+ end
435
+
311
436
  ##
312
437
  # Provide a user friendly representation
313
438
  def to_s
@@ -94,6 +94,7 @@ module Twilio
94
94
 
95
95
  # Marshaled Properties
96
96
  @properties = {
97
+ 'sid' => payload['sid'],
97
98
  'account_sid' => payload['account_sid'],
98
99
  'campaign_id' => payload['campaign_id'],
99
100
  'messaging_service_sid' => payload['messaging_service_sid'],
@@ -101,6 +102,12 @@ module Twilio
101
102
  }
102
103
  end
103
104
 
105
+ ##
106
+ # @return [String] The unique string that identifies a US A2P Compliance resource
107
+ def sid
108
+ @properties['sid']
109
+ end
110
+
104
111
  ##
105
112
  # @return [String] The SID of the Account that created the resource
106
113
  def account_sid