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.
- checksums.yaml +4 -4
- data/CHANGES.md +13 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api.rb +16 -13
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +85 -88
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +135 -146
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +21 -17
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +14 -8
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +150 -166
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +147 -160
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +147 -160
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +174 -79
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +51 -51
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +246 -251
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +31 -26
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +34 -26
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +109 -112
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +108 -112
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +108 -112
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +21 -11
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +7 -6
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +32 -25
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +36 -36
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +70 -66
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +14 -14
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +26 -23
- 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
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +12 -12
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +26 -23
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +11 -9
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +2 -1
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +56 -47
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +59 -47
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +59 -44
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +76 -74
- data/lib/twilio-ruby/rest/authy.rb +8 -8
- data/lib/twilio-ruby/rest/authy/v1.rb +15 -15
- data/lib/twilio-ruby/rest/client.rb +16 -13
- data/lib/twilio-ruby/rest/messaging.rb +15 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +23 -0
- data/lib/twilio-ruby/rest/messaging/v1/session.rb +482 -0
- data/lib/twilio-ruby/rest/messaging/v1/session/message.rb +434 -0
- data/lib/twilio-ruby/rest/messaging/v1/session/participant.rb +458 -0
- data/lib/twilio-ruby/rest/messaging/v1/webhook.rb +285 -0
- data/lib/twilio-ruby/rest/preview.rb +8 -8
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +3 -2
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -6
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +37 -21
- data/lib/twilio-ruby/rest/video/v1/recording.rb +12 -3
- data/lib/twilio-ruby/security/request_validator.rb +2 -2
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/messaging/v1/session/message_spec.rb +238 -0
- data/spec/integration/messaging/v1/session/participant_spec.rb +256 -0
- data/spec/integration/messaging/v1/session_spec.rb +223 -0
- data/spec/integration/messaging/v1/webhook_spec.rb +92 -0
- data/spec/integration/video/v1/composition_hook_spec.rb +1 -1
- data/spec/security/request_validator_spec.rb +5 -7
- 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
|
20
|
-
# [Account](https://www.twilio.com/docs/
|
21
|
-
#
|
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
|
36
|
-
#
|
37
|
-
# @param [String] friendly_name
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
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
|
68
|
-
#
|
69
|
-
# @param [String] friendly_name
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
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
|
116
|
-
#
|
117
|
-
# @param [String] friendly_name
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
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
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
# @param [String]
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
# `
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
196
|
-
#
|
197
|
-
#
|
198
|
-
# `
|
199
|
-
# @param [String]
|
200
|
-
#
|
201
|
-
# @param [String]
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
#
|
208
|
-
#
|
209
|
-
#
|
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
|
285
|
-
# [Account](https://www.twilio.com/docs/
|
286
|
-
#
|
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
|
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
|
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]
|
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]
|
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]
|
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]
|
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
|
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
|
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]
|
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
|
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
|
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]
|
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]
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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]
|
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
|
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
|
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
|
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
|
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
|
20
|
-
# [Account](https://www.twilio.com/docs/
|
21
|
-
#
|
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
|
36
|
-
#
|
37
|
-
# @param [String] friendly_name
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
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
|
68
|
-
#
|
69
|
-
# @param [String] friendly_name
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
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
|
116
|
-
#
|
117
|
-
# @param [String] friendly_name
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
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
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
# @param [String]
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
# `
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
#
|
195
|
-
#
|
196
|
-
#
|
197
|
-
#
|
198
|
-
# `
|
199
|
-
# @param [String]
|
200
|
-
#
|
201
|
-
# @param [String]
|
202
|
-
#
|
203
|
-
#
|
204
|
-
#
|
205
|
-
#
|
206
|
-
#
|
207
|
-
#
|
208
|
-
#
|
209
|
-
#
|
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
|
285
|
-
# [Account](https://www.twilio.com/docs/
|
286
|
-
#
|
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
|
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
|
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]
|
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]
|
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]
|
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]
|
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
|
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
|
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]
|
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
|
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
|
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]
|
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]
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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]
|
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
|
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
|
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
|
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
|
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
|