twilio-ruby 5.19.0 → 5.20.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -16,9 +16,9 @@ module Twilio
16
16
  ##
17
17
  # Initialize the MobileList
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 [MobileList] MobileList
23
23
  def initialize(version, account_sid: nil)
24
24
  super(version)
@@ -32,16 +32,15 @@ module Twilio
32
32
  # Lists MobileInstance 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 MobileInstance 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 MobileInstance 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,53 @@ module Twilio
160
157
  ##
161
158
  # Retrieve a single page of MobileInstance 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, the 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 of the application.
172
+ # @param [String] sms_fallback_method The HTTP method that we should use to call
173
+ # `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
174
+ # @param [String] sms_fallback_url The URL that we should call when an error
175
+ # occurs while requesting or executing the TwiML defined by `sms_url`.
176
+ # @param [String] sms_method The HTTP method that we should use to call `sms_url`.
177
+ # Can be: `GET` or `POST` and defaults to `POST`.
178
+ # @param [String] sms_url The URL we should call when the new phone number
179
+ # receives an incoming SMS message.
180
+ # @param [String] status_callback The URL we should call using the
181
+ # `status_callback_method` to send status information to your application.
182
+ # @param [String] status_callback_method The HTTP method we should use to call
183
+ # `status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
184
+ # @param [String] voice_application_sid The SID of the application we should use
185
+ # to handle calls to the new phone number. If a `voice_application_sid` is
186
+ # present, we ignore all of the voice urls and use only those set on the
187
+ # application. Setting a `voice_application_sid` will automatically delete your
188
+ # `trunk_sid` and vice versa.
189
+ # @param [Boolean] voice_caller_id_lookup Whether to lookup the caller's name from
190
+ # the CNAM database and post it to your app. Can be: `true` or `false` and
191
+ # defaults to `false`.
192
+ # @param [String] voice_fallback_method The HTTP method that we should use to call
193
+ # `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
194
+ # @param [String] voice_fallback_url The URL that we should call when an error
195
+ # occurs retrieving or executing the TwiML requested by `url`.
196
+ # @param [String] voice_method The HTTP method that we should use to call
197
+ # `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.
198
+ # @param [String] voice_url The URL that we should call to answer a call to the
199
+ # new phone number. The `voice_url` will not be called if a
200
+ # `voice_application_sid` or a `trunk_sid` is set.
201
+ # @param [String] identity_sid The SID of the Identity resource that we should
202
+ # associate with the new phone number. Some regions require an identity to meet
203
+ # local regulations.
204
+ # @param [String] address_sid The SID of the Address resource we should associate
205
+ # with the new phone number. Some regions require addresses to meet local
206
+ # regulations.
211
207
  # @return [MobileInstance] Newly created MobileInstance
212
208
  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
209
  data = Twilio::Values.of({
@@ -281,9 +277,9 @@ module Twilio
281
277
  # Initialize the MobileInstance
282
278
  # @param [Version] version Version that contains the resource
283
279
  # @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.
280
+ # @param [String] account_sid The SID of the
281
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created this
282
+ # IncomingPhoneNumber resource.
287
283
  # @return [MobileInstance] MobileInstance
288
284
  def initialize(version, payload, account_sid: nil)
289
285
  super(version)
@@ -322,169 +318,169 @@ module Twilio
322
318
  end
323
319
 
324
320
  ##
325
- # @return [String] The unique id of the Account responsible for this phone number.
321
+ # @return [String] The SID of the Account that created the resource
326
322
  def account_sid
327
323
  @properties['account_sid']
328
324
  end
329
325
 
330
326
  ##
331
- # @return [String] The 34 character sid of the address associated with this number.
327
+ # @return [String] The SID of the Address resource associated with the phone number
332
328
  def address_sid
333
329
  @properties['address_sid']
334
330
  end
335
331
 
336
332
  ##
337
- # @return [mobile.AddressRequirement] This indicates whether the phone number requires you or your customer to have an Address registered with Twilio.
333
+ # @return [mobile.AddressRequirement] Whether the phone number requires an Address registered with Twilio.
338
334
  def address_requirements
339
335
  @properties['address_requirements']
340
336
  end
341
337
 
342
338
  ##
343
- # @return [String] Calls to this phone number will start a new TwiML session with this API version.
339
+ # @return [String] The API version used to start a new TwiML session
344
340
  def api_version
345
341
  @properties['api_version']
346
342
  end
347
343
 
348
344
  ##
349
- # @return [Boolean] Phone numbers new to the Twilio platform are marked as beta.
345
+ # @return [Boolean] Whether the phone number is new to the Twilio platform
350
346
  def beta
351
347
  @properties['beta']
352
348
  end
353
349
 
354
350
  ##
355
- # @return [String] This is a set of boolean properties that indicate whether a phone number can receive calls or messages.
351
+ # @return [String] Indicate if a phone can receive calls or messages
356
352
  def capabilities
357
353
  @properties['capabilities']
358
354
  end
359
355
 
360
356
  ##
361
- # @return [Time] The date that this resource was created, given as GMT RFC 2822 format.
357
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was created
362
358
  def date_created
363
359
  @properties['date_created']
364
360
  end
365
361
 
366
362
  ##
367
- # @return [Time] The date that this resource was last updated, given as GMT RFC 2822 format.
363
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
368
364
  def date_updated
369
365
  @properties['date_updated']
370
366
  end
371
367
 
372
368
  ##
373
- # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
369
+ # @return [String] The string that you assigned to describe the resource
374
370
  def friendly_name
375
371
  @properties['friendly_name']
376
372
  end
377
373
 
378
374
  ##
379
- # @return [String] The identity_sid
375
+ # @return [String] The SID of the Identity resource associated with number
380
376
  def identity_sid
381
377
  @properties['identity_sid']
382
378
  end
383
379
 
384
380
  ##
385
- # @return [String] The incoming phone number.
381
+ # @return [String] The phone number in E.164 format
386
382
  def phone_number
387
383
  @properties['phone_number']
388
384
  end
389
385
 
390
386
  ##
391
- # @return [String] Twilio owned phone numbers are marked as twilio while hosted phone numbers are marked as hosted.
387
+ # @return [String] The phone number's origin. Can be twilio or hosted.
392
388
  def origin
393
389
  @properties['origin']
394
390
  end
395
391
 
396
392
  ##
397
- # @return [String] A 34 character string that uniquely identifies this resource.
393
+ # @return [String] The unique string that identifies the resource
398
394
  def sid
399
395
  @properties['sid']
400
396
  end
401
397
 
402
398
  ##
403
- # @return [String] The 34 character sid of the application Twilio should use to handle SMSs sent to this number.
399
+ # @return [String] The SID of the application that handles SMS messages sent to the phone number
404
400
  def sms_application_sid
405
401
  @properties['sms_application_sid']
406
402
  end
407
403
 
408
404
  ##
409
- # @return [String] The HTTP method Twilio will use when requesting the above URL.
405
+ # @return [String] The HTTP method used with sms_fallback_url
410
406
  def sms_fallback_method
411
407
  @properties['sms_fallback_method']
412
408
  end
413
409
 
414
410
  ##
415
- # @return [String] The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.
411
+ # @return [String] The URL that we call when an error occurs while retrieving or executing the TwiML
416
412
  def sms_fallback_url
417
413
  @properties['sms_fallback_url']
418
414
  end
419
415
 
420
416
  ##
421
- # @return [String] The HTTP method Twilio will use when making requests to the SmsUrl.
417
+ # @return [String] The HTTP method to use with sms_url
422
418
  def sms_method
423
419
  @properties['sms_method']
424
420
  end
425
421
 
426
422
  ##
427
- # @return [String] The URL Twilio will request when receiving an incoming SMS message to this number.
423
+ # @return [String] The URL we call when the phone number receives an incoming SMS message
428
424
  def sms_url
429
425
  @properties['sms_url']
430
426
  end
431
427
 
432
428
  ##
433
- # @return [String] The URL that Twilio will request to pass status parameters to your application.
429
+ # @return [String] The URL to send status information to your application
434
430
  def status_callback
435
431
  @properties['status_callback']
436
432
  end
437
433
 
438
434
  ##
439
- # @return [String] The HTTP method Twilio will use to make requests to the StatusCallback URL.
435
+ # @return [String] The HTTP method we use to call status_callback
440
436
  def status_callback_method
441
437
  @properties['status_callback_method']
442
438
  end
443
439
 
444
440
  ##
445
- # @return [String] The 34 character sid of the Trunk Twilio should use to handle phone calls to this number.
441
+ # @return [String] The SID of the Trunk that handles calls to the phone number
446
442
  def trunk_sid
447
443
  @properties['trunk_sid']
448
444
  end
449
445
 
450
446
  ##
451
- # @return [String] The URI for this resource, relative to https://api.
447
+ # @return [String] The URI of the resource, relative to `https://api.twilio.com`
452
448
  def uri
453
449
  @properties['uri']
454
450
  end
455
451
 
456
452
  ##
457
- # @return [String] The 34 character sid of the application Twilio should use to handle phone calls to this number.
453
+ # @return [String] The SID of the application that handles calls to the phone number
458
454
  def voice_application_sid
459
455
  @properties['voice_application_sid']
460
456
  end
461
457
 
462
458
  ##
463
- # @return [Boolean] Look up the caller's caller-ID name from the CNAM database.
459
+ # @return [Boolean] Whether to lookup the caller's name
464
460
  def voice_caller_id_lookup
465
461
  @properties['voice_caller_id_lookup']
466
462
  end
467
463
 
468
464
  ##
469
- # @return [String] The HTTP method Twilio will use when requesting the VoiceFallbackUrl.
465
+ # @return [String] The HTTP method used with voice_fallback_url
470
466
  def voice_fallback_method
471
467
  @properties['voice_fallback_method']
472
468
  end
473
469
 
474
470
  ##
475
- # @return [String] The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
471
+ # @return [String] The URL we call when an error occurs in TwiML
476
472
  def voice_fallback_url
477
473
  @properties['voice_fallback_url']
478
474
  end
479
475
 
480
476
  ##
481
- # @return [String] The HTTP method Twilio will use when requesting the above Url.
477
+ # @return [String] The HTTP method used with the voice_url
482
478
  def voice_method
483
479
  @properties['voice_method']
484
480
  end
485
481
 
486
482
  ##
487
- # @return [String] The URL Twilio will request when this phone number receives a call.
483
+ # @return [String] The URL we call when the phone number receives a call
488
484
  def voice_url
489
485
  @properties['voice_url']
490
486
  end
@@ -16,9 +16,9 @@ module Twilio
16
16
  ##
17
17
  # Initialize the TollFreeList
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 [TollFreeList] TollFreeList
23
23
  def initialize(version, account_sid: nil)
24
24
  super(version)
@@ -32,16 +32,15 @@ module Twilio
32
32
  # Lists TollFreeInstance 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 TollFreeInstance 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 TollFreeInstance 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,53 @@ module Twilio
160
157
  ##
161
158
  # Retrieve a single page of TollFreeInstance 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 `sms_*_url` values and use those of the application.
172
+ # @param [String] sms_fallback_method The HTTP method that we should use to call
173
+ # `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
174
+ # @param [String] sms_fallback_url The URL that we should call when an error
175
+ # occurs while requesting or executing the TwiML defined by `sms_url`.
176
+ # @param [String] sms_method The HTTP method that we should use to call `sms_url`.
177
+ # Can be: `GET` or `POST` and defaults to `POST`.
178
+ # @param [String] sms_url The URL we should call when the new phone number
179
+ # receives an incoming SMS message.
180
+ # @param [String] status_callback The URL we should call using the
181
+ # `status_callback_method` to send status information to your application.
182
+ # @param [String] status_callback_method The HTTP method we should use to call
183
+ # `status_callback`. Can be: `GET` or `POST` and defaults to `POST`.
184
+ # @param [String] voice_application_sid The SID of the application we should use
185
+ # to handle calls to the new phone number. If a `voice_application_sid` is
186
+ # present, we ignore all of the voice urls and use those set on the application.
187
+ # Setting a `voice_application_sid` will automatically delete your `trunk_sid` and
188
+ # vice versa.
189
+ # @param [Boolean] voice_caller_id_lookup Whether to lookup the caller's name from
190
+ # the CNAM database and post it to your app. Can be: `true` or `false` and
191
+ # defaults to `false`.
192
+ # @param [String] voice_fallback_method The HTTP method that we should use to call
193
+ # `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`.
194
+ # @param [String] voice_fallback_url The URL that we should call when an error
195
+ # occurs retrieving or executing the TwiML requested by `url`.
196
+ # @param [String] voice_method The HTTP method that we should use to call
197
+ # `voice_url`. Can be: `GET` or `POST` and defaults to `POST`.
198
+ # @param [String] voice_url The URL that we should call to answer a call to the
199
+ # new phone number. The `voice_url` will not be called if a
200
+ # `voice_application_sid` or a `trunk_sid` is set.
201
+ # @param [String] identity_sid The SID of the Identity resource that we should
202
+ # associate with the new phone number. Some regions require an Identity to meet
203
+ # local regulations.
204
+ # @param [String] address_sid The SID of the Address resource we should associate
205
+ # with the new phone number. Some regions require addresses to meet local
206
+ # regulations.
211
207
  # @return [TollFreeInstance] Newly created TollFreeInstance
212
208
  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
209
  data = Twilio::Values.of({
@@ -281,9 +277,9 @@ module Twilio
281
277
  # Initialize the TollFreeInstance
282
278
  # @param [Version] version Version that contains the resource
283
279
  # @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.
280
+ # @param [String] account_sid The SID of the
281
+ # [Account](https://www.twilio.com/docs/api/rest/account) that created this
282
+ # IncomingPhoneNumber resource.
287
283
  # @return [TollFreeInstance] TollFreeInstance
288
284
  def initialize(version, payload, account_sid: nil)
289
285
  super(version)
@@ -322,169 +318,169 @@ module Twilio
322
318
  end
323
319
 
324
320
  ##
325
- # @return [String] The unique id of the Account responsible for this phone number.
321
+ # @return [String] The SID of the Account that created the resource
326
322
  def account_sid
327
323
  @properties['account_sid']
328
324
  end
329
325
 
330
326
  ##
331
- # @return [String] The 34 character sid of the address associated with this number.
327
+ # @return [String] The SID of the Address resource associated with the phone number
332
328
  def address_sid
333
329
  @properties['address_sid']
334
330
  end
335
331
 
336
332
  ##
337
- # @return [toll_free.AddressRequirement] This indicates whether the phone number requires you or your customer to have an Address registered with Twilio.
333
+ # @return [toll_free.AddressRequirement] Whether the phone number requires an Address registered with Twilio.
338
334
  def address_requirements
339
335
  @properties['address_requirements']
340
336
  end
341
337
 
342
338
  ##
343
- # @return [String] Calls to this phone number will start a new TwiML session with this API version.
339
+ # @return [String] The API version used to start a new TwiML session
344
340
  def api_version
345
341
  @properties['api_version']
346
342
  end
347
343
 
348
344
  ##
349
- # @return [Boolean] Phone numbers new to the Twilio platform are marked as beta.
345
+ # @return [Boolean] Whether the phone number is new to the Twilio platform
350
346
  def beta
351
347
  @properties['beta']
352
348
  end
353
349
 
354
350
  ##
355
- # @return [String] This is a set of boolean properties that indicate whether a phone number can receive calls or messages.
351
+ # @return [String] Indicate if a phone can receive calls or messages
356
352
  def capabilities
357
353
  @properties['capabilities']
358
354
  end
359
355
 
360
356
  ##
361
- # @return [Time] The date that this resource was created, given as GMT RFC 2822 format.
357
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was created
362
358
  def date_created
363
359
  @properties['date_created']
364
360
  end
365
361
 
366
362
  ##
367
- # @return [Time] The date that this resource was last updated, given as GMT RFC 2822 format.
363
+ # @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
368
364
  def date_updated
369
365
  @properties['date_updated']
370
366
  end
371
367
 
372
368
  ##
373
- # @return [String] A human readable descriptive text for this resource, up to 64 characters long.
369
+ # @return [String] The string that you assigned to describe the resource
374
370
  def friendly_name
375
371
  @properties['friendly_name']
376
372
  end
377
373
 
378
374
  ##
379
- # @return [String] The identity_sid
375
+ # @return [String] The SID of the Identity resource associated with number
380
376
  def identity_sid
381
377
  @properties['identity_sid']
382
378
  end
383
379
 
384
380
  ##
385
- # @return [String] The incoming phone number.
381
+ # @return [String] The phone number in E.164 format
386
382
  def phone_number
387
383
  @properties['phone_number']
388
384
  end
389
385
 
390
386
  ##
391
- # @return [String] Twilio owned phone numbers are marked as twilio while hosted phone numbers are marked as hosted.
387
+ # @return [String] The phone number's origin. Can be twilio or hosted.
392
388
  def origin
393
389
  @properties['origin']
394
390
  end
395
391
 
396
392
  ##
397
- # @return [String] A 34 character string that uniquely identifies this resource.
393
+ # @return [String] The unique string that identifies the resource
398
394
  def sid
399
395
  @properties['sid']
400
396
  end
401
397
 
402
398
  ##
403
- # @return [String] The 34 character sid of the application Twilio should use to handle SMSs sent to this number.
399
+ # @return [String] The SID of the application that handles SMS messages sent to the phone number
404
400
  def sms_application_sid
405
401
  @properties['sms_application_sid']
406
402
  end
407
403
 
408
404
  ##
409
- # @return [String] The HTTP method Twilio will use when requesting the above URL.
405
+ # @return [String] The HTTP method used with sms_fallback_url
410
406
  def sms_fallback_method
411
407
  @properties['sms_fallback_method']
412
408
  end
413
409
 
414
410
  ##
415
- # @return [String] The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.
411
+ # @return [String] The URL that we call when an error occurs while retrieving or executing the TwiML
416
412
  def sms_fallback_url
417
413
  @properties['sms_fallback_url']
418
414
  end
419
415
 
420
416
  ##
421
- # @return [String] The HTTP method Twilio will use when making requests to the SmsUrl.
417
+ # @return [String] The HTTP method to use with sms_url
422
418
  def sms_method
423
419
  @properties['sms_method']
424
420
  end
425
421
 
426
422
  ##
427
- # @return [String] The URL Twilio will request when receiving an incoming SMS message to this number.
423
+ # @return [String] The URL we call when the phone number receives an incoming SMS message
428
424
  def sms_url
429
425
  @properties['sms_url']
430
426
  end
431
427
 
432
428
  ##
433
- # @return [String] The URL that Twilio will request to pass status parameters to your application.
429
+ # @return [String] The URL to send status information to your application
434
430
  def status_callback
435
431
  @properties['status_callback']
436
432
  end
437
433
 
438
434
  ##
439
- # @return [String] The HTTP method Twilio will use to make requests to the StatusCallback URL.
435
+ # @return [String] The HTTP method we use to call status_callback
440
436
  def status_callback_method
441
437
  @properties['status_callback_method']
442
438
  end
443
439
 
444
440
  ##
445
- # @return [String] The 34 character sid of the Trunk Twilio should use to handle phone calls to this number.
441
+ # @return [String] The SID of the Trunk that handles calls to the phone number
446
442
  def trunk_sid
447
443
  @properties['trunk_sid']
448
444
  end
449
445
 
450
446
  ##
451
- # @return [String] The URI for this resource, relative to https://api.
447
+ # @return [String] The URI of the resource, relative to `https://api.twilio.com`
452
448
  def uri
453
449
  @properties['uri']
454
450
  end
455
451
 
456
452
  ##
457
- # @return [String] The 34 character sid of the application Twilio should use to handle phone calls to this number.
453
+ # @return [String] The SID of the application that handles calls to the phone number
458
454
  def voice_application_sid
459
455
  @properties['voice_application_sid']
460
456
  end
461
457
 
462
458
  ##
463
- # @return [Boolean] Look up the caller's caller-ID name from the CNAM database.
459
+ # @return [Boolean] Whether to lookup the caller's name
464
460
  def voice_caller_id_lookup
465
461
  @properties['voice_caller_id_lookup']
466
462
  end
467
463
 
468
464
  ##
469
- # @return [String] The HTTP method Twilio will use when requesting the VoiceFallbackUrl.
465
+ # @return [String] The HTTP method used with voice_fallback_url
470
466
  def voice_fallback_method
471
467
  @properties['voice_fallback_method']
472
468
  end
473
469
 
474
470
  ##
475
- # @return [String] The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
471
+ # @return [String] The URL we call when an error occurs in TwiML
476
472
  def voice_fallback_url
477
473
  @properties['voice_fallback_url']
478
474
  end
479
475
 
480
476
  ##
481
- # @return [String] The HTTP method Twilio will use when requesting the above Url.
477
+ # @return [String] The HTTP method used with the voice_url
482
478
  def voice_method
483
479
  @properties['voice_method']
484
480
  end
485
481
 
486
482
  ##
487
- # @return [String] The URL Twilio will request when this phone number receives a call.
483
+ # @return [String] The URL we call when the phone number receives a call
488
484
  def voice_url
489
485
  @properties['voice_url']
490
486
  end