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.
- 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
@@ -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
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
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
|
120
|
-
#
|
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
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
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
|
277
|
-
#
|
278
|
-
#
|
279
|
-
#
|
280
|
-
#
|
281
|
-
#
|
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]
|
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
|
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
|
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]
|
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]
|
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]
|
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
|
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
|
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
|
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]
|
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
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
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
|
174
|
-
#
|
175
|
-
#
|
176
|
-
# @param [String]
|
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
|
229
|
-
#
|
230
|
-
#
|
231
|
-
#
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
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]
|
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
|
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
|
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]
|
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]
|
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
|
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]
|
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
|
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]
|
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
|
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 [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
|
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 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
|
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 LocalInstance 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,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
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
# `
|
180
|
-
# @param [String]
|
181
|
-
#
|
182
|
-
# @param [String]
|
183
|
-
#
|
184
|
-
# @param [String]
|
185
|
-
#
|
186
|
-
# @param [String]
|
187
|
-
#
|
188
|
-
# @param [String]
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
193
|
-
#
|
194
|
-
# and
|
195
|
-
#
|
196
|
-
# @param [
|
197
|
-
#
|
198
|
-
#
|
199
|
-
#
|
200
|
-
#
|
201
|
-
#
|
202
|
-
#
|
203
|
-
#
|
204
|
-
# `
|
205
|
-
# @param [String]
|
206
|
-
# the new phone number.
|
207
|
-
#
|
208
|
-
# @param [String]
|
209
|
-
#
|
210
|
-
#
|
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
|
285
|
-
# [Account](https://www.twilio.com/docs/
|
286
|
-
#
|
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
|
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
|
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]
|
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]
|
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]
|
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]
|
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
|
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
|
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]
|
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
|
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
|
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]
|
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]
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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]
|
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
|
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
|
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
|
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
|
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
|