twilio-ruby 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +5 -6
  3. data/CHANGES.md +21 -0
  4. data/README.md +28 -19
  5. data/VERSIONS.md +9 -10
  6. data/lib/twilio-ruby.rb +4 -2
  7. data/lib/twilio-ruby/framework/domain.rb +1 -1
  8. data/lib/twilio-ruby/http/http_client.rb +9 -3
  9. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +3 -3
  10. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -2
  11. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +3 -3
  12. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +3 -3
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +1 -1
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +18 -18
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/machine_to_machine.rb +18 -18
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +18 -18
  17. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/national.rb +18 -18
  18. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/shared_cost.rb +18 -18
  19. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +18 -18
  20. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/voip.rb +18 -18
  21. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +3 -3
  22. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +3 -3
  23. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +3 -3
  24. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +6 -6
  25. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +6 -6
  26. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +3 -3
  27. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +5 -5
  28. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +3 -3
  29. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
  30. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +5 -5
  31. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +4 -4
  32. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +4 -4
  33. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +2 -2
  34. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +2 -2
  35. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +2 -2
  36. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +1 -1
  37. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -6
  38. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +3 -5
  39. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +3 -3
  40. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +3 -3
  41. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +3 -3
  42. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +3 -3
  43. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +5 -5
  44. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +6 -6
  45. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +3 -3
  46. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +3 -3
  47. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +3 -3
  48. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +3 -3
  49. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +1 -1
  50. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +2 -2
  51. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping.rb +2 -2
  52. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_calls_mapping/auth_calls_credential_list_mapping.rb +3 -3
  53. 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
  54. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping.rb +2 -2
  55. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_registrations_mapping/auth_registrations_credential_list_mapping.rb +3 -3
  56. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +1 -1
  57. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +1 -1
  58. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +1 -1
  59. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +2 -2
  60. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +3 -3
  61. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +3 -3
  62. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +3 -3
  63. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +3 -3
  64. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +3 -3
  65. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +3 -3
  66. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +3 -3
  67. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +3 -3
  68. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +3 -3
  69. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +3 -3
  70. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +10 -10
  71. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +2 -2
  72. data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +1 -1
  73. data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +1 -1
  74. data/lib/twilio-ruby/rest/chat/v2/service.rb +12 -6
  75. data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +12 -12
  76. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
  77. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +17 -16
  78. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +35 -35
  79. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +6 -6
  80. data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +6 -6
  81. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +8 -8
  82. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +16 -12
  83. data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +12 -12
  84. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +13 -11
  85. data/lib/twilio-ruby/rest/client.rb +2 -2
  86. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +4 -4
  87. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +4 -4
  88. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +4 -4
  89. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +4 -4
  90. data/lib/twilio-ruby/rest/conversations/v1/webhook.rb +4 -4
  91. data/lib/twilio-ruby/rest/fax/v1/fax.rb +11 -5
  92. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +12 -6
  93. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +12 -12
  94. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +6 -6
  95. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +17 -16
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +35 -35
  97. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +6 -6
  98. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
  99. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +8 -8
  100. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +16 -12
  101. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +12 -12
  102. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +13 -11
  103. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -5
  104. data/lib/twilio-ruby/rest/monitor/v1.rb +1 -1
  105. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +16 -16
  106. data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +1 -1
  107. data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
  108. data/lib/twilio-ruby/security/request_validator.rb +1 -1
  109. data/lib/twilio-ruby/util/configuration.rb +10 -5
  110. data/lib/twilio-ruby/version.rb +1 -1
  111. data/spec/http/http_client_spec.rb +2 -2
  112. data/spec/integration/lookups/v1/phone_number_spec.rb +1 -1
  113. data/spec/integration/monitor/v1/alert_spec.rb +5 -28
  114. data/spec/integration/pricing/v1/voice/number_spec.rb +1 -1
  115. data/spec/integration/pricing/v2/voice/number_spec.rb +1 -1
  116. data/spec/rest/client_spec.rb +22 -0
  117. data/spec/twilio_spec.rb +3 -1
  118. data/spec/util/configuration_spec.rb +6 -0
  119. metadata +4 -3
@@ -16,8 +16,8 @@ module Twilio
16
16
  # Initialize the RoleList
17
17
  # @param [Version] version Version that contains the resource
18
18
  # @param [String] service_sid The SID of the
19
- # [Service](https://www.twilio.com/docs/chat/rest/services) the Role resource is
20
- # associated with.
19
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Role
20
+ # resource is associated with.
21
21
  # @return [RoleList] RoleList
22
22
  def initialize(version, service_sid: nil)
23
23
  super(version)
@@ -33,8 +33,8 @@ module Twilio
33
33
  # @param [String] friendly_name A descriptive string that you create to describe
34
34
  # the new resource. It can be up to 64 characters long.
35
35
  # @param [role.RoleType] type The type of role. Can be: `channel` for
36
- # [Channel](https://www.twilio.com/docs/chat/api/channels) roles or `deployment`
37
- # for [Service](https://www.twilio.com/docs/chat/api/services) roles.
36
+ # [Channel](https://www.twilio.com/docs/chat/channels) roles or `deployment` for
37
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) roles.
38
38
  # @param [String] permission A permission that you grant to the new role. Only one
39
39
  # permission can be granted per parameter. To assign more than one permission,
40
40
  # repeat this parameter for each permission value. The values for this parameter
@@ -179,8 +179,8 @@ module Twilio
179
179
  # Initialize the RoleContext
180
180
  # @param [Version] version Version that contains the resource
181
181
  # @param [String] service_sid The SID of the
182
- # [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the Role
183
- # resource from.
182
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the
183
+ # Role resource from.
184
184
  # @param [String] sid The SID of the Role resource to fetch.
185
185
  # @return [RoleContext] RoleContext
186
186
  def initialize(version, service_sid, sid)
@@ -255,8 +255,8 @@ module Twilio
255
255
  # @param [Version] version Version that contains the resource
256
256
  # @param [Hash] payload payload that contains response from Twilio
257
257
  # @param [String] service_sid The SID of the
258
- # [Service](https://www.twilio.com/docs/chat/rest/services) the Role resource is
259
- # associated with.
258
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the Role
259
+ # resource is associated with.
260
260
  # @param [String] sid The SID of the Role resource to fetch.
261
261
  # @return [RoleInstance] RoleInstance
262
262
  def initialize(version, payload, service_sid: nil, sid: nil)
@@ -16,8 +16,8 @@ module Twilio
16
16
  # Initialize the UserList
17
17
  # @param [Version] version Version that contains the resource
18
18
  # @param [String] service_sid The SID of the
19
- # [Service](https://www.twilio.com/docs/chat/rest/services) the User resource is
20
- # associated with.
19
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User
20
+ # resource is associated with.
21
21
  # @return [UserList] UserList
22
22
  def initialize(version, service_sid: nil)
23
23
  super(version)
@@ -31,11 +31,13 @@ module Twilio
31
31
  # Retrieve a single page of UserInstance records from the API.
32
32
  # Request is executed immediately.
33
33
  # @param [String] identity The `identity` value that uniquely identifies the new
34
- # resource's [User](https://www.twilio.com/docs/chat/rest/users) within the
35
- # [Service](https://www.twilio.com/docs/chat/rest/services). This value is often a
36
- # username or email address. See the Identity documentation for more info.
34
+ # resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within
35
+ # the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This
36
+ # value is often a username or email address. See the Identity documentation for
37
+ # more info.
37
38
  # @param [String] role_sid The SID of the
38
- # [Role](https://www.twilio.com/docs/chat/rest/roles) to assign to the new User.
39
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new
40
+ # User.
39
41
  # @param [String] attributes A valid JSON string that contains
40
42
  # application-specific data.
41
43
  # @param [String] friendly_name A descriptive string that you create to describe
@@ -181,8 +183,8 @@ module Twilio
181
183
  # Initialize the UserContext
182
184
  # @param [Version] version Version that contains the resource
183
185
  # @param [String] service_sid The SID of the
184
- # [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the User
185
- # resource from.
186
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the
187
+ # User resource from.
186
188
  # @param [String] sid The SID of the User resource to fetch. This value can be
187
189
  # either the `sid` or the `identity` of the User resource to fetch.
188
190
  # @return [UserContext] UserContext
@@ -223,7 +225,8 @@ module Twilio
223
225
  ##
224
226
  # Update the UserInstance
225
227
  # @param [String] role_sid The SID of the
226
- # [Role](https://www.twilio.com/docs/chat/rest/roles) to assign to the User.
228
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
229
+ # User.
227
230
  # @param [String] attributes A valid JSON string that contains
228
231
  # application-specific data.
229
232
  # @param [String] friendly_name A descriptive string that you create to describe
@@ -310,8 +313,8 @@ module Twilio
310
313
  # @param [Version] version Version that contains the resource
311
314
  # @param [Hash] payload payload that contains response from Twilio
312
315
  # @param [String] service_sid The SID of the
313
- # [Service](https://www.twilio.com/docs/chat/rest/services) the User resource is
314
- # associated with.
316
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User
317
+ # resource is associated with.
315
318
  # @param [String] sid The SID of the User resource to fetch. This value can be
316
319
  # either the `sid` or the `identity` of the User resource to fetch.
317
320
  # @return [UserInstance] UserInstance
@@ -453,7 +456,8 @@ module Twilio
453
456
  ##
454
457
  # Update the UserInstance
455
458
  # @param [String] role_sid The SID of the
456
- # [Role](https://www.twilio.com/docs/chat/rest/roles) to assign to the User.
459
+ # [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the
460
+ # User.
457
461
  # @param [String] attributes A valid JSON string that contains
458
462
  # application-specific data.
459
463
  # @param [String] friendly_name A descriptive string that you create to describe
@@ -17,11 +17,11 @@ module Twilio
17
17
  # Initialize the UserBindingList
18
18
  # @param [Version] version Version that contains the resource
19
19
  # @param [String] service_sid The SID of the
20
- # [Service](https://www.twilio.com/docs/chat/rest/services) the User Binding
21
- # resource is associated with.
20
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User
21
+ # Binding resource is associated with.
22
22
  # @param [String] user_sid The SID of the
23
- # [User](https://www.twilio.com/docs/chat/rest/users) with the User Binding
24
- # resource. See [push notification
23
+ # [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User
24
+ # Binding resource. See [push notification
25
25
  # configuration](https://www.twilio.com/docs/chat/push-notification-configuration)
26
26
  # for more info.
27
27
  # @return [UserBindingList] UserBindingList
@@ -177,11 +177,11 @@ module Twilio
177
177
  # Initialize the UserBindingContext
178
178
  # @param [Version] version Version that contains the resource
179
179
  # @param [String] service_sid The SID of the
180
- # [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the User
181
- # Binding resource from.
180
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the
181
+ # User Binding resource from.
182
182
  # @param [String] user_sid The SID of the
183
- # [User](https://www.twilio.com/docs/chat/rest/users) with the User Binding
184
- # resource to fetch. See [push notification
183
+ # [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User
184
+ # Binding resource to fetch. See [push notification
185
185
  # configuration](https://www.twilio.com/docs/chat/push-notification-configuration)
186
186
  # for more info.
187
187
  # @param [String] sid The SID of the User Binding resource to fetch.
@@ -243,11 +243,11 @@ module Twilio
243
243
  # @param [Version] version Version that contains the resource
244
244
  # @param [Hash] payload payload that contains response from Twilio
245
245
  # @param [String] service_sid The SID of the
246
- # [Service](https://www.twilio.com/docs/chat/rest/services) the User Binding
247
- # resource is associated with.
246
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User
247
+ # Binding resource is associated with.
248
248
  # @param [String] user_sid The SID of the
249
- # [User](https://www.twilio.com/docs/chat/rest/users) with the User Binding
250
- # resource. See [push notification
249
+ # [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User
250
+ # Binding resource. See [push notification
251
251
  # configuration](https://www.twilio.com/docs/chat/push-notification-configuration)
252
252
  # for more info.
253
253
  # @param [String] sid The SID of the User Binding resource to fetch.
@@ -17,10 +17,11 @@ module Twilio
17
17
  # Initialize the UserChannelList
18
18
  # @param [Version] version Version that contains the resource
19
19
  # @param [String] service_sid The SID of the
20
- # [Service](https://www.twilio.com/docs/chat/rest/services) the User Channel
21
- # resource is associated with.
20
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User
21
+ # Channel resource is associated with.
22
22
  # @param [String] user_sid The SID of the
23
- # [User](https://www.twilio.com/docs/chat/rest/users) the User Channel belongs to.
23
+ # [User](https://www.twilio.com/docs/chat/rest/user-resource) the User Channel
24
+ # belongs to.
24
25
  # @return [UserChannelList] UserChannelList
25
26
  def initialize(version, service_sid: nil, user_sid: nil)
26
27
  super(version)
@@ -158,12 +159,12 @@ module Twilio
158
159
  # Initialize the UserChannelContext
159
160
  # @param [Version] version Version that contains the resource
160
161
  # @param [String] service_sid The SID of the
161
- # [Service](https://www.twilio.com/docs/chat/rest/services) to fetch the User
162
- # Channel resource from.
162
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the
163
+ # User Channel resource from.
163
164
  # @param [String] user_sid The SID of the
164
- # [User](https://www.twilio.com/docs/chat/rest/users) to fetch the User Channel
165
- # resource from. This value can be either the `sid` or the `identity` of the User
166
- # resource.
165
+ # [User](https://www.twilio.com/docs/chat/rest/user-resource) to fetch the User
166
+ # Channel resource from. This value can be either the `sid` or the `identity` of
167
+ # the User resource.
167
168
  # @param [String] channel_sid The SID of the
168
169
  # [Channel](https://www.twilio.com/docs/chat/channels) that has the User Channel
169
170
  # to fetch. This value can be either the `sid` or the `unique_name` of the Channel
@@ -242,10 +243,11 @@ module Twilio
242
243
  # @param [Version] version Version that contains the resource
243
244
  # @param [Hash] payload payload that contains response from Twilio
244
245
  # @param [String] service_sid The SID of the
245
- # [Service](https://www.twilio.com/docs/chat/rest/services) the User Channel
246
- # resource is associated with.
246
+ # [Service](https://www.twilio.com/docs/chat/rest/service-resource) the User
247
+ # Channel resource is associated with.
247
248
  # @param [String] user_sid The SID of the
248
- # [User](https://www.twilio.com/docs/chat/rest/users) the User Channel belongs to.
249
+ # [User](https://www.twilio.com/docs/chat/rest/user-resource) the User Channel
250
+ # belongs to.
249
251
  # @param [String] channel_sid The SID of the
250
252
  # [Channel](https://www.twilio.com/docs/chat/channels) that has the User Channel
251
253
  # to fetch. This value can be either the `sid` or the `unique_name` of the Channel
@@ -71,13 +71,13 @@ module Twilio
71
71
 
72
72
  # Path Solution
73
73
  @solution = {phone_number: phone_number, }
74
- @uri = "/PhoneNumbers/#{@solution[:phone_number]}"
74
+ @uri = "/PhoneNumbers/#{CGI.escape(@solution[:phone_number]).gsub("+", "%20")}"
75
75
  end
76
76
 
77
77
  ##
78
78
  # Fetch a PhoneNumberInstance
79
79
  # @param [String] country_code The [ISO country
80
- # code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to
80
+ # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to
81
81
  # fetch. This is used to specify the country when the phone number is provided in
82
82
  # a national format.
83
83
  # @param [String] type The type of information to return. Can be: `carrier` or
@@ -90,7 +90,7 @@ module Twilio
90
90
  # Can be the `unique_name` of an Add-on that is installed on your account. You can
91
91
  # specify multiple instances of this parameter to invoke multiple Add-ons. For
92
92
  # more information about Add-ons, see the [Add-ons
93
- # documentation](https://www.twilio.com/docs/api/addons).
93
+ # documentation](https://www.twilio.com/docs/add-ons).
94
94
  # @param [Hash] add_ons_data Data specific to the add-on you would like to invoke.
95
95
  # The content and format of this value depends on the add-on.
96
96
  # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
@@ -210,7 +210,7 @@ module Twilio
210
210
  ##
211
211
  # Fetch a PhoneNumberInstance
212
212
  # @param [String] country_code The [ISO country
213
- # code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to
213
+ # code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to
214
214
  # fetch. This is used to specify the country when the phone number is provided in
215
215
  # a national format.
216
216
  # @param [String] type The type of information to return. Can be: `carrier` or
@@ -223,7 +223,7 @@ module Twilio
223
223
  # Can be the `unique_name` of an Add-on that is installed on your account. You can
224
224
  # specify multiple instances of this parameter to invoke multiple Add-ons. For
225
225
  # more information about Add-ons, see the [Add-ons
226
- # documentation](https://www.twilio.com/docs/api/addons).
226
+ # documentation](https://www.twilio.com/docs/add-ons).
227
227
  # @param [Hash] add_ons_data Data specific to the add-on you would like to invoke.
228
228
  # The content and format of this value depends on the add-on.
229
229
  # @return [PhoneNumberInstance] Fetched PhoneNumberInstance
@@ -20,7 +20,7 @@ module Twilio
20
20
  end
21
21
 
22
22
  ##
23
- # @param [String] sid The sid
23
+ # @param [String] sid A 34 character string that uniquely identifies this Alert.
24
24
  # @return [Twilio::REST::Monitor::V1::AlertContext] if sid was passed.
25
25
  # @return [Twilio::REST::Monitor::V1::AlertList]
26
26
  def alerts(sid=:unset)
@@ -195,7 +195,7 @@ module Twilio
195
195
  ##
196
196
  # Initialize the AlertContext
197
197
  # @param [Version] version Version that contains the resource
198
- # @param [String] sid The sid
198
+ # @param [String] sid A 34 character string that uniquely identifies this Alert.
199
199
  # @return [AlertContext] AlertContext
200
200
  def initialize(version, sid)
201
201
  super(version)
@@ -220,13 +220,6 @@ module Twilio
220
220
  AlertInstance.new(@version, payload, sid: @solution[:sid], )
221
221
  end
222
222
 
223
- ##
224
- # Deletes the AlertInstance
225
- # @return [Boolean] true if delete succeeds, false otherwise
226
- def delete
227
- @version.delete('delete', @uri)
228
- end
229
-
230
223
  ##
231
224
  # Provide a user friendly representation
232
225
  def to_s
@@ -247,7 +240,7 @@ module Twilio
247
240
  # Initialize the AlertInstance
248
241
  # @param [Version] version Version that contains the resource
249
242
  # @param [Hash] payload payload that contains response from Twilio
250
- # @param [String] sid The sid
243
+ # @param [String] sid A 34 character string that uniquely identifies this Alert.
251
244
  # @return [AlertInstance] AlertInstance
252
245
  def initialize(version, payload, sid: nil)
253
246
  super(version)
@@ -268,9 +261,11 @@ module Twilio
268
261
  'resource_sid' => payload['resource_sid'],
269
262
  'sid' => payload['sid'],
270
263
  'url' => payload['url'],
264
+ 'service_sid' => payload['service_sid'],
271
265
  'request_variables' => payload['request_variables'],
272
266
  'response_body' => payload['response_body'],
273
267
  'response_headers' => payload['response_headers'],
268
+ 'request_headers' => payload['request_headers'],
274
269
  }
275
270
 
276
271
  # Context
@@ -391,6 +386,18 @@ module Twilio
391
386
  @properties['url']
392
387
  end
393
388
 
389
+ ##
390
+ # @return [String] The request_headers
391
+ def request_headers
392
+ @properties['request_headers']
393
+ end
394
+
395
+ ##
396
+ # @return [String] The service_sid
397
+ def service_sid
398
+ @properties['service_sid']
399
+ end
400
+
394
401
  ##
395
402
  # Fetch a AlertInstance
396
403
  # @return [AlertInstance] Fetched AlertInstance
@@ -398,13 +405,6 @@ module Twilio
398
405
  context.fetch
399
406
  end
400
407
 
401
- ##
402
- # Deletes the AlertInstance
403
- # @return [Boolean] true if delete succeeds, false otherwise
404
- def delete
405
- context.delete
406
- end
407
-
408
408
  ##
409
409
  # Provide a user friendly representation
410
410
  def to_s
@@ -70,7 +70,7 @@ module Twilio
70
70
 
71
71
  # Path Solution
72
72
  @solution = {number: number, }
73
- @uri = "/Voice/Numbers/#{@solution[:number]}"
73
+ @uri = "/Voice/Numbers/#{CGI.escape(@solution[:number]).gsub("+", "%20")}"
74
74
  end
75
75
 
76
76
  ##
@@ -73,7 +73,7 @@ module Twilio
73
73
 
74
74
  # Path Solution
75
75
  @solution = {destination_number: destination_number, }
76
- @uri = "/Voice/Numbers/#{@solution[:destination_number]}"
76
+ @uri = "/Voice/Numbers/#{CGI.escape(@solution[:destination_number]).gsub("+", "%20")}"
77
77
  end
78
78
 
79
79
  ##
@@ -58,7 +58,7 @@ module Twilio
58
58
  def build_signature_for(url, params)
59
59
  data = url + params.sort.join
60
60
  digest = OpenSSL::Digest.new('sha1')
61
- Base64.encode64(OpenSSL::HMAC.digest(digest, @auth_token, data)).strip
61
+ Base64.strict_encode64(OpenSSL::HMAC.digest(digest, @auth_token, data))
62
62
  end
63
63
 
64
64
  private
@@ -3,13 +3,18 @@
3
3
  module Twilio
4
4
  module Util
5
5
  class Configuration
6
- attr_accessor :account_sid, :auth_token
7
- def account_sid=value
8
- @account_sid=value
6
+ attr_accessor :account_sid, :auth_token, :http_client
7
+
8
+ def account_sid=(value)
9
+ @account_sid = value
10
+ end
11
+
12
+ def auth_token=(value)
13
+ @auth_token = value
9
14
  end
10
15
 
11
- def auth_token=value
12
- @auth_token=value
16
+ def http_client=(value)
17
+ @http_client = value
13
18
  end
14
19
  end
15
20
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.26.0'
2
+ VERSION = '5.27.0'
3
3
  end
@@ -96,7 +96,7 @@ describe Twilio::HTTP::Client do
96
96
  expect(Faraday).to receive(:new).and_return(Faraday::Connection.new)
97
97
  allow_any_instance_of(Faraday::Connection).to receive(:send).and_raise(Faraday::ConnectionFailed.new('BOOM'))
98
98
 
99
- expect { @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b']) }.to raise_exception(Faraday::ConnectionFailed)
99
+ expect { @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b']) }.to raise_exception(Twilio::REST::TwilioError)
100
100
  expect(@client.last_response).to be_nil
101
101
  expect(@client.last_request).to_not be_nil
102
102
  expect(@client.last_request.host).to eq('host')
@@ -116,7 +116,7 @@ describe Twilio::HTTP::Client do
116
116
  it 'previous last_response should be cleared' do
117
117
  expect(Faraday).to receive(:new).and_return(Faraday::Connection.new)
118
118
  allow_any_instance_of(Faraday::Connection).to receive(:send).and_raise(Faraday::ConnectionFailed.new('BOOM'))
119
- expect { @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b']) }.to raise_exception(Faraday::ConnectionFailed)
119
+ expect { @client.request('host', 'port', 'GET', 'url', nil, nil, {}, ['a', 'b']) }.to raise_exception(Twilio::REST::TwilioError)
120
120
  expect(@client.last_response).to be_nil
121
121
  end
122
122
  end
@@ -20,7 +20,7 @@ describe 'PhoneNumber' do
20
20
  expect(
21
21
  @holodeck.has_request?(Holodeck::Request.new(
22
22
  method: 'get',
23
- url: 'https://lookups.twilio.com/v1/PhoneNumbers/+15017122661',
23
+ url: 'https://lookups.twilio.com/v1/PhoneNumbers/%2B15017122661',
24
24
  ))).to eq(true)
25
25
  end
26
26
 
@@ -44,8 +44,10 @@ describe 'Alert' do
44
44
  "resource_sid": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
45
45
  "response_body": "response_body",
46
46
  "response_headers": "response_headers",
47
+ "request_headers": "request_headers",
47
48
  "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
48
- "url": "https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
49
+ "url": "https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
50
+ "service_sid": "PNe2cd757cd5257b0217a447933a0290d2"
49
51
  }
50
52
  ]
51
53
  ))
@@ -55,32 +57,6 @@ describe 'Alert' do
55
57
  expect(actual).to_not eq(nil)
56
58
  end
57
59
 
58
- it "can delete" do
59
- @holodeck.mock(Twilio::Response.new(500, ''))
60
-
61
- expect {
62
- @client.monitor.v1.alerts('NOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
63
- }.to raise_exception(Twilio::REST::TwilioError)
64
-
65
- values = {}
66
- expect(
67
- @holodeck.has_request?(Holodeck::Request.new(
68
- method: 'delete',
69
- url: 'https://monitor.twilio.com/v1/Alerts/NOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
70
- ))).to eq(true)
71
- end
72
-
73
- it "receives delete responses" do
74
- @holodeck.mock(Twilio::Response.new(
75
- 204,
76
- nil,
77
- ))
78
-
79
- actual = @client.monitor.v1.alerts('NOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
80
-
81
- expect(actual).to eq(true)
82
- end
83
-
84
60
  it "can read" do
85
61
  @holodeck.mock(Twilio::Response.new(500, ''))
86
62
 
@@ -140,7 +116,8 @@ describe 'Alert' do
140
116
  "request_url": "http://www.example.com",
141
117
  "resource_sid": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
142
118
  "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
143
- "url": "https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
119
+ "url": "https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
120
+ "service_sid": "PNe2cd757cd5257b0217a447933a0290d2"
144
121
  }
145
122
  ],
146
123
  "meta": {