twilio-ruby 5.0.0.rc22 → 5.0.0.rc23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +10 -0
- data/lib/twilio-ruby/jwt/client_capability.rb +17 -8
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +15 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +15 -3
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +15 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +10 -2
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +15 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +15 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +15 -3
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +15 -3
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +61 -28
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +11 -6
- data/lib/twilio-ruby/rest/notify/v1/service.rb +28 -3
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +8 -1
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +1 -4
- data/lib/twilio-ruby/twiml/voice_response.rb +5 -20
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +1 -0
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +1 -0
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +1 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +2 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +2 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +2 -0
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -0
- data/spec/integration/notify/v1/service/notification_spec.rb +2 -1
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +34 -0
- data/spec/integration/notify/v1/service_spec.rb +8 -0
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +2 -3
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +57 -41
- data/spec/integration/taskrouter/v1/workspace_spec.rb +38 -30
- data/spec/jwt/client_capability_spec.rb +9 -9
- data/spec/twiml/voice_response_spec.rb +5 -5
- metadata +2 -2
@@ -37,8 +37,11 @@ module Twilio
|
|
37
37
|
# @param [String] default_fcm_notification_protocol_version The
|
38
38
|
# default_fcm_notification_protocol_version
|
39
39
|
# @param [Boolean] log_enabled The log_enabled
|
40
|
+
# @param [String] alexa_skill_id The alexa_skill_id
|
41
|
+
# @param [String] default_alexa_notification_protocol_version The
|
42
|
+
# default_alexa_notification_protocol_version
|
40
43
|
# @return [ServiceInstance] Newly created ServiceInstance
|
41
|
-
def create(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset)
|
44
|
+
def create(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset)
|
42
45
|
data = Twilio::Values.of({
|
43
46
|
'FriendlyName' => friendly_name,
|
44
47
|
'ApnCredentialSid' => apn_credential_sid,
|
@@ -50,6 +53,8 @@ module Twilio
|
|
50
53
|
'FcmCredentialSid' => fcm_credential_sid,
|
51
54
|
'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version,
|
52
55
|
'LogEnabled' => log_enabled,
|
56
|
+
'AlexaSkillId' => alexa_skill_id,
|
57
|
+
'DefaultAlexaNotificationProtocolVersion' => default_alexa_notification_protocol_version,
|
53
58
|
})
|
54
59
|
|
55
60
|
payload = @version.create(
|
@@ -268,8 +273,11 @@ module Twilio
|
|
268
273
|
# @param [String] default_fcm_notification_protocol_version The
|
269
274
|
# default_fcm_notification_protocol_version
|
270
275
|
# @param [Boolean] log_enabled The log_enabled
|
276
|
+
# @param [String] alexa_skill_id The alexa_skill_id
|
277
|
+
# @param [String] default_alexa_notification_protocol_version The
|
278
|
+
# default_alexa_notification_protocol_version
|
271
279
|
# @return [ServiceInstance] Updated ServiceInstance
|
272
|
-
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset)
|
280
|
+
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset)
|
273
281
|
data = Twilio::Values.of({
|
274
282
|
'FriendlyName' => friendly_name,
|
275
283
|
'ApnCredentialSid' => apn_credential_sid,
|
@@ -281,6 +289,8 @@ module Twilio
|
|
281
289
|
'FcmCredentialSid' => fcm_credential_sid,
|
282
290
|
'DefaultFcmNotificationProtocolVersion' => default_fcm_notification_protocol_version,
|
283
291
|
'LogEnabled' => log_enabled,
|
292
|
+
'AlexaSkillId' => alexa_skill_id,
|
293
|
+
'DefaultAlexaNotificationProtocolVersion' => default_alexa_notification_protocol_version,
|
284
294
|
})
|
285
295
|
|
286
296
|
payload = @version.update(
|
@@ -404,6 +414,8 @@ module Twilio
|
|
404
414
|
'log_enabled' => payload['log_enabled'],
|
405
415
|
'url' => payload['url'],
|
406
416
|
'links' => payload['links'],
|
417
|
+
'alexa_skill_id' => payload['alexa_skill_id'],
|
418
|
+
'default_alexa_notification_protocol_version' => payload['default_alexa_notification_protocol_version'],
|
407
419
|
}
|
408
420
|
|
409
421
|
# Context
|
@@ -492,6 +504,14 @@ module Twilio
|
|
492
504
|
@properties['links']
|
493
505
|
end
|
494
506
|
|
507
|
+
def alexa_skill_id
|
508
|
+
@properties['alexa_skill_id']
|
509
|
+
end
|
510
|
+
|
511
|
+
def default_alexa_notification_protocol_version
|
512
|
+
@properties['default_alexa_notification_protocol_version']
|
513
|
+
end
|
514
|
+
|
495
515
|
##
|
496
516
|
# Deletes the ServiceInstance
|
497
517
|
# @return [Boolean] true if delete succeeds, true otherwise
|
@@ -521,8 +541,11 @@ module Twilio
|
|
521
541
|
# @param [String] default_fcm_notification_protocol_version The
|
522
542
|
# default_fcm_notification_protocol_version
|
523
543
|
# @param [Boolean] log_enabled The log_enabled
|
544
|
+
# @param [String] alexa_skill_id The alexa_skill_id
|
545
|
+
# @param [String] default_alexa_notification_protocol_version The
|
546
|
+
# default_alexa_notification_protocol_version
|
524
547
|
# @return [ServiceInstance] Updated ServiceInstance
|
525
|
-
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset)
|
548
|
+
def update(friendly_name: :unset, apn_credential_sid: :unset, gcm_credential_sid: :unset, messaging_service_sid: :unset, facebook_messenger_page_id: :unset, default_apn_notification_protocol_version: :unset, default_gcm_notification_protocol_version: :unset, fcm_credential_sid: :unset, default_fcm_notification_protocol_version: :unset, log_enabled: :unset, alexa_skill_id: :unset, default_alexa_notification_protocol_version: :unset)
|
526
549
|
context.update(
|
527
550
|
friendly_name: friendly_name,
|
528
551
|
apn_credential_sid: apn_credential_sid,
|
@@ -534,6 +557,8 @@ module Twilio
|
|
534
557
|
fcm_credential_sid: fcm_credential_sid,
|
535
558
|
default_fcm_notification_protocol_version: default_fcm_notification_protocol_version,
|
536
559
|
log_enabled: log_enabled,
|
560
|
+
alexa_skill_id: alexa_skill_id,
|
561
|
+
default_alexa_notification_protocol_version: default_alexa_notification_protocol_version,
|
537
562
|
)
|
538
563
|
end
|
539
564
|
|
@@ -41,10 +41,11 @@ module Twilio
|
|
41
41
|
# @param [Hash] facebook_messenger The facebook_messenger
|
42
42
|
# @param [String] fcm The fcm
|
43
43
|
# @param [String] segment The segment
|
44
|
+
# @param [String] alexa The alexa
|
44
45
|
# @param [String] identity The identity
|
45
46
|
# @param [String] tag The tag
|
46
47
|
# @return [NotificationInstance] Newly created NotificationInstance
|
47
|
-
def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, identity: :unset, tag: :unset)
|
48
|
+
def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, identity: :unset, tag: :unset)
|
48
49
|
data = Twilio::Values.of({
|
49
50
|
'Identity' => identity,
|
50
51
|
'Tag' => tag,
|
@@ -61,6 +62,7 @@ module Twilio
|
|
61
62
|
'FacebookMessenger' => Twilio.serialize_object(facebook_messenger),
|
62
63
|
'Fcm' => fcm,
|
63
64
|
'Segment' => segment,
|
65
|
+
'Alexa' => alexa,
|
64
66
|
})
|
65
67
|
|
66
68
|
payload = @version.create(
|
@@ -148,6 +150,7 @@ module Twilio
|
|
148
150
|
'fcm' => payload['fcm'],
|
149
151
|
'sms' => payload['sms'],
|
150
152
|
'facebook_messenger' => payload['facebook_messenger'],
|
153
|
+
'alexa' => payload['alexa'],
|
151
154
|
}
|
152
155
|
end
|
153
156
|
|
@@ -227,6 +230,10 @@ module Twilio
|
|
227
230
|
@properties['facebook_messenger']
|
228
231
|
end
|
229
232
|
|
233
|
+
def alexa
|
234
|
+
@properties['alexa']
|
235
|
+
end
|
236
|
+
|
230
237
|
##
|
231
238
|
# Provide a user friendly representation
|
232
239
|
def to_s
|
@@ -186,8 +186,6 @@ module Twilio
|
|
186
186
|
# Address resource that represents the address of the owner of this phone number.
|
187
187
|
# @param [String] phone_number An E164 formatted phone number hosted by this
|
188
188
|
# HostedNumberOrder.
|
189
|
-
# @param [hosted_number_order.Type] type The type of the phone_number. One of
|
190
|
-
# `local` or `tollfree`.
|
191
189
|
# @param [String] iso_country The ISO country code of the phone_number.
|
192
190
|
# @param [Boolean] sms_capability Used to specify that the SMS capability will be
|
193
191
|
# hosted on Twilio's platform.
|
@@ -211,11 +209,10 @@ module Twilio
|
|
211
209
|
# @param [String] sms_fallback_method Optional. The SMS Fallback Method attached
|
212
210
|
# to the IncomingPhoneNumber resource.
|
213
211
|
# @return [HostedNumberOrderInstance] Newly created HostedNumberOrderInstance
|
214
|
-
def create(address_sid: nil, phone_number: nil,
|
212
|
+
def create(address_sid: nil, phone_number: nil, iso_country: nil, sms_capability: nil, email: nil, account_sid: :unset, friendly_name: :unset, unique_name: :unset, cc_emails: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset)
|
215
213
|
data = Twilio::Values.of({
|
216
214
|
'AddressSid' => address_sid,
|
217
215
|
'PhoneNumber' => phone_number,
|
218
|
-
'Type' => type,
|
219
216
|
'IsoCountry' => iso_country,
|
220
217
|
'SmsCapability' => sms_capability,
|
221
218
|
'Email' => email,
|
@@ -186,13 +186,8 @@ module Twilio
|
|
186
186
|
#
|
187
187
|
# == Returns:
|
188
188
|
# A <Response> element with a <Play> child element
|
189
|
-
def play(url, loop: nil, digits: nil, **keyword_args)
|
190
|
-
|
191
|
-
url,
|
192
|
-
loop: loop,
|
193
|
-
digits: digits,
|
194
|
-
**keyword_args
|
195
|
-
))
|
189
|
+
def play(url: nil, loop: nil, digits: nil, **keyword_args)
|
190
|
+
append(Play.new(url: url, loop: loop, digits: digits, **keyword_args))
|
196
191
|
end
|
197
192
|
|
198
193
|
# Create a <Record> element
|
@@ -762,18 +757,8 @@ module Twilio
|
|
762
757
|
#
|
763
758
|
# == Returns:
|
764
759
|
# A <Gather> element with a <Play> child element
|
765
|
-
def play(
|
766
|
-
url,
|
767
|
-
loop: nil,
|
768
|
-
digits: nil,
|
769
|
-
**keyword_args)
|
770
|
-
|
771
|
-
self.append(Play.new(
|
772
|
-
url,
|
773
|
-
loop: loop,
|
774
|
-
digits: digits,
|
775
|
-
**keyword_args
|
776
|
-
))
|
760
|
+
def play(url: nil, loop: nil, digits: nil, **keyword_args)
|
761
|
+
append(Play.new(url: url, loop: loop, digits: digits, **keyword_args))
|
777
762
|
end
|
778
763
|
|
779
764
|
# Create a <Pause> element
|
@@ -812,7 +797,7 @@ module Twilio
|
|
812
797
|
#
|
813
798
|
# == Returns:
|
814
799
|
# A <Play> element
|
815
|
-
def initialize(url, **keyword_args)
|
800
|
+
def initialize(url: nil, **keyword_args)
|
816
801
|
super(**keyword_args)
|
817
802
|
@value = url
|
818
803
|
end
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -46,6 +46,7 @@ describe 'Local' do
|
|
46
46
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
47
47
|
"friendly_name": "(808) 925-5327",
|
48
48
|
"phone_number": "+18089255327",
|
49
|
+
"origin": "origin",
|
49
50
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
50
51
|
"sms_application_sid": "",
|
51
52
|
"sms_fallback_method": "POST",
|
@@ -150,6 +151,7 @@ describe 'Local' do
|
|
150
151
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
151
152
|
"friendly_name": "(808) 925-5327",
|
152
153
|
"phone_number": "+18089255327",
|
154
|
+
"origin": "origin",
|
153
155
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
154
156
|
"sms_application_sid": "",
|
155
157
|
"sms_fallback_method": "POST",
|
@@ -46,6 +46,7 @@ describe 'Mobile' do
|
|
46
46
|
"date_updated": "Tue, 08 Sep 2015 16:21:16 +0000",
|
47
47
|
"friendly_name": "61429099450",
|
48
48
|
"phone_number": "+61429099450",
|
49
|
+
"origin": "origin",
|
49
50
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
50
51
|
"sms_application_sid": "",
|
51
52
|
"sms_fallback_method": "POST",
|
@@ -150,6 +151,7 @@ describe 'Mobile' do
|
|
150
151
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
151
152
|
"friendly_name": "(808) 925-5327",
|
152
153
|
"phone_number": "+18089255327",
|
154
|
+
"origin": "origin",
|
153
155
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
154
156
|
"sms_application_sid": "",
|
155
157
|
"sms_fallback_method": "POST",
|
@@ -46,6 +46,7 @@ describe 'TollFree' do
|
|
46
46
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
47
47
|
"friendly_name": "(808) 925-5327",
|
48
48
|
"phone_number": "+18089255327",
|
49
|
+
"origin": "origin",
|
49
50
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
50
51
|
"sms_application_sid": "",
|
51
52
|
"sms_fallback_method": "POST",
|
@@ -150,6 +151,7 @@ describe 'TollFree' do
|
|
150
151
|
"date_updated": "Thu, 30 Jul 2015 23:19:04 +0000",
|
151
152
|
"friendly_name": "(808) 925-5327",
|
152
153
|
"phone_number": "+18089255327",
|
154
|
+
"origin": "origin",
|
153
155
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
154
156
|
"sms_application_sid": "",
|
155
157
|
"sms_fallback_method": "POST",
|
@@ -42,6 +42,7 @@ describe 'IncomingPhoneNumber' do
|
|
42
42
|
"emergency_status": "Inactive",
|
43
43
|
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
44
44
|
"friendly_name": "(808) 925-5327",
|
45
|
+
"origin": "origin",
|
45
46
|
"phone_number": "+18089255327",
|
46
47
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
48
|
"sms_application_sid": "",
|
@@ -104,6 +105,7 @@ describe 'IncomingPhoneNumber' do
|
|
104
105
|
"emergency_status": "Active",
|
105
106
|
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
106
107
|
"friendly_name": "(808) 925-5327",
|
108
|
+
"origin": "origin",
|
107
109
|
"phone_number": "+18089255327",
|
108
110
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
109
111
|
"sms_application_sid": "",
|
@@ -198,6 +200,7 @@ describe 'IncomingPhoneNumber' do
|
|
198
200
|
"emergency_status": "Active",
|
199
201
|
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
200
202
|
"friendly_name": "(808) 925-5327",
|
203
|
+
"origin": "origin",
|
201
204
|
"phone_number": "+18089255327",
|
202
205
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
203
206
|
"sms_application_sid": "",
|
@@ -298,6 +301,7 @@ describe 'IncomingPhoneNumber' do
|
|
298
301
|
"emergency_status": "Active",
|
299
302
|
"emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
300
303
|
"friendly_name": "(808) 925-5327",
|
304
|
+
"origin": "origin",
|
301
305
|
"phone_number": "+18089255327",
|
302
306
|
"sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
303
307
|
"sms_application_sid": "",
|
@@ -143,6 +143,40 @@ describe 'UserBinding' do
|
|
143
143
|
expect(actual).to_not eq(nil)
|
144
144
|
end
|
145
145
|
|
146
|
+
it "receives create_alexa responses" do
|
147
|
+
@holodeck.mock(Twilio::TwilioResponse.new(
|
148
|
+
201,
|
149
|
+
%q[
|
150
|
+
{
|
151
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
152
|
+
"address": "address",
|
153
|
+
"binding_type": "binding_type",
|
154
|
+
"credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
155
|
+
"date_created": "2015-07-30T20:00:00Z",
|
156
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
157
|
+
"endpoint": "endpoint",
|
158
|
+
"identity": "identity",
|
159
|
+
"links": {
|
160
|
+
"user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity"
|
161
|
+
},
|
162
|
+
"notification_protocol_version": "notification_protocol_version",
|
163
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
164
|
+
"sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
165
|
+
"tags": [
|
166
|
+
"tag"
|
167
|
+
],
|
168
|
+
"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
169
|
+
}
|
170
|
+
]
|
171
|
+
))
|
172
|
+
|
173
|
+
actual = @client.notify.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
174
|
+
.users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
|
175
|
+
.bindings.create(binding_type: "apn", address: "address")
|
176
|
+
|
177
|
+
expect(actual).to_not eq(nil)
|
178
|
+
end
|
179
|
+
|
146
180
|
it "can read" do
|
147
181
|
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
148
182
|
|
@@ -37,9 +37,11 @@ describe 'Service' do
|
|
37
37
|
"fcm_credential_sid": null,
|
38
38
|
"messaging_service_sid": null,
|
39
39
|
"facebook_messenger_page_id": "4",
|
40
|
+
"alexa_skill_id": null,
|
40
41
|
"default_apn_notification_protocol_version": "3",
|
41
42
|
"default_gcm_notification_protocol_version": "3",
|
42
43
|
"default_fcm_notification_protocol_version": "3",
|
44
|
+
"default_alexa_notification_protocol_version": "3",
|
43
45
|
"log_enabled": true,
|
44
46
|
"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
45
47
|
"links": {
|
@@ -113,9 +115,11 @@ describe 'Service' do
|
|
113
115
|
"fcm_credential_sid": null,
|
114
116
|
"messaging_service_sid": null,
|
115
117
|
"facebook_messenger_page_id": "4",
|
118
|
+
"alexa_skill_id": null,
|
116
119
|
"default_apn_notification_protocol_version": "3",
|
117
120
|
"default_gcm_notification_protocol_version": "3",
|
118
121
|
"default_fcm_notification_protocol_version": "3",
|
122
|
+
"default_alexa_notification_protocol_version": "3",
|
119
123
|
"log_enabled": true,
|
120
124
|
"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
121
125
|
"links": {
|
@@ -174,9 +178,11 @@ describe 'Service' do
|
|
174
178
|
"fcm_credential_sid": null,
|
175
179
|
"messaging_service_sid": null,
|
176
180
|
"facebook_messenger_page_id": "4",
|
181
|
+
"alexa_skill_id": null,
|
177
182
|
"default_apn_notification_protocol_version": "3",
|
178
183
|
"default_gcm_notification_protocol_version": "3",
|
179
184
|
"default_fcm_notification_protocol_version": "3",
|
185
|
+
"default_alexa_notification_protocol_version": "3",
|
180
186
|
"log_enabled": true,
|
181
187
|
"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
182
188
|
"links": {
|
@@ -251,7 +257,9 @@ describe 'Service' do
|
|
251
257
|
"default_apn_notification_protocol_version": "3",
|
252
258
|
"default_gcm_notification_protocol_version": "3",
|
253
259
|
"default_fcm_notification_protocol_version": "3",
|
260
|
+
"default_alexa_notification_protocol_version": "3",
|
254
261
|
"messaging_service_sid": null,
|
262
|
+
"alexa_skill_id": null,
|
255
263
|
"facebook_messenger_page_id": "4",
|
256
264
|
"log_enabled": true,
|
257
265
|
"url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
@@ -224,13 +224,12 @@ describe 'HostedNumberOrder' do
|
|
224
224
|
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
|
225
225
|
|
226
226
|
expect {
|
227
|
-
@client.preview.hosted_numbers.hosted_number_orders.create(address_sid: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", phone_number: "+987654321",
|
227
|
+
@client.preview.hosted_numbers.hosted_number_orders.create(address_sid: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", phone_number: "+987654321", iso_country: "iso_country", sms_capability: true, email: "email")
|
228
228
|
}.to raise_exception(Twilio::REST::TwilioError)
|
229
229
|
|
230
230
|
values = {
|
231
231
|
'AddressSid' => "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
232
232
|
'PhoneNumber' => "+987654321",
|
233
|
-
'Type' => "local",
|
234
233
|
'IsoCountry' => "iso_country",
|
235
234
|
'SmsCapability' => true,
|
236
235
|
'Email' => "email",
|
@@ -270,7 +269,7 @@ describe 'HostedNumberOrder' do
|
|
270
269
|
]
|
271
270
|
))
|
272
271
|
|
273
|
-
actual = @client.preview.hosted_numbers.hosted_number_orders.create(address_sid: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", phone_number: "+987654321",
|
272
|
+
actual = @client.preview.hosted_numbers.hosted_number_orders.create(address_sid: "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", phone_number: "+987654321", iso_country: "iso_country", sms_capability: true, email: "email")
|
274
273
|
|
275
274
|
expect(actual).to_not eq(nil)
|
276
275
|
end
|
@@ -29,32 +29,36 @@ describe 'Worker' do
|
|
29
29
|
%q[
|
30
30
|
{
|
31
31
|
"meta": {
|
32
|
-
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0",
|
33
|
-
"key": "workers",
|
34
|
-
"next_page_url": null,
|
35
32
|
"page": 0,
|
36
33
|
"page_size": 50,
|
34
|
+
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0",
|
37
35
|
"previous_page_url": null,
|
38
|
-
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0"
|
36
|
+
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0",
|
37
|
+
"next_page_url": null,
|
38
|
+
"key": "workers"
|
39
39
|
},
|
40
40
|
"workers": [
|
41
41
|
{
|
42
|
+
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
43
|
+
"friendly_name": "testWorker",
|
42
44
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
43
|
-
"activity_name": "Offline",
|
44
45
|
"activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
46
|
+
"activity_name": "Offline",
|
47
|
+
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
45
48
|
"attributes": "{}",
|
46
49
|
"available": false,
|
47
|
-
"date_created": "
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
50
|
+
"date_created": "2017-05-30T23:05:29Z",
|
51
|
+
"date_updated": "2017-05-30T23:05:29Z",
|
52
|
+
"date_status_changed": "2017-05-30T23:05:29Z",
|
53
|
+
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
51
54
|
"links": {
|
55
|
+
"channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
52
56
|
"activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
53
|
-
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
57
|
+
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
58
|
+
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics",
|
59
|
+
"worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
60
|
+
"reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"
|
61
|
+
}
|
58
62
|
}
|
59
63
|
]
|
60
64
|
}
|
@@ -116,21 +120,25 @@ describe 'Worker' do
|
|
116
120
|
201,
|
117
121
|
%q[
|
118
122
|
{
|
123
|
+
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
124
|
+
"friendly_name": "NewWorker",
|
119
125
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
120
|
-
"activity_name": "available",
|
121
126
|
"activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
122
|
-
"
|
123
|
-
"available": true,
|
124
|
-
"date_created": "2014-05-14T10:50:02Z",
|
125
|
-
"date_status_changed": "2014-05-14T23:26:06Z",
|
126
|
-
"date_updated": "2014-05-14T23:26:06Z",
|
127
|
-
"friendly_name": "Test Worker",
|
128
|
-
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
129
|
-
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
127
|
+
"activity_name": "Offline",
|
130
128
|
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
129
|
+
"attributes": "{}",
|
130
|
+
"available": false,
|
131
|
+
"date_created": "2017-05-30T23:19:38Z",
|
132
|
+
"date_updated": "2017-05-30T23:19:38Z",
|
133
|
+
"date_status_changed": "2017-05-30T23:19:38Z",
|
134
|
+
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
131
135
|
"links": {
|
136
|
+
"channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
132
137
|
"activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
133
|
-
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
138
|
+
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
139
|
+
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics",
|
140
|
+
"worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
141
|
+
"reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"
|
134
142
|
}
|
135
143
|
}
|
136
144
|
]
|
@@ -166,18 +174,22 @@ describe 'Worker' do
|
|
166
174
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
167
175
|
"activity_name": "available",
|
168
176
|
"activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
169
|
-
"attributes": "{
|
170
|
-
"available":
|
171
|
-
"date_created": "
|
172
|
-
"date_status_changed": "
|
173
|
-
"date_updated": "
|
174
|
-
"friendly_name": "
|
177
|
+
"attributes": "{}",
|
178
|
+
"available": false,
|
179
|
+
"date_created": "2017-05-30T23:32:39Z",
|
180
|
+
"date_status_changed": "2017-05-30T23:32:39Z",
|
181
|
+
"date_updated": "2017-05-30T23:32:39Z",
|
182
|
+
"friendly_name": "NewWorker3",
|
175
183
|
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
176
184
|
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
177
185
|
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
178
186
|
"links": {
|
187
|
+
"channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
179
188
|
"activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
180
|
-
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
189
|
+
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
190
|
+
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics",
|
191
|
+
"worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
192
|
+
"reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"
|
181
193
|
}
|
182
194
|
}
|
183
195
|
]
|
@@ -210,21 +222,25 @@ describe 'Worker' do
|
|
210
222
|
200,
|
211
223
|
%q[
|
212
224
|
{
|
225
|
+
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
226
|
+
"friendly_name": "blah",
|
213
227
|
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
214
|
-
"activity_name": "available",
|
215
228
|
"activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
216
|
-
"
|
217
|
-
"available": true,
|
218
|
-
"date_created": "2014-05-14T10:50:02Z",
|
219
|
-
"date_status_changed": "2014-05-14T23:26:06Z",
|
220
|
-
"date_updated": "2014-05-14T23:26:06Z",
|
221
|
-
"friendly_name": "Test Worker",
|
222
|
-
"sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
223
|
-
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
229
|
+
"activity_name": "Offline",
|
224
230
|
"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
231
|
+
"attributes": "{}",
|
232
|
+
"available": false,
|
233
|
+
"date_created": "2017-05-30T23:32:22Z",
|
234
|
+
"date_updated": "2017-05-31T00:05:57Z",
|
235
|
+
"date_status_changed": "2017-05-30T23:32:22Z",
|
236
|
+
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
225
237
|
"links": {
|
238
|
+
"channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
226
239
|
"activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
227
|
-
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
240
|
+
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
241
|
+
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics",
|
242
|
+
"worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels",
|
243
|
+
"reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations"
|
228
244
|
}
|
229
245
|
}
|
230
246
|
]
|