twilio-ruby 5.26.0 → 5.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +5 -6
- data/CHANGES.md +21 -0
- data/README.md +28 -19
- data/VERSIONS.md +9 -10
- data/lib/twilio-ruby.rb +4 -2
- data/lib/twilio-ruby/framework/domain.rb +1 -1
- data/lib/twilio-ruby/http/http_client.rb +9 -3
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -5
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +6 -6
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_ip_access_control_list_mapping.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +2 -2
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +1 -1
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service.rb +12 -6
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +12 -12
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +17 -16
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +35 -35
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +8 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +16 -12
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +12 -12
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +13 -11
- data/lib/twilio-ruby/rest/client.rb +2 -2
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +4 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +4 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +4 -4
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +4 -4
- data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +4 -4
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +11 -5
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +12 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +12 -12
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +17 -16
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +35 -35
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +8 -8
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +16 -12
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +12 -12
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +13 -11
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -5
- data/lib/twilio-ruby/rest/monitor/v1.rb +1 -1
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +16 -16
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
- data/lib/twilio-ruby/security/request_validator.rb +1 -1
- data/lib/twilio-ruby/util/configuration.rb +10 -5
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/http/http_client_spec.rb +2 -2
- data/spec/integration/lookups/v1/phone_number_spec.rb +1 -1
- data/spec/integration/monitor/v1/alert_spec.rb +5 -28
- data/spec/integration/pricing/v1/voice/number_spec.rb +1 -1
- data/spec/integration/pricing/v2/voice/number_spec.rb +1 -1
- data/spec/rest/client_spec.rb +22 -0
- data/spec/twilio_spec.rb +3 -1
- data/spec/util/configuration_spec.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: baa7dce555a4ad4de4227461d7a72ec110497c8b
|
4
|
+
data.tar.gz: bbc2be81ddf4ba27d70771882365d9a7e6f37e1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5346f6f6ca92b82f445cd38581da67d1db3fd3c4dd23b8e05c14a59473ce2bf6e4cc523b070bd747d01391ec14bb9c2219a4383eeba01878f7dc08c83e1edf0
|
7
|
+
data.tar.gz: 9c4308bdc71dc730ec1aee203759aa5d0c00f56889efe315d37b0e95cef5a0d0cc6e338923afd0ebbdba1fd6fcd0c0a511a64a2c31a733bfc60bae34d1b353eb
|
data/.travis.yml
CHANGED
@@ -5,11 +5,10 @@ bundler_args: --without development
|
|
5
5
|
|
6
6
|
rvm:
|
7
7
|
- ruby-head
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
- 2.
|
11
|
-
-
|
12
|
-
- jruby-9.1.9.0
|
8
|
+
- 2.6
|
9
|
+
- 2.5
|
10
|
+
- 2.4
|
11
|
+
- jruby
|
13
12
|
|
14
13
|
services:
|
15
14
|
- docker
|
@@ -26,4 +25,4 @@ deploy:
|
|
26
25
|
skip_cleanup: true
|
27
26
|
on:
|
28
27
|
tags: true
|
29
|
-
rvm: "2.4
|
28
|
+
rvm: "2.4"
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2019-09-18] Version 5.27.0
|
5
|
+
----------------------------
|
6
|
+
**Library**
|
7
|
+
- [PR #470](https://github.com/twilio/twilio-ruby/pull/470): breaking: Catch and wrap Faraday client errors. Thanks to [@childish-sambino](https://github.com/childish-sambino)! **(breaking change)**
|
8
|
+
- [PR #471](https://github.com/twilio/twilio-ruby/pull/471): Drop support for Ruby < 2.4 and add 2.6. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
9
|
+
- [PR #468](https://github.com/twilio/twilio-ruby/pull/468): Add URI encoding for phone numbers. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
10
|
+
- [PR #469](https://github.com/twilio/twilio-ruby/pull/469): Add TwiML FaxResponse require to top-level file. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
11
|
+
- [PR #450](https://github.com/twilio/twilio-ruby/pull/450): Update encode64 to strict_encode64 in RequestValidator#build_signature_for. Thanks to [@kitallis](https://github.com/kitallis)!
|
12
|
+
- [PR #467](https://github.com/twilio/twilio-ruby/pull/467): Add a global configuration for the HTTP client. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
13
|
+
- [PR #466](https://github.com/twilio/twilio-ruby/pull/466): Use the 'base_url' instead of the 'host' for HTTP client URL. Thanks to [@childish-sambino](https://github.com/childish-sambino)!
|
14
|
+
|
15
|
+
**Numbers**
|
16
|
+
- Add v2 of the Identites API
|
17
|
+
|
18
|
+
**Preview**
|
19
|
+
- Changed authentication method for SDK Trusted Comms endpoints: `/CPS`, `/CurrentCall`, and `/Devices`. Please use `Authorization: Bearer <xCNAM JWT>` **(breaking change)**
|
20
|
+
|
21
|
+
**Voice**
|
22
|
+
- Add Recordings endpoints
|
23
|
+
|
24
|
+
|
4
25
|
[2019-09-04] Version 5.26.0
|
5
26
|
----------------------------
|
6
27
|
**Library**
|
data/README.md
CHANGED
@@ -29,13 +29,13 @@ in-line code documentation here in the library.
|
|
29
29
|
To install using [Bundler][bundler] grab the latest stable version:
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
gem 'twilio-ruby', '~> 5.
|
32
|
+
gem 'twilio-ruby', '~> 5.27.0'
|
33
33
|
```
|
34
34
|
|
35
35
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
36
36
|
|
37
37
|
```bash
|
38
|
-
gem install twilio-ruby -v 5.
|
38
|
+
gem install twilio-ruby -v 5.27.0
|
39
39
|
```
|
40
40
|
|
41
41
|
To build and install the development branch yourself from the latest source:
|
@@ -46,6 +46,10 @@ cd twilio-ruby
|
|
46
46
|
make install
|
47
47
|
```
|
48
48
|
|
49
|
+
## Versions
|
50
|
+
|
51
|
+
`twilio-ruby` uses a modified version of [Semantic Versioning](https://semver.org) for all changes. [See this document](VERSIONS.md) for details.
|
52
|
+
|
49
53
|
### Migration from 4.x
|
50
54
|
|
51
55
|
[Upgrade Guide][upgrade]
|
@@ -78,7 +82,7 @@ auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
|
78
82
|
### Make a Call
|
79
83
|
|
80
84
|
```ruby
|
81
|
-
@client.
|
85
|
+
@client.calls.create(
|
82
86
|
from: '+14159341234',
|
83
87
|
to: '+16105557069',
|
84
88
|
url: 'http://example.com'
|
@@ -88,7 +92,7 @@ auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
|
88
92
|
### Send an SMS
|
89
93
|
|
90
94
|
```ruby
|
91
|
-
@client.
|
95
|
+
@client.messages.create(
|
92
96
|
from: '+14159341234',
|
93
97
|
to: '+16105557069',
|
94
98
|
body: 'Hey there!'
|
@@ -98,7 +102,7 @@ auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
|
98
102
|
### List your SMS Messages
|
99
103
|
|
100
104
|
```ruby
|
101
|
-
@client.
|
105
|
+
@client.messages.list(limit: 20)
|
102
106
|
```
|
103
107
|
|
104
108
|
### Fetch a single SMS message by Sid
|
@@ -106,22 +110,30 @@ auth_token = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
|
106
110
|
```ruby
|
107
111
|
# put the message sid you want to retrieve here:
|
108
112
|
message_sid = 'SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
109
|
-
@client.
|
113
|
+
@client.messages(message_sid).fetch
|
110
114
|
```
|
111
115
|
|
112
116
|
### Customizing your HTTP Client
|
113
117
|
|
114
|
-
twilio-ruby uses [Faraday][faraday] to make HTTP requests. You can tell
|
115
|
-
Twilio::REST::Client to use any of the Faraday adapters like so:
|
118
|
+
`twilio-ruby` uses [Faraday][faraday] to make HTTP requests. You can tell `Twilio::REST::Client` to use any of the Faraday adapters like so:
|
116
119
|
|
117
120
|
```ruby
|
118
121
|
@client.http_client.adapter = :typhoeus
|
119
122
|
```
|
120
123
|
|
121
|
-
|
124
|
+
### Handling Errors
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
begin
|
128
|
+
messages = @client.messages.list(limit: 20)
|
129
|
+
rescue Twilio::REST::TwilioError => e
|
130
|
+
puts e.message
|
131
|
+
end
|
132
|
+
```
|
133
|
+
|
134
|
+
### Getting Started With Client Capability Tokens
|
122
135
|
|
123
|
-
If you just need to generate a Capability Token for use with Twilio Client, you
|
124
|
-
can do this:
|
136
|
+
If you just need to generate a Capability Token for use with Twilio Client, you can do this:
|
125
137
|
|
126
138
|
```ruby
|
127
139
|
require 'twilio-ruby'
|
@@ -145,8 +157,7 @@ capability.add_scope(incoming_scope)
|
|
145
157
|
@token = capability.to_s
|
146
158
|
```
|
147
159
|
|
148
|
-
There is a slightly more detailed document in the [Capability][capability]
|
149
|
-
section of the wiki.
|
160
|
+
There is a slightly more detailed document in the [Capability][capability] section of the wiki.
|
150
161
|
|
151
162
|
### Generating TwiML
|
152
163
|
|
@@ -182,13 +193,11 @@ This will print the following (except for the whitespace):
|
|
182
193
|
|
183
194
|
## Supported Ruby Versions
|
184
195
|
|
185
|
-
This library supports and is [tested against][travis] the following Ruby
|
186
|
-
implementations:
|
196
|
+
This library supports and is [tested against][travis] the following Ruby implementations:
|
187
197
|
|
188
|
-
- Ruby 2.
|
189
|
-
- Ruby 2.
|
190
|
-
- Ruby 2.
|
191
|
-
- Ruby 2.2.0
|
198
|
+
- Ruby 2.6.X
|
199
|
+
- Ruby 2.5.X
|
200
|
+
- Ruby 2.4.X
|
192
201
|
|
193
202
|
[apidocs]: https://www.twilio.com/docs/api
|
194
203
|
[twiml]: https://www.twilio.com/docs/api/twiml
|
data/VERSIONS.md
CHANGED
@@ -5,11 +5,11 @@ all changes to the helper library. It is strongly encouraged that you pin at
|
|
5
5
|
least the major version and potentially the minor version to avoid pulling in
|
6
6
|
breaking changes.
|
7
7
|
|
8
|
-
Semantic Versions take the form of `MAJOR
|
8
|
+
Semantic Versions take the form of `MAJOR.MINOR.PATCH`
|
9
9
|
|
10
|
-
When bugs are fixed in the library in a backwards
|
10
|
+
When bugs are fixed in the library in a backwards-compatible way, the `PATCH`
|
11
11
|
level will be incremented by one. When new features are added to the library
|
12
|
-
in a backwards
|
12
|
+
in a backwards-compatible way, the `PATCH` level will be incremented by one.
|
13
13
|
`PATCH` changes should _not_ break your code and are generally safe for upgrade.
|
14
14
|
|
15
15
|
When a new large feature set comes online or a small breaking change is
|
@@ -19,8 +19,8 @@ change for upgrade. These backwards-incompatible changes will generally be
|
|
19
19
|
limited to a small number of function signature changes.
|
20
20
|
|
21
21
|
The `MAJOR` version is used to indicate the family of technology represented by
|
22
|
-
the helper library. Breaking changes that
|
23
|
-
will
|
22
|
+
the helper library. Breaking changes that require extensive reworking of code
|
23
|
+
will cause the `MAJOR` version to be incremented by one, and the `MINOR` and
|
24
24
|
`PATCH` versions will be reset to zero. Twilio understands that this can be very
|
25
25
|
disruptive, so we will only introduce this type of breaking change when
|
26
26
|
absolutely necessary. New `MAJOR` versions will be communicated in advance with
|
@@ -28,9 +28,8 @@ absolutely necessary. New `MAJOR` versions will be communicated in advance with
|
|
28
28
|
|
29
29
|
## Supported Versions
|
30
30
|
|
31
|
-
`twilio-ruby`
|
32
|
-
functionality will only be added to
|
33
|
-
|
34
|
-
features.
|
31
|
+
Only the current `MAJOR` version of `twilio-ruby` is supported. New
|
32
|
+
features, functionality, bug fixes, and security updates will only be added to
|
33
|
+
the current `MAJOR` version.
|
35
34
|
|
36
|
-
[semver]:
|
35
|
+
[semver]: https://semver.org
|
data/lib/twilio-ruby.rb
CHANGED
@@ -23,8 +23,9 @@ require 'twilio-ruby/security/request_validator'
|
|
23
23
|
require 'twilio-ruby/util/configuration'
|
24
24
|
|
25
25
|
require 'twilio-ruby/twiml/twiml'
|
26
|
-
require 'twilio-ruby/twiml/
|
26
|
+
require 'twilio-ruby/twiml/fax_response'
|
27
27
|
require 'twilio-ruby/twiml/messaging_response'
|
28
|
+
require 'twilio-ruby/twiml/voice_response'
|
28
29
|
|
29
30
|
Dir[File.dirname(__FILE__) + '/twilio-ruby/http/**/*.rb'].each do |file|
|
30
31
|
require file
|
@@ -45,7 +46,7 @@ end
|
|
45
46
|
module Twilio
|
46
47
|
extend SingleForwardable
|
47
48
|
|
48
|
-
def_delegators :configuration, :account_sid, :auth_token
|
49
|
+
def_delegators :configuration, :account_sid, :auth_token, :http_client
|
49
50
|
|
50
51
|
##
|
51
52
|
# Pre-configure with account SID and auth token so that you don't need to
|
@@ -59,5 +60,6 @@ module Twilio
|
|
59
60
|
def self.configuration
|
60
61
|
@configuration ||= Util::Configuration.new
|
61
62
|
end
|
63
|
+
|
62
64
|
private_class_method :configuration
|
63
65
|
end
|
@@ -36,10 +36,8 @@ module Twilio
|
|
36
36
|
|
37
37
|
@last_request = request
|
38
38
|
@last_response = nil
|
39
|
-
response = @connection.send(request.method.downcase.to_sym,
|
40
|
-
request.url,
|
41
|
-
request.method == 'GET' ? request.params : request.data)
|
42
39
|
|
40
|
+
response = send(request)
|
43
41
|
if response.body && !response.body.empty?
|
44
42
|
object = response.body
|
45
43
|
elsif response.status == 400
|
@@ -52,6 +50,14 @@ module Twilio
|
|
52
50
|
twilio_response
|
53
51
|
end
|
54
52
|
|
53
|
+
def send(request)
|
54
|
+
@connection.send(request.method.downcase.to_sym,
|
55
|
+
request.url,
|
56
|
+
request.method == 'GET' ? request.params : request.data)
|
57
|
+
rescue Faraday::ClientError => e
|
58
|
+
raise Twilio::REST::TwilioError, e
|
59
|
+
end
|
60
|
+
|
55
61
|
def request(host, port, method, url, params = {}, data = {}, headers = {}, auth = nil, timeout = nil)
|
56
62
|
request = Twilio::Request.new(host, port, method, url, params, data, headers, auth, timeout)
|
57
63
|
_request(request)
|
@@ -16,7 +16,7 @@ module Twilio
|
|
16
16
|
# Initialize the AddressList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
18
|
# @param [String] account_sid The SID of the
|
19
|
-
# [Account](https://www.twilio.com/docs/api/
|
19
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for
|
20
20
|
# the Address resource.
|
21
21
|
# @return [AddressList] AddressList
|
22
22
|
def initialize(version, account_sid: nil)
|
@@ -222,7 +222,7 @@ module Twilio
|
|
222
222
|
# Initialize the AddressContext
|
223
223
|
# @param [Version] version Version that contains the resource
|
224
224
|
# @param [String] account_sid The SID of the
|
225
|
-
# [Account](https://www.twilio.com/docs/api/
|
225
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for
|
226
226
|
# the Address resource to fetch.
|
227
227
|
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
228
228
|
# Address resource to fetch.
|
@@ -334,7 +334,7 @@ module Twilio
|
|
334
334
|
# @param [Version] version Version that contains the resource
|
335
335
|
# @param [Hash] payload payload that contains response from Twilio
|
336
336
|
# @param [String] account_sid The SID of the
|
337
|
-
# [Account](https://www.twilio.com/docs/api/
|
337
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for
|
338
338
|
# the Address resource.
|
339
339
|
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
340
340
|
# Address resource to fetch.
|
@@ -17,7 +17,7 @@ module Twilio
|
|
17
17
|
# Initialize the DependentPhoneNumberList
|
18
18
|
# @param [Version] version Version that contains the resource
|
19
19
|
# @param [String] account_sid The SID of the
|
20
|
-
# [Account](https://www.twilio.com/docs/api/
|
20
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
21
21
|
# DependentPhoneNumber resource.
|
22
22
|
# @param [String] address_sid The unique string that that we created to identify
|
23
23
|
# the Address resource.
|
@@ -159,7 +159,7 @@ module Twilio
|
|
159
159
|
# @param [Version] version Version that contains the resource
|
160
160
|
# @param [Hash] payload payload that contains response from Twilio
|
161
161
|
# @param [String] account_sid The SID of the
|
162
|
-
# [Account](https://www.twilio.com/docs/api/
|
162
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
163
163
|
# DependentPhoneNumber resource.
|
164
164
|
# @param [String] address_sid The unique string that that we created to identify
|
165
165
|
# the Address resource.
|
@@ -16,7 +16,7 @@ module Twilio
|
|
16
16
|
# Initialize the ApplicationList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
18
|
# @param [String] account_sid The SID of the
|
19
|
-
# [Account](https://www.twilio.com/docs/api/
|
19
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
20
20
|
# Application resource.
|
21
21
|
# @return [ApplicationList] ApplicationList
|
22
22
|
def initialize(version, account_sid: nil)
|
@@ -221,7 +221,7 @@ module Twilio
|
|
221
221
|
# Initialize the ApplicationContext
|
222
222
|
# @param [Version] version Version that contains the resource
|
223
223
|
# @param [String] account_sid The SID of the
|
224
|
-
# [Account](https://www.twilio.com/docs/api/
|
224
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
225
225
|
# Application resource to fetch.
|
226
226
|
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
227
227
|
# Application resource to fetch.
|
@@ -350,7 +350,7 @@ module Twilio
|
|
350
350
|
# @param [Version] version Version that contains the resource
|
351
351
|
# @param [Hash] payload payload that contains response from Twilio
|
352
352
|
# @param [String] account_sid The SID of the
|
353
|
-
# [Account](https://www.twilio.com/docs/api/
|
353
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
354
354
|
# Application resource.
|
355
355
|
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
356
356
|
# Application resource to fetch.
|
@@ -16,7 +16,7 @@ module Twilio
|
|
16
16
|
# Initialize the AuthorizedConnectAppList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
18
|
# @param [String] account_sid The SID of the
|
19
|
-
# [Account](https://www.twilio.com/docs/api/
|
19
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
20
20
|
# AuthorizedConnectApp resource.
|
21
21
|
# @return [AuthorizedConnectAppList] AuthorizedConnectAppList
|
22
22
|
def initialize(version, account_sid: nil)
|
@@ -150,7 +150,7 @@ module Twilio
|
|
150
150
|
# Initialize the AuthorizedConnectAppContext
|
151
151
|
# @param [Version] version Version that contains the resource
|
152
152
|
# @param [String] account_sid The SID of the
|
153
|
-
# [Account](https://www.twilio.com/docs/api/
|
153
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
154
154
|
# AuthorizedConnectApp resource to fetch.
|
155
155
|
# @param [String] connect_app_sid The SID of the Connect App to fetch.
|
156
156
|
# @return [AuthorizedConnectAppContext] AuthorizedConnectAppContext
|
@@ -203,7 +203,7 @@ module Twilio
|
|
203
203
|
# @param [Version] version Version that contains the resource
|
204
204
|
# @param [Hash] payload payload that contains response from Twilio
|
205
205
|
# @param [String] account_sid The SID of the
|
206
|
-
# [Account](https://www.twilio.com/docs/api/
|
206
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) that created the
|
207
207
|
# AuthorizedConnectApp resource.
|
208
208
|
# @param [String] connect_app_sid The SID of the Connect App to fetch.
|
209
209
|
# @return [AuthorizedConnectAppInstance] AuthorizedConnectAppInstance
|
@@ -149,7 +149,7 @@ module Twilio
|
|
149
149
|
# Initialize the AvailablePhoneNumberCountryContext
|
150
150
|
# @param [Version] version Version that contains the resource
|
151
151
|
# @param [String] account_sid The SID of the
|
152
|
-
# [Account](https://www.twilio.com/docs/api/
|
152
|
+
# [Account](https://www.twilio.com/docs/iam/api/account) requesting the available
|
153
153
|
# phone number Country resource.
|
154
154
|
# @param [String] country_code The
|
155
155
|
# [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of
|
@@ -38,7 +38,7 @@ module Twilio
|
|
38
38
|
# @param [String] contains The pattern on which to match phone numbers. Valid
|
39
39
|
# characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any
|
40
40
|
# single digit. For examples, see [Example
|
41
|
-
# 2](https://www.twilio.com/docs/api/
|
41
|
+
# 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
42
42
|
# @param [Boolean] sms_enabled Whether the phone numbers can receive text
|
43
43
|
# messages. Can be: `true` or `false`.
|
44
44
|
# @param [Boolean] mms_enabled Whether the phone numbers can receive MMS messages.
|
@@ -46,14 +46,14 @@ module Twilio
|
|
46
46
|
# @param [Boolean] voice_enabled Whether the phone numbers can receive calls. Can
|
47
47
|
# be: `true` or `false`.
|
48
48
|
# @param [Boolean] exclude_all_address_required Whether to exclude phone numbers
|
49
|
-
# that require an [Address](https://www.twilio.com/docs/usage/api/
|
49
|
+
# that require an [Address](https://www.twilio.com/docs/usage/api/address). Can
|
50
50
|
# be: `true` or `false` and the default is `false`.
|
51
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/
|
52
|
+
# that require a local [Address](https://www.twilio.com/docs/usage/api/address).
|
53
53
|
# Can be: `true` or `false` and the default is `false`.
|
54
54
|
# @param [Boolean] exclude_foreign_address_required Whether to exclude phone
|
55
55
|
# numbers that require a foreign
|
56
|
-
# [Address](https://www.twilio.com/docs/usage/api/
|
56
|
+
# [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or
|
57
57
|
# `false` and the default is `false`.
|
58
58
|
# @param [Boolean] beta Whether to read phone numbers that are new to the Twilio
|
59
59
|
# platform. Can be: `true` or `false` and the default is `true`.
|
@@ -76,9 +76,9 @@ module Twilio
|
|
76
76
|
# a phone number search within the same rate center as that number. Requires
|
77
77
|
# `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
78
78
|
# @param [String] in_lata Limit results to a specific local access and transport
|
79
|
-
# area ([LATA](
|
79
|
+
# area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)).
|
80
80
|
# Given a phone number, search within the same
|
81
|
-
# [LATA](
|
81
|
+
# [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that
|
82
82
|
# number. Applies to only phone numbers in the US and Canada.
|
83
83
|
# @param [String] in_locality Limit results to a particular locality or city.
|
84
84
|
# Given a phone number, search within the same Locality as that number.
|
@@ -125,7 +125,7 @@ module Twilio
|
|
125
125
|
# @param [String] contains The pattern on which to match phone numbers. Valid
|
126
126
|
# characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any
|
127
127
|
# single digit. For examples, see [Example
|
128
|
-
# 2](https://www.twilio.com/docs/api/
|
128
|
+
# 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
129
129
|
# @param [Boolean] sms_enabled Whether the phone numbers can receive text
|
130
130
|
# messages. Can be: `true` or `false`.
|
131
131
|
# @param [Boolean] mms_enabled Whether the phone numbers can receive MMS messages.
|
@@ -133,14 +133,14 @@ module Twilio
|
|
133
133
|
# @param [Boolean] voice_enabled Whether the phone numbers can receive calls. Can
|
134
134
|
# be: `true` or `false`.
|
135
135
|
# @param [Boolean] exclude_all_address_required Whether to exclude phone numbers
|
136
|
-
# that require an [Address](https://www.twilio.com/docs/usage/api/
|
136
|
+
# that require an [Address](https://www.twilio.com/docs/usage/api/address). Can
|
137
137
|
# be: `true` or `false` and the default is `false`.
|
138
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/
|
139
|
+
# that require a local [Address](https://www.twilio.com/docs/usage/api/address).
|
140
140
|
# Can be: `true` or `false` and the default is `false`.
|
141
141
|
# @param [Boolean] exclude_foreign_address_required Whether to exclude phone
|
142
142
|
# numbers that require a foreign
|
143
|
-
# [Address](https://www.twilio.com/docs/usage/api/
|
143
|
+
# [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or
|
144
144
|
# `false` and the default is `false`.
|
145
145
|
# @param [Boolean] beta Whether to read phone numbers that are new to the Twilio
|
146
146
|
# platform. Can be: `true` or `false` and the default is `true`.
|
@@ -163,9 +163,9 @@ module Twilio
|
|
163
163
|
# a phone number search within the same rate center as that number. Requires
|
164
164
|
# `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
165
165
|
# @param [String] in_lata Limit results to a specific local access and transport
|
166
|
-
# area ([LATA](
|
166
|
+
# area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)).
|
167
167
|
# Given a phone number, search within the same
|
168
|
-
# [LATA](
|
168
|
+
# [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that
|
169
169
|
# number. Applies to only phone numbers in the US and Canada.
|
170
170
|
# @param [String] in_locality Limit results to a particular locality or city.
|
171
171
|
# Given a phone number, search within the same Locality as that number.
|
@@ -228,7 +228,7 @@ module Twilio
|
|
228
228
|
# @param [String] contains The pattern on which to match phone numbers. Valid
|
229
229
|
# characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any
|
230
230
|
# single digit. For examples, see [Example
|
231
|
-
# 2](https://www.twilio.com/docs/api/
|
231
|
+
# 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
232
232
|
# @param [Boolean] sms_enabled Whether the phone numbers can receive text
|
233
233
|
# messages. Can be: `true` or `false`.
|
234
234
|
# @param [Boolean] mms_enabled Whether the phone numbers can receive MMS messages.
|
@@ -236,14 +236,14 @@ module Twilio
|
|
236
236
|
# @param [Boolean] voice_enabled Whether the phone numbers can receive calls. Can
|
237
237
|
# be: `true` or `false`.
|
238
238
|
# @param [Boolean] exclude_all_address_required Whether to exclude phone numbers
|
239
|
-
# that require an [Address](https://www.twilio.com/docs/usage/api/
|
239
|
+
# that require an [Address](https://www.twilio.com/docs/usage/api/address). Can
|
240
240
|
# be: `true` or `false` and the default is `false`.
|
241
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/
|
242
|
+
# that require a local [Address](https://www.twilio.com/docs/usage/api/address).
|
243
243
|
# Can be: `true` or `false` and the default is `false`.
|
244
244
|
# @param [Boolean] exclude_foreign_address_required Whether to exclude phone
|
245
245
|
# numbers that require a foreign
|
246
|
-
# [Address](https://www.twilio.com/docs/usage/api/
|
246
|
+
# [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or
|
247
247
|
# `false` and the default is `false`.
|
248
248
|
# @param [Boolean] beta Whether to read phone numbers that are new to the Twilio
|
249
249
|
# platform. Can be: `true` or `false` and the default is `true`.
|
@@ -266,9 +266,9 @@ module Twilio
|
|
266
266
|
# a phone number search within the same rate center as that number. Requires
|
267
267
|
# `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
268
268
|
# @param [String] in_lata Limit results to a specific local access and transport
|
269
|
-
# area ([LATA](
|
269
|
+
# area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)).
|
270
270
|
# Given a phone number, search within the same
|
271
|
-
# [LATA](
|
271
|
+
# [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that
|
272
272
|
# number. Applies to only phone numbers in the US and Canada.
|
273
273
|
# @param [String] in_locality Limit results to a particular locality or city.
|
274
274
|
# Given a phone number, search within the same Locality as that number.
|