twilio-ruby 5.4.3 → 5.4.4
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 +12 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/framework/serialize.rb +9 -0
- data/lib/twilio-ruby/http/http_client.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +8 -2
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +2 -2
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +5 -1
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +3 -3
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +4 -4
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +5 -2
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +2 -2
- data/lib/twilio-ruby/rest/preview.rb +10 -3
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +4 -4
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +2 -2
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/preview/understand.rb +41 -0
- data/lib/twilio-ruby/rest/preview/understand/service.rb +503 -0
- data/lib/twilio-ruby/rest/preview/understand/service/field_type.rb +399 -0
- data/lib/twilio-ruby/rest/preview/understand/service/field_type/field_value.rb +375 -0
- data/lib/twilio-ruby/rest/preview/understand/service/intent.rb +421 -0
- data/lib/twilio-ruby/rest/preview/understand/service/intent/field.rb +371 -0
- data/lib/twilio-ruby/rest/preview/understand/service/intent/sample.rb +407 -0
- data/lib/twilio-ruby/rest/preview/understand/service/model_build.rb +358 -0
- data/lib/twilio-ruby/rest/preview/understand/service/query.rb +422 -0
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +2 -2
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +3 -3
- data/lib/twilio-ruby/rest/video/v1/recording.rb +1 -1
- data/lib/twilio-ruby/rest/video/v1/room.rb +27 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +407 -0
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb +326 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +21 -0
- data/spec/integration/chat/v1/service/role_spec.rb +6 -2
- data/spec/integration/chat/v2/service/role_spec.rb +6 -2
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +6 -2
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +6 -2
- data/spec/integration/preview/hosted_numbers/authorization_document_spec.rb +1 -1
- data/spec/integration/preview/understand/service/field_type/field_value_spec.rb +205 -0
- data/spec/integration/preview/understand/service/field_type_spec.rb +244 -0
- data/spec/integration/preview/understand/service/intent/field_spec.rb +205 -0
- data/spec/integration/preview/understand/service/intent/sample_spec.rb +247 -0
- data/spec/integration/preview/understand/service/intent_spec.rb +252 -0
- data/spec/integration/preview/understand/service/model_build_spec.rb +231 -0
- data/spec/integration/preview/understand/service/query_spec.rb +300 -0
- data/spec/integration/preview/understand/service_spec.rb +256 -0
- data/spec/integration/video/v1/room/room_participant/room_participant_published_track_spec.rb +94 -0
- data/spec/integration/video/v1/room/room_participant_spec.rb +182 -0
- data/spec/integration/video/v1/room_spec.rb +4 -0
- metadata +33 -2
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Video < Domain
|
|
10
|
+
class V1 < Version
|
|
11
|
+
class RoomContext < InstanceContext
|
|
12
|
+
class RoomParticipantContext < InstanceContext
|
|
13
|
+
class PublishedTrackList < ListResource
|
|
14
|
+
##
|
|
15
|
+
# Initialize the PublishedTrackList
|
|
16
|
+
# @param [Version] version Version that contains the resource
|
|
17
|
+
# @param [String] room_sid The room_sid
|
|
18
|
+
# @param [String] participant_sid The participant_sid
|
|
19
|
+
# @return [PublishedTrackList] PublishedTrackList
|
|
20
|
+
def initialize(version, room_sid: nil, participant_sid: nil)
|
|
21
|
+
super(version)
|
|
22
|
+
|
|
23
|
+
# Path Solution
|
|
24
|
+
@solution = {room_sid: room_sid, participant_sid: participant_sid}
|
|
25
|
+
@uri = "/Rooms/#{@solution[:room_sid]}/Participants/#{@solution[:participant_sid]}/PublishedTracks"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# Lists PublishedTrackInstance records from the API as a list.
|
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
31
|
+
# memory before returning.
|
|
32
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
33
|
+
# guarantees to never return more than limit. Default is no limit
|
|
34
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
35
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
36
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
37
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
38
|
+
# @return [Array] Array of up to limit results
|
|
39
|
+
def list(limit: nil, page_size: nil)
|
|
40
|
+
self.stream(limit: limit, page_size: page_size).entries
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
##
|
|
44
|
+
# Streams PublishedTrackInstance records from the API as an Enumerable.
|
|
45
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
46
|
+
# is reached.
|
|
47
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
48
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
49
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
50
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
51
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
52
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
53
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
54
|
+
def stream(limit: nil, page_size: nil)
|
|
55
|
+
limits = @version.read_limits(limit, page_size)
|
|
56
|
+
|
|
57
|
+
page = self.page(page_size: limits[:page_size],)
|
|
58
|
+
|
|
59
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
##
|
|
63
|
+
# When passed a block, yields PublishedTrackInstance records from the API.
|
|
64
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
65
|
+
# is reached.
|
|
66
|
+
def each
|
|
67
|
+
limits = @version.read_limits
|
|
68
|
+
|
|
69
|
+
page = self.page(page_size: limits[:page_size],)
|
|
70
|
+
|
|
71
|
+
@version.stream(page,
|
|
72
|
+
limit: limits[:limit],
|
|
73
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
##
|
|
77
|
+
# Retrieve a single page of PublishedTrackInstance records from the API.
|
|
78
|
+
# Request is executed immediately.
|
|
79
|
+
# @param [String] page_token PageToken provided by the API
|
|
80
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
81
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
82
|
+
# @return [Page] Page of PublishedTrackInstance
|
|
83
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
|
84
|
+
params = Twilio::Values.of({
|
|
85
|
+
'PageToken' => page_token,
|
|
86
|
+
'Page' => page_number,
|
|
87
|
+
'PageSize' => page_size,
|
|
88
|
+
})
|
|
89
|
+
response = @version.page(
|
|
90
|
+
'GET',
|
|
91
|
+
@uri,
|
|
92
|
+
params
|
|
93
|
+
)
|
|
94
|
+
PublishedTrackPage.new(@version, response, @solution)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
##
|
|
98
|
+
# Retrieve a single page of PublishedTrackInstance records from the API.
|
|
99
|
+
# Request is executed immediately.
|
|
100
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
101
|
+
# @return [Page] Page of PublishedTrackInstance
|
|
102
|
+
def get_page(target_url)
|
|
103
|
+
response = @version.domain.request(
|
|
104
|
+
'GET',
|
|
105
|
+
target_url
|
|
106
|
+
)
|
|
107
|
+
PublishedTrackPage.new(@version, response, @solution)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# Provide a user friendly representation
|
|
112
|
+
def to_s
|
|
113
|
+
'#<Twilio.Video.V1.PublishedTrackList>'
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
class PublishedTrackPage < Page
|
|
118
|
+
##
|
|
119
|
+
# Initialize the PublishedTrackPage
|
|
120
|
+
# @param [Version] version Version that contains the resource
|
|
121
|
+
# @param [Response] response Response from the API
|
|
122
|
+
# @param [Hash] solution Path solution for the resource
|
|
123
|
+
# @return [PublishedTrackPage] PublishedTrackPage
|
|
124
|
+
def initialize(version, response, solution)
|
|
125
|
+
super(version, response)
|
|
126
|
+
|
|
127
|
+
# Path Solution
|
|
128
|
+
@solution = solution
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
##
|
|
132
|
+
# Build an instance of PublishedTrackInstance
|
|
133
|
+
# @param [Hash] payload Payload response from the API
|
|
134
|
+
# @return [PublishedTrackInstance] PublishedTrackInstance
|
|
135
|
+
def get_instance(payload)
|
|
136
|
+
PublishedTrackInstance.new(
|
|
137
|
+
@version,
|
|
138
|
+
payload,
|
|
139
|
+
room_sid: @solution[:room_sid],
|
|
140
|
+
participant_sid: @solution[:participant_sid],
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
##
|
|
145
|
+
# Provide a user friendly representation
|
|
146
|
+
def to_s
|
|
147
|
+
'<Twilio.Video.V1.PublishedTrackPage>'
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
class PublishedTrackContext < InstanceContext
|
|
152
|
+
##
|
|
153
|
+
# Initialize the PublishedTrackContext
|
|
154
|
+
# @param [Version] version Version that contains the resource
|
|
155
|
+
# @param [String] room_sid The room_sid
|
|
156
|
+
# @param [String] participant_sid The participant_sid
|
|
157
|
+
# @param [String] sid The sid
|
|
158
|
+
# @return [PublishedTrackContext] PublishedTrackContext
|
|
159
|
+
def initialize(version, room_sid, participant_sid, sid)
|
|
160
|
+
super(version)
|
|
161
|
+
|
|
162
|
+
# Path Solution
|
|
163
|
+
@solution = {room_sid: room_sid, participant_sid: participant_sid, sid: sid,}
|
|
164
|
+
@uri = "/Rooms/#{@solution[:room_sid]}/Participants/#{@solution[:participant_sid]}/PublishedTracks/#{@solution[:sid]}"
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
##
|
|
168
|
+
# Fetch a PublishedTrackInstance
|
|
169
|
+
# @return [PublishedTrackInstance] Fetched PublishedTrackInstance
|
|
170
|
+
def fetch
|
|
171
|
+
params = Twilio::Values.of({})
|
|
172
|
+
|
|
173
|
+
payload = @version.fetch(
|
|
174
|
+
'GET',
|
|
175
|
+
@uri,
|
|
176
|
+
params,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
PublishedTrackInstance.new(
|
|
180
|
+
@version,
|
|
181
|
+
payload,
|
|
182
|
+
room_sid: @solution[:room_sid],
|
|
183
|
+
participant_sid: @solution[:participant_sid],
|
|
184
|
+
sid: @solution[:sid],
|
|
185
|
+
)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
##
|
|
189
|
+
# Provide a user friendly representation
|
|
190
|
+
def to_s
|
|
191
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
192
|
+
"#<Twilio.Video.V1.PublishedTrackContext #{context}>"
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
class PublishedTrackInstance < InstanceResource
|
|
197
|
+
##
|
|
198
|
+
# Initialize the PublishedTrackInstance
|
|
199
|
+
# @param [Version] version Version that contains the resource
|
|
200
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
201
|
+
# @param [String] room_sid The room_sid
|
|
202
|
+
# @param [String] participant_sid The participant_sid
|
|
203
|
+
# @param [String] sid The sid
|
|
204
|
+
# @return [PublishedTrackInstance] PublishedTrackInstance
|
|
205
|
+
def initialize(version, payload, room_sid: nil, participant_sid: nil, sid: nil)
|
|
206
|
+
super(version)
|
|
207
|
+
|
|
208
|
+
# Marshaled Properties
|
|
209
|
+
@properties = {
|
|
210
|
+
'sid' => payload['sid'],
|
|
211
|
+
'participant_sid' => payload['participant_sid'],
|
|
212
|
+
'room_sid' => payload['room_sid'],
|
|
213
|
+
'name' => payload['name'],
|
|
214
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
215
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
216
|
+
'enabled' => payload['enabled'],
|
|
217
|
+
'kind' => payload['kind'],
|
|
218
|
+
'url' => payload['url'],
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
# Context
|
|
222
|
+
@instance_context = nil
|
|
223
|
+
@params = {
|
|
224
|
+
'room_sid' => room_sid,
|
|
225
|
+
'participant_sid' => participant_sid,
|
|
226
|
+
'sid' => sid || @properties['sid'],
|
|
227
|
+
}
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
##
|
|
231
|
+
# Generate an instance context for the instance, the context is capable of
|
|
232
|
+
# performing various actions. All instance actions are proxied to the context
|
|
233
|
+
# @return [PublishedTrackContext] PublishedTrackContext for this PublishedTrackInstance
|
|
234
|
+
def context
|
|
235
|
+
unless @instance_context
|
|
236
|
+
@instance_context = PublishedTrackContext.new(
|
|
237
|
+
@version,
|
|
238
|
+
@params['room_sid'],
|
|
239
|
+
@params['participant_sid'],
|
|
240
|
+
@params['sid'],
|
|
241
|
+
)
|
|
242
|
+
end
|
|
243
|
+
@instance_context
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
##
|
|
247
|
+
# @return [String] The sid
|
|
248
|
+
def sid
|
|
249
|
+
@properties['sid']
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
##
|
|
253
|
+
# @return [String] The participant_sid
|
|
254
|
+
def participant_sid
|
|
255
|
+
@properties['participant_sid']
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
##
|
|
259
|
+
# @return [String] The room_sid
|
|
260
|
+
def room_sid
|
|
261
|
+
@properties['room_sid']
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
##
|
|
265
|
+
# @return [String] The name
|
|
266
|
+
def name
|
|
267
|
+
@properties['name']
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
##
|
|
271
|
+
# @return [Time] The date_created
|
|
272
|
+
def date_created
|
|
273
|
+
@properties['date_created']
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
##
|
|
277
|
+
# @return [Time] The date_updated
|
|
278
|
+
def date_updated
|
|
279
|
+
@properties['date_updated']
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
##
|
|
283
|
+
# @return [Boolean] The enabled
|
|
284
|
+
def enabled
|
|
285
|
+
@properties['enabled']
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
##
|
|
289
|
+
# @return [published_track.Kind] The kind
|
|
290
|
+
def kind
|
|
291
|
+
@properties['kind']
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
##
|
|
295
|
+
# @return [String] The url
|
|
296
|
+
def url
|
|
297
|
+
@properties['url']
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
##
|
|
301
|
+
# Fetch a PublishedTrackInstance
|
|
302
|
+
# @return [PublishedTrackInstance] Fetched PublishedTrackInstance
|
|
303
|
+
def fetch
|
|
304
|
+
context.fetch
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
##
|
|
308
|
+
# Provide a user friendly representation
|
|
309
|
+
def to_s
|
|
310
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
311
|
+
"<Twilio.Video.V1.PublishedTrackInstance #{values}>"
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
##
|
|
315
|
+
# Provide a detailed, user friendly representation
|
|
316
|
+
def inspect
|
|
317
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
318
|
+
"<Twilio.Video.V1.PublishedTrackInstance #{values}>"
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
end
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
end
|
|
@@ -131,7 +131,7 @@ module Twilio
|
|
|
131
131
|
'MessagingEnabled' => messaging_enabled,
|
|
132
132
|
'VoiceEnabled' => voice_enabled,
|
|
133
133
|
'NationalRoamingEnabled' => national_roaming_enabled,
|
|
134
|
-
'InternationalRoaming' => international_roaming,
|
|
134
|
+
'InternationalRoaming' => Twilio.serialize_list(international_roaming) { |e| e },
|
|
135
135
|
'NationalRoamingDataLimit' => national_roaming_data_limit,
|
|
136
136
|
'InternationalRoamingDataLimit' => international_roaming_data_limit,
|
|
137
137
|
})
|
data/lib/twilio-ruby/version.rb
CHANGED
|
@@ -56,4 +56,25 @@ describe Twilio do
|
|
|
56
56
|
expect(actual).to eq(123)
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
|
+
|
|
60
|
+
describe 'serialize_list' do
|
|
61
|
+
it 'should only operate on things with .each method' do
|
|
62
|
+
actual = Twilio.serialize_list(nil)
|
|
63
|
+
expect(actual).to eq(nil)
|
|
64
|
+
|
|
65
|
+
actual = Twilio.serialize_list("something")
|
|
66
|
+
expect(actual).to eq("something")
|
|
67
|
+
|
|
68
|
+
actual = Twilio.serialize_list(1)
|
|
69
|
+
expect(actual).to eq(1)
|
|
70
|
+
|
|
71
|
+
actual = Twilio.serialize_list({ some_obj: 'some_val' })
|
|
72
|
+
expect(actual).to eq({ some_obj: 'some_val' })
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it 'should apply block to every element in list' do
|
|
76
|
+
actual = Twilio.serialize_list([1, 2, 3, 4]) { |e| e * 2 }
|
|
77
|
+
expect(actual).to eq([2, 4, 6, 8])
|
|
78
|
+
end
|
|
79
|
+
end
|
|
59
80
|
end
|
|
@@ -88,7 +88,11 @@ describe 'Role' do
|
|
|
88
88
|
.roles.create(friendly_name: "friendly_name", type: "channel", permission: ['permission'])
|
|
89
89
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
90
90
|
|
|
91
|
-
values = {
|
|
91
|
+
values = {
|
|
92
|
+
'FriendlyName' => "friendly_name",
|
|
93
|
+
'Type' => "channel",
|
|
94
|
+
'Permission' => Twilio.serialize_list(['permission']) { |e| e },
|
|
95
|
+
}
|
|
92
96
|
expect(
|
|
93
97
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
94
98
|
method: 'post',
|
|
@@ -217,7 +221,7 @@ describe 'Role' do
|
|
|
217
221
|
.roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update(permission: ['permission'])
|
|
218
222
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
219
223
|
|
|
220
|
-
values = {'Permission' => ['permission'],}
|
|
224
|
+
values = {'Permission' => Twilio.serialize_list(['permission']) { |e| e },}
|
|
221
225
|
expect(
|
|
222
226
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
223
227
|
method: 'post',
|
|
@@ -88,7 +88,11 @@ describe 'Role' do
|
|
|
88
88
|
.roles.create(friendly_name: "friendly_name", type: "channel", permission: ['permission'])
|
|
89
89
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
90
90
|
|
|
91
|
-
values = {
|
|
91
|
+
values = {
|
|
92
|
+
'FriendlyName' => "friendly_name",
|
|
93
|
+
'Type' => "channel",
|
|
94
|
+
'Permission' => Twilio.serialize_list(['permission']) { |e| e },
|
|
95
|
+
}
|
|
92
96
|
expect(
|
|
93
97
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
94
98
|
method: 'post',
|
|
@@ -217,7 +221,7 @@ describe 'Role' do
|
|
|
217
221
|
.roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update(permission: ['permission'])
|
|
218
222
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
219
223
|
|
|
220
|
-
values = {'Permission' => ['permission'],}
|
|
224
|
+
values = {'Permission' => Twilio.serialize_list(['permission']) { |e| e },}
|
|
221
225
|
expect(
|
|
222
226
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
223
227
|
method: 'post',
|
|
@@ -88,7 +88,11 @@ describe 'Role' do
|
|
|
88
88
|
.roles.create(friendly_name: "friendly_name", type: "channel", permission: ['permission'])
|
|
89
89
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
90
90
|
|
|
91
|
-
values = {
|
|
91
|
+
values = {
|
|
92
|
+
'FriendlyName' => "friendly_name",
|
|
93
|
+
'Type' => "channel",
|
|
94
|
+
'Permission' => Twilio.serialize_list(['permission']) { |e| e },
|
|
95
|
+
}
|
|
92
96
|
expect(
|
|
93
97
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
94
98
|
method: 'post',
|
|
@@ -217,7 +221,7 @@ describe 'Role' do
|
|
|
217
221
|
.roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update(permission: ['permission'])
|
|
218
222
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
219
223
|
|
|
220
|
-
values = {'Permission' => ['permission'],}
|
|
224
|
+
values = {'Permission' => Twilio.serialize_list(['permission']) { |e| e },}
|
|
221
225
|
expect(
|
|
222
226
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
223
227
|
method: 'post',
|
|
@@ -88,7 +88,11 @@ describe 'Role' do
|
|
|
88
88
|
.roles.create(friendly_name: "friendly_name", type: "channel", permission: ['permission'])
|
|
89
89
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
90
90
|
|
|
91
|
-
values = {
|
|
91
|
+
values = {
|
|
92
|
+
'FriendlyName' => "friendly_name",
|
|
93
|
+
'Type' => "channel",
|
|
94
|
+
'Permission' => Twilio.serialize_list(['permission']) { |e| e },
|
|
95
|
+
}
|
|
92
96
|
expect(
|
|
93
97
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
94
98
|
method: 'post',
|
|
@@ -217,7 +221,7 @@ describe 'Role' do
|
|
|
217
221
|
.roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update(permission: ['permission'])
|
|
218
222
|
}.to raise_exception(Twilio::REST::TwilioError)
|
|
219
223
|
|
|
220
|
-
values = {'Permission' => ['permission'],}
|
|
224
|
+
values = {'Permission' => Twilio.serialize_list(['permission']) { |e| e },}
|
|
221
225
|
expect(
|
|
222
226
|
@holodeck.has_request?(Holodeck::Request.new(
|
|
223
227
|
method: 'post',
|