twilio-ruby 5.4.0 → 5.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56f7c1583df9eb3ebbfdb20f743dc5e98d500c1c
4
- data.tar.gz: c7b36ff967128b82901b6a71dc229e79bf548d18
3
+ metadata.gz: 40703106c2efc08fd3626dfebfd1985a9309f487
4
+ data.tar.gz: 678073456fc08e365a14103b987ee13e7619584c
5
5
  SHA512:
6
- metadata.gz: 7402344a5aad78ed4c7b1b35be18938fd845a8e4bcad2223f83bb2046faa9184d438131a097ab8978bb01e1fafeaaa38aef80cde0fdaffc7301de1469047574d
7
- data.tar.gz: e29836c18de0a83521123f0f3a4090874575720e792f1332c69c96b36360fb1ab979f9da7f1a7c3261ab79324cdd53926b1505521373c044b583aa24f52d4128
6
+ metadata.gz: 5198f1c44aadfee2c07510bc0d2000104e72ac9dfc52ab109d952709d9f13f8a2d8d0f53b72c8ed1df481335fccbb8fab4b584cf32717a8e5ccfc883fc4192b7
7
+ data.tar.gz: 6a43ed52d83119f5ff1b2b888afa50f74cf6fffdd64d3ac14ca90d8604fdc0e39e6a9dff35e3431e5623dd69bb6bd9e0b0d8deeed399a6035f2e63b58b00d5c0
data/CHANGES.md CHANGED
@@ -1,6 +1,17 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2017-10-20] Version 5.4.1
5
+ ---------------------------
6
+ **Library**
7
+ - #359 Correctly set headers on Twilio::Response
8
+ - #360 Fix downcasing twiml parameters that are not snake_case
9
+
10
+ **Api**
11
+ - Add `address_sid` param to IncomingPhoneNumbers create and update
12
+ - Add 'fax_enabled' option for Phone Number Search
13
+
14
+
4
15
  [2017-10-13] Version 5.4.0
5
16
  ---------------------------
6
17
  **Api**
data/README.md CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
27
27
  To install using [Bundler][bundler] grab the latest stable version:
28
28
 
29
29
  ```ruby
30
- gem 'twilio-ruby', '~> 5.4.0'
30
+ gem 'twilio-ruby', '~> 5.4.1'
31
31
  ```
32
32
 
33
33
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
34
34
 
35
35
  ```bash
36
- gem install twilio-ruby -v 5.4.0
36
+ gem install twilio-ruby -v 5.4.1
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
@@ -167,7 +167,7 @@ implementations:
167
167
  - Ruby 2.1.0
168
168
  - Ruby 2.0.0
169
169
 
170
- [capability]: https://github.com/twilio/twilio-ruby/wiki/Capability
170
+ [capability]: https://github.com/twilio/twilio-ruby/wiki/JWT-Tokens
171
171
  [examples]: https://github.com/twilio/twilio-ruby/blob/master/examples
172
172
  [documentation]: http://twilio.github.io/twilio-ruby
173
173
  [wiki]: https://github.com/twilio/twilio-ruby/wiki
@@ -1,11 +1,12 @@
1
1
  module Twilio
2
2
  class Response
3
- attr_accessor :status_code, :body
3
+ attr_accessor :status_code, :body, :headers
4
4
 
5
- def initialize(status_code, body)
5
+ def initialize(status_code, body, headers: nil)
6
6
  @status_code = status_code
7
7
  body = '{}' if !body || body.empty?
8
8
  @body = JSON.parse(body)
9
+ @headers = !headers ? {} : headers.to_hash
9
10
  end
10
11
 
11
12
  def to_s
@@ -43,7 +43,7 @@ module Twilio
43
43
  object = { message: 'Bad request', code: 400 }.to_json
44
44
  end
45
45
 
46
- twilio_response = Twilio::Response.new(response.status, object)
46
+ twilio_response = Twilio::Response.new(response.status, object, headers: response.headers)
47
47
  @last_response = twilio_response
48
48
 
49
49
  twilio_response
@@ -52,6 +52,7 @@ module Twilio
52
52
  # @param [String] in_rate_center The in_rate_center
53
53
  # @param [String] in_lata The in_lata
54
54
  # @param [String] in_locality The in_locality
55
+ # @param [Boolean] fax_enabled The fax_enabled
55
56
  # @param [Integer] limit Upper limit for the number of records to return. stream()
56
57
  # guarantees to never return more than limit. Default is no limit
57
58
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -59,7 +60,7 @@ module Twilio
59
60
  # but a limit is defined, stream() will attempt to read the limit with the most
60
61
  # efficient page size, i.e. min(limit, 1000)
61
62
  # @return [Array] Array of up to limit results
62
- def list(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, limit: nil, page_size: nil)
63
+ def list(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, limit: nil, page_size: nil)
63
64
  self.stream(
64
65
  area_code: area_code,
65
66
  contains: contains,
@@ -78,6 +79,7 @@ module Twilio
78
79
  in_rate_center: in_rate_center,
79
80
  in_lata: in_lata,
80
81
  in_locality: in_locality,
82
+ fax_enabled: fax_enabled,
81
83
  limit: limit,
82
84
  page_size: page_size
83
85
  ).entries
@@ -106,6 +108,7 @@ module Twilio
106
108
  # @param [String] in_rate_center The in_rate_center
107
109
  # @param [String] in_lata The in_lata
108
110
  # @param [String] in_locality The in_locality
111
+ # @param [Boolean] fax_enabled The fax_enabled
109
112
  # @param [Integer] limit Upper limit for the number of records to return. stream()
110
113
  # guarantees to never return more than limit. Default is no limit.
111
114
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -113,7 +116,7 @@ module Twilio
113
116
  # but a limit is defined, stream() will attempt to read the limit with the most
114
117
  # efficient page size, i.e. min(limit, 1000)
115
118
  # @return [Enumerable] Enumerable that will yield up to limit results
116
- def stream(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, limit: nil, page_size: nil)
119
+ def stream(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, limit: nil, page_size: nil)
117
120
  limits = @version.read_limits(limit, page_size)
118
121
 
119
122
  page = self.page(
@@ -134,6 +137,7 @@ module Twilio
134
137
  in_rate_center: in_rate_center,
135
138
  in_lata: in_lata,
136
139
  in_locality: in_locality,
140
+ fax_enabled: fax_enabled,
137
141
  page_size: limits[:page_size],
138
142
  )
139
143
 
@@ -178,11 +182,12 @@ module Twilio
178
182
  # @param [String] in_rate_center The in_rate_center
179
183
  # @param [String] in_lata The in_lata
180
184
  # @param [String] in_locality The in_locality
185
+ # @param [Boolean] fax_enabled The fax_enabled
181
186
  # @param [String] page_token PageToken provided by the API
182
187
  # @param [Integer] page_number Page Number, this value is simply for client state
183
188
  # @param [Integer] page_size Number of records to return, defaults to 50
184
189
  # @return [Page] Page of LocalInstance
185
- def page(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
190
+ def page(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
186
191
  params = Twilio::Values.of({
187
192
  'AreaCode' => area_code,
188
193
  'Contains' => contains,
@@ -201,6 +206,7 @@ module Twilio
201
206
  'InRateCenter' => in_rate_center,
202
207
  'InLata' => in_lata,
203
208
  'InLocality' => in_locality,
209
+ 'FaxEnabled' => fax_enabled,
204
210
  'PageToken' => page_token,
205
211
  'Page' => page_number,
206
212
  'PageSize' => page_size,
@@ -52,6 +52,7 @@ module Twilio
52
52
  # @param [String] in_rate_center The in_rate_center
53
53
  # @param [String] in_lata The in_lata
54
54
  # @param [String] in_locality The in_locality
55
+ # @param [Boolean] fax_enabled The fax_enabled
55
56
  # @param [Integer] limit Upper limit for the number of records to return. stream()
56
57
  # guarantees to never return more than limit. Default is no limit
57
58
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -59,7 +60,7 @@ module Twilio
59
60
  # but a limit is defined, stream() will attempt to read the limit with the most
60
61
  # efficient page size, i.e. min(limit, 1000)
61
62
  # @return [Array] Array of up to limit results
62
- def list(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, limit: nil, page_size: nil)
63
+ def list(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, limit: nil, page_size: nil)
63
64
  self.stream(
64
65
  area_code: area_code,
65
66
  contains: contains,
@@ -78,6 +79,7 @@ module Twilio
78
79
  in_rate_center: in_rate_center,
79
80
  in_lata: in_lata,
80
81
  in_locality: in_locality,
82
+ fax_enabled: fax_enabled,
81
83
  limit: limit,
82
84
  page_size: page_size
83
85
  ).entries
@@ -106,6 +108,7 @@ module Twilio
106
108
  # @param [String] in_rate_center The in_rate_center
107
109
  # @param [String] in_lata The in_lata
108
110
  # @param [String] in_locality The in_locality
111
+ # @param [Boolean] fax_enabled The fax_enabled
109
112
  # @param [Integer] limit Upper limit for the number of records to return. stream()
110
113
  # guarantees to never return more than limit. Default is no limit.
111
114
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -113,7 +116,7 @@ module Twilio
113
116
  # but a limit is defined, stream() will attempt to read the limit with the most
114
117
  # efficient page size, i.e. min(limit, 1000)
115
118
  # @return [Enumerable] Enumerable that will yield up to limit results
116
- def stream(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, limit: nil, page_size: nil)
119
+ def stream(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, limit: nil, page_size: nil)
117
120
  limits = @version.read_limits(limit, page_size)
118
121
 
119
122
  page = self.page(
@@ -134,6 +137,7 @@ module Twilio
134
137
  in_rate_center: in_rate_center,
135
138
  in_lata: in_lata,
136
139
  in_locality: in_locality,
140
+ fax_enabled: fax_enabled,
137
141
  page_size: limits[:page_size],
138
142
  )
139
143
 
@@ -178,11 +182,12 @@ module Twilio
178
182
  # @param [String] in_rate_center The in_rate_center
179
183
  # @param [String] in_lata The in_lata
180
184
  # @param [String] in_locality The in_locality
185
+ # @param [Boolean] fax_enabled The fax_enabled
181
186
  # @param [String] page_token PageToken provided by the API
182
187
  # @param [Integer] page_number Page Number, this value is simply for client state
183
188
  # @param [Integer] page_size Number of records to return, defaults to 50
184
189
  # @return [Page] Page of MobileInstance
185
- def page(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
190
+ def page(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
186
191
  params = Twilio::Values.of({
187
192
  'AreaCode' => area_code,
188
193
  'Contains' => contains,
@@ -201,6 +206,7 @@ module Twilio
201
206
  'InRateCenter' => in_rate_center,
202
207
  'InLata' => in_lata,
203
208
  'InLocality' => in_locality,
209
+ 'FaxEnabled' => fax_enabled,
204
210
  'PageToken' => page_token,
205
211
  'Page' => page_number,
206
212
  'PageSize' => page_size,
@@ -52,6 +52,7 @@ module Twilio
52
52
  # @param [String] in_rate_center The in_rate_center
53
53
  # @param [String] in_lata The in_lata
54
54
  # @param [String] in_locality The in_locality
55
+ # @param [Boolean] fax_enabled The fax_enabled
55
56
  # @param [Integer] limit Upper limit for the number of records to return. stream()
56
57
  # guarantees to never return more than limit. Default is no limit
57
58
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -59,7 +60,7 @@ module Twilio
59
60
  # but a limit is defined, stream() will attempt to read the limit with the most
60
61
  # efficient page size, i.e. min(limit, 1000)
61
62
  # @return [Array] Array of up to limit results
62
- def list(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, limit: nil, page_size: nil)
63
+ def list(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, limit: nil, page_size: nil)
63
64
  self.stream(
64
65
  area_code: area_code,
65
66
  contains: contains,
@@ -78,6 +79,7 @@ module Twilio
78
79
  in_rate_center: in_rate_center,
79
80
  in_lata: in_lata,
80
81
  in_locality: in_locality,
82
+ fax_enabled: fax_enabled,
81
83
  limit: limit,
82
84
  page_size: page_size
83
85
  ).entries
@@ -106,6 +108,7 @@ module Twilio
106
108
  # @param [String] in_rate_center The in_rate_center
107
109
  # @param [String] in_lata The in_lata
108
110
  # @param [String] in_locality The in_locality
111
+ # @param [Boolean] fax_enabled The fax_enabled
109
112
  # @param [Integer] limit Upper limit for the number of records to return. stream()
110
113
  # guarantees to never return more than limit. Default is no limit.
111
114
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -113,7 +116,7 @@ module Twilio
113
116
  # but a limit is defined, stream() will attempt to read the limit with the most
114
117
  # efficient page size, i.e. min(limit, 1000)
115
118
  # @return [Enumerable] Enumerable that will yield up to limit results
116
- def stream(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, limit: nil, page_size: nil)
119
+ def stream(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, limit: nil, page_size: nil)
117
120
  limits = @version.read_limits(limit, page_size)
118
121
 
119
122
  page = self.page(
@@ -134,6 +137,7 @@ module Twilio
134
137
  in_rate_center: in_rate_center,
135
138
  in_lata: in_lata,
136
139
  in_locality: in_locality,
140
+ fax_enabled: fax_enabled,
137
141
  page_size: limits[:page_size],
138
142
  )
139
143
 
@@ -178,11 +182,12 @@ module Twilio
178
182
  # @param [String] in_rate_center The in_rate_center
179
183
  # @param [String] in_lata The in_lata
180
184
  # @param [String] in_locality The in_locality
185
+ # @param [Boolean] fax_enabled The fax_enabled
181
186
  # @param [String] page_token PageToken provided by the API
182
187
  # @param [Integer] page_number Page Number, this value is simply for client state
183
188
  # @param [Integer] page_size Number of records to return, defaults to 50
184
189
  # @return [Page] Page of TollFreeInstance
185
- def page(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
190
+ def page(area_code: :unset, contains: :unset, sms_enabled: :unset, mms_enabled: :unset, voice_enabled: :unset, exclude_all_address_required: :unset, exclude_local_address_required: :unset, exclude_foreign_address_required: :unset, beta: :unset, near_number: :unset, near_lat_long: :unset, distance: :unset, in_postal_code: :unset, in_region: :unset, in_rate_center: :unset, in_lata: :unset, in_locality: :unset, fax_enabled: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
186
191
  params = Twilio::Values.of({
187
192
  'AreaCode' => area_code,
188
193
  'Contains' => contains,
@@ -201,6 +206,7 @@ module Twilio
201
206
  'InRateCenter' => in_rate_center,
202
207
  'InLata' => in_lata,
203
208
  'InLocality' => in_locality,
209
+ 'FaxEnabled' => fax_enabled,
204
210
  'PageToken' => page_token,
205
211
  'Page' => page_number,
206
212
  'PageSize' => page_size,
@@ -160,8 +160,9 @@ module Twilio
160
160
  # @param [String] voice_method The voice_method
161
161
  # @param [String] voice_url The voice_url
162
162
  # @param [String] identity_sid The identity_sid
163
+ # @param [String] address_sid The address_sid
163
164
  # @return [LocalInstance] Newly created LocalInstance
164
- 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)
165
+ 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)
165
166
  data = Twilio::Values.of({
166
167
  'PhoneNumber' => phone_number,
167
168
  'ApiVersion' => api_version,
@@ -180,6 +181,7 @@ module Twilio
180
181
  'VoiceMethod' => voice_method,
181
182
  'VoiceUrl' => voice_url,
182
183
  'IdentitySid' => identity_sid,
184
+ 'AddressSid' => address_sid,
183
185
  })
184
186
 
185
187
  payload = @version.create(
@@ -249,6 +251,7 @@ module Twilio
249
251
  # Marshaled Properties
250
252
  @properties = {
251
253
  'account_sid' => payload['account_sid'],
254
+ 'address_sid' => payload['address_sid'],
252
255
  'address_requirements' => payload['address_requirements'],
253
256
  'api_version' => payload['api_version'],
254
257
  'beta' => payload['beta'],
@@ -284,6 +287,12 @@ module Twilio
284
287
  @properties['account_sid']
285
288
  end
286
289
 
290
+ ##
291
+ # @return [String] The address_sid
292
+ def address_sid
293
+ @properties['address_sid']
294
+ end
295
+
287
296
  ##
288
297
  # @return [local.AddressRequirement] The address_requirements
289
298
  def address_requirements
@@ -160,8 +160,9 @@ module Twilio
160
160
  # @param [String] voice_method The voice_method
161
161
  # @param [String] voice_url The voice_url
162
162
  # @param [String] identity_sid The identity_sid
163
+ # @param [String] address_sid The address_sid
163
164
  # @return [MobileInstance] Newly created MobileInstance
164
- 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)
165
+ 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)
165
166
  data = Twilio::Values.of({
166
167
  'PhoneNumber' => phone_number,
167
168
  'ApiVersion' => api_version,
@@ -180,6 +181,7 @@ module Twilio
180
181
  'VoiceMethod' => voice_method,
181
182
  'VoiceUrl' => voice_url,
182
183
  'IdentitySid' => identity_sid,
184
+ 'AddressSid' => address_sid,
183
185
  })
184
186
 
185
187
  payload = @version.create(
@@ -249,6 +251,7 @@ module Twilio
249
251
  # Marshaled Properties
250
252
  @properties = {
251
253
  'account_sid' => payload['account_sid'],
254
+ 'address_sid' => payload['address_sid'],
252
255
  'address_requirements' => payload['address_requirements'],
253
256
  'api_version' => payload['api_version'],
254
257
  'beta' => payload['beta'],
@@ -284,6 +287,12 @@ module Twilio
284
287
  @properties['account_sid']
285
288
  end
286
289
 
290
+ ##
291
+ # @return [String] The address_sid
292
+ def address_sid
293
+ @properties['address_sid']
294
+ end
295
+
287
296
  ##
288
297
  # @return [mobile.AddressRequirement] The address_requirements
289
298
  def address_requirements
@@ -160,8 +160,9 @@ module Twilio
160
160
  # @param [String] voice_method The voice_method
161
161
  # @param [String] voice_url The voice_url
162
162
  # @param [String] identity_sid The identity_sid
163
+ # @param [String] address_sid The address_sid
163
164
  # @return [TollFreeInstance] Newly created TollFreeInstance
164
- 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)
165
+ 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)
165
166
  data = Twilio::Values.of({
166
167
  'PhoneNumber' => phone_number,
167
168
  'ApiVersion' => api_version,
@@ -180,6 +181,7 @@ module Twilio
180
181
  'VoiceMethod' => voice_method,
181
182
  'VoiceUrl' => voice_url,
182
183
  'IdentitySid' => identity_sid,
184
+ 'AddressSid' => address_sid,
183
185
  })
184
186
 
185
187
  payload = @version.create(
@@ -249,6 +251,7 @@ module Twilio
249
251
  # Marshaled Properties
250
252
  @properties = {
251
253
  'account_sid' => payload['account_sid'],
254
+ 'address_sid' => payload['address_sid'],
252
255
  'address_requirements' => payload['address_requirements'],
253
256
  'api_version' => payload['api_version'],
254
257
  'beta' => payload['beta'],
@@ -284,6 +287,12 @@ module Twilio
284
287
  @properties['account_sid']
285
288
  end
286
289
 
290
+ ##
291
+ # @return [String] The address_sid
292
+ def address_sid
293
+ @properties['address_sid']
294
+ end
295
+
287
296
  ##
288
297
  # @return [toll_free.AddressRequirement] The address_requirements
289
298
  def address_requirements
@@ -201,12 +201,15 @@ module Twilio
201
201
  # @param [String] identity_sid The 34 character sid of the identity Twilio should
202
202
  # use to associate with the number. Identities are required in some regions to
203
203
  # meet local regulations
204
+ # @param [String] address_sid The 34 character sid of the address Twilio should
205
+ # use to associate with the number. Addresses are required in some regions to meet
206
+ # local regulations
204
207
  # @param [String] phone_number The phone number to purchase. e.g., +16175551212
205
208
  # (E.164 format)
206
209
  # @param [String] area_code The desired area code for the new phone number. Any
207
210
  # three digit US or Canada rea code is valid
208
211
  # @return [IncomingPhoneNumberInstance] Newly created IncomingPhoneNumberInstance
209
- def create(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, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, identity_sid: :unset, phone_number: :unset, area_code: :unset)
212
+ def create(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, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, identity_sid: :unset, address_sid: :unset, phone_number: :unset, area_code: :unset)
210
213
  data = Twilio::Values.of({
211
214
  'PhoneNumber' => phone_number,
212
215
  'AreaCode' => area_code,
@@ -229,6 +232,7 @@ module Twilio
229
232
  'EmergencyAddressSid' => emergency_address_sid,
230
233
  'TrunkSid' => trunk_sid,
231
234
  'IdentitySid' => identity_sid,
235
+ 'AddressSid' => address_sid,
232
236
  })
233
237
 
234
238
  payload = @version.create(
@@ -393,8 +397,11 @@ module Twilio
393
397
  # @param [String] identity_sid The 34 character sid of the identity Twilio should
394
398
  # use to associate with the number. Identities are required in some regions to
395
399
  # meet local regulations
400
+ # @param [String] address_sid The 34 character sid of the address Twilio should
401
+ # use to associate with the number. Addresses are required in some regions to meet
402
+ # local regulations
396
403
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
397
- def update(account_sid: :unset, 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, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset)
404
+ def update(account_sid: :unset, 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, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset)
398
405
  data = Twilio::Values.of({
399
406
  'AccountSid' => account_sid,
400
407
  'ApiVersion' => api_version,
@@ -417,6 +424,7 @@ module Twilio
417
424
  'TrunkSid' => trunk_sid,
418
425
  'VoiceReceiveMode' => voice_receive_mode,
419
426
  'IdentitySid' => identity_sid,
427
+ 'AddressSid' => address_sid,
420
428
  })
421
429
 
422
430
  payload = @version.update(
@@ -511,6 +519,7 @@ module Twilio
511
519
  # Marshaled Properties
512
520
  @properties = {
513
521
  'account_sid' => payload['account_sid'],
522
+ 'address_sid' => payload['address_sid'],
514
523
  'address_requirements' => payload['address_requirements'],
515
524
  'api_version' => payload['api_version'],
516
525
  'beta' => payload['beta'],
@@ -570,6 +579,12 @@ module Twilio
570
579
  @properties['account_sid']
571
580
  end
572
581
 
582
+ ##
583
+ # @return [String] Unique string that identifies the address associated with number
584
+ def address_sid
585
+ @properties['address_sid']
586
+ end
587
+
573
588
  ##
574
589
  # @return [toll_free.AddressRequirement] Indicates if the customer requires an address
575
590
  def address_requirements
@@ -792,8 +807,11 @@ module Twilio
792
807
  # @param [String] identity_sid The 34 character sid of the identity Twilio should
793
808
  # use to associate with the number. Identities are required in some regions to
794
809
  # meet local regulations
810
+ # @param [String] address_sid The 34 character sid of the address Twilio should
811
+ # use to associate with the number. Addresses are required in some regions to meet
812
+ # local regulations
795
813
  # @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
796
- def update(account_sid: :unset, 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, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset)
814
+ def update(account_sid: :unset, 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, emergency_status: :unset, emergency_address_sid: :unset, trunk_sid: :unset, voice_receive_mode: :unset, identity_sid: :unset, address_sid: :unset)
797
815
  context.update(
798
816
  account_sid: account_sid,
799
817
  api_version: api_version,
@@ -816,6 +834,7 @@ module Twilio
816
834
  trunk_sid: trunk_sid,
817
835
  voice_receive_mode: voice_receive_mode,
818
836
  identity_sid: identity_sid,
837
+ address_sid: address_sid,
819
838
  )
820
839
  end
821
840
 
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.4.0'
2
+ VERSION = '5.4.1'
3
3
  end
@@ -11,7 +11,7 @@ describe Twilio::HTTP::Client do
11
11
  @connection = Faraday::Connection.new
12
12
 
13
13
  expect(Faraday).to receive(:new).and_yield(@connection).and_return(@connection)
14
- allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
14
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}, headers: {}))
15
15
 
16
16
  @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b'])
17
17
 
@@ -25,7 +25,7 @@ describe Twilio::HTTP::Client do
25
25
  @connection = Faraday::Connection.new
26
26
 
27
27
  expect(Faraday).to receive(:new).and_yield(@connection).and_return(@connection)
28
- allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
28
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}, headers: {}))
29
29
 
30
30
  @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b'], 20)
31
31
 
@@ -36,18 +36,19 @@ describe Twilio::HTTP::Client do
36
36
 
37
37
  it 'should contain a last response' do
38
38
  expect(Faraday).to receive(:new).and_return(Faraday::Connection.new)
39
- allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
39
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}, headers: { something: '1' }))
40
40
 
41
41
  @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b'])
42
42
 
43
43
  expect(@client.last_response).to_not be_nil
44
44
  expect(@client.last_response.is_a?(Twilio::Response)).to be(true)
45
45
  expect(@client.last_response.status_code).to eq(301)
46
+ expect(@client.last_response.headers).to eq(something: '1')
46
47
  end
47
48
 
48
49
  it 'should contain a last request' do
49
50
  expect(Faraday).to receive(:new).and_return(Faraday::Connection.new)
50
- allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}))
51
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 301, body: {}, headers: {}))
51
52
 
52
53
  @client.request('host',
53
54
  'port',
@@ -74,7 +75,7 @@ describe Twilio::HTTP::Client do
74
75
 
75
76
  it 'should contain a last response for 5XX status classes' do
76
77
  expect(Faraday).to receive(:new).and_return(Faraday::Connection.new)
77
- allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 500, body: {}))
78
+ allow_any_instance_of(Faraday::Connection).to receive(:send).and_return(double('response', status: 500, body: {}, headers: {}))
78
79
 
79
80
  @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b'])
80
81
  expect(@client.last_response).to_not be_nil
@@ -35,6 +35,7 @@ describe 'Local' do
35
35
  {
36
36
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
37
  "address_requirements": "none",
38
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
39
  "api_version": "2010-04-01",
39
40
  "beta": null,
40
41
  "capabilities": {
@@ -141,6 +142,7 @@ describe 'Local' do
141
142
  {
142
143
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
143
144
  "address_requirements": "none",
145
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
144
146
  "api_version": "2010-04-01",
145
147
  "beta": false,
146
148
  "capabilities": {
@@ -35,6 +35,7 @@ describe 'Mobile' do
35
35
  {
36
36
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
37
  "address_requirements": "none",
38
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
39
  "api_version": "2010-04-01",
39
40
  "beta": null,
40
41
  "capabilities": {
@@ -141,6 +142,7 @@ describe 'Mobile' do
141
142
  {
142
143
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
143
144
  "address_requirements": "none",
145
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
144
146
  "api_version": "2010-04-01",
145
147
  "beta": false,
146
148
  "capabilities": {
@@ -35,6 +35,7 @@ describe 'TollFree' do
35
35
  {
36
36
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
37
37
  "address_requirements": "none",
38
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
39
  "api_version": "2010-04-01",
39
40
  "beta": null,
40
41
  "capabilities": {
@@ -141,6 +142,7 @@ describe 'TollFree' do
141
142
  {
142
143
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
143
144
  "address_requirements": "none",
145
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
144
146
  "api_version": "2010-04-01",
145
147
  "beta": false,
146
148
  "capabilities": {
@@ -30,6 +30,7 @@ describe 'IncomingPhoneNumber' do
30
30
  {
31
31
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
32
32
  "address_requirements": "none",
33
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
34
  "api_version": "2010-04-01",
34
35
  "beta": false,
35
36
  "capabilities": {
@@ -94,6 +95,7 @@ describe 'IncomingPhoneNumber' do
94
95
  {
95
96
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
96
97
  "address_requirements": "none",
98
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
97
99
  "api_version": "2010-04-01",
98
100
  "beta": false,
99
101
  "capabilities": {
@@ -190,6 +192,7 @@ describe 'IncomingPhoneNumber' do
190
192
  {
191
193
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
192
194
  "address_requirements": "none",
195
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
193
196
  "api_version": "2010-04-01",
194
197
  "beta": null,
195
198
  "capabilities": {
@@ -292,6 +295,7 @@ describe 'IncomingPhoneNumber' do
292
295
  {
293
296
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
294
297
  "address_requirements": "none",
298
+ "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
295
299
  "api_version": "2010-04-01",
296
300
  "beta": false,
297
301
  "capabilities": {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0
4
+ version: 5.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twilio API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-13 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libxml-ruby
@@ -677,7 +677,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
677
677
  version: '0'
678
678
  requirements: []
679
679
  rubyforge_project:
680
- rubygems_version: 2.6.11
680
+ rubygems_version: 2.2.0
681
681
  signing_key:
682
682
  specification_version: 4
683
683
  summary: A simple library for communicating with the Twilio REST API, building TwiML,