twilio-ruby 5.37.0 → 5.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +32 -9
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +41 -5
  5. data/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +0 -16
  6. data/lib/twilio-ruby/rest/client.rb +0 -7
  7. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +28 -3
  8. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +8 -8
  9. data/lib/twilio-ruby/rest/verify/v2/service.rb +26 -0
  10. data/lib/twilio-ruby/rest/{authy/v1/service/entity.rb → verify/v2/service/webhook.rb} +154 -108
  11. data/lib/twilio-ruby/version.rb +1 -1
  12. data/spec/integration/api/v2010/account/conference/participant_spec.rb +60 -0
  13. data/spec/integration/autopilot/v1/assistant_spec.rb +4 -8
  14. data/spec/integration/conversations/v1/conversation_spec.rb +16 -0
  15. data/spec/integration/verify/v2/service/webhook_spec.rb +262 -0
  16. data/spec/integration/verify/v2/service_spec.rb +8 -4
  17. metadata +5 -22
  18. data/lib/twilio-ruby/rest/authy.rb +0 -55
  19. data/lib/twilio-ruby/rest/authy/v1.rb +0 -59
  20. data/lib/twilio-ruby/rest/authy/v1/form.rb +0 -197
  21. data/lib/twilio-ruby/rest/authy/v1/service.rb +0 -404
  22. data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +0 -500
  23. data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +0 -494
  24. data/lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb +0 -222
  25. data/spec/integration/authy/v1/form_spec.rb +0 -48
  26. data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +0 -353
  27. data/spec/integration/authy/v1/service/entity/factor_spec.rb +0 -298
  28. data/spec/integration/authy/v1/service/entity_spec.rb +0 -201
  29. data/spec/integration/authy/v1/service_spec.rb +0 -231
  30. data/spec/integration/autopilot/v1/assistant/export_assistant_spec.rb +0 -49
@@ -1,222 +0,0 @@
1
- ##
2
- # This code was generated by
3
- # \ / _ _ _| _ _
4
- # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
- # / /
6
- #
7
- # frozen_string_literal: true
8
-
9
- module Twilio
10
- module REST
11
- class Autopilot < Domain
12
- class V1 < Version
13
- class AssistantContext < InstanceContext
14
- ##
15
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
16
- class ExportAssistantList < ListResource
17
- ##
18
- # Initialize the ExportAssistantList
19
- # @param [Version] version Version that contains the resource
20
- # @param [String] assistant_sid The SID of the
21
- # [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) to export.
22
- # @return [ExportAssistantList] ExportAssistantList
23
- def initialize(version, assistant_sid: nil)
24
- super(version)
25
-
26
- # Path Solution
27
- @solution = {assistant_sid: assistant_sid}
28
- end
29
-
30
- ##
31
- # Provide a user friendly representation
32
- def to_s
33
- '#<Twilio.Autopilot.V1.ExportAssistantList>'
34
- end
35
- end
36
-
37
- ##
38
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
39
- class ExportAssistantPage < Page
40
- ##
41
- # Initialize the ExportAssistantPage
42
- # @param [Version] version Version that contains the resource
43
- # @param [Response] response Response from the API
44
- # @param [Hash] solution Path solution for the resource
45
- # @return [ExportAssistantPage] ExportAssistantPage
46
- def initialize(version, response, solution)
47
- super(version, response)
48
-
49
- # Path Solution
50
- @solution = solution
51
- end
52
-
53
- ##
54
- # Build an instance of ExportAssistantInstance
55
- # @param [Hash] payload Payload response from the API
56
- # @return [ExportAssistantInstance] ExportAssistantInstance
57
- def get_instance(payload)
58
- ExportAssistantInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
59
- end
60
-
61
- ##
62
- # Provide a user friendly representation
63
- def to_s
64
- '<Twilio.Autopilot.V1.ExportAssistantPage>'
65
- end
66
- end
67
-
68
- ##
69
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
70
- class ExportAssistantContext < InstanceContext
71
- ##
72
- # Initialize the ExportAssistantContext
73
- # @param [Version] version Version that contains the resource
74
- # @param [String] assistant_sid The SID of the
75
- # [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) to export.
76
- # @return [ExportAssistantContext] ExportAssistantContext
77
- def initialize(version, assistant_sid)
78
- super(version)
79
-
80
- # Path Solution
81
- @solution = {assistant_sid: assistant_sid, }
82
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Export"
83
- end
84
-
85
- ##
86
- # Fetch a ExportAssistantInstance
87
- # @return [ExportAssistantInstance] Fetched ExportAssistantInstance
88
- def fetch
89
- params = Twilio::Values.of({})
90
-
91
- payload = @version.fetch(
92
- 'GET',
93
- @uri,
94
- params,
95
- )
96
-
97
- ExportAssistantInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
98
- end
99
-
100
- ##
101
- # Provide a user friendly representation
102
- def to_s
103
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
104
- "#<Twilio.Autopilot.V1.ExportAssistantContext #{context}>"
105
- end
106
-
107
- ##
108
- # Provide a detailed, user friendly representation
109
- def inspect
110
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
111
- "#<Twilio.Autopilot.V1.ExportAssistantContext #{context}>"
112
- end
113
- end
114
-
115
- ##
116
- # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
117
- class ExportAssistantInstance < InstanceResource
118
- ##
119
- # Initialize the ExportAssistantInstance
120
- # @param [Version] version Version that contains the resource
121
- # @param [Hash] payload payload that contains response from Twilio
122
- # @param [String] assistant_sid The SID of the
123
- # [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) to export.
124
- # @return [ExportAssistantInstance] ExportAssistantInstance
125
- def initialize(version, payload, assistant_sid: nil)
126
- super(version)
127
-
128
- # Marshaled Properties
129
- @properties = {
130
- 'account_sid' => payload['account_sid'],
131
- 'assistant_sid' => payload['assistant_sid'],
132
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
133
- 'status' => payload['status'],
134
- 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
135
- 'url' => payload['url'],
136
- 'schema' => payload['schema'],
137
- }
138
-
139
- # Context
140
- @instance_context = nil
141
- @params = {'assistant_sid' => assistant_sid, }
142
- end
143
-
144
- ##
145
- # Generate an instance context for the instance, the context is capable of
146
- # performing various actions. All instance actions are proxied to the context
147
- # @return [ExportAssistantContext] ExportAssistantContext for this ExportAssistantInstance
148
- def context
149
- unless @instance_context
150
- @instance_context = ExportAssistantContext.new(@version, @params['assistant_sid'], )
151
- end
152
- @instance_context
153
- end
154
-
155
- ##
156
- # @return [String] The SID of the Account that created the resource
157
- def account_sid
158
- @properties['account_sid']
159
- end
160
-
161
- ##
162
- # @return [String] The SID of the Assistant to export.
163
- def assistant_sid
164
- @properties['assistant_sid']
165
- end
166
-
167
- ##
168
- # @return [Time] The RFC 2822 date and time in GMT when the resource was created
169
- def date_created
170
- @properties['date_created']
171
- end
172
-
173
- ##
174
- # @return [export_assistant.Status] The status of the export
175
- def status
176
- @properties['status']
177
- end
178
-
179
- ##
180
- # @return [String] More information about why the export failed, if `status` is `failed`
181
- def error_code
182
- @properties['error_code']
183
- end
184
-
185
- ##
186
- # @return [String] The absolute URL of the Export resource.
187
- def url
188
- @properties['url']
189
- end
190
-
191
- ##
192
- # @return [Hash] The JSON string that describes the requested Assistant.
193
- def schema
194
- @properties['schema']
195
- end
196
-
197
- ##
198
- # Fetch a ExportAssistantInstance
199
- # @return [ExportAssistantInstance] Fetched ExportAssistantInstance
200
- def fetch
201
- context.fetch
202
- end
203
-
204
- ##
205
- # Provide a user friendly representation
206
- def to_s
207
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
208
- "<Twilio.Autopilot.V1.ExportAssistantInstance #{values}>"
209
- end
210
-
211
- ##
212
- # Provide a detailed, user friendly representation
213
- def inspect
214
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
215
- "<Twilio.Autopilot.V1.ExportAssistantInstance #{values}>"
216
- end
217
- end
218
- end
219
- end
220
- end
221
- end
222
- end
@@ -1,48 +0,0 @@
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
@@ -1,353 +0,0 @@
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
- "status": "pending",
46
- "responded_reason": "none",
47
- "details": "Hi! Mr. John Doe, would you like to sign up?",
48
- "hidden_details": "Hidden details about the sign up",
49
- "factor_type": "sms",
50
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
51
- }
52
- ]
53
- ))
54
-
55
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
56
- .entities('identity') \
57
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
58
- .challenges.create()
59
-
60
- expect(actual).to_not eq(nil)
61
- end
62
-
63
- it "can delete" do
64
- @holodeck.mock(Twilio::Response.new(500, ''))
65
-
66
- expect {
67
- @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
68
- .entities('identity') \
69
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
70
- .challenges('sid').delete()
71
- }.to raise_exception(Twilio::REST::TwilioError)
72
-
73
- values = {}
74
- expect(
75
- @holodeck.has_request?(Holodeck::Request.new(
76
- method: 'delete',
77
- url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid',
78
- ))).to eq(true)
79
- end
80
-
81
- it "receives delete responses" do
82
- @holodeck.mock(Twilio::Response.new(
83
- 204,
84
- nil,
85
- ))
86
-
87
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
88
- .entities('identity') \
89
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
90
- .challenges('sid').delete()
91
-
92
- expect(actual).to eq(true)
93
- end
94
-
95
- it "can fetch" do
96
- @holodeck.mock(Twilio::Response.new(500, ''))
97
-
98
- expect {
99
- @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
100
- .entities('identity') \
101
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
102
- .challenges('sid').fetch()
103
- }.to raise_exception(Twilio::REST::TwilioError)
104
-
105
- values = {}
106
- expect(
107
- @holodeck.has_request?(Holodeck::Request.new(
108
- method: 'get',
109
- url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid',
110
- ))).to eq(true)
111
- end
112
-
113
- it "receives fetch_sid responses" do
114
- @holodeck.mock(Twilio::Response.new(
115
- 200,
116
- %q[
117
- {
118
- "sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
119
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
120
- "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
121
- "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
122
- "identity": "ff483d1ff591898a9942916050d2ca3f",
123
- "factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
124
- "date_created": "2015-07-30T20:00:00Z",
125
- "date_updated": "2015-07-30T20:00:00Z",
126
- "date_responded": "2015-07-30T20:00:00Z",
127
- "expiration_date": "2015-07-30T20:00:00Z",
128
- "status": "pending",
129
- "responded_reason": "none",
130
- "details": "details",
131
- "hidden_details": "hidden_details",
132
- "factor_type": "sms",
133
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
134
- }
135
- ]
136
- ))
137
-
138
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
139
- .entities('identity') \
140
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
141
- .challenges('sid').fetch()
142
-
143
- expect(actual).to_not eq(nil)
144
- end
145
-
146
- it "receives fetch_latest responses" do
147
- @holodeck.mock(Twilio::Response.new(
148
- 200,
149
- %q[
150
- {
151
- "sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
152
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
153
- "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
154
- "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
155
- "identity": "ff483d1ff591898a9942916050d2ca3f",
156
- "factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
157
- "date_created": "2015-07-30T20:00:00Z",
158
- "date_updated": "2015-07-30T20:00:00Z",
159
- "date_responded": "2015-07-30T20:00:00Z",
160
- "expiration_date": "2015-07-30T20:00:00Z",
161
- "status": "pending",
162
- "responded_reason": "none",
163
- "details": "details",
164
- "hidden_details": "hidden_details",
165
- "factor_type": "sms",
166
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
167
- }
168
- ]
169
- ))
170
-
171
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
172
- .entities('identity') \
173
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
174
- .challenges('sid').fetch()
175
-
176
- expect(actual).to_not eq(nil)
177
- end
178
-
179
- it "can read" do
180
- @holodeck.mock(Twilio::Response.new(500, ''))
181
-
182
- expect {
183
- @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
184
- .entities('identity') \
185
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
186
- .challenges.list()
187
- }.to raise_exception(Twilio::REST::TwilioError)
188
-
189
- values = {}
190
- expect(
191
- @holodeck.has_request?(Holodeck::Request.new(
192
- method: 'get',
193
- url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges',
194
- ))).to eq(true)
195
- end
196
-
197
- it "receives read_empty responses" do
198
- @holodeck.mock(Twilio::Response.new(
199
- 200,
200
- %q[
201
- {
202
- "challenges": [],
203
- "meta": {
204
- "page": 0,
205
- "page_size": 50,
206
- "first_page_url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
207
- "previous_page_url": null,
208
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
209
- "next_page_url": null,
210
- "key": "challenges"
211
- }
212
- }
213
- ]
214
- ))
215
-
216
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
217
- .entities('identity') \
218
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
219
- .challenges.list()
220
-
221
- expect(actual).to_not eq(nil)
222
- end
223
-
224
- it "receives read_full responses" do
225
- @holodeck.mock(Twilio::Response.new(
226
- 200,
227
- %q[
228
- {
229
- "challenges": [
230
- {
231
- "sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
232
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
233
- "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
234
- "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
235
- "identity": "ff483d1ff591898a9942916050d2ca3f",
236
- "factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
237
- "date_created": "2015-07-30T20:00:00Z",
238
- "date_updated": "2015-07-30T20:00:00Z",
239
- "date_responded": "2015-07-30T20:00:00Z",
240
- "expiration_date": "2015-07-30T20:00:00Z",
241
- "status": "pending",
242
- "responded_reason": "none",
243
- "details": "details",
244
- "hidden_details": "hidden_details",
245
- "factor_type": "sms",
246
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
247
- }
248
- ],
249
- "meta": {
250
- "page": 0,
251
- "page_size": 50,
252
- "first_page_url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
253
- "previous_page_url": null,
254
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges?PageSize=50&Page=0",
255
- "next_page_url": null,
256
- "key": "challenges"
257
- }
258
- }
259
- ]
260
- ))
261
-
262
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
263
- .entities('identity') \
264
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
265
- .challenges.list()
266
-
267
- expect(actual).to_not eq(nil)
268
- end
269
-
270
- it "can update" do
271
- @holodeck.mock(Twilio::Response.new(500, ''))
272
-
273
- expect {
274
- @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
275
- .entities('identity') \
276
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
277
- .challenges('sid').update()
278
- }.to raise_exception(Twilio::REST::TwilioError)
279
-
280
- values = {}
281
- expect(
282
- @holodeck.has_request?(Holodeck::Request.new(
283
- method: 'post',
284
- url: 'https://authy.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity/Factors/YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Challenges/sid',
285
- ))).to eq(true)
286
- end
287
-
288
- it "receives verify_sid responses" do
289
- @holodeck.mock(Twilio::Response.new(
290
- 200,
291
- %q[
292
- {
293
- "sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
294
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
295
- "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
296
- "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
297
- "identity": "ff483d1ff591898a9942916050d2ca3f",
298
- "factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
299
- "date_created": "2015-07-30T20:00:00Z",
300
- "date_updated": "2015-07-30T20:00:00Z",
301
- "date_responded": "2015-07-30T20:00:00Z",
302
- "expiration_date": "2015-07-30T20:00:00Z",
303
- "status": "approved",
304
- "responded_reason": "none",
305
- "details": "Hi! Mr. John Doe, would you like to sign up?",
306
- "hidden_details": "Hidden details about the sign up",
307
- "factor_type": "sms",
308
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
309
- }
310
- ]
311
- ))
312
-
313
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
314
- .entities('identity') \
315
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
316
- .challenges('sid').update()
317
-
318
- expect(actual).to_not eq(nil)
319
- end
320
-
321
- it "receives verify_latest responses" do
322
- @holodeck.mock(Twilio::Response.new(
323
- 200,
324
- %q[
325
- {
326
- "sid": "YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
327
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
328
- "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
329
- "entity_sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
330
- "identity": "ff483d1ff591898a9942916050d2ca3f",
331
- "factor_sid": "YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
332
- "date_created": "2015-07-30T20:00:00Z",
333
- "date_updated": "2015-07-30T20:00:00Z",
334
- "date_responded": "2015-07-30T20:00:00Z",
335
- "expiration_date": "2015-07-30T20:00:00Z",
336
- "status": "approved",
337
- "responded_reason": "none",
338
- "details": "Hi! Mr. John Doe, would you like to sign up?",
339
- "hidden_details": "Hidden details about the sign up",
340
- "factor_type": "sms",
341
- "url": "https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
342
- }
343
- ]
344
- ))
345
-
346
- actual = @client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
347
- .entities('identity') \
348
- .factors('YFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
349
- .challenges('sid').update()
350
-
351
- expect(actual).to_not eq(nil)
352
- end
353
- end