twilio-ruby 5.19.0 → 5.20.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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +13 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api.rb +16 -13
  5. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +85 -88
  6. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +4 -4
  7. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +135 -146
  8. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +21 -17
  9. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +14 -8
  10. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +150 -166
  11. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +174 -79
  12. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +147 -160
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +174 -79
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +174 -79
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +147 -160
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +174 -79
  17. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +51 -51
  18. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +246 -251
  19. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +31 -26
  20. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +34 -26
  21. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +109 -112
  22. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +108 -112
  23. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +108 -112
  24. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +21 -11
  25. data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +7 -6
  26. data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +7 -6
  27. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +32 -25
  28. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +36 -36
  29. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +2 -1
  30. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +70 -66
  31. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +10 -10
  32. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +14 -14
  33. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +26 -23
  34. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +26 -23
  35. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +12 -12
  36. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +26 -23
  37. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +4 -4
  38. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +4 -4
  39. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +11 -9
  40. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +2 -1
  41. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +56 -47
  42. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +59 -44
  43. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +59 -44
  44. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +59 -47
  45. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +59 -44
  46. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +59 -44
  47. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +59 -44
  48. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +59 -44
  49. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +59 -44
  50. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +76 -74
  51. data/lib/twilio-ruby/rest/authy.rb +8 -8
  52. data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
  53. data/lib/twilio-ruby/rest/client.rb +16 -13
  54. data/lib/twilio-ruby/rest/messaging.rb +15 -0
  55. data/lib/twilio-ruby/rest/messaging/v1.rb +23 -0
  56. data/lib/twilio-ruby/rest/messaging/v1/session.rb +482 -0
  57. data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +434 -0
  58. data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +458 -0
  59. data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +285 -0
  60. data/lib/twilio-ruby/rest/preview.rb +8 -8
  61. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  62. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +3 -2
  63. data/lib/twilio-ruby/rest/video.rb +9 -9
  64. data/lib/twilio-ruby/rest/video/v1.rb +16 -16
  65. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -6
  66. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +37 -21
  67. data/lib/twilio-ruby/rest/video/v1/recording.rb +12 -3
  68. data/lib/twilio-ruby/security/request_validator.rb +2 -2
  69. data/lib/twilio-ruby/version.rb +1 -1
  70. data/spec/integration/messaging/v1/session/message_spec.rb +238 -0
  71. data/spec/integration/messaging/v1/session/participant_spec.rb +256 -0
  72. data/spec/integration/messaging/v1/session_spec.rb +223 -0
  73. data/spec/integration/messaging/v1/webhook_spec.rb +92 -0
  74. data/spec/integration/video/v1/composition_hook_spec.rb +1 -1
  75. data/spec/security/request_validator_spec.rb +5 -7
  76. metadata +14 -2
@@ -18,10 +18,11 @@ module Twilio
18
18
  ##
19
19
  # Initialize the AssignedAddOnList
20
20
  # @param [Version] version Version that contains the resource
21
- # @param [String] account_sid The unique id of the Account that has installed this
22
- # Add-on.
23
- # @param [String] resource_sid The unique id of the Phone Number to which the
24
- # Add-on is assigned.
21
+ # @param [String] account_sid The SID of the
22
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created the
23
+ # resource.
24
+ # @param [String] resource_sid The SID of the Phone Number to which the Add-on is
25
+ # assigned.
25
26
  # @return [AssignedAddOnList] AssignedAddOnList
26
27
  def initialize(version, account_sid: nil, resource_sid: nil)
27
28
  super(version)
@@ -116,8 +117,8 @@ module Twilio
116
117
  ##
117
118
  # Retrieve a single page of AssignedAddOnInstance records from the API.
118
119
  # Request is executed immediately.
119
- # @param [String] installed_add_on_sid A 34 character string that uniquely
120
- # identifies the Add-on installation.
120
+ # @param [String] installed_add_on_sid The SID that identifies the Add-on
121
+ # installation.
121
122
  # @return [AssignedAddOnInstance] Newly created AssignedAddOnInstance
122
123
  def create(installed_add_on_sid: nil)
123
124
  data = Twilio::Values.of({'InstalledAddOnSid' => installed_add_on_sid, })
@@ -185,10 +186,13 @@ module Twilio
185
186
  ##
186
187
  # Initialize the AssignedAddOnContext
187
188
  # @param [Version] version Version that contains the resource
188
- # @param [String] account_sid The account_sid
189
- # @param [String] resource_sid The resource_sid
190
- # @param [String] sid The Installed Add-on Sid that uniquely identifies the
191
- # assignment
189
+ # @param [String] account_sid The SID of the
190
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created the
191
+ # resource to fetch.
192
+ # @param [String] resource_sid The SID of the Phone Number to which the Add-on is
193
+ # assigned.
194
+ # @param [String] sid The Twilio-provided string that uniquely identifies the
195
+ # resource to fetch.
192
196
  # @return [AssignedAddOnContext] AssignedAddOnContext
193
197
  def initialize(version, account_sid, resource_sid, sid)
194
198
  super(version)
@@ -273,12 +277,13 @@ module Twilio
273
277
  # Initialize the AssignedAddOnInstance
274
278
  # @param [Version] version Version that contains the resource
275
279
  # @param [Hash] payload payload that contains response from Twilio
276
- # @param [String] account_sid The unique id of the Account that has installed this
277
- # Add-on.
278
- # @param [String] resource_sid The unique id of the Phone Number to which the
279
- # Add-on is assigned.
280
- # @param [String] sid The Installed Add-on Sid that uniquely identifies the
281
- # assignment
280
+ # @param [String] account_sid The SID of the
281
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created the
282
+ # resource.
283
+ # @param [String] resource_sid The SID of the Phone Number to which the Add-on is
284
+ # assigned.
285
+ # @param [String] sid The Twilio-provided string that uniquely identifies the
286
+ # resource to fetch.
282
287
  # @return [AssignedAddOnInstance] AssignedAddOnInstance
283
288
  def initialize(version, payload, account_sid: nil, resource_sid: nil, sid: nil)
284
289
  super(version)
@@ -324,25 +329,25 @@ module Twilio
324
329
  end
325
330
 
326
331
  ##
327
- # @return [String] A string that uniquely identifies this assigned Add-on installation
332
+ # @return [String] The unique string that identifies the resource
328
333
  def sid
329
334
  @properties['sid']
330
335
  end
331
336
 
332
337
  ##
333
- # @return [String] The Account id that has installed this Add-on
338
+ # @return [String] The SID of the Account that created the resource
334
339
  def account_sid
335
340
  @properties['account_sid']
336
341
  end
337
342
 
338
343
  ##
339
- # @return [String] The Phone Number id that has installed this Add-on
344
+ # @return [String] The SID of the Phone Number that installed this Add-on
340
345
  def resource_sid
341
346
  @properties['resource_sid']
342
347
  end
343
348
 
344
349
  ##
345
- # @return [String] A description of this Add-on installation
350
+ # @return [String] The string that you assigned to describe the resource
346
351
  def friendly_name
347
352
  @properties['friendly_name']
348
353
  end
@@ -354,37 +359,37 @@ module Twilio
354
359
  end
355
360
 
356
361
  ##
357
- # @return [Hash] The JSON object representing the current configuration
362
+ # @return [Hash] A JSON string that represents the current configuration
358
363
  def configuration
359
364
  @properties['configuration']
360
365
  end
361
366
 
362
367
  ##
363
- # @return [String] The string that uniquely identifies this Add-on installation
368
+ # @return [String] An application-defined string that uniquely identifies the resource
364
369
  def unique_name
365
370
  @properties['unique_name']
366
371
  end
367
372
 
368
373
  ##
369
- # @return [Time] The date this Add-on was installed
374
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was created
370
375
  def date_created
371
376
  @properties['date_created']
372
377
  end
373
378
 
374
379
  ##
375
- # @return [Time] The date this Add-on installation was last updated
380
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
376
381
  def date_updated
377
382
  @properties['date_updated']
378
383
  end
379
384
 
380
385
  ##
381
- # @return [String] The uri
386
+ # @return [String] The URI of the resource, relative to `https://api.twilio.com`
382
387
  def uri
383
388
  @properties['uri']
384
389
  end
385
390
 
386
391
  ##
387
- # @return [String] The subresource_uris
392
+ # @return [String] A list of related resources identified by their relative URIs
388
393
  def subresource_uris
389
394
  @properties['subresource_uris']
390
395
  end
@@ -19,12 +19,13 @@ module Twilio
19
19
  ##
20
20
  # Initialize the AssignedAddOnExtensionList
21
21
  # @param [Version] version Version that contains the resource
22
- # @param [String] account_sid The unique id of the Account that has installed this
23
- # Add-on.
24
- # @param [String] resource_sid The unique id of the Phone Number to which the
25
- # Add-on is assigned.
26
- # @param [String] assigned_add_on_sid A 34 character string that uniquely
27
- # identifies the assigned Add-on installation.
22
+ # @param [String] account_sid The SID of the
23
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created the
24
+ # resource.
25
+ # @param [String] resource_sid The SID of the Phone Number to which the Add-on is
26
+ # assigned.
27
+ # @param [String] assigned_add_on_sid The SID that uniquely identifies the
28
+ # assigned Add-on installation.
28
29
  # @return [AssignedAddOnExtensionList] AssignedAddOnExtensionList
29
30
  def initialize(version, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil)
30
31
  super(version)
@@ -170,10 +171,15 @@ module Twilio
170
171
  ##
171
172
  # Initialize the AssignedAddOnExtensionContext
172
173
  # @param [Version] version Version that contains the resource
173
- # @param [String] account_sid The account_sid
174
- # @param [String] resource_sid The resource_sid
175
- # @param [String] assigned_add_on_sid The assigned_add_on_sid
176
- # @param [String] sid The Extension Sid that uniquely identifies this resource
174
+ # @param [String] account_sid The SID of the
175
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created the
176
+ # resource to fetch.
177
+ # @param [String] resource_sid The SID of the Phone Number to which the Add-on is
178
+ # assigned.
179
+ # @param [String] assigned_add_on_sid The SID that uniquely identifies the
180
+ # assigned Add-on installation.
181
+ # @param [String] sid The Twilio-provided string that uniquely identifies the
182
+ # resource to fetch.
177
183
  # @return [AssignedAddOnExtensionContext] AssignedAddOnExtensionContext
178
184
  def initialize(version, account_sid, resource_sid, assigned_add_on_sid, sid)
179
185
  super(version)
@@ -225,13 +231,15 @@ module Twilio
225
231
  # Initialize the AssignedAddOnExtensionInstance
226
232
  # @param [Version] version Version that contains the resource
227
233
  # @param [Hash] payload payload that contains response from Twilio
228
- # @param [String] account_sid The unique id of the Account that has installed this
229
- # Add-on.
230
- # @param [String] resource_sid The unique id of the Phone Number to which the
231
- # Add-on is assigned.
232
- # @param [String] assigned_add_on_sid A 34 character string that uniquely
233
- # identifies the assigned Add-on installation.
234
- # @param [String] sid The Extension Sid that uniquely identifies this resource
234
+ # @param [String] account_sid The SID of the
235
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created the
236
+ # resource.
237
+ # @param [String] resource_sid The SID of the Phone Number to which the Add-on is
238
+ # assigned.
239
+ # @param [String] assigned_add_on_sid The SID that uniquely identifies the
240
+ # assigned Add-on installation.
241
+ # @param [String] sid The Twilio-provided string that uniquely identifies the
242
+ # resource to fetch.
235
243
  # @return [AssignedAddOnExtensionInstance] AssignedAddOnExtensionInstance
236
244
  def initialize(version, payload, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil, sid: nil)
237
245
  super(version)
@@ -277,55 +285,55 @@ module Twilio
277
285
  end
278
286
 
279
287
  ##
280
- # @return [String] A string that uniquely identifies this Extension
288
+ # @return [String] The unique string that identifies the resource
281
289
  def sid
282
290
  @properties['sid']
283
291
  end
284
292
 
285
293
  ##
286
- # @return [String] The Account id that has installed this Add-on
294
+ # @return [String] The SID of the Account that created the resource
287
295
  def account_sid
288
296
  @properties['account_sid']
289
297
  end
290
298
 
291
299
  ##
292
- # @return [String] The Phone Number id that has installed this Add-on
300
+ # @return [String] The SID of the Phone Number to which the Add-on is assigned
293
301
  def resource_sid
294
302
  @properties['resource_sid']
295
303
  end
296
304
 
297
305
  ##
298
- # @return [String] A string that uniquely identifies the assigned Add-on installation
306
+ # @return [String] The SID that uniquely identifies the assigned Add-on installation
299
307
  def assigned_add_on_sid
300
308
  @properties['assigned_add_on_sid']
301
309
  end
302
310
 
303
311
  ##
304
- # @return [String] A human-readable description of this Extension
312
+ # @return [String] The string that you assigned to describe the resource
305
313
  def friendly_name
306
314
  @properties['friendly_name']
307
315
  end
308
316
 
309
317
  ##
310
- # @return [String] A human-readable description of the Extension's Product
318
+ # @return [String] A string that you assigned to describe the Product this Extension is used within
311
319
  def product_name
312
320
  @properties['product_name']
313
321
  end
314
322
 
315
323
  ##
316
- # @return [String] The string that uniquely identifies this Extension
324
+ # @return [String] An application-defined string that uniquely identifies the resource
317
325
  def unique_name
318
326
  @properties['unique_name']
319
327
  end
320
328
 
321
329
  ##
322
- # @return [String] The uri
330
+ # @return [String] The URI of the resource, relative to `https://api.twilio.com`
323
331
  def uri
324
332
  @properties['uri']
325
333
  end
326
334
 
327
335
  ##
328
- # @return [Boolean] A Boolean indicating if the Extension will be invoked
336
+ # @return [Boolean] Whether the Extension will be invoked
329
337
  def enabled
330
338
  @properties['enabled']
331
339
  end
@@ -16,9 +16,9 @@ module Twilio
16
16
  ##
17
17
  # Initialize the LocalList
18
18
  # @param [Version] version Version that contains the resource
19
- # @param [String] account_sid The unique id of the
20
- # [Account](https://www.twilio.com/docs/iam/api/account) responsible for this
21
- # phone number.
19
+ # @param [String] account_sid The SID of the
20
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created this
21
+ # IncomingPhoneNumber resource.
22
22
  # @return [LocalList] LocalList
23
23
  def initialize(version, account_sid: nil)
24
24
  super(version)
@@ -32,16 +32,15 @@ module Twilio
32
32
  # Lists LocalInstance 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
- # @param [Boolean] beta Include phone numbers new to the Twilio platform. Possible
36
- # values are either `true` or `false`. Default is `true`.
37
- # @param [String] friendly_name Only show the incoming phone number resources with
38
- # friendly names that exactly match this name.
39
- # @param [String] phone_number Only show the incoming phone number resources that
40
- # match this pattern. You can specify partial numbers and use '*' as a wildcard
41
- # for any digit.
42
- # @param [String] origin Include phone numbers based on the origin, by default,
43
- # phone numbers of all origin are included. Possible values are either `twilio` or
44
- # `hosted`.
35
+ # @param [Boolean] beta Whether to include phone numbers new to the Twilio
36
+ # platform. Can be: `true` or `false` and the default is `true`.
37
+ # @param [String] friendly_name A string that identifies the resources to read.
38
+ # @param [String] phone_number The phone numbers of the IncomingPhoneNumber
39
+ # resources to read. You can specify partial numbers and use '*' as a wildcard for
40
+ # any digit.
41
+ # @param [String] origin Whether to include phone numbers based on their origin.
42
+ # Can be: `twilio` or `hosted`. By default, phone numbers of all origin are
43
+ # included.
45
44
  # @param [Integer] limit Upper limit for the number of records to return. stream()
46
45
  # guarantees to never return more than limit. Default is no limit
47
46
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -64,16 +63,15 @@ module Twilio
64
63
  # Streams LocalInstance records from the API as an Enumerable.
65
64
  # This operation lazily loads records as efficiently as possible until the limit
66
65
  # is reached.
67
- # @param [Boolean] beta Include phone numbers new to the Twilio platform. Possible
68
- # values are either `true` or `false`. Default is `true`.
69
- # @param [String] friendly_name Only show the incoming phone number resources with
70
- # friendly names that exactly match this name.
71
- # @param [String] phone_number Only show the incoming phone number resources that
72
- # match this pattern. You can specify partial numbers and use '*' as a wildcard
73
- # for any digit.
74
- # @param [String] origin Include phone numbers based on the origin, by default,
75
- # phone numbers of all origin are included. Possible values are either `twilio` or
76
- # `hosted`.
66
+ # @param [Boolean] beta Whether to include phone numbers new to the Twilio
67
+ # platform. Can be: `true` or `false` and the default is `true`.
68
+ # @param [String] friendly_name A string that identifies the resources to read.
69
+ # @param [String] phone_number The phone numbers of the IncomingPhoneNumber
70
+ # resources to read. You can specify partial numbers and use '*' as a wildcard for
71
+ # any digit.
72
+ # @param [String] origin Whether to include phone numbers based on their origin.
73
+ # Can be: `twilio` or `hosted`. By default, phone numbers of all origin are
74
+ # included.
77
75
  # @param [Integer] limit Upper limit for the number of records to return. stream()
78
76
  # guarantees to never return more than limit. Default is no limit.
79
77
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -112,16 +110,15 @@ module Twilio
112
110
  ##
113
111
  # Retrieve a single page of LocalInstance records from the API.
114
112
  # Request is executed immediately.
115
- # @param [Boolean] beta Include phone numbers new to the Twilio platform. Possible
116
- # values are either `true` or `false`. Default is `true`.
117
- # @param [String] friendly_name Only show the incoming phone number resources with
118
- # friendly names that exactly match this name.
119
- # @param [String] phone_number Only show the incoming phone number resources that
120
- # match this pattern. You can specify partial numbers and use '*' as a wildcard
121
- # for any digit.
122
- # @param [String] origin Include phone numbers based on the origin, by default,
123
- # phone numbers of all origin are included. Possible values are either `twilio` or
124
- # `hosted`.
113
+ # @param [Boolean] beta Whether to include phone numbers new to the Twilio
114
+ # platform. Can be: `true` or `false` and the default is `true`.
115
+ # @param [String] friendly_name A string that identifies the resources to read.
116
+ # @param [String] phone_number The phone numbers of the IncomingPhoneNumber
117
+ # resources to read. You can specify partial numbers and use '*' as a wildcard for
118
+ # any digit.
119
+ # @param [String] origin Whether to include phone numbers based on their origin.
120
+ # Can be: `twilio` or `hosted`. By default, phone numbers of all origin are
121
+ # included.
125
122
  # @param [String] page_token PageToken provided by the API
126
123
  # @param [Integer] page_number Page Number, this value is simply for client state
127
124
  # @param [Integer] page_size Number of records to return, defaults to 50
@@ -160,54 +157,54 @@ module Twilio
160
157
  ##
161
158
  # Retrieve a single page of LocalInstance records from the API.
162
159
  # Request is executed immediately.
163
- # @param [String] phone_number The phone number you want to purchase. The number
164
- # should be formatted starting with a '+' followed by the country code and the
165
- # number in [E.164](http://en.wikipedia.org/wiki/E.164) format e.g.,
166
- # '+15105555555'. **You must include either this or an `AreaCode` parameter to
167
- # have your POST succeed.**
168
- # @param [String] api_version The Twilio REST API version to use for incoming
169
- # calls made to this number. If omitted, uses `2010-04-01`.
170
- # @param [String] friendly_name A human readable description of the new incoming
171
- # phone number. Maximum 64 characters. Defaults to a formatted version of the
172
- # number.
173
- # @param [String] sms_application_sid The 34 character sid of the application
174
- # Twilio should use to handle SMSs sent to the new number. If a
175
- # `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and
176
- # use those set on the application.
177
- # @param [String] sms_fallback_method The HTTP method that should be used to
178
- # request the `SmsFallbackUrl`. Must be either `GET` or `POST`. Defaults to
179
- # `POST`.
180
- # @param [String] sms_fallback_url A URL that Twilio will request if an error
181
- # occurs requesting or executing the TwiML defined by `SmsUrl`.
182
- # @param [String] sms_method The HTTP method that should be used to request the
183
- # `SmsUrl`. Must be either `GET` or `POST`. Defaults to `POST`.
184
- # @param [String] sms_url The URL that Twilio should request when somebody sends
185
- # an SMS to the phone number.
186
- # @param [String] status_callback The URL that Twilio will request to pass status
187
- # parameters (such as call ended) to your application.
188
- # @param [String] status_callback_method The HTTP method Twilio will use to make
189
- # requests to the `StatusCallback` URL. Either `GET` or `POST`. Defaults to
190
- # `POST`.
191
- # @param [String] voice_application_sid The 34 character sid of the application
192
- # Twilio should use to handle phone calls to the new number. If a
193
- # `VoiceApplicationSid` is present, Twilio will ignore all of the voice urls above
194
- # and use those set on the application. Setting a `VoiceApplicationSid` will
195
- # automatically delete your `TrunkSid` and vice versa.
196
- # @param [Boolean] voice_caller_id_lookup Do a lookup of a caller's name from the
197
- # CNAM database and post it to your app. Either `true` or `false`. Defaults to
198
- # `false`.
199
- # @param [String] voice_fallback_method The HTTP method that should be used to
200
- # request the `VoiceFallbackUrl`. Either `GET` or `POST`. Defaults to `POST`.
201
- # @param [String] voice_fallback_url A URL that Twilio will request if an error
202
- # occurs requesting or executing the TwiML at `Url`.
203
- # @param [String] voice_method The HTTP method that should be used to request the
204
- # `VoiceUrl`. Must be either `GET` or `POST`. Defaults to `POST`.
205
- # @param [String] voice_url The URL that Twilio should request when somebody dials
206
- # the new phone number. The VoiceURL will no longer be used if a
207
- # `VoiceApplicationSid` or a `TrunkSid` is set.
208
- # @param [String] identity_sid The identity_sid
209
- # @param [String] address_sid The 34 character sid of the address Twilio should
210
- # associate with the number.
160
+ # @param [String] phone_number The phone number to purchase specified in
161
+ # [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone
162
+ # numbers consist of a + followed by the country code and subscriber number
163
+ # without punctuation characters. For example, +14155551234.
164
+ # @param [String] api_version The API version to use for incoming calls made to
165
+ # the new phone number. The default is `2010-04-01`.
166
+ # @param [String] friendly_name A descriptive string that you created to describe
167
+ # the new phone number. It can be up to 64 characters long. By default, this is a
168
+ # formatted version of the phone number.
169
+ # @param [String] sms_application_sid The SID of the application that should
170
+ # handle SMS messages sent to the new phone number. If an `sms_application_sid` is
171
+ # present, we ignore all of the `sms_*_url` urls and use those set on the
172
+ # application.
173
+ # @param [String] sms_fallback_method The HTTP method that we should use to call
174
+ # `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
175
+ # @param [String] sms_fallback_url The URL that we should call when an error
176
+ # occurs while requesting or executing the TwiML defined by `sms_url`.
177
+ # @param [String] sms_method The HTTP method that we should use to call `sms_url`.
178
+ # Can be: `GET` or `POST` and defaults to `POST`.
179
+ # @param [String] sms_url The URL we should call when the new phone number
180
+ # receives an incoming SMS message.
181
+ # @param [String] status_callback The URL we should call using the
182
+ # `status_callback_method` to send status information to your application.
183
+ # @param [String] status_callback_method The HTTP method we should use to call
184
+ # `status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
185
+ # @param [String] voice_application_sid The SID of the application we should use
186
+ # to handle calls to the new phone number. If a `voice_application_sid` is
187
+ # present, we ignore all of the voice urls and use only those set on the
188
+ # application. Setting a `voice_application_sid` will automatically delete your
189
+ # `trunk_sid` and vice versa.
190
+ # @param [Boolean] voice_caller_id_lookup Whether to lookup the caller's name from
191
+ # the CNAM database and post it to your app. Can be: `true` or `false` and
192
+ # defaults to `false`.
193
+ # @param [String] voice_fallback_method The HTTP method that we should use to call
194
+ # `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
195
+ # @param [String] voice_fallback_url The URL that we should call when an error
196
+ # occurs retrieving or executing the TwiML requested by `url`.
197
+ # @param [String] voice_method The HTTP method that we should use to call
198
+ # `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.
199
+ # @param [String] voice_url The URL that we should call to answer a call to the
200
+ # new phone number. The `voice_url` will not be called if a
201
+ # `voice_application_sid` or a `trunk_sid` is set.
202
+ # @param [String] identity_sid The SID of the Identity resource that we should
203
+ # associate with the new phone number. Some regions require an identity to meet
204
+ # local regulations.
205
+ # @param [String] address_sid The SID of the Address resource we should associate
206
+ # with the new phone number. Some regions require addresses to meet local
207
+ # regulations.
211
208
  # @return [LocalInstance] Newly created LocalInstance
212
209
  def create(phone_number: nil, api_version: :unset, friendly_name: :unset, sms_application_sid: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, status_callback: :unset, status_callback_method: :unset, voice_application_sid: :unset, voice_caller_id_lookup: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset, identity_sid: :unset, address_sid: :unset)
213
210
  data = Twilio::Values.of({
@@ -281,9 +278,9 @@ module Twilio
281
278
  # Initialize the LocalInstance
282
279
  # @param [Version] version Version that contains the resource
283
280
  # @param [Hash] payload payload that contains response from Twilio
284
- # @param [String] account_sid The unique id of the
285
- # [Account](https://www.twilio.com/docs/iam/api/account) responsible for this
286
- # phone number.
281
+ # @param [String] account_sid The SID of the
282
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created this
283
+ # IncomingPhoneNumber resource.
287
284
  # @return [LocalInstance] LocalInstance
288
285
  def initialize(version, payload, account_sid: nil)
289
286
  super(version)
@@ -322,169 +319,169 @@ module Twilio
322
319
  end
323
320
 
324
321
  ##
325
- # @return [String] The unique id of the Account responsible for this phone number.
322
+ # @return [String] The SID of the Account that created the resource
326
323
  def account_sid
327
324
  @properties['account_sid']
328
325
  end
329
326
 
330
327
  ##
331
- # @return [String] The 34 character sid of the address associated with this number.
328
+ # @return [String] The SID of the Address resource associated with the phone number
332
329
  def address_sid
333
330
  @properties['address_sid']
334
331
  end
335
332
 
336
333
  ##
337
- # @return [local.AddressRequirement] This indicates whether the phone number requires you or your customer to have an Address registered with Twilio.
334
+ # @return [local.AddressRequirement] Whether the phone number requires an Address registered with Twilio.
338
335
  def address_requirements
339
336
  @properties['address_requirements']
340
337
  end
341
338
 
342
339
  ##
343
- # @return [String] Calls to this phone number will start a new TwiML session with this API version.
340
+ # @return [String] The API version used to start a new TwiML session
344
341
  def api_version
345
342
  @properties['api_version']
346
343
  end
347
344
 
348
345
  ##
349
- # @return [Boolean] Phone numbers new to the Twilio platform are marked as beta.
346
+ # @return [Boolean] Whether the phone number is new to the Twilio platform
350
347
  def beta
351
348
  @properties['beta']
352
349
  end
353
350
 
354
351
  ##
355
- # @return [String] This is a set of boolean properties that indicate whether a phone number can receive calls or messages.
352
+ # @return [String] Indicate if a phone can receive calls or messages
356
353
  def capabilities
357
354
  @properties['capabilities']
358
355
  end
359
356
 
360
357
  ##
361
- # @return [Time] The date that this resource was created, given as GMT RFC 2822 format.
358
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was created
362
359
  def date_created
363
360
  @properties['date_created']
364
361
  end
365
362
 
366
363
  ##
367
- # @return [Time] The date that this resource was last updated, given as GMT RFC 2822 format.
364
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
368
365
  def date_updated
369
366
  @properties['date_updated']
370
367
  end
371
368
 
372
369
  ##
373
- # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
370
+ # @return [String] The string that you assigned to describe the resource
374
371
  def friendly_name
375
372
  @properties['friendly_name']
376
373
  end
377
374
 
378
375
  ##
379
- # @return [String] The identity_sid
376
+ # @return [String] The SID of the Identity resource associated with number
380
377
  def identity_sid
381
378
  @properties['identity_sid']
382
379
  end
383
380
 
384
381
  ##
385
- # @return [String] The incoming phone number.
382
+ # @return [String] The phone number in E.164 format
386
383
  def phone_number
387
384
  @properties['phone_number']
388
385
  end
389
386
 
390
387
  ##
391
- # @return [String] Twilio owned phone numbers are marked as twilio while hosted phone numbers are marked as hosted.
388
+ # @return [String] The phone number's origin. Can be twilio or hosted.
392
389
  def origin
393
390
  @properties['origin']
394
391
  end
395
392
 
396
393
  ##
397
- # @return [String] A 34 character string that uniquely identifies this resource.
394
+ # @return [String] The unique string that identifies the resource
398
395
  def sid
399
396
  @properties['sid']
400
397
  end
401
398
 
402
399
  ##
403
- # @return [String] The 34 character sid of the application Twilio should use to handle SMSs sent to this number.
400
+ # @return [String] The SID of the Application resource to handle SMS messages
404
401
  def sms_application_sid
405
402
  @properties['sms_application_sid']
406
403
  end
407
404
 
408
405
  ##
409
- # @return [String] The HTTP method Twilio will use when requesting the above URL.
406
+ # @return [String] The HTTP method used with sms_fallback_url
410
407
  def sms_fallback_method
411
408
  @properties['sms_fallback_method']
412
409
  end
413
410
 
414
411
  ##
415
- # @return [String] The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.
412
+ # @return [String] The URL that we call when an error occurs while retrieving or executing the TwiML
416
413
  def sms_fallback_url
417
414
  @properties['sms_fallback_url']
418
415
  end
419
416
 
420
417
  ##
421
- # @return [String] The HTTP method Twilio will use when making requests to the SmsUrl.
418
+ # @return [String] The HTTP method to use with sms_url
422
419
  def sms_method
423
420
  @properties['sms_method']
424
421
  end
425
422
 
426
423
  ##
427
- # @return [String] The URL Twilio will request when receiving an incoming SMS message to this number.
424
+ # @return [String] The URL we call when the phone number receives an incoming SMS message
428
425
  def sms_url
429
426
  @properties['sms_url']
430
427
  end
431
428
 
432
429
  ##
433
- # @return [String] The URL that Twilio will request to pass status parameters to your application.
430
+ # @return [String] The URL to send status information to your application
434
431
  def status_callback
435
432
  @properties['status_callback']
436
433
  end
437
434
 
438
435
  ##
439
- # @return [String] The HTTP method Twilio will use to make requests to the StatusCallback URL.
436
+ # @return [String] The HTTP method we use to call status_callback
440
437
  def status_callback_method
441
438
  @properties['status_callback_method']
442
439
  end
443
440
 
444
441
  ##
445
- # @return [String] The 34 character sid of the Trunk Twilio should use to handle phone calls to this number.
442
+ # @return [String] The SID of the Trunk that handles calls to the phone number
446
443
  def trunk_sid
447
444
  @properties['trunk_sid']
448
445
  end
449
446
 
450
447
  ##
451
- # @return [String] The URI for this resource, relative to https://api.
448
+ # @return [String] The URI of the resource, relative to `https://api.twilio.com`
452
449
  def uri
453
450
  @properties['uri']
454
451
  end
455
452
 
456
453
  ##
457
- # @return [String] The 34 character sid of the application Twilio should use to handle phone calls to this number.
454
+ # @return [String] The SID of the application that handles calls to the phone number
458
455
  def voice_application_sid
459
456
  @properties['voice_application_sid']
460
457
  end
461
458
 
462
459
  ##
463
- # @return [Boolean] Look up the caller's caller-ID name from the CNAM database.
460
+ # @return [Boolean] Whether to lookup the caller's name
464
461
  def voice_caller_id_lookup
465
462
  @properties['voice_caller_id_lookup']
466
463
  end
467
464
 
468
465
  ##
469
- # @return [String] The HTTP method Twilio will use when requesting the VoiceFallbackUrl.
466
+ # @return [String] The HTTP method used with voice_fallback_url
470
467
  def voice_fallback_method
471
468
  @properties['voice_fallback_method']
472
469
  end
473
470
 
474
471
  ##
475
- # @return [String] The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
472
+ # @return [String] The URL we call when an error occurs in TwiML
476
473
  def voice_fallback_url
477
474
  @properties['voice_fallback_url']
478
475
  end
479
476
 
480
477
  ##
481
- # @return [String] The HTTP method Twilio will use when requesting the above Url.
478
+ # @return [String] The HTTP method used with the voice_url
482
479
  def voice_method
483
480
  @properties['voice_method']
484
481
  end
485
482
 
486
483
  ##
487
- # @return [String] The URL Twilio will request when this phone number receives a call.
484
+ # @return [String] The URL we call when this phone number receives a call
488
485
  def voice_url
489
486
  @properties['voice_url']
490
487
  end