twilio-ruby 5.51.0 → 5.53.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +22 -28
  3. data/CHANGES.md +50 -0
  4. data/README.md +3 -2
  5. data/lib/twilio-ruby/http/http_client.rb +3 -1
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +23 -23
  7. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  8. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -8
  9. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +0 -8
  10. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +1 -7
  11. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +1 -9
  12. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -8
  13. data/lib/twilio-ruby/rest/events/v1/schema.rb +12 -12
  14. data/lib/twilio-ruby/rest/events/v1/schema/{schema_version.rb → version.rb} +37 -37
  15. data/lib/twilio-ruby/rest/events/v1/sink.rb +22 -0
  16. data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +15 -12
  17. data/lib/twilio-ruby/rest/messaging/v1/service.rb +69 -26
  18. data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +3 -3
  19. data/lib/twilio-ruby/rest/studio/v1/flow/execution.rb +1 -1
  20. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +1 -1
  21. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +6 -6
  22. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +16 -4
  23. data/lib/twilio-ruby/rest/verify/v2/service.rb +61 -3
  24. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +39 -1
  25. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +202 -0
  26. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +45 -15
  27. data/lib/twilio-ruby/version.rb +1 -1
  28. metadata +4 -3
@@ -10,8 +10,6 @@ module Twilio
10
10
  module REST
11
11
  class Bulkexports < Domain
12
12
  class V1 < Version
13
- ##
14
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
13
  class ExportConfigurationList < ListResource
16
14
  ##
17
15
  # Initialize the ExportConfigurationList
@@ -31,8 +29,6 @@ module Twilio
31
29
  end
32
30
  end
33
31
 
34
- ##
35
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
32
  class ExportConfigurationPage < Page
37
33
  ##
38
34
  # Initialize the ExportConfigurationPage
@@ -62,8 +58,6 @@ module Twilio
62
58
  end
63
59
  end
64
60
 
65
- ##
66
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
61
  class ExportConfigurationContext < InstanceContext
68
62
  ##
69
63
  # Initialize the ExportConfigurationContext
@@ -125,8 +119,6 @@ module Twilio
125
119
  end
126
120
  end
127
121
 
128
- ##
129
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
130
122
  class ExportConfigurationInstance < InstanceResource
131
123
  ##
132
124
  # Initialize the ExportConfigurationInstance
@@ -93,17 +93,17 @@ module Twilio
93
93
 
94
94
  ##
95
95
  # Access the versions
96
- # @return [VersionList]
97
- # @return [VersionContext] if schema_version was passed.
96
+ # @return [SchemaVersionList]
97
+ # @return [SchemaVersionContext] if schema_version was passed.
98
98
  def versions(schema_version=:unset)
99
99
  raise ArgumentError, 'schema_version cannot be nil' if schema_version.nil?
100
100
 
101
101
  if schema_version != :unset
102
- return VersionContext.new(@version, @solution[:id], schema_version, )
102
+ return SchemaVersionContext.new(@version, @solution[:id], schema_version, )
103
103
  end
104
104
 
105
105
  unless @versions
106
- @versions = VersionList.new(@version, id: @solution[:id], )
106
+ @versions = SchemaVersionList.new(@version, id: @solution[:id], )
107
107
  end
108
108
 
109
109
  @versions
@@ -142,8 +142,8 @@ module Twilio
142
142
  'id' => payload['id'],
143
143
  'url' => payload['url'],
144
144
  'links' => payload['links'],
145
- 'last_created' => Twilio.deserialize_iso8601_datetime(payload['last_created']),
146
- 'last_version' => payload['last_version'].to_i,
145
+ 'latest_version_date_created' => Twilio.deserialize_iso8601_datetime(payload['latest_version_date_created']),
146
+ 'latest_version' => payload['latest_version'].to_i,
147
147
  }
148
148
 
149
149
  # Context
@@ -181,15 +181,15 @@ module Twilio
181
181
  end
182
182
 
183
183
  ##
184
- # @return [Time] The date that the last schema version was created.
185
- def last_created
186
- @properties['last_created']
184
+ # @return [Time] The date that the latest schema version was created.
185
+ def latest_version_date_created
186
+ @properties['latest_version_date_created']
187
187
  end
188
188
 
189
189
  ##
190
- # @return [String] Last schema version.
191
- def last_version
192
- @properties['last_version']
190
+ # @return [String] Latest schema version.
191
+ def latest_version
192
+ @properties['latest_version']
193
193
  end
194
194
 
195
195
  ##
@@ -13,13 +13,13 @@ module Twilio
13
13
  class SchemaContext < InstanceContext
14
14
  ##
15
15
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
- class VersionList < ListResource
16
+ class SchemaVersionList < ListResource
17
17
  ##
18
- # Initialize the VersionList
18
+ # Initialize the SchemaVersionList
19
19
  # @param [Version] version Version that contains the resource
20
20
  # @param [String] id The unique identifier of the schema. Each schema can have
21
21
  # multiple versions, that share the same id.
22
- # @return [VersionList] VersionList
22
+ # @return [SchemaVersionList] SchemaVersionList
23
23
  def initialize(version, id: nil)
24
24
  super(version)
25
25
 
@@ -29,7 +29,7 @@ module Twilio
29
29
  end
30
30
 
31
31
  ##
32
- # Lists VersionInstance records from the API as a list.
32
+ # Lists SchemaVersionInstance records from the API as a list.
33
33
  # Unlike stream(), this operation is eager and will load `limit` records into
34
34
  # memory before returning.
35
35
  # @param [Integer] limit Upper limit for the number of records to return. stream()
@@ -44,7 +44,7 @@ module Twilio
44
44
  end
45
45
 
46
46
  ##
47
- # Streams VersionInstance records from the API as an Enumerable.
47
+ # Streams SchemaVersionInstance records from the API as an Enumerable.
48
48
  # This operation lazily loads records as efficiently as possible until the limit
49
49
  # is reached.
50
50
  # @param [Integer] limit Upper limit for the number of records to return. stream()
@@ -63,7 +63,7 @@ module Twilio
63
63
  end
64
64
 
65
65
  ##
66
- # When passed a block, yields VersionInstance records from the API.
66
+ # When passed a block, yields SchemaVersionInstance records from the API.
67
67
  # This operation lazily loads records as efficiently as possible until the limit
68
68
  # is reached.
69
69
  def each
@@ -77,12 +77,12 @@ module Twilio
77
77
  end
78
78
 
79
79
  ##
80
- # Retrieve a single page of VersionInstance records from the API.
80
+ # Retrieve a single page of SchemaVersionInstance records from the API.
81
81
  # Request is executed immediately.
82
82
  # @param [String] page_token PageToken provided by the API
83
83
  # @param [Integer] page_number Page Number, this value is simply for client state
84
84
  # @param [Integer] page_size Number of records to return, defaults to 50
85
- # @return [Page] Page of VersionInstance
85
+ # @return [Page] Page of SchemaVersionInstance
86
86
  def page(page_token: :unset, page_number: :unset, page_size: :unset)
87
87
  params = Twilio::Values.of({
88
88
  'PageToken' => page_token,
@@ -92,38 +92,38 @@ module Twilio
92
92
 
93
93
  response = @version.page('GET', @uri, params: params)
94
94
 
95
- VersionPage.new(@version, response, @solution)
95
+ SchemaVersionPage.new(@version, response, @solution)
96
96
  end
97
97
 
98
98
  ##
99
- # Retrieve a single page of VersionInstance records from the API.
99
+ # Retrieve a single page of SchemaVersionInstance records from the API.
100
100
  # Request is executed immediately.
101
101
  # @param [String] target_url API-generated URL for the requested results page
102
- # @return [Page] Page of VersionInstance
102
+ # @return [Page] Page of SchemaVersionInstance
103
103
  def get_page(target_url)
104
104
  response = @version.domain.request(
105
105
  'GET',
106
106
  target_url
107
107
  )
108
- VersionPage.new(@version, response, @solution)
108
+ SchemaVersionPage.new(@version, response, @solution)
109
109
  end
110
110
 
111
111
  ##
112
112
  # Provide a user friendly representation
113
113
  def to_s
114
- '#<Twilio.Events.V1.VersionList>'
114
+ '#<Twilio.Events.V1.SchemaVersionList>'
115
115
  end
116
116
  end
117
117
 
118
118
  ##
119
119
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
120
- class VersionPage < Page
120
+ class SchemaVersionPage < Page
121
121
  ##
122
- # Initialize the VersionPage
122
+ # Initialize the SchemaVersionPage
123
123
  # @param [Version] version Version that contains the resource
124
124
  # @param [Response] response Response from the API
125
125
  # @param [Hash] solution Path solution for the resource
126
- # @return [VersionPage] VersionPage
126
+ # @return [SchemaVersionPage] SchemaVersionPage
127
127
  def initialize(version, response, solution)
128
128
  super(version, response)
129
129
 
@@ -132,30 +132,30 @@ module Twilio
132
132
  end
133
133
 
134
134
  ##
135
- # Build an instance of VersionInstance
135
+ # Build an instance of SchemaVersionInstance
136
136
  # @param [Hash] payload Payload response from the API
137
- # @return [VersionInstance] VersionInstance
137
+ # @return [SchemaVersionInstance] SchemaVersionInstance
138
138
  def get_instance(payload)
139
- VersionInstance.new(@version, payload, id: @solution[:id], )
139
+ SchemaVersionInstance.new(@version, payload, id: @solution[:id], )
140
140
  end
141
141
 
142
142
  ##
143
143
  # Provide a user friendly representation
144
144
  def to_s
145
- '<Twilio.Events.V1.VersionPage>'
145
+ '<Twilio.Events.V1.SchemaVersionPage>'
146
146
  end
147
147
  end
148
148
 
149
149
  ##
150
150
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
151
- class VersionContext < InstanceContext
151
+ class SchemaVersionContext < InstanceContext
152
152
  ##
153
- # Initialize the VersionContext
153
+ # Initialize the SchemaVersionContext
154
154
  # @param [Version] version Version that contains the resource
155
155
  # @param [String] id The unique identifier of the schema. Each schema can have
156
156
  # multiple versions, that share the same id.
157
157
  # @param [String] schema_version The version of the schema
158
- # @return [VersionContext] VersionContext
158
+ # @return [SchemaVersionContext] SchemaVersionContext
159
159
  def initialize(version, id, schema_version)
160
160
  super(version)
161
161
 
@@ -165,12 +165,12 @@ module Twilio
165
165
  end
166
166
 
167
167
  ##
168
- # Fetch the VersionInstance
169
- # @return [VersionInstance] Fetched VersionInstance
168
+ # Fetch the SchemaVersionInstance
169
+ # @return [SchemaVersionInstance] Fetched SchemaVersionInstance
170
170
  def fetch
171
171
  payload = @version.fetch('GET', @uri)
172
172
 
173
- VersionInstance.new(
173
+ SchemaVersionInstance.new(
174
174
  @version,
175
175
  payload,
176
176
  id: @solution[:id],
@@ -182,28 +182,28 @@ module Twilio
182
182
  # Provide a user friendly representation
183
183
  def to_s
184
184
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
185
- "#<Twilio.Events.V1.VersionContext #{context}>"
185
+ "#<Twilio.Events.V1.SchemaVersionContext #{context}>"
186
186
  end
187
187
 
188
188
  ##
189
189
  # Provide a detailed, user friendly representation
190
190
  def inspect
191
191
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
192
- "#<Twilio.Events.V1.VersionContext #{context}>"
192
+ "#<Twilio.Events.V1.SchemaVersionContext #{context}>"
193
193
  end
194
194
  end
195
195
 
196
196
  ##
197
197
  # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
198
- class VersionInstance < InstanceResource
198
+ class SchemaVersionInstance < InstanceResource
199
199
  ##
200
- # Initialize the VersionInstance
200
+ # Initialize the SchemaVersionInstance
201
201
  # @param [Version] version Version that contains the resource
202
202
  # @param [Hash] payload payload that contains response from Twilio
203
203
  # @param [String] id The unique identifier of the schema. Each schema can have
204
204
  # multiple versions, that share the same id.
205
205
  # @param [String] schema_version The version of the schema
206
- # @return [VersionInstance] VersionInstance
206
+ # @return [SchemaVersionInstance] SchemaVersionInstance
207
207
  def initialize(version, payload, id: nil, schema_version: nil)
208
208
  super(version)
209
209
 
@@ -224,10 +224,10 @@ module Twilio
224
224
  ##
225
225
  # Generate an instance context for the instance, the context is capable of
226
226
  # performing various actions. All instance actions are proxied to the context
227
- # @return [VersionContext] VersionContext for this VersionInstance
227
+ # @return [SchemaVersionContext] SchemaVersionContext for this SchemaVersionInstance
228
228
  def context
229
229
  unless @instance_context
230
- @instance_context = VersionContext.new(@version, @params['id'], @params['schema_version'], )
230
+ @instance_context = SchemaVersionContext.new(@version, @params['id'], @params['schema_version'], )
231
231
  end
232
232
  @instance_context
233
233
  end
@@ -263,8 +263,8 @@ module Twilio
263
263
  end
264
264
 
265
265
  ##
266
- # Fetch the VersionInstance
267
- # @return [VersionInstance] Fetched VersionInstance
266
+ # Fetch the SchemaVersionInstance
267
+ # @return [SchemaVersionInstance] Fetched SchemaVersionInstance
268
268
  def fetch
269
269
  context.fetch
270
270
  end
@@ -273,14 +273,14 @@ module Twilio
273
273
  # Provide a user friendly representation
274
274
  def to_s
275
275
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
276
- "<Twilio.Events.V1.VersionInstance #{values}>"
276
+ "<Twilio.Events.V1.SchemaVersionInstance #{values}>"
277
277
  end
278
278
 
279
279
  ##
280
280
  # Provide a detailed, user friendly representation
281
281
  def inspect
282
282
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
283
- "<Twilio.Events.V1.VersionInstance #{values}>"
283
+ "<Twilio.Events.V1.SchemaVersionInstance #{values}>"
284
284
  end
285
285
  end
286
286
  end
@@ -200,6 +200,19 @@ module Twilio
200
200
  @version.delete('DELETE', @uri)
201
201
  end
202
202
 
203
+ ##
204
+ # Update the SinkInstance
205
+ # @param [String] description A human readable description for the Sink **This
206
+ # value should not contain PII.**
207
+ # @return [SinkInstance] Updated SinkInstance
208
+ def update(description: nil)
209
+ data = Twilio::Values.of({'Description' => description, })
210
+
211
+ payload = @version.update('POST', @uri, data: data)
212
+
213
+ SinkInstance.new(@version, payload, sid: @solution[:sid], )
214
+ end
215
+
203
216
  ##
204
217
  # Access the sink_test
205
218
  # @return [SinkTestList]
@@ -348,6 +361,15 @@ module Twilio
348
361
  context.delete
349
362
  end
350
363
 
364
+ ##
365
+ # Update the SinkInstance
366
+ # @param [String] description A human readable description for the Sink **This
367
+ # value should not contain PII.**
368
+ # @return [SinkInstance] Updated SinkInstance
369
+ def update(description: nil)
370
+ context.update(description: description, )
371
+ end
372
+
351
373
  ##
352
374
  # Access the sink_test
353
375
  # @return [sink_test] sink_test
@@ -110,10 +110,11 @@ module Twilio
110
110
  ##
111
111
  # Create the SubscribedEventInstance
112
112
  # @param [String] type Type of event being subscribed to.
113
- # @param [String] version The schema version that the subscription should use.
113
+ # @param [String] schema_version The schema version that the subscription should
114
+ # use.
114
115
  # @return [SubscribedEventInstance] Created SubscribedEventInstance
115
- def create(type: nil, version: :unset)
116
- data = Twilio::Values.of({'Type' => type, 'Version' => version, })
116
+ def create(type: nil, schema_version: :unset)
117
+ data = Twilio::Values.of({'Type' => type, 'SchemaVersion' => schema_version, })
117
118
 
118
119
  payload = @version.create('POST', @uri, data: data)
119
120
 
@@ -191,10 +192,11 @@ module Twilio
191
192
 
192
193
  ##
193
194
  # Update the SubscribedEventInstance
194
- # @param [String] version The schema version that the subscription should use.
195
+ # @param [String] schema_version The schema version that the subscription should
196
+ # use.
195
197
  # @return [SubscribedEventInstance] Updated SubscribedEventInstance
196
- def update(version: :unset)
197
- data = Twilio::Values.of({'Version' => version, })
198
+ def update(schema_version: :unset)
199
+ data = Twilio::Values.of({'SchemaVersion' => schema_version, })
198
200
 
199
201
  payload = @version.update('POST', @uri, data: data)
200
202
 
@@ -245,7 +247,7 @@ module Twilio
245
247
  @properties = {
246
248
  'account_sid' => payload['account_sid'],
247
249
  'type' => payload['type'],
248
- 'version' => payload['version'].to_i,
250
+ 'schema_version' => payload['schema_version'].to_i,
249
251
  'subscription_sid' => payload['subscription_sid'],
250
252
  'url' => payload['url'],
251
253
  }
@@ -284,8 +286,8 @@ module Twilio
284
286
 
285
287
  ##
286
288
  # @return [String] The schema version that the subscription should use.
287
- def version
288
- @properties['version']
289
+ def schema_version
290
+ @properties['schema_version']
289
291
  end
290
292
 
291
293
  ##
@@ -309,10 +311,11 @@ module Twilio
309
311
 
310
312
  ##
311
313
  # Update the SubscribedEventInstance
312
- # @param [String] version The schema version that the subscription should use.
314
+ # @param [String] schema_version The schema version that the subscription should
315
+ # use.
313
316
  # @return [SubscribedEventInstance] Updated SubscribedEventInstance
314
- def update(version: :unset)
315
- context.update(version: version, )
317
+ def update(schema_version: :unset)
318
+ context.update(schema_version: schema_version, )
316
319
  end
317
320
 
318
321
  ##
@@ -29,15 +29,20 @@ module Twilio
29
29
  # Create the ServiceInstance
30
30
  # @param [String] friendly_name A descriptive string that you create to describe
31
31
  # the resource. It can be up to 64 characters long.
32
- # @param [String] inbound_request_url The URL we should call using
33
- # `inbound_method` when a message is received by any phone number or short code in
34
- # the Service. When this property is `null`, receiving inbound messages is
35
- # disabled.
32
+ # @param [String] inbound_request_url The URL we call using `inbound_method` when
33
+ # a message is received by any phone number or short code in the Service. When
34
+ # this property is `null`, receiving inbound messages is disabled. All messages
35
+ # sent to the Twilio phone number or short code will not be logged and received on
36
+ # the Account. If the `use_inbound_webhook_on_number` field is enabled then the
37
+ # webhook url defined on the phone number will override the `inbound_request_url`
38
+ # defined for the Messaging Service.
36
39
  # @param [String] inbound_method The HTTP method we should use to call
37
40
  # `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`.
38
- # @param [String] fallback_url The URL that we should call using `fallback_method`
39
- # if an error occurs while retrieving or executing the TwiML from the Inbound
40
- # Request URL.
41
+ # @param [String] fallback_url The URL that we call using `fallback_method` if an
42
+ # error occurs while retrieving or executing the TwiML from the Inbound Request
43
+ # URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook
44
+ # url defined on the phone number will override the `fallback_url` defined for the
45
+ # Messaging Service.
41
46
  # @param [String] fallback_method The HTTP method we should use to call
42
47
  # `fallback_url`. Can be: `GET` or `POST`.
43
48
  # @param [String] status_callback The URL we should call to {pass status
@@ -62,8 +67,14 @@ module Twilio
62
67
  # @param [String] validity_period How long, in seconds, messages sent from the
63
68
  # Service are valid. Can be an integer from `1` to `14,400`.
64
69
  # @param [Boolean] synchronous_validation Reserved.
70
+ # @param [Boolean] use_inbound_webhook_on_number A boolean value that indicates
71
+ # either the webhook url configured on the phone number will be used or
72
+ # `inbound_request_url`/`fallback_url` url will be called when a message is
73
+ # received from the phone number. If this field is enabled then the webhook url
74
+ # defined on the phone number will override the
75
+ # `inbound_request_url`/`fallback_url` defined for the Messaging Service.
65
76
  # @return [ServiceInstance] Created ServiceInstance
66
- def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
77
+ def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, use_inbound_webhook_on_number: :unset)
67
78
  data = Twilio::Values.of({
68
79
  'FriendlyName' => friendly_name,
69
80
  'InboundRequestUrl' => inbound_request_url,
@@ -79,6 +90,7 @@ module Twilio
79
90
  'AreaCodeGeomatch' => area_code_geomatch,
80
91
  'ValidityPeriod' => validity_period,
81
92
  'SynchronousValidation' => synchronous_validation,
93
+ 'UseInboundWebhookOnNumber' => use_inbound_webhook_on_number,
82
94
  })
83
95
 
84
96
  payload = @version.create('POST', @uri, data: data)
@@ -231,15 +243,20 @@ module Twilio
231
243
  # Update the ServiceInstance
232
244
  # @param [String] friendly_name A descriptive string that you create to describe
233
245
  # the resource. It can be up to 64 characters long.
234
- # @param [String] inbound_request_url The URL we should call using
235
- # `inbound_method` when a message is received by any phone number or short code in
236
- # the Service. When this property is `null`, receiving inbound messages is
237
- # disabled.
246
+ # @param [String] inbound_request_url The URL we call using `inbound_method` when
247
+ # a message is received by any phone number or short code in the Service. When
248
+ # this property is `null`, receiving inbound messages is disabled. All messages
249
+ # sent to the Twilio phone number or short code will not be logged and received on
250
+ # the Account. If the `use_inbound_webhook_on_number` field is enabled then the
251
+ # webhook url defined on the phone number will override the `inbound_request_url`
252
+ # defined for the Messaging Service.
238
253
  # @param [String] inbound_method The HTTP method we should use to call
239
254
  # `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`.
240
- # @param [String] fallback_url The URL that we should call using `fallback_method`
241
- # if an error occurs while retrieving or executing the TwiML from the Inbound
242
- # Request URL.
255
+ # @param [String] fallback_url The URL that we call using `fallback_method` if an
256
+ # error occurs while retrieving or executing the TwiML from the Inbound Request
257
+ # URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook
258
+ # url defined on the phone number will override the `fallback_url` defined for the
259
+ # Messaging Service.
243
260
  # @param [String] fallback_method The HTTP method we should use to call
244
261
  # `fallback_url`. Can be: `GET` or `POST`.
245
262
  # @param [String] status_callback The URL we should call to {pass status
@@ -264,8 +281,14 @@ module Twilio
264
281
  # @param [String] validity_period How long, in seconds, messages sent from the
265
282
  # Service are valid. Can be an integer from `1` to `14,400`.
266
283
  # @param [Boolean] synchronous_validation Reserved.
284
+ # @param [Boolean] use_inbound_webhook_on_number A boolean value that indicates
285
+ # either the webhook url configured on the phone number will be used or
286
+ # `inbound_request_url`/`fallback_url` url will be called when a message is
287
+ # received from the phone number. If this field is enabled then the webhook url
288
+ # defined on the phone number will override the
289
+ # `inbound_request_url`/`fallback_url` defined for the Messaging Service.
267
290
  # @return [ServiceInstance] Updated ServiceInstance
268
- def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
291
+ def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, use_inbound_webhook_on_number: :unset)
269
292
  data = Twilio::Values.of({
270
293
  'FriendlyName' => friendly_name,
271
294
  'InboundRequestUrl' => inbound_request_url,
@@ -281,6 +304,7 @@ module Twilio
281
304
  'AreaCodeGeomatch' => area_code_geomatch,
282
305
  'ValidityPeriod' => validity_period,
283
306
  'SynchronousValidation' => synchronous_validation,
307
+ 'UseInboundWebhookOnNumber' => use_inbound_webhook_on_number,
284
308
  })
285
309
 
286
310
  payload = @version.update('POST', @uri, data: data)
@@ -434,6 +458,7 @@ module Twilio
434
458
  'validity_period' => payload['validity_period'].to_i,
435
459
  'url' => payload['url'],
436
460
  'links' => payload['links'],
461
+ 'use_inbound_webhook_on_number' => payload['use_inbound_webhook_on_number'],
437
462
  }
438
463
 
439
464
  # Context
@@ -483,7 +508,7 @@ module Twilio
483
508
  end
484
509
 
485
510
  ##
486
- # @return [String] The URL we call using inbound_method when a message is received by any phone number or short code in the Service
511
+ # @return [String] The URL we call using inbound_method when a message is received by any phone number or short code in the Service. This field will be overridden if the `use_inbound_webhook_on_number` field is enabled.
487
512
  def inbound_request_url
488
513
  @properties['inbound_request_url']
489
514
  end
@@ -495,7 +520,7 @@ module Twilio
495
520
  end
496
521
 
497
522
  ##
498
- # @return [String] The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL
523
+ # @return [String] The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. This field will be overridden if the `use_inbound_webhook_on_number` field is enabled.
499
524
  def fallback_url
500
525
  @properties['fallback_url']
501
526
  end
@@ -572,19 +597,30 @@ module Twilio
572
597
  @properties['links']
573
598
  end
574
599
 
600
+ ##
601
+ # @return [Boolean] If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
602
+ def use_inbound_webhook_on_number
603
+ @properties['use_inbound_webhook_on_number']
604
+ end
605
+
575
606
  ##
576
607
  # Update the ServiceInstance
577
608
  # @param [String] friendly_name A descriptive string that you create to describe
578
609
  # the resource. It can be up to 64 characters long.
579
- # @param [String] inbound_request_url The URL we should call using
580
- # `inbound_method` when a message is received by any phone number or short code in
581
- # the Service. When this property is `null`, receiving inbound messages is
582
- # disabled.
610
+ # @param [String] inbound_request_url The URL we call using `inbound_method` when
611
+ # a message is received by any phone number or short code in the Service. When
612
+ # this property is `null`, receiving inbound messages is disabled. All messages
613
+ # sent to the Twilio phone number or short code will not be logged and received on
614
+ # the Account. If the `use_inbound_webhook_on_number` field is enabled then the
615
+ # webhook url defined on the phone number will override the `inbound_request_url`
616
+ # defined for the Messaging Service.
583
617
  # @param [String] inbound_method The HTTP method we should use to call
584
618
  # `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`.
585
- # @param [String] fallback_url The URL that we should call using `fallback_method`
586
- # if an error occurs while retrieving or executing the TwiML from the Inbound
587
- # Request URL.
619
+ # @param [String] fallback_url The URL that we call using `fallback_method` if an
620
+ # error occurs while retrieving or executing the TwiML from the Inbound Request
621
+ # URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook
622
+ # url defined on the phone number will override the `fallback_url` defined for the
623
+ # Messaging Service.
588
624
  # @param [String] fallback_method The HTTP method we should use to call
589
625
  # `fallback_url`. Can be: `GET` or `POST`.
590
626
  # @param [String] status_callback The URL we should call to {pass status
@@ -609,8 +645,14 @@ module Twilio
609
645
  # @param [String] validity_period How long, in seconds, messages sent from the
610
646
  # Service are valid. Can be an integer from `1` to `14,400`.
611
647
  # @param [Boolean] synchronous_validation Reserved.
648
+ # @param [Boolean] use_inbound_webhook_on_number A boolean value that indicates
649
+ # either the webhook url configured on the phone number will be used or
650
+ # `inbound_request_url`/`fallback_url` url will be called when a message is
651
+ # received from the phone number. If this field is enabled then the webhook url
652
+ # defined on the phone number will override the
653
+ # `inbound_request_url`/`fallback_url` defined for the Messaging Service.
612
654
  # @return [ServiceInstance] Updated ServiceInstance
613
- def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
655
+ def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, use_inbound_webhook_on_number: :unset)
614
656
  context.update(
615
657
  friendly_name: friendly_name,
616
658
  inbound_request_url: inbound_request_url,
@@ -626,6 +668,7 @@ module Twilio
626
668
  area_code_geomatch: area_code_geomatch,
627
669
  validity_period: validity_period,
628
670
  synchronous_validation: synchronous_validation,
671
+ use_inbound_webhook_on_number: use_inbound_webhook_on_number,
629
672
  )
630
673
  end
631
674