twilio-ruby 5.16.0 → 5.17.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.
- checksums.yaml +5 -5
- data/CHANGES.md +22 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +2 -2
- data/lib/twilio-ruby/rest/authy.rb +9 -9
- data/lib/twilio-ruby/rest/authy/v1.rb +16 -16
- data/lib/twilio-ruby/rest/authy/v1/form.rb +18 -18
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +6 -12
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +6 -13
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +25 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +25 -3
- data/lib/twilio-ruby/rest/preview.rb +13 -20
- data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +6 -3
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +6 -3
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +4 -1
- data/lib/twilio-ruby/rest/video.rb +9 -9
- data/lib/twilio-ruby/rest/video/v1.rb +16 -16
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/authy/v1/form_spec.rb +1 -1
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +5 -10
- data/spec/integration/authy/v1/service/entity/factor_spec.rb +3 -3
- data/spec/integration/chat/v2/service/channel/member_spec.rb +4 -0
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +4 -0
- metadata +3 -10
- data/lib/twilio-ruby/rest/preview/authy.rb +0 -43
- data/lib/twilio-ruby/rest/preview/authy/service.rb +0 -364
- data/lib/twilio-ruby/rest/preview/authy/service/entity.rb +0 -326
- data/spec/integration/preview/authy/service/entity_spec.rb +0 -173
- data/spec/integration/preview/authy/service_spec.rb +0 -201
@@ -1,326 +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 Preview < Domain
|
12
|
-
class Authy < Version
|
13
|
-
class ServiceContext < 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 EntityList < ListResource
|
17
|
-
##
|
18
|
-
# Initialize the EntityList
|
19
|
-
# @param [Version] version Version that contains the resource
|
20
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
21
|
-
# @return [EntityList] EntityList
|
22
|
-
def initialize(version, service_sid: nil)
|
23
|
-
super(version)
|
24
|
-
|
25
|
-
# Path Solution
|
26
|
-
@solution = {service_sid: service_sid}
|
27
|
-
@uri = "/Services/#{@solution[:service_sid]}/Entities"
|
28
|
-
end
|
29
|
-
|
30
|
-
##
|
31
|
-
# Retrieve a single page of EntityInstance records from the API.
|
32
|
-
# Request is executed immediately.
|
33
|
-
# @param [String] identity Customer unique identity for the Entity of the Service
|
34
|
-
# @return [EntityInstance] Newly created EntityInstance
|
35
|
-
def create(identity: nil)
|
36
|
-
data = Twilio::Values.of({'Identity' => identity, })
|
37
|
-
|
38
|
-
payload = @version.create(
|
39
|
-
'POST',
|
40
|
-
@uri,
|
41
|
-
data: data
|
42
|
-
)
|
43
|
-
|
44
|
-
EntityInstance.new(@version, payload, service_sid: @solution[:service_sid], )
|
45
|
-
end
|
46
|
-
|
47
|
-
##
|
48
|
-
# Lists EntityInstance records from the API as a list.
|
49
|
-
# Unlike stream(), this operation is eager and will load `limit` records into
|
50
|
-
# memory before returning.
|
51
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
52
|
-
# guarantees to never return more than limit. Default is no limit
|
53
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
54
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
55
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
56
|
-
# efficient page size, i.e. min(limit, 1000)
|
57
|
-
# @return [Array] Array of up to limit results
|
58
|
-
def list(limit: nil, page_size: nil)
|
59
|
-
self.stream(limit: limit, page_size: page_size).entries
|
60
|
-
end
|
61
|
-
|
62
|
-
##
|
63
|
-
# Streams EntityInstance records from the API as an Enumerable.
|
64
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
-
# is reached.
|
66
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
67
|
-
# guarantees to never return more than limit. Default is no limit.
|
68
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
69
|
-
# not set will use the default value of 50 records. If no page_size is defined
|
70
|
-
# but a limit is defined, stream() will attempt to read the limit with the most
|
71
|
-
# efficient page size, i.e. min(limit, 1000)
|
72
|
-
# @return [Enumerable] Enumerable that will yield up to limit results
|
73
|
-
def stream(limit: nil, page_size: nil)
|
74
|
-
limits = @version.read_limits(limit, page_size)
|
75
|
-
|
76
|
-
page = self.page(page_size: limits[:page_size], )
|
77
|
-
|
78
|
-
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
79
|
-
end
|
80
|
-
|
81
|
-
##
|
82
|
-
# When passed a block, yields EntityInstance records from the API.
|
83
|
-
# This operation lazily loads records as efficiently as possible until the limit
|
84
|
-
# is reached.
|
85
|
-
def each
|
86
|
-
limits = @version.read_limits
|
87
|
-
|
88
|
-
page = self.page(page_size: limits[:page_size], )
|
89
|
-
|
90
|
-
@version.stream(page,
|
91
|
-
limit: limits[:limit],
|
92
|
-
page_limit: limits[:page_limit]).each {|x| yield x}
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# Retrieve a single page of EntityInstance records from the API.
|
97
|
-
# Request is executed immediately.
|
98
|
-
# @param [String] page_token PageToken provided by the API
|
99
|
-
# @param [Integer] page_number Page Number, this value is simply for client state
|
100
|
-
# @param [Integer] page_size Number of records to return, defaults to 50
|
101
|
-
# @return [Page] Page of EntityInstance
|
102
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
103
|
-
params = Twilio::Values.of({
|
104
|
-
'PageToken' => page_token,
|
105
|
-
'Page' => page_number,
|
106
|
-
'PageSize' => page_size,
|
107
|
-
})
|
108
|
-
response = @version.page(
|
109
|
-
'GET',
|
110
|
-
@uri,
|
111
|
-
params
|
112
|
-
)
|
113
|
-
EntityPage.new(@version, response, @solution)
|
114
|
-
end
|
115
|
-
|
116
|
-
##
|
117
|
-
# Retrieve a single page of EntityInstance records from the API.
|
118
|
-
# Request is executed immediately.
|
119
|
-
# @param [String] target_url API-generated URL for the requested results page
|
120
|
-
# @return [Page] Page of EntityInstance
|
121
|
-
def get_page(target_url)
|
122
|
-
response = @version.domain.request(
|
123
|
-
'GET',
|
124
|
-
target_url
|
125
|
-
)
|
126
|
-
EntityPage.new(@version, response, @solution)
|
127
|
-
end
|
128
|
-
|
129
|
-
##
|
130
|
-
# Provide a user friendly representation
|
131
|
-
def to_s
|
132
|
-
'#<Twilio.Preview.Authy.EntityList>'
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
##
|
137
|
-
# 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.
|
138
|
-
class EntityPage < Page
|
139
|
-
##
|
140
|
-
# Initialize the EntityPage
|
141
|
-
# @param [Version] version Version that contains the resource
|
142
|
-
# @param [Response] response Response from the API
|
143
|
-
# @param [Hash] solution Path solution for the resource
|
144
|
-
# @return [EntityPage] EntityPage
|
145
|
-
def initialize(version, response, solution)
|
146
|
-
super(version, response)
|
147
|
-
|
148
|
-
# Path Solution
|
149
|
-
@solution = solution
|
150
|
-
end
|
151
|
-
|
152
|
-
##
|
153
|
-
# Build an instance of EntityInstance
|
154
|
-
# @param [Hash] payload Payload response from the API
|
155
|
-
# @return [EntityInstance] EntityInstance
|
156
|
-
def get_instance(payload)
|
157
|
-
EntityInstance.new(@version, payload, service_sid: @solution[:service_sid], )
|
158
|
-
end
|
159
|
-
|
160
|
-
##
|
161
|
-
# Provide a user friendly representation
|
162
|
-
def to_s
|
163
|
-
'<Twilio.Preview.Authy.EntityPage>'
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
##
|
168
|
-
# 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.
|
169
|
-
class EntityContext < InstanceContext
|
170
|
-
##
|
171
|
-
# Initialize the EntityContext
|
172
|
-
# @param [Version] version Version that contains the resource
|
173
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
174
|
-
# @param [String] identity Customer unique identity for the Entity of the Service
|
175
|
-
# @return [EntityContext] EntityContext
|
176
|
-
def initialize(version, service_sid, identity)
|
177
|
-
super(version)
|
178
|
-
|
179
|
-
# Path Solution
|
180
|
-
@solution = {service_sid: service_sid, identity: identity, }
|
181
|
-
@uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}"
|
182
|
-
end
|
183
|
-
|
184
|
-
##
|
185
|
-
# Fetch a EntityInstance
|
186
|
-
# @return [EntityInstance] Fetched EntityInstance
|
187
|
-
def fetch
|
188
|
-
params = Twilio::Values.of({})
|
189
|
-
|
190
|
-
payload = @version.fetch(
|
191
|
-
'GET',
|
192
|
-
@uri,
|
193
|
-
params,
|
194
|
-
)
|
195
|
-
|
196
|
-
EntityInstance.new(
|
197
|
-
@version,
|
198
|
-
payload,
|
199
|
-
service_sid: @solution[:service_sid],
|
200
|
-
identity: @solution[:identity],
|
201
|
-
)
|
202
|
-
end
|
203
|
-
|
204
|
-
##
|
205
|
-
# Provide a user friendly representation
|
206
|
-
def to_s
|
207
|
-
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
208
|
-
"#<Twilio.Preview.Authy.EntityContext #{context}>"
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
##
|
213
|
-
# 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.
|
214
|
-
class EntityInstance < InstanceResource
|
215
|
-
##
|
216
|
-
# Initialize the EntityInstance
|
217
|
-
# @param [Version] version Version that contains the resource
|
218
|
-
# @param [Hash] payload payload that contains response from Twilio
|
219
|
-
# @param [String] service_sid The unique SID identifier of the Service.
|
220
|
-
# @param [String] identity Customer unique identity for the Entity of the Service
|
221
|
-
# @return [EntityInstance] EntityInstance
|
222
|
-
def initialize(version, payload, service_sid: nil, identity: nil)
|
223
|
-
super(version)
|
224
|
-
|
225
|
-
# Marshaled Properties
|
226
|
-
@properties = {
|
227
|
-
'sid' => payload['sid'],
|
228
|
-
'identity' => payload['identity'],
|
229
|
-
'account_sid' => payload['account_sid'],
|
230
|
-
'service_sid' => payload['service_sid'],
|
231
|
-
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
232
|
-
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
233
|
-
'url' => payload['url'],
|
234
|
-
'links' => payload['links'],
|
235
|
-
}
|
236
|
-
|
237
|
-
# Context
|
238
|
-
@instance_context = nil
|
239
|
-
@params = {'service_sid' => service_sid, 'identity' => identity || @properties['identity'], }
|
240
|
-
end
|
241
|
-
|
242
|
-
##
|
243
|
-
# Generate an instance context for the instance, the context is capable of
|
244
|
-
# performing various actions. All instance actions are proxied to the context
|
245
|
-
# @return [EntityContext] EntityContext for this EntityInstance
|
246
|
-
def context
|
247
|
-
unless @instance_context
|
248
|
-
@instance_context = EntityContext.new(@version, @params['service_sid'], @params['identity'], )
|
249
|
-
end
|
250
|
-
@instance_context
|
251
|
-
end
|
252
|
-
|
253
|
-
##
|
254
|
-
# @return [String] A string that uniquely identifies this Entity.
|
255
|
-
def sid
|
256
|
-
@properties['sid']
|
257
|
-
end
|
258
|
-
|
259
|
-
##
|
260
|
-
# @return [String] Unique identity of the Entity
|
261
|
-
def identity
|
262
|
-
@properties['identity']
|
263
|
-
end
|
264
|
-
|
265
|
-
##
|
266
|
-
# @return [String] Account Sid.
|
267
|
-
def account_sid
|
268
|
-
@properties['account_sid']
|
269
|
-
end
|
270
|
-
|
271
|
-
##
|
272
|
-
# @return [String] Service Sid.
|
273
|
-
def service_sid
|
274
|
-
@properties['service_sid']
|
275
|
-
end
|
276
|
-
|
277
|
-
##
|
278
|
-
# @return [Time] The date this Entity was created
|
279
|
-
def date_created
|
280
|
-
@properties['date_created']
|
281
|
-
end
|
282
|
-
|
283
|
-
##
|
284
|
-
# @return [Time] The date this Entity was updated
|
285
|
-
def date_updated
|
286
|
-
@properties['date_updated']
|
287
|
-
end
|
288
|
-
|
289
|
-
##
|
290
|
-
# @return [String] The URL of this resource.
|
291
|
-
def url
|
292
|
-
@properties['url']
|
293
|
-
end
|
294
|
-
|
295
|
-
##
|
296
|
-
# @return [String] Nested resource URLs.
|
297
|
-
def links
|
298
|
-
@properties['links']
|
299
|
-
end
|
300
|
-
|
301
|
-
##
|
302
|
-
# Fetch a EntityInstance
|
303
|
-
# @return [EntityInstance] Fetched EntityInstance
|
304
|
-
def fetch
|
305
|
-
context.fetch
|
306
|
-
end
|
307
|
-
|
308
|
-
##
|
309
|
-
# Provide a user friendly representation
|
310
|
-
def to_s
|
311
|
-
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
312
|
-
"<Twilio.Preview.Authy.EntityInstance #{values}>"
|
313
|
-
end
|
314
|
-
|
315
|
-
##
|
316
|
-
# Provide a detailed, user friendly representation
|
317
|
-
def inspect
|
318
|
-
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
319
|
-
"<Twilio.Preview.Authy.EntityInstance #{values}>"
|
320
|
-
end
|
321
|
-
end
|
322
|
-
end
|
323
|
-
end
|
324
|
-
end
|
325
|
-
end
|
326
|
-
end
|
@@ -1,173 +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 'Entity' do
|
12
|
-
it "can create" do
|
13
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
14
|
-
|
15
|
-
expect {
|
16
|
-
@client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
17
|
-
.entities.create(identity: 'identity')
|
18
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
19
|
-
|
20
|
-
values = {'Identity' => 'identity', }
|
21
|
-
expect(
|
22
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
23
|
-
method: 'post',
|
24
|
-
url: 'https://preview.twilio.com/Authy/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities',
|
25
|
-
data: values,
|
26
|
-
))).to eq(true)
|
27
|
-
end
|
28
|
-
|
29
|
-
it "receives create responses" do
|
30
|
-
@holodeck.mock(Twilio::Response.new(
|
31
|
-
201,
|
32
|
-
%q[
|
33
|
-
{
|
34
|
-
"sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
35
|
-
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
36
|
-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
37
|
-
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
38
|
-
"date_created": "2015-07-30T20:00:00Z",
|
39
|
-
"date_updated": "2015-07-30T20:00:00Z",
|
40
|
-
"url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f",
|
41
|
-
"links": {
|
42
|
-
"factors": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors"
|
43
|
-
}
|
44
|
-
}
|
45
|
-
]
|
46
|
-
))
|
47
|
-
|
48
|
-
actual = @client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
49
|
-
.entities.create(identity: 'identity')
|
50
|
-
|
51
|
-
expect(actual).to_not eq(nil)
|
52
|
-
end
|
53
|
-
|
54
|
-
it "can read" do
|
55
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
56
|
-
|
57
|
-
expect {
|
58
|
-
@client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
59
|
-
.entities.list()
|
60
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
61
|
-
|
62
|
-
values = {}
|
63
|
-
expect(
|
64
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
65
|
-
method: 'get',
|
66
|
-
url: 'https://preview.twilio.com/Authy/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities',
|
67
|
-
))).to eq(true)
|
68
|
-
end
|
69
|
-
|
70
|
-
it "receives read_empty responses" do
|
71
|
-
@holodeck.mock(Twilio::Response.new(
|
72
|
-
200,
|
73
|
-
%q[
|
74
|
-
{
|
75
|
-
"entities": [],
|
76
|
-
"meta": {
|
77
|
-
"page": 0,
|
78
|
-
"page_size": 50,
|
79
|
-
"first_page_url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities?PageSize=50&Page=0",
|
80
|
-
"previous_page_url": null,
|
81
|
-
"url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities?PageSize=50&Page=0",
|
82
|
-
"next_page_url": null,
|
83
|
-
"key": "entities"
|
84
|
-
}
|
85
|
-
}
|
86
|
-
]
|
87
|
-
))
|
88
|
-
|
89
|
-
actual = @client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
90
|
-
.entities.list()
|
91
|
-
|
92
|
-
expect(actual).to_not eq(nil)
|
93
|
-
end
|
94
|
-
|
95
|
-
it "receives read_full responses" do
|
96
|
-
@holodeck.mock(Twilio::Response.new(
|
97
|
-
200,
|
98
|
-
%q[
|
99
|
-
{
|
100
|
-
"entities": [
|
101
|
-
{
|
102
|
-
"sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
103
|
-
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
104
|
-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
105
|
-
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
106
|
-
"date_created": "2015-07-30T20:00:00Z",
|
107
|
-
"date_updated": "2015-07-30T20:00:00Z",
|
108
|
-
"url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f",
|
109
|
-
"links": {
|
110
|
-
"factors": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors"
|
111
|
-
}
|
112
|
-
}
|
113
|
-
],
|
114
|
-
"meta": {
|
115
|
-
"page": 0,
|
116
|
-
"page_size": 50,
|
117
|
-
"first_page_url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities?PageSize=50&Page=0",
|
118
|
-
"previous_page_url": null,
|
119
|
-
"url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities?PageSize=50&Page=0",
|
120
|
-
"next_page_url": null,
|
121
|
-
"key": "entities"
|
122
|
-
}
|
123
|
-
}
|
124
|
-
]
|
125
|
-
))
|
126
|
-
|
127
|
-
actual = @client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
128
|
-
.entities.list()
|
129
|
-
|
130
|
-
expect(actual).to_not eq(nil)
|
131
|
-
end
|
132
|
-
|
133
|
-
it "can fetch" do
|
134
|
-
@holodeck.mock(Twilio::Response.new(500, ''))
|
135
|
-
|
136
|
-
expect {
|
137
|
-
@client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
138
|
-
.entities('identity').fetch()
|
139
|
-
}.to raise_exception(Twilio::REST::TwilioError)
|
140
|
-
|
141
|
-
values = {}
|
142
|
-
expect(
|
143
|
-
@holodeck.has_request?(Holodeck::Request.new(
|
144
|
-
method: 'get',
|
145
|
-
url: 'https://preview.twilio.com/Authy/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities/identity',
|
146
|
-
))).to eq(true)
|
147
|
-
end
|
148
|
-
|
149
|
-
it "receives fetch responses" do
|
150
|
-
@holodeck.mock(Twilio::Response.new(
|
151
|
-
200,
|
152
|
-
%q[
|
153
|
-
{
|
154
|
-
"sid": "YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
155
|
-
"identity": "ff483d1ff591898a9942916050d2ca3f",
|
156
|
-
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
157
|
-
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
158
|
-
"date_created": "2015-07-30T20:00:00Z",
|
159
|
-
"date_updated": "2015-07-30T20:00:00Z",
|
160
|
-
"url": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f",
|
161
|
-
"links": {
|
162
|
-
"factors": "https://preview.twilio.com/Authy/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors"
|
163
|
-
}
|
164
|
-
}
|
165
|
-
]
|
166
|
-
))
|
167
|
-
|
168
|
-
actual = @client.preview.authy.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
|
169
|
-
.entities('identity').fetch()
|
170
|
-
|
171
|
-
expect(actual).to_not eq(nil)
|
172
|
-
end
|
173
|
-
end
|