twilio-ruby 5.14.1 → 5.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +33 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +2 -1
- data/lib/twilio-ruby/rest/authy.rb +55 -0
- data/lib/twilio-ruby/rest/authy/v1.rb +59 -0
- data/lib/twilio-ruby/rest/authy/v1/form.rb +190 -0
- data/lib/twilio-ruby/rest/authy/v1/service.rb +378 -0
- data/lib/twilio-ruby/rest/authy/v1/service/entity.rb +372 -0
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +474 -0
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +405 -0
- data/lib/twilio-ruby/rest/autopilot.rb +47 -0
- data/lib/twilio-ruby/rest/autopilot/v1.rb +43 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +606 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +215 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +205 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +417 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +393 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +390 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +443 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +215 -0
- data/lib/twilio-ruby/rest/{preview/understand/assistant/intent.rb → autopilot/v1/assistant/task.rb} +91 -84
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +377 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +442 -0
- data/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +244 -0
- data/lib/twilio-ruby/rest/{preview/understand/assistant/intent/intent_statistics.rb → autopilot/v1/assistant/task/task_statistics.rb} +49 -51
- data/lib/twilio-ruby/rest/chat/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +12 -6
- data/lib/twilio-ruby/rest/client.rb +14 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +12 -6
- data/lib/twilio-ruby/rest/preview/understand.rb +2 -1
- data/lib/twilio-ruby/rest/preview/understand/assistant.rb +59 -29
- data/lib/twilio-ruby/rest/preview/understand/assistant/query.rb +17 -13
- data/lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb +215 -0
- data/lib/twilio-ruby/rest/preview/understand/assistant/task.rb +505 -0
- data/lib/twilio-ruby/rest/preview/understand/assistant/{intent → task}/field.rb +25 -25
- data/lib/twilio-ruby/rest/preview/understand/assistant/{intent → task}/sample.rb +30 -30
- data/lib/twilio-ruby/rest/preview/understand/assistant/{intent/intent_actions.rb → task/task_actions.rb} +50 -54
- data/lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb +224 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +7 -7
- data/lib/twilio-ruby/rest/verify/v1/service.rb +45 -6
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +9 -2
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +32 -5
- data/lib/twilio-ruby/twiml/voice_response.rb +66 -5
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/recording_spec.rb +3 -3
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +42 -1
- data/spec/integration/api/v2010/account/conference/recording_spec.rb +2 -2
- data/spec/integration/authy/v1/form_spec.rb +48 -0
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +267 -0
- data/spec/integration/authy/v1/service/entity/factor_spec.rb +269 -0
- data/spec/integration/authy/v1/service/entity_spec.rb +201 -0
- data/spec/integration/authy/v1/service_spec.rb +227 -0
- data/spec/integration/autopilot/v1/assistant/defaults_spec.rb +81 -0
- data/spec/integration/autopilot/v1/assistant/dialogue_spec.rb +47 -0
- data/spec/integration/autopilot/v1/assistant/field_type/field_value_spec.rb +210 -0
- data/spec/integration/autopilot/v1/assistant/field_type_spec.rb +246 -0
- data/spec/integration/autopilot/v1/assistant/model_build_spec.rb +241 -0
- data/spec/integration/autopilot/v1/assistant/query_spec.rb +306 -0
- data/spec/integration/autopilot/v1/assistant/style_sheet_spec.rb +81 -0
- data/spec/integration/autopilot/v1/assistant/task/field_spec.rb +207 -0
- data/spec/integration/autopilot/v1/assistant/task/sample_spec.rb +253 -0
- data/spec/integration/autopilot/v1/assistant/task/task_actions_spec.rb +87 -0
- data/spec/integration/autopilot/v1/assistant/task/task_statistics_spec.rb +50 -0
- data/spec/integration/autopilot/v1/assistant/task_spec.rb +262 -0
- data/spec/integration/autopilot/v1/assistant_spec.rb +270 -0
- data/spec/integration/preview/understand/assistant/query_spec.rb +8 -8
- data/spec/integration/preview/understand/assistant/style_sheet_spec.rb +81 -0
- data/spec/integration/preview/understand/assistant/{intent → task}/field_spec.rb +23 -23
- data/spec/integration/preview/understand/assistant/{intent → task}/sample_spec.rb +28 -28
- data/spec/integration/preview/understand/assistant/{intent/intent_actions_spec.rb → task/task_actions_spec.rb} +15 -15
- data/spec/integration/preview/understand/assistant/{intent/intent_statistics_spec.rb → task/task_statistics_spec.rb} +6 -6
- data/spec/integration/preview/understand/assistant/{intent_spec.rb → task_spec.rb} +53 -49
- data/spec/integration/preview/understand/assistant_spec.rb +12 -8
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +3 -7
- data/spec/integration/verify/v1/service_spec.rb +30 -0
- data/spec/integration/wireless/v1/command_spec.rb +99 -2
- data/spec/twiml/voice_response_spec.rb +25 -2
- metadata +78 -17
@@ -619,15 +619,18 @@ module Twilio
|
|
619
619
|
|
620
620
|
##
|
621
621
|
# Create a new <Client> element
|
622
|
-
#
|
622
|
+
# identity:: Client identity
|
623
623
|
# url:: Client URL
|
624
624
|
# method:: Client URL Method
|
625
625
|
# status_callback_event:: Events to trigger status callback
|
626
626
|
# status_callback:: Status Callback URL
|
627
627
|
# status_callback_method:: Status Callback URL Method
|
628
628
|
# keyword_args:: additional attributes
|
629
|
-
def client(
|
630
|
-
|
629
|
+
def client(identity: nil, url: nil, method: nil, status_callback_event: nil, status_callback: nil, status_callback_method: nil, **keyword_args)
|
630
|
+
client = Client.new(identity: identity, url: url, method: method, status_callback_event: status_callback_event, status_callback: status_callback, status_callback_method: status_callback_method, **keyword_args)
|
631
|
+
|
632
|
+
yield(client) if block_given?
|
633
|
+
append(client)
|
631
634
|
end
|
632
635
|
|
633
636
|
##
|
@@ -753,10 +756,49 @@ module Twilio
|
|
753
756
|
##
|
754
757
|
# <Client> TwiML Noun
|
755
758
|
class Client < TwiML
|
756
|
-
def initialize(
|
759
|
+
def initialize(identity: nil, **keyword_args)
|
757
760
|
super(**keyword_args)
|
758
761
|
@name = 'Client'
|
759
|
-
@value =
|
762
|
+
@value = identity unless identity.nil?
|
763
|
+
yield(self) if block_given?
|
764
|
+
end
|
765
|
+
|
766
|
+
##
|
767
|
+
# Create a new <Identity> element
|
768
|
+
# client_identity:: Identity of the client to dial
|
769
|
+
# keyword_args:: additional attributes
|
770
|
+
def identity(client_identity, **keyword_args)
|
771
|
+
append(Identity.new(client_identity, **keyword_args))
|
772
|
+
end
|
773
|
+
|
774
|
+
##
|
775
|
+
# Create a new <Parameter> element
|
776
|
+
# name:: The name of the custom parameter
|
777
|
+
# value:: The value of the custom parameter
|
778
|
+
# keyword_args:: additional attributes
|
779
|
+
def parameter(name: nil, value: nil, **keyword_args)
|
780
|
+
append(Parameter.new(name: name, value: value, **keyword_args))
|
781
|
+
end
|
782
|
+
end
|
783
|
+
|
784
|
+
##
|
785
|
+
# <Parameter> TwiML Noun
|
786
|
+
class Parameter < TwiML
|
787
|
+
def initialize(**keyword_args)
|
788
|
+
super(**keyword_args)
|
789
|
+
@name = 'Parameter'
|
790
|
+
|
791
|
+
yield(self) if block_given?
|
792
|
+
end
|
793
|
+
end
|
794
|
+
|
795
|
+
##
|
796
|
+
# <Identity> TwiML Noun
|
797
|
+
class Identity < TwiML
|
798
|
+
def initialize(client_identity, **keyword_args)
|
799
|
+
super(**keyword_args)
|
800
|
+
@name = 'Identity'
|
801
|
+
@value = client_identity
|
760
802
|
yield(self) if block_given?
|
761
803
|
end
|
762
804
|
end
|
@@ -779,6 +821,25 @@ module Twilio
|
|
779
821
|
def room(name, participantIdentity: nil, **keyword_args)
|
780
822
|
append(Room.new(name, participantIdentity: participantIdentity, **keyword_args))
|
781
823
|
end
|
824
|
+
|
825
|
+
##
|
826
|
+
# Create a new <Autopilot> element
|
827
|
+
# name:: Autopilot assistant sid or unique name
|
828
|
+
# keyword_args:: additional attributes
|
829
|
+
def autopilot(name, **keyword_args)
|
830
|
+
append(Autopilot.new(name, **keyword_args))
|
831
|
+
end
|
832
|
+
end
|
833
|
+
|
834
|
+
##
|
835
|
+
# <Autopilot> TwiML Noun
|
836
|
+
class Autopilot < TwiML
|
837
|
+
def initialize(name, **keyword_args)
|
838
|
+
super(**keyword_args)
|
839
|
+
@name = 'Autopilot'
|
840
|
+
@value = name
|
841
|
+
yield(self) if block_given?
|
842
|
+
end
|
782
843
|
end
|
783
844
|
|
784
845
|
##
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -41,7 +41,7 @@ describe 'Recording' do
|
|
41
41
|
"start_time": "Fri, 14 Oct 2016 21:56:34 +0000",
|
42
42
|
"price": null,
|
43
43
|
"price_unit": null,
|
44
|
-
"duration":
|
44
|
+
"duration": null,
|
45
45
|
"sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
46
46
|
"source": "StartCallRecordingAPI",
|
47
47
|
"status": "in-progress",
|
@@ -88,11 +88,11 @@ describe 'Recording' do
|
|
88
88
|
"conference_sid": null,
|
89
89
|
"channels": 2,
|
90
90
|
"date_created": "Fri, 14 Oct 2016 21:56:34 +0000",
|
91
|
-
"date_updated": "Fri, 14 Oct 2016 21:56:
|
91
|
+
"date_updated": "Fri, 14 Oct 2016 21:56:36 +0000",
|
92
92
|
"start_time": "Fri, 14 Oct 2016 21:56:34 +0000",
|
93
93
|
"price": null,
|
94
94
|
"price_unit": null,
|
95
|
-
"duration":
|
95
|
+
"duration": null,
|
96
96
|
"sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
97
97
|
"source": "StartCallRecordingAPI",
|
98
98
|
"status": "paused",
|
@@ -41,6 +41,8 @@ describe 'Participant' do
|
|
41
41
|
"hold": false,
|
42
42
|
"status": "complete",
|
43
43
|
"start_conference_on_enter": true,
|
44
|
+
"coaching": true,
|
45
|
+
"call_sid_to_coach": "CAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
44
46
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
45
47
|
}
|
46
48
|
]
|
@@ -70,7 +72,7 @@ describe 'Participant' do
|
|
70
72
|
))).to eq(true)
|
71
73
|
end
|
72
74
|
|
73
|
-
it "receives
|
75
|
+
it "receives mute_participant responses" do
|
74
76
|
@holodeck.mock(Twilio::Response.new(
|
75
77
|
200,
|
76
78
|
%q[
|
@@ -85,6 +87,37 @@ describe 'Participant' do
|
|
85
87
|
"hold": false,
|
86
88
|
"status": "complete",
|
87
89
|
"start_conference_on_enter": true,
|
90
|
+
"coaching": false,
|
91
|
+
"call_sid_to_coach": null,
|
92
|
+
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
93
|
+
}
|
94
|
+
]
|
95
|
+
))
|
96
|
+
|
97
|
+
actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
98
|
+
.conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
99
|
+
.participants('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update()
|
100
|
+
|
101
|
+
expect(actual).to_not eq(nil)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "receives modify_participant responses" do
|
105
|
+
@holodeck.mock(Twilio::Response.new(
|
106
|
+
200,
|
107
|
+
%q[
|
108
|
+
{
|
109
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
110
|
+
"call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
111
|
+
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
112
|
+
"date_created": "Fri, 18 Feb 2011 21:07:19 +0000",
|
113
|
+
"date_updated": "Fri, 18 Feb 2011 21:07:19 +0000",
|
114
|
+
"end_conference_on_exit": false,
|
115
|
+
"muted": false,
|
116
|
+
"hold": false,
|
117
|
+
"status": "complete",
|
118
|
+
"start_conference_on_enter": true,
|
119
|
+
"coaching": true,
|
120
|
+
"call_sid_to_coach": "CAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
88
121
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
89
122
|
}
|
90
123
|
]
|
@@ -130,6 +163,8 @@ describe 'Participant' do
|
|
130
163
|
"hold": false,
|
131
164
|
"status": "complete",
|
132
165
|
"start_conference_on_enter": true,
|
166
|
+
"coaching": false,
|
167
|
+
"call_sid_to_coach": null,
|
133
168
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
134
169
|
}
|
135
170
|
]
|
@@ -157,6 +192,8 @@ describe 'Participant' do
|
|
157
192
|
"hold": false,
|
158
193
|
"status": "complete",
|
159
194
|
"start_conference_on_enter": true,
|
195
|
+
"coaching": false,
|
196
|
+
"call_sid_to_coach": null,
|
160
197
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
161
198
|
}
|
162
199
|
]
|
@@ -184,6 +221,8 @@ describe 'Participant' do
|
|
184
221
|
"hold": false,
|
185
222
|
"status": "queued",
|
186
223
|
"start_conference_on_enter": true,
|
224
|
+
"coaching": false,
|
225
|
+
"call_sid_to_coach": null,
|
187
226
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
188
227
|
}
|
189
228
|
]
|
@@ -265,6 +304,8 @@ describe 'Participant' do
|
|
265
304
|
"hold": false,
|
266
305
|
"status": "complete",
|
267
306
|
"start_conference_on_enter": true,
|
307
|
+
"coaching": true,
|
308
|
+
"call_sid_to_coach": "CAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
268
309
|
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
|
269
310
|
}
|
270
311
|
],
|
@@ -38,11 +38,11 @@ describe 'Recording' do
|
|
38
38
|
"conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
39
|
"channels": 1,
|
40
40
|
"date_created": "Fri, 14 Oct 2016 21:56:34 +0000",
|
41
|
-
"date_updated": "Fri, 14 Oct 2016 21:56:
|
41
|
+
"date_updated": "Fri, 14 Oct 2016 21:56:39 +0000",
|
42
42
|
"start_time": "Fri, 14 Oct 2016 21:56:34 +0000",
|
43
43
|
"price": null,
|
44
44
|
"price_unit": null,
|
45
|
-
"duration":
|
45
|
+
"duration": null,
|
46
46
|
"sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
47
47
|
"source": "StartConferenceRecordingAPI",
|
48
48
|
"status": "paused",
|
@@ -0,0 +1,48 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
require 'spec_helper.rb'
|
10
|
+
|
11
|
+
describe 'Form' do
|
12
|
+
it "can fetch" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.authy.v1.forms('form-app-push').fetch()
|
17
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
18
|
+
|
19
|
+
values = {}
|
20
|
+
expect(
|
21
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
22
|
+
method: 'get',
|
23
|
+
url: 'https://authy.twilio.com/v1/Forms/form-app-push',
|
24
|
+
))).to eq(true)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "receives fetch responses" do
|
28
|
+
@holodeck.mock(Twilio::Response.new(
|
29
|
+
200,
|
30
|
+
%q[
|
31
|
+
{
|
32
|
+
"form_type": "form-sms",
|
33
|
+
"forms": {
|
34
|
+
"create_factor": {},
|
35
|
+
"verify_factor": {},
|
36
|
+
"create_challenge": {}
|
37
|
+
},
|
38
|
+
"form_meta": {},
|
39
|
+
"url": "https://authy.twilio.com/v1/Forms/form-sms"
|
40
|
+
}
|
41
|
+
]
|
42
|
+
))
|
43
|
+
|
44
|
+
actual = @client.authy.v1.forms('form-app-push').fetch()
|
45
|
+
|
46
|
+
expect(actual).to_not eq(nil)
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,267 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
require 'spec_helper.rb'
|
10
|
+
|
11
|
+
describe 'Challenge' do
|
12
|
+
it "can create" do
|
13
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
+
|
15
|
+
expect {
|
16
|
+
@client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
+
.entities('identity') \
|
18
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
19
|
+
.challenges.create()
|
20
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
21
|
+
|
22
|
+
values = {}
|
23
|
+
expect(
|
24
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
25
|
+
method: 'post',
|
26
|
+
url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges',
|
27
|
+
))).to eq(true)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "receives create responses" do
|
31
|
+
@holodeck.mock(Twilio::Response.new(
|
32
|
+
201,
|
33
|
+
%q[
|
34
|
+
{
|
35
|
+
"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
36
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
+
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
39
|
+
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
40
|
+
"factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
41
|
+
"date_created": "2015-07-30T20:00:00Z",
|
42
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
43
|
+
"date_responded": "2015-07-30T20:00:00Z",
|
44
|
+
"expiration_date": "2015-07-30T20:00:00Z",
|
45
|
+
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
46
|
+
"status": "pending",
|
47
|
+
"reason": "none",
|
48
|
+
"details": "Hi! Mr. John Doe, would you like to sign up?",
|
49
|
+
"hidden_details": "Hidden details about the sign up",
|
50
|
+
"type": "sms",
|
51
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
52
|
+
}
|
53
|
+
]
|
54
|
+
))
|
55
|
+
|
56
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
57
|
+
.entities('identity') \
|
58
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
59
|
+
.challenges.create()
|
60
|
+
|
61
|
+
expect(actual).to_not eq(nil)
|
62
|
+
end
|
63
|
+
|
64
|
+
it "can delete" do
|
65
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
66
|
+
|
67
|
+
expect {
|
68
|
+
@client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
69
|
+
.entities('identity') \
|
70
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
71
|
+
.challenges('sid').delete()
|
72
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
73
|
+
|
74
|
+
values = {}
|
75
|
+
expect(
|
76
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
77
|
+
method: 'delete',
|
78
|
+
url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid',
|
79
|
+
))).to eq(true)
|
80
|
+
end
|
81
|
+
|
82
|
+
it "receives delete responses" do
|
83
|
+
@holodeck.mock(Twilio::Response.new(
|
84
|
+
204,
|
85
|
+
nil,
|
86
|
+
))
|
87
|
+
|
88
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
89
|
+
.entities('identity') \
|
90
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
91
|
+
.challenges('sid').delete()
|
92
|
+
|
93
|
+
expect(actual).to eq(true)
|
94
|
+
end
|
95
|
+
|
96
|
+
it "can fetch" do
|
97
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
98
|
+
|
99
|
+
expect {
|
100
|
+
@client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
101
|
+
.entities('identity') \
|
102
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
103
|
+
.challenges('sid').fetch()
|
104
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
105
|
+
|
106
|
+
values = {}
|
107
|
+
expect(
|
108
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
109
|
+
method: 'get',
|
110
|
+
url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid',
|
111
|
+
))).to eq(true)
|
112
|
+
end
|
113
|
+
|
114
|
+
it "receives fetch_sid responses" do
|
115
|
+
@holodeck.mock(Twilio::Response.new(
|
116
|
+
200,
|
117
|
+
%q[
|
118
|
+
{
|
119
|
+
"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
120
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
121
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
122
|
+
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
123
|
+
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
124
|
+
"factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
125
|
+
"date_created": "2015-07-30T20:00:00Z",
|
126
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
127
|
+
"date_responded": "2015-07-30T20:00:00Z",
|
128
|
+
"expiration_date": "2015-07-30T20:00:00Z",
|
129
|
+
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
130
|
+
"status": "pending",
|
131
|
+
"reason": "none",
|
132
|
+
"details": "details",
|
133
|
+
"hidden_details": "hidden_details",
|
134
|
+
"type": "sms",
|
135
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
136
|
+
}
|
137
|
+
]
|
138
|
+
))
|
139
|
+
|
140
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
141
|
+
.entities('identity') \
|
142
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
143
|
+
.challenges('sid').fetch()
|
144
|
+
|
145
|
+
expect(actual).to_not eq(nil)
|
146
|
+
end
|
147
|
+
|
148
|
+
it "receives fetch_latest responses" do
|
149
|
+
@holodeck.mock(Twilio::Response.new(
|
150
|
+
200,
|
151
|
+
%q[
|
152
|
+
{
|
153
|
+
"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
154
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
155
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
156
|
+
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
+
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
158
|
+
"factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
159
|
+
"date_created": "2015-07-30T20:00:00Z",
|
160
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
161
|
+
"date_responded": "2015-07-30T20:00:00Z",
|
162
|
+
"expiration_date": "2015-07-30T20:00:00Z",
|
163
|
+
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
164
|
+
"status": "pending",
|
165
|
+
"reason": "none",
|
166
|
+
"details": "details",
|
167
|
+
"hidden_details": "hidden_details",
|
168
|
+
"type": "sms",
|
169
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
170
|
+
}
|
171
|
+
]
|
172
|
+
))
|
173
|
+
|
174
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
175
|
+
.entities('identity') \
|
176
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
177
|
+
.challenges('sid').fetch()
|
178
|
+
|
179
|
+
expect(actual).to_not eq(nil)
|
180
|
+
end
|
181
|
+
|
182
|
+
it "can update" do
|
183
|
+
@holodeck.mock(Twilio::Response.new(500, ''))
|
184
|
+
|
185
|
+
expect {
|
186
|
+
@client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
187
|
+
.entities('identity') \
|
188
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
189
|
+
.challenges('sid').update()
|
190
|
+
}.to raise_exception(Twilio::REST::TwilioError)
|
191
|
+
|
192
|
+
values = {}
|
193
|
+
expect(
|
194
|
+
@holodeck.has_request?(Holodeck::Request.new(
|
195
|
+
method: 'post',
|
196
|
+
url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid',
|
197
|
+
))).to eq(true)
|
198
|
+
end
|
199
|
+
|
200
|
+
it "receives verify_sid responses" do
|
201
|
+
@holodeck.mock(Twilio::Response.new(
|
202
|
+
200,
|
203
|
+
%q[
|
204
|
+
{
|
205
|
+
"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
206
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
207
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
208
|
+
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
209
|
+
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
210
|
+
"factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
211
|
+
"date_created": "2015-07-30T20:00:00Z",
|
212
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
213
|
+
"date_responded": "2015-07-30T20:00:00Z",
|
214
|
+
"expiration_date": "2015-07-30T20:00:00Z",
|
215
|
+
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
216
|
+
"status": "approved",
|
217
|
+
"reason": "none",
|
218
|
+
"details": "Hi! Mr. John Doe, would you like to sign up?",
|
219
|
+
"hidden_details": "Hidden details about the sign up",
|
220
|
+
"type": "sms",
|
221
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
222
|
+
}
|
223
|
+
]
|
224
|
+
))
|
225
|
+
|
226
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
227
|
+
.entities('identity') \
|
228
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
229
|
+
.challenges('sid').update()
|
230
|
+
|
231
|
+
expect(actual).to_not eq(nil)
|
232
|
+
end
|
233
|
+
|
234
|
+
it "receives verify_latest responses" do
|
235
|
+
@holodeck.mock(Twilio::Response.new(
|
236
|
+
200,
|
237
|
+
%q[
|
238
|
+
{
|
239
|
+
"sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
240
|
+
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
241
|
+
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
242
|
+
"entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
243
|
+
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
244
|
+
"factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
245
|
+
"date_created": "2015-07-30T20:00:00Z",
|
246
|
+
"date_updated": "2015-07-30T20:00:00Z",
|
247
|
+
"date_responded": "2015-07-30T20:00:00Z",
|
248
|
+
"expiration_date": "2015-07-30T20:00:00Z",
|
249
|
+
"verification_sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
250
|
+
"status": "approved",
|
251
|
+
"reason": "none",
|
252
|
+
"details": "Hi! Mr. John Doe, would you like to sign up?",
|
253
|
+
"hidden_details": "Hidden details about the sign up",
|
254
|
+
"type": "sms",
|
255
|
+
"url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
256
|
+
}
|
257
|
+
]
|
258
|
+
))
|
259
|
+
|
260
|
+
actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
261
|
+
.entities('identity') \
|
262
|
+
.factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
263
|
+
.challenges('sid').update()
|
264
|
+
|
265
|
+
expect(actual).to_not eq(nil)
|
266
|
+
end
|
267
|
+
end
|