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
@@ -148,8 +148,12 @@ module Twilio
|
|
148
148
|
##
|
149
149
|
# Initialize the AvailablePhoneNumberCountryContext
|
150
150
|
# @param [Version] version Version that contains the resource
|
151
|
-
# @param [String] account_sid The
|
152
|
-
#
|
151
|
+
# @param [String] account_sid The SID of the
|
152
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) requesting the available
|
153
|
+
# phone number Country resource.
|
154
|
+
# @param [String] country_code The
|
155
|
+
# [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of
|
156
|
+
# the country to fetch available phone number information about.
|
153
157
|
# @return [AvailablePhoneNumberCountryContext] AvailablePhoneNumberCountryContext
|
154
158
|
def initialize(version, account_sid, country_code)
|
155
159
|
super(version)
|
@@ -315,7 +319,9 @@ module Twilio
|
|
315
319
|
# @param [Hash] payload payload that contains response from Twilio
|
316
320
|
# @param [String] account_sid A 34 character string that uniquely identifies this
|
317
321
|
# resource.
|
318
|
-
# @param [String] country_code The
|
322
|
+
# @param [String] country_code The
|
323
|
+
# [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of
|
324
|
+
# the country to fetch available phone number information about.
|
319
325
|
# @return [AvailablePhoneNumberCountryInstance] AvailablePhoneNumberCountryInstance
|
320
326
|
def initialize(version, payload, account_sid: nil, country_code: nil)
|
321
327
|
super(version)
|
@@ -353,31 +359,31 @@ module Twilio
|
|
353
359
|
end
|
354
360
|
|
355
361
|
##
|
356
|
-
# @return [String] The ISO
|
362
|
+
# @return [String] The ISO-3166-1 country code of the country.
|
357
363
|
def country_code
|
358
364
|
@properties['country_code']
|
359
365
|
end
|
360
366
|
|
361
367
|
##
|
362
|
-
# @return [String] The country
|
368
|
+
# @return [String] The name of the country
|
363
369
|
def country
|
364
370
|
@properties['country']
|
365
371
|
end
|
366
372
|
|
367
373
|
##
|
368
|
-
# @return [String] The
|
374
|
+
# @return [String] The URI of the Country resource, relative to `https://api.twilio.com`
|
369
375
|
def uri
|
370
376
|
@properties['uri']
|
371
377
|
end
|
372
378
|
|
373
379
|
##
|
374
|
-
# @return [Boolean]
|
380
|
+
# @return [Boolean] Whether all phone numbers available in the country are new to the Twilio platform.
|
375
381
|
def beta
|
376
382
|
@properties['beta']
|
377
383
|
end
|
378
384
|
|
379
385
|
##
|
380
|
-
# @return [String]
|
386
|
+
# @return [String] A list of related resources identified by their relative URIs
|
381
387
|
def subresource_uris
|
382
388
|
@properties['subresource_uris']
|
383
389
|
end
|
@@ -16,9 +16,10 @@ 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
|
-
#
|
21
|
-
#
|
19
|
+
# @param [String] account_sid The account_sid
|
20
|
+
# @param [String] country_code The
|
21
|
+
# [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of
|
22
|
+
# the country.
|
22
23
|
# @return [LocalList] LocalList
|
23
24
|
def initialize(version, account_sid: nil, country_code: nil)
|
24
25
|
super(version)
|
@@ -32,63 +33,57 @@ module Twilio
|
|
32
33
|
# Lists LocalInstance records from the API as a list.
|
33
34
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
35
|
# memory before returning.
|
35
|
-
# @param [String] area_code
|
36
|
-
# Canada
|
37
|
-
# @param [String] contains
|
38
|
-
# characters are `
|
39
|
-
# single digit.
|
40
|
-
# 2](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-3)
|
41
|
-
# @param [Boolean] sms_enabled
|
42
|
-
#
|
43
|
-
# @param [Boolean] mms_enabled
|
44
|
-
#
|
45
|
-
# @param [Boolean] voice_enabled
|
46
|
-
#
|
47
|
-
# @param [Boolean] exclude_all_address_required
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
# `true` or
|
56
|
-
#
|
57
|
-
# @param [Boolean]
|
58
|
-
#
|
59
|
-
# [Address](https://www.twilio.com/docs/usage/api/addresses). Possible values are
|
60
|
-
# `true` or `false`. If not specified, the default is `false`, and results could
|
61
|
-
# include phone numbers with a foreign Address required.
|
62
|
-
# @param [Boolean] beta Include phone numbers new to the Twilio platform. Possible
|
63
|
-
# values are either `true` or `false`. Default is `true`.
|
36
|
+
# @param [String] area_code The area code of the phone numbers to read. Applies to
|
37
|
+
# only phone numbers in the US and Canada.
|
38
|
+
# @param [String] contains The pattern on which to match phone numbers. Valid
|
39
|
+
# characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any
|
40
|
+
# single digit. For examples, see [Example
|
41
|
+
# 2](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-3). If specified, this value must have at least two characters.
|
42
|
+
# @param [Boolean] sms_enabled Whether the phone numbers can receive text
|
43
|
+
# messages. Can be: `true` or `false`.
|
44
|
+
# @param [Boolean] mms_enabled Whether the phone numbers can receive MMS messages.
|
45
|
+
# Can be: `true` or `false`.
|
46
|
+
# @param [Boolean] voice_enabled Whether the phone numbers can receive calls. Can
|
47
|
+
# be: `true` or `false`.
|
48
|
+
# @param [Boolean] exclude_all_address_required Whether to exclude phone numbers
|
49
|
+
# that require an [Address](https://www.twilio.com/docs/usage/api/addresses). Can
|
50
|
+
# be: `true` or `false` and the default is `false`.
|
51
|
+
# @param [Boolean] exclude_local_address_required Whether to exclude phone numbers
|
52
|
+
# that require a local [Address](https://www.twilio.com/docs/usage/api/addresses).
|
53
|
+
# Can be: `true` or `false` and the default is `false`.
|
54
|
+
# @param [Boolean] exclude_foreign_address_required Whether to exclude phone
|
55
|
+
# numbers that require a foreign
|
56
|
+
# [Address](https://www.twilio.com/docs/usage/api/addresses). Can be: `true` or
|
57
|
+
# `false` and the default is `false`.
|
58
|
+
# @param [Boolean] beta Whether to read phone numbers that are new to the Twilio
|
59
|
+
# platform. Can be: `true` or `false` and the default is `true`.
|
64
60
|
# @param [String] near_number Given a phone number, find a geographically close
|
65
|
-
# number within `
|
66
|
-
#
|
61
|
+
# number within `distance` miles. Distance defaults to 25 miles. Applies to only
|
62
|
+
# phone numbers in the US and Canada.
|
67
63
|
# @param [String] near_lat_long Given a latitude/longitude pair `lat,long` find
|
68
|
-
# geographically close numbers within `
|
69
|
-
#
|
70
|
-
# @param [String] distance
|
71
|
-
#
|
72
|
-
#
|
64
|
+
# geographically close numbers within `distance` miles. Applies to only phone
|
65
|
+
# numbers in the US and Canada.
|
66
|
+
# @param [String] distance The search radius, in miles, for a `near_` query. Can
|
67
|
+
# be up to `500` and the default is `25`. Applies to only phone numbers in the US
|
68
|
+
# and Canada.
|
73
69
|
# @param [String] in_postal_code Limit results to a particular postal code. Given
|
74
|
-
# a phone number, search within the same postal code as that number.
|
75
|
-
# US and
|
76
|
-
# @param [String] in_region Limit results to a particular region
|
77
|
-
#
|
78
|
-
#
|
70
|
+
# a phone number, search within the same postal code as that number. Applies to
|
71
|
+
# only phone numbers in the US and Canada.
|
72
|
+
# @param [String] in_region Limit results to a particular region, state, or
|
73
|
+
# province. Given a phone number, search within the same region as that number.
|
74
|
+
# Applies to only phone numbers in the US and Canada.
|
79
75
|
# @param [String] in_rate_center Limit results to a specific rate center, or given
|
80
76
|
# a phone number search within the same rate center as that number. Requires
|
81
|
-
#
|
82
|
-
# @param [String] in_lata Limit results to a specific
|
77
|
+
# `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
78
|
+
# @param [String] in_lata Limit results to a specific local access and transport
|
83
79
|
# area ([LATA](http://en.wikipedia.org/wiki/Local_access_and_transport_area)).
|
84
80
|
# Given a phone number, search within the same
|
85
81
|
# [LATA](http://en.wikipedia.org/wiki/Local_access_and_transport_area) as that
|
86
|
-
# number.
|
87
|
-
# @param [String] in_locality Limit results to a particular locality
|
88
|
-
# Given a phone number, search within the same Locality as that number.
|
89
|
-
#
|
90
|
-
#
|
91
|
-
# receive faxes. Possible values are `true` or `false`.
|
82
|
+
# number. Applies to only phone numbers in the US and Canada.
|
83
|
+
# @param [String] in_locality Limit results to a particular locality or city.
|
84
|
+
# Given a phone number, search within the same Locality as that number.
|
85
|
+
# @param [Boolean] fax_enabled Whether the phone numbers can receive faxes. Can
|
86
|
+
# be: `true` or `false`.
|
92
87
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
93
88
|
# guarantees to never return more than limit. Default is no limit
|
94
89
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -125,63 +120,57 @@ module Twilio
|
|
125
120
|
# Streams LocalInstance records from the API as an Enumerable.
|
126
121
|
# This operation lazily loads records as efficiently as possible until the limit
|
127
122
|
# is reached.
|
128
|
-
# @param [String] area_code
|
129
|
-
# Canada
|
130
|
-
# @param [String] contains
|
131
|
-
# characters are `
|
132
|
-
# single digit.
|
133
|
-
# 2](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-3)
|
134
|
-
# @param [Boolean] sms_enabled
|
135
|
-
#
|
136
|
-
# @param [Boolean] mms_enabled
|
137
|
-
#
|
138
|
-
# @param [Boolean] voice_enabled
|
139
|
-
#
|
140
|
-
# @param [Boolean] exclude_all_address_required
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
# `true` or
|
149
|
-
#
|
150
|
-
# @param [Boolean]
|
151
|
-
#
|
152
|
-
# [Address](https://www.twilio.com/docs/usage/api/addresses). Possible values are
|
153
|
-
# `true` or `false`. If not specified, the default is `false`, and results could
|
154
|
-
# include phone numbers with a foreign Address required.
|
155
|
-
# @param [Boolean] beta Include phone numbers new to the Twilio platform. Possible
|
156
|
-
# values are either `true` or `false`. Default is `true`.
|
123
|
+
# @param [String] area_code The area code of the phone numbers to read. Applies to
|
124
|
+
# only phone numbers in the US and Canada.
|
125
|
+
# @param [String] contains The pattern on which to match phone numbers. Valid
|
126
|
+
# characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any
|
127
|
+
# single digit. For examples, see [Example
|
128
|
+
# 2](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-3). If specified, this value must have at least two characters.
|
129
|
+
# @param [Boolean] sms_enabled Whether the phone numbers can receive text
|
130
|
+
# messages. Can be: `true` or `false`.
|
131
|
+
# @param [Boolean] mms_enabled Whether the phone numbers can receive MMS messages.
|
132
|
+
# Can be: `true` or `false`.
|
133
|
+
# @param [Boolean] voice_enabled Whether the phone numbers can receive calls. Can
|
134
|
+
# be: `true` or `false`.
|
135
|
+
# @param [Boolean] exclude_all_address_required Whether to exclude phone numbers
|
136
|
+
# that require an [Address](https://www.twilio.com/docs/usage/api/addresses). Can
|
137
|
+
# be: `true` or `false` and the default is `false`.
|
138
|
+
# @param [Boolean] exclude_local_address_required Whether to exclude phone numbers
|
139
|
+
# that require a local [Address](https://www.twilio.com/docs/usage/api/addresses).
|
140
|
+
# Can be: `true` or `false` and the default is `false`.
|
141
|
+
# @param [Boolean] exclude_foreign_address_required Whether to exclude phone
|
142
|
+
# numbers that require a foreign
|
143
|
+
# [Address](https://www.twilio.com/docs/usage/api/addresses). Can be: `true` or
|
144
|
+
# `false` and the default is `false`.
|
145
|
+
# @param [Boolean] beta Whether to read phone numbers that are new to the Twilio
|
146
|
+
# platform. Can be: `true` or `false` and the default is `true`.
|
157
147
|
# @param [String] near_number Given a phone number, find a geographically close
|
158
|
-
# number within `
|
159
|
-
#
|
148
|
+
# number within `distance` miles. Distance defaults to 25 miles. Applies to only
|
149
|
+
# phone numbers in the US and Canada.
|
160
150
|
# @param [String] near_lat_long Given a latitude/longitude pair `lat,long` find
|
161
|
-
# geographically close numbers within `
|
162
|
-
#
|
163
|
-
# @param [String] distance
|
164
|
-
#
|
165
|
-
#
|
151
|
+
# geographically close numbers within `distance` miles. Applies to only phone
|
152
|
+
# numbers in the US and Canada.
|
153
|
+
# @param [String] distance The search radius, in miles, for a `near_` query. Can
|
154
|
+
# be up to `500` and the default is `25`. Applies to only phone numbers in the US
|
155
|
+
# and Canada.
|
166
156
|
# @param [String] in_postal_code Limit results to a particular postal code. Given
|
167
|
-
# a phone number, search within the same postal code as that number.
|
168
|
-
# US and
|
169
|
-
# @param [String] in_region Limit results to a particular region
|
170
|
-
#
|
171
|
-
#
|
157
|
+
# a phone number, search within the same postal code as that number. Applies to
|
158
|
+
# only phone numbers in the US and Canada.
|
159
|
+
# @param [String] in_region Limit results to a particular region, state, or
|
160
|
+
# province. Given a phone number, search within the same region as that number.
|
161
|
+
# Applies to only phone numbers in the US and Canada.
|
172
162
|
# @param [String] in_rate_center Limit results to a specific rate center, or given
|
173
163
|
# a phone number search within the same rate center as that number. Requires
|
174
|
-
#
|
175
|
-
# @param [String] in_lata Limit results to a specific
|
164
|
+
# `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
165
|
+
# @param [String] in_lata Limit results to a specific local access and transport
|
176
166
|
# area ([LATA](http://en.wikipedia.org/wiki/Local_access_and_transport_area)).
|
177
167
|
# Given a phone number, search within the same
|
178
168
|
# [LATA](http://en.wikipedia.org/wiki/Local_access_and_transport_area) as that
|
179
|
-
# number.
|
180
|
-
# @param [String] in_locality Limit results to a particular locality
|
181
|
-
# Given a phone number, search within the same Locality as that number.
|
182
|
-
#
|
183
|
-
#
|
184
|
-
# receive faxes. Possible values are `true` or `false`.
|
169
|
+
# number. Applies to only phone numbers in the US and Canada.
|
170
|
+
# @param [String] in_locality Limit results to a particular locality or city.
|
171
|
+
# Given a phone number, search within the same Locality as that number.
|
172
|
+
# @param [Boolean] fax_enabled Whether the phone numbers can receive faxes. Can
|
173
|
+
# be: `true` or `false`.
|
185
174
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
186
175
|
# guarantees to never return more than limit. Default is no limit.
|
187
176
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -234,63 +223,57 @@ module Twilio
|
|
234
223
|
##
|
235
224
|
# Retrieve a single page of LocalInstance records from the API.
|
236
225
|
# Request is executed immediately.
|
237
|
-
# @param [String] area_code
|
238
|
-
# Canada
|
239
|
-
# @param [String] contains
|
240
|
-
# characters are `
|
241
|
-
# single digit.
|
242
|
-
# 2](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-3)
|
243
|
-
# @param [Boolean] sms_enabled
|
244
|
-
#
|
245
|
-
# @param [Boolean] mms_enabled
|
246
|
-
#
|
247
|
-
# @param [Boolean] voice_enabled
|
248
|
-
#
|
249
|
-
# @param [Boolean] exclude_all_address_required
|
250
|
-
#
|
251
|
-
#
|
252
|
-
#
|
253
|
-
#
|
254
|
-
#
|
255
|
-
#
|
256
|
-
#
|
257
|
-
# `true` or
|
258
|
-
#
|
259
|
-
# @param [Boolean]
|
260
|
-
#
|
261
|
-
# [Address](https://www.twilio.com/docs/usage/api/addresses). Possible values are
|
262
|
-
# `true` or `false`. If not specified, the default is `false`, and results could
|
263
|
-
# include phone numbers with a foreign Address required.
|
264
|
-
# @param [Boolean] beta Include phone numbers new to the Twilio platform. Possible
|
265
|
-
# values are either `true` or `false`. Default is `true`.
|
226
|
+
# @param [String] area_code The area code of the phone numbers to read. Applies to
|
227
|
+
# only phone numbers in the US and Canada.
|
228
|
+
# @param [String] contains The pattern on which to match phone numbers. Valid
|
229
|
+
# characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any
|
230
|
+
# single digit. For examples, see [Example
|
231
|
+
# 2](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/api/rest/available-phone-numbers#local-get-basic-example-3). If specified, this value must have at least two characters.
|
232
|
+
# @param [Boolean] sms_enabled Whether the phone numbers can receive text
|
233
|
+
# messages. Can be: `true` or `false`.
|
234
|
+
# @param [Boolean] mms_enabled Whether the phone numbers can receive MMS messages.
|
235
|
+
# Can be: `true` or `false`.
|
236
|
+
# @param [Boolean] voice_enabled Whether the phone numbers can receive calls. Can
|
237
|
+
# be: `true` or `false`.
|
238
|
+
# @param [Boolean] exclude_all_address_required Whether to exclude phone numbers
|
239
|
+
# that require an [Address](https://www.twilio.com/docs/usage/api/addresses). Can
|
240
|
+
# be: `true` or `false` and the default is `false`.
|
241
|
+
# @param [Boolean] exclude_local_address_required Whether to exclude phone numbers
|
242
|
+
# that require a local [Address](https://www.twilio.com/docs/usage/api/addresses).
|
243
|
+
# Can be: `true` or `false` and the default is `false`.
|
244
|
+
# @param [Boolean] exclude_foreign_address_required Whether to exclude phone
|
245
|
+
# numbers that require a foreign
|
246
|
+
# [Address](https://www.twilio.com/docs/usage/api/addresses). Can be: `true` or
|
247
|
+
# `false` and the default is `false`.
|
248
|
+
# @param [Boolean] beta Whether to read phone numbers that are new to the Twilio
|
249
|
+
# platform. Can be: `true` or `false` and the default is `true`.
|
266
250
|
# @param [String] near_number Given a phone number, find a geographically close
|
267
|
-
# number within `
|
268
|
-
#
|
251
|
+
# number within `distance` miles. Distance defaults to 25 miles. Applies to only
|
252
|
+
# phone numbers in the US and Canada.
|
269
253
|
# @param [String] near_lat_long Given a latitude/longitude pair `lat,long` find
|
270
|
-
# geographically close numbers within `
|
271
|
-
#
|
272
|
-
# @param [String] distance
|
273
|
-
#
|
274
|
-
#
|
254
|
+
# geographically close numbers within `distance` miles. Applies to only phone
|
255
|
+
# numbers in the US and Canada.
|
256
|
+
# @param [String] distance The search radius, in miles, for a `near_` query. Can
|
257
|
+
# be up to `500` and the default is `25`. Applies to only phone numbers in the US
|
258
|
+
# and Canada.
|
275
259
|
# @param [String] in_postal_code Limit results to a particular postal code. Given
|
276
|
-
# a phone number, search within the same postal code as that number.
|
277
|
-
# US and
|
278
|
-
# @param [String] in_region Limit results to a particular region
|
279
|
-
#
|
280
|
-
#
|
260
|
+
# a phone number, search within the same postal code as that number. Applies to
|
261
|
+
# only phone numbers in the US and Canada.
|
262
|
+
# @param [String] in_region Limit results to a particular region, state, or
|
263
|
+
# province. Given a phone number, search within the same region as that number.
|
264
|
+
# Applies to only phone numbers in the US and Canada.
|
281
265
|
# @param [String] in_rate_center Limit results to a specific rate center, or given
|
282
266
|
# a phone number search within the same rate center as that number. Requires
|
283
|
-
#
|
284
|
-
# @param [String] in_lata Limit results to a specific
|
267
|
+
# `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
268
|
+
# @param [String] in_lata Limit results to a specific local access and transport
|
285
269
|
# area ([LATA](http://en.wikipedia.org/wiki/Local_access_and_transport_area)).
|
286
270
|
# Given a phone number, search within the same
|
287
271
|
# [LATA](http://en.wikipedia.org/wiki/Local_access_and_transport_area) as that
|
288
|
-
# number.
|
289
|
-
# @param [String] in_locality Limit results to a particular locality
|
290
|
-
# Given a phone number, search within the same Locality as that number.
|
291
|
-
#
|
292
|
-
#
|
293
|
-
# receive faxes. Possible values are `true` or `false`.
|
272
|
+
# number. Applies to only phone numbers in the US and Canada.
|
273
|
+
# @param [String] in_locality Limit results to a particular locality or city.
|
274
|
+
# Given a phone number, search within the same Locality as that number.
|
275
|
+
# @param [Boolean] fax_enabled Whether the phone numbers can receive faxes. Can
|
276
|
+
# be: `true` or `false`.
|
294
277
|
# @param [String] page_token PageToken provided by the API
|
295
278
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
296
279
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -386,9 +369,10 @@ module Twilio
|
|
386
369
|
# Initialize the LocalInstance
|
387
370
|
# @param [Version] version Version that contains the resource
|
388
371
|
# @param [Hash] payload payload that contains response from Twilio
|
389
|
-
# @param [String] account_sid The
|
390
|
-
#
|
391
|
-
#
|
372
|
+
# @param [String] account_sid The account_sid
|
373
|
+
# @param [String] country_code The
|
374
|
+
# [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of
|
375
|
+
# the country.
|
392
376
|
# @return [LocalInstance] LocalInstance
|
393
377
|
def initialize(version, payload, account_sid: nil, country_code: nil)
|
394
378
|
super(version)
|
@@ -412,79 +396,79 @@ module Twilio
|
|
412
396
|
end
|
413
397
|
|
414
398
|
##
|
415
|
-
# @return [String] A
|
399
|
+
# @return [String] A formatted version of the phone number
|
416
400
|
def friendly_name
|
417
401
|
@properties['friendly_name']
|
418
402
|
end
|
419
403
|
|
420
404
|
##
|
421
|
-
# @return [String] The phone number
|
405
|
+
# @return [String] The phone number in E.164 format
|
422
406
|
def phone_number
|
423
407
|
@properties['phone_number']
|
424
408
|
end
|
425
409
|
|
426
410
|
##
|
427
|
-
# @return [String] The LATA of this phone number
|
411
|
+
# @return [String] The LATA of this phone number
|
428
412
|
def lata
|
429
413
|
@properties['lata']
|
430
414
|
end
|
431
415
|
|
432
416
|
##
|
433
|
-
# @return [String] The locality
|
417
|
+
# @return [String] The locality or city of this phone number's location
|
434
418
|
def locality
|
435
419
|
@properties['locality']
|
436
420
|
end
|
437
421
|
|
438
422
|
##
|
439
|
-
# @return [String] The rate center of this phone number
|
423
|
+
# @return [String] The rate center of this phone number
|
440
424
|
def rate_center
|
441
425
|
@properties['rate_center']
|
442
426
|
end
|
443
427
|
|
444
428
|
##
|
445
|
-
# @return [String] The latitude
|
429
|
+
# @return [String] The latitude of this phone number's location
|
446
430
|
def latitude
|
447
431
|
@properties['latitude']
|
448
432
|
end
|
449
433
|
|
450
434
|
##
|
451
|
-
# @return [String] The longitude
|
435
|
+
# @return [String] The longitude of this phone number's location
|
452
436
|
def longitude
|
453
437
|
@properties['longitude']
|
454
438
|
end
|
455
439
|
|
456
440
|
##
|
457
|
-
# @return [String] The two-letter state or province abbreviation of this phone number
|
441
|
+
# @return [String] The two-letter state or province abbreviation of this phone number's location
|
458
442
|
def region
|
459
443
|
@properties['region']
|
460
444
|
end
|
461
445
|
|
462
446
|
##
|
463
|
-
# @return [String] The postal code of this phone number
|
447
|
+
# @return [String] The postal or ZIP code of this phone number's location
|
464
448
|
def postal_code
|
465
449
|
@properties['postal_code']
|
466
450
|
end
|
467
451
|
|
468
452
|
##
|
469
|
-
# @return [String] The ISO country code of this phone number
|
453
|
+
# @return [String] The ISO country code of this phone number
|
470
454
|
def iso_country
|
471
455
|
@properties['iso_country']
|
472
456
|
end
|
473
457
|
|
474
458
|
##
|
475
|
-
# @return [String]
|
459
|
+
# @return [String] The type of Address resource the phone number requires
|
476
460
|
def address_requirements
|
477
461
|
@properties['address_requirements']
|
478
462
|
end
|
479
463
|
|
480
464
|
##
|
481
|
-
# @return [Boolean]
|
465
|
+
# @return [Boolean] Whether the phone number is new to the Twilio platform
|
482
466
|
def beta
|
483
467
|
@properties['beta']
|
484
468
|
end
|
485
469
|
|
486
470
|
##
|
487
|
-
# @return [String]
|
471
|
+
# @return [String] Whether a phone number can receive calls or messages
|
488
472
|
def capabilities
|
489
473
|
@properties['capabilities']
|
490
474
|
end
|