twilio-ruby 5.55.0 → 5.58.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop_todo.yml +7 -7
  4. data/.travis.yml +23 -6
  5. data/CHANGES.md +73 -0
  6. data/Gemfile +1 -0
  7. data/README.md +10 -2
  8. data/examples/examples.rb +1 -1
  9. data/lib/twilio-ruby.rb +5 -15
  10. data/lib/twilio-ruby/framework/{domain.rb → rest/domain.rb} +0 -0
  11. data/lib/twilio-ruby/framework/{error.rb → rest/error.rb} +0 -0
  12. data/lib/twilio-ruby/framework/{helper.rb → rest/helper.rb} +0 -0
  13. data/lib/twilio-ruby/framework/{obsolete_client.rb → rest/obsolete_client.rb} +0 -0
  14. data/lib/twilio-ruby/framework/{page.rb → rest/page.rb} +0 -0
  15. data/lib/twilio-ruby/framework/{resource.rb → rest/resource.rb} +0 -0
  16. data/lib/twilio-ruby/framework/{version.rb → rest/version.rb} +0 -0
  17. data/lib/twilio-ruby/http.rb +5 -0
  18. data/lib/twilio-ruby/http/http_client.rb +11 -1
  19. data/lib/twilio-ruby/rest.rb +13 -0
  20. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -3
  21. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +12 -8
  22. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
  23. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +2 -2
  24. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  25. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  26. data/lib/twilio-ruby/rest/conversations.rb +6 -0
  27. data/lib/twilio-ruby/rest/conversations/v1.rb +7 -0
  28. data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +7 -0
  29. data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
  30. data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
  31. data/lib/twilio-ruby/rest/conversations/v1/service/conversation.rb +7 -0
  32. data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
  33. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
  34. data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
  35. data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
  36. data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
  37. data/lib/twilio-ruby/rest/insights.rb +6 -0
  38. data/lib/twilio-ruby/rest/insights/v1.rb +7 -0
  39. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +428 -0
  40. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +19 -1
  41. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +29 -0
  42. data/lib/twilio-ruby/rest/supersim/v1/sim/billing_period.rb +231 -0
  43. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
  44. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -1
  45. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
  46. data/lib/twilio-ruby/version.rb +1 -1
  47. data/sonar-project.properties +13 -0
  48. metadata +18 -9
@@ -36,6 +36,12 @@ module Twilio
36
36
  self.v1.calls(sid)
37
37
  end
38
38
 
39
+ ##
40
+ # @return [Twilio::REST::Insights::V1::CallSummariesInstance]
41
+ def call_summaries
42
+ self.v1.call_summaries()
43
+ end
44
+
39
45
  ##
40
46
  # @param [String] room_sid Unique identifier for the room.
41
47
  # @return [Twilio::REST::Insights::V1::RoomInstance] if room_sid was passed.
@@ -16,6 +16,7 @@ module Twilio
16
16
  super
17
17
  @version = 'v1'
18
18
  @calls = nil
19
+ @call_summaries = nil
19
20
  @rooms = nil
20
21
  end
21
22
 
@@ -34,6 +35,12 @@ module Twilio
34
35
  end
35
36
  end
36
37
 
38
+ ##
39
+ # @return [Twilio::REST::Insights::V1::CallSummariesContext]
40
+ def call_summaries
41
+ @call_summaries ||= CallSummariesList.new self
42
+ end
43
+
37
44
  ##
38
45
  # @param [String] room_sid The SID of the Room resource.
39
46
  # @return [Twilio::REST::Insights::V1::RoomContext] if room_sid was passed.
@@ -0,0 +1,428 @@
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 Insights < Domain
12
+ class V1 < Version
13
+ class CallSummariesList < ListResource
14
+ ##
15
+ # Initialize the CallSummariesList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [CallSummariesList] CallSummariesList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Voice/Summaries"
24
+ end
25
+
26
+ ##
27
+ # Lists CallSummariesInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [Array[String]] from The from
31
+ # @param [Array[String]] to The to
32
+ # @param [Array[String]] from_carrier The from_carrier
33
+ # @param [Array[String]] to_carrier The to_carrier
34
+ # @param [Array[String]] from_country_code The from_country_code
35
+ # @param [Array[String]] to_country_code The to_country_code
36
+ # @param [Boolean] branded The branded
37
+ # @param [Boolean] verified_caller The verified_caller
38
+ # @param [Boolean] has_tag The has_tag
39
+ # @param [String] start_time The start_time
40
+ # @param [String] end_time The end_time
41
+ # @param [Array[String]] call_type The call_type
42
+ # @param [Array[String]] call_state The call_state
43
+ # @param [call_summaries.CallDirection] direction The direction
44
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
45
+ # processing_state
46
+ # @param [call_summaries.SortBy] sort_by The sort_by
47
+ # @param [String] subaccount The subaccount
48
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
49
+ # guarantees to never return more than limit. Default is no limit
50
+ # @param [Integer] page_size Number of records to fetch per request, when
51
+ # not set will use the default value of 50 records. If no page_size is defined
52
+ # but a limit is defined, stream() will attempt to read the limit with the most
53
+ # efficient page size, i.e. min(limit, 1000)
54
+ # @return [Array] Array of up to limit results
55
+ def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, limit: nil, page_size: nil)
56
+ self.stream(
57
+ from: from,
58
+ to: to,
59
+ from_carrier: from_carrier,
60
+ to_carrier: to_carrier,
61
+ from_country_code: from_country_code,
62
+ to_country_code: to_country_code,
63
+ branded: branded,
64
+ verified_caller: verified_caller,
65
+ has_tag: has_tag,
66
+ start_time: start_time,
67
+ end_time: end_time,
68
+ call_type: call_type,
69
+ call_state: call_state,
70
+ direction: direction,
71
+ processing_state: processing_state,
72
+ sort_by: sort_by,
73
+ subaccount: subaccount,
74
+ limit: limit,
75
+ page_size: page_size
76
+ ).entries
77
+ end
78
+
79
+ ##
80
+ # Streams CallSummariesInstance records from the API as an Enumerable.
81
+ # This operation lazily loads records as efficiently as possible until the limit
82
+ # is reached.
83
+ # @param [Array[String]] from The from
84
+ # @param [Array[String]] to The to
85
+ # @param [Array[String]] from_carrier The from_carrier
86
+ # @param [Array[String]] to_carrier The to_carrier
87
+ # @param [Array[String]] from_country_code The from_country_code
88
+ # @param [Array[String]] to_country_code The to_country_code
89
+ # @param [Boolean] branded The branded
90
+ # @param [Boolean] verified_caller The verified_caller
91
+ # @param [Boolean] has_tag The has_tag
92
+ # @param [String] start_time The start_time
93
+ # @param [String] end_time The end_time
94
+ # @param [Array[String]] call_type The call_type
95
+ # @param [Array[String]] call_state The call_state
96
+ # @param [call_summaries.CallDirection] direction The direction
97
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
98
+ # processing_state
99
+ # @param [call_summaries.SortBy] sort_by The sort_by
100
+ # @param [String] subaccount The subaccount
101
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
102
+ # guarantees to never return more than limit. Default is no limit.
103
+ # @param [Integer] page_size Number of records to fetch per request, when
104
+ # not set will use the default value of 50 records. If no page_size is defined
105
+ # but a limit is defined, stream() will attempt to read the limit with the most
106
+ # efficient page size, i.e. min(limit, 1000)
107
+ # @return [Enumerable] Enumerable that will yield up to limit results
108
+ def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, limit: nil, page_size: nil)
109
+ limits = @version.read_limits(limit, page_size)
110
+
111
+ page = self.page(
112
+ from: from,
113
+ to: to,
114
+ from_carrier: from_carrier,
115
+ to_carrier: to_carrier,
116
+ from_country_code: from_country_code,
117
+ to_country_code: to_country_code,
118
+ branded: branded,
119
+ verified_caller: verified_caller,
120
+ has_tag: has_tag,
121
+ start_time: start_time,
122
+ end_time: end_time,
123
+ call_type: call_type,
124
+ call_state: call_state,
125
+ direction: direction,
126
+ processing_state: processing_state,
127
+ sort_by: sort_by,
128
+ subaccount: subaccount,
129
+ page_size: limits[:page_size],
130
+ )
131
+
132
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
133
+ end
134
+
135
+ ##
136
+ # When passed a block, yields CallSummariesInstance records from the API.
137
+ # This operation lazily loads records as efficiently as possible until the limit
138
+ # is reached.
139
+ def each
140
+ limits = @version.read_limits
141
+
142
+ page = self.page(page_size: limits[:page_size], )
143
+
144
+ @version.stream(page,
145
+ limit: limits[:limit],
146
+ page_limit: limits[:page_limit]).each {|x| yield x}
147
+ end
148
+
149
+ ##
150
+ # Retrieve a single page of CallSummariesInstance records from the API.
151
+ # Request is executed immediately.
152
+ # @param [Array[String]] from The from
153
+ # @param [Array[String]] to The to
154
+ # @param [Array[String]] from_carrier The from_carrier
155
+ # @param [Array[String]] to_carrier The to_carrier
156
+ # @param [Array[String]] from_country_code The from_country_code
157
+ # @param [Array[String]] to_country_code The to_country_code
158
+ # @param [Boolean] branded The branded
159
+ # @param [Boolean] verified_caller The verified_caller
160
+ # @param [Boolean] has_tag The has_tag
161
+ # @param [String] start_time The start_time
162
+ # @param [String] end_time The end_time
163
+ # @param [Array[String]] call_type The call_type
164
+ # @param [Array[String]] call_state The call_state
165
+ # @param [call_summaries.CallDirection] direction The direction
166
+ # @param [call_summaries.ProcessingStateRequest] processing_state The
167
+ # processing_state
168
+ # @param [call_summaries.SortBy] sort_by The sort_by
169
+ # @param [String] subaccount The subaccount
170
+ # @param [String] page_token PageToken provided by the API
171
+ # @param [Integer] page_number Page Number, this value is simply for client state
172
+ # @param [Integer] page_size Number of records to return, defaults to 50
173
+ # @return [Page] Page of CallSummariesInstance
174
+ def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
175
+ params = Twilio::Values.of({
176
+ 'From' => Twilio.serialize_list(from) { |e| e },
177
+ 'To' => Twilio.serialize_list(to) { |e| e },
178
+ 'FromCarrier' => Twilio.serialize_list(from_carrier) { |e| e },
179
+ 'ToCarrier' => Twilio.serialize_list(to_carrier) { |e| e },
180
+ 'FromCountryCode' => Twilio.serialize_list(from_country_code) { |e| e },
181
+ 'ToCountryCode' => Twilio.serialize_list(to_country_code) { |e| e },
182
+ 'Branded' => branded,
183
+ 'VerifiedCaller' => verified_caller,
184
+ 'HasTag' => has_tag,
185
+ 'StartTime' => start_time,
186
+ 'EndTime' => end_time,
187
+ 'CallType' => Twilio.serialize_list(call_type) { |e| e },
188
+ 'CallState' => Twilio.serialize_list(call_state) { |e| e },
189
+ 'Direction' => direction,
190
+ 'ProcessingState' => processing_state,
191
+ 'SortBy' => sort_by,
192
+ 'Subaccount' => subaccount,
193
+ 'PageToken' => page_token,
194
+ 'Page' => page_number,
195
+ 'PageSize' => page_size,
196
+ })
197
+
198
+ response = @version.page('GET', @uri, params: params)
199
+
200
+ CallSummariesPage.new(@version, response, @solution)
201
+ end
202
+
203
+ ##
204
+ # Retrieve a single page of CallSummariesInstance records from the API.
205
+ # Request is executed immediately.
206
+ # @param [String] target_url API-generated URL for the requested results page
207
+ # @return [Page] Page of CallSummariesInstance
208
+ def get_page(target_url)
209
+ response = @version.domain.request(
210
+ 'GET',
211
+ target_url
212
+ )
213
+ CallSummariesPage.new(@version, response, @solution)
214
+ end
215
+
216
+ ##
217
+ # Provide a user friendly representation
218
+ def to_s
219
+ '#<Twilio.Insights.V1.CallSummariesList>'
220
+ end
221
+ end
222
+
223
+ class CallSummariesPage < Page
224
+ ##
225
+ # Initialize the CallSummariesPage
226
+ # @param [Version] version Version that contains the resource
227
+ # @param [Response] response Response from the API
228
+ # @param [Hash] solution Path solution for the resource
229
+ # @return [CallSummariesPage] CallSummariesPage
230
+ def initialize(version, response, solution)
231
+ super(version, response)
232
+
233
+ # Path Solution
234
+ @solution = solution
235
+ end
236
+
237
+ ##
238
+ # Build an instance of CallSummariesInstance
239
+ # @param [Hash] payload Payload response from the API
240
+ # @return [CallSummariesInstance] CallSummariesInstance
241
+ def get_instance(payload)
242
+ CallSummariesInstance.new(@version, payload, )
243
+ end
244
+
245
+ ##
246
+ # Provide a user friendly representation
247
+ def to_s
248
+ '<Twilio.Insights.V1.CallSummariesPage>'
249
+ end
250
+ end
251
+
252
+ class CallSummariesInstance < InstanceResource
253
+ ##
254
+ # Initialize the CallSummariesInstance
255
+ # @param [Version] version Version that contains the resource
256
+ # @param [Hash] payload payload that contains response from Twilio
257
+ # @return [CallSummariesInstance] CallSummariesInstance
258
+ def initialize(version, payload)
259
+ super(version)
260
+
261
+ # Marshaled Properties
262
+ @properties = {
263
+ 'account_sid' => payload['account_sid'],
264
+ 'call_sid' => payload['call_sid'],
265
+ 'call_type' => payload['call_type'],
266
+ 'call_state' => payload['call_state'],
267
+ 'processing_state' => payload['processing_state'],
268
+ 'created_time' => Twilio.deserialize_iso8601_datetime(payload['created_time']),
269
+ 'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
270
+ 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
271
+ 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
272
+ 'connect_duration' => payload['connect_duration'] == nil ? payload['connect_duration'] : payload['connect_duration'].to_i,
273
+ 'from' => payload['from'],
274
+ 'to' => payload['to'],
275
+ 'carrier_edge' => payload['carrier_edge'],
276
+ 'client_edge' => payload['client_edge'],
277
+ 'sdk_edge' => payload['sdk_edge'],
278
+ 'sip_edge' => payload['sip_edge'],
279
+ 'tags' => payload['tags'],
280
+ 'url' => payload['url'],
281
+ 'attributes' => payload['attributes'],
282
+ 'properties' => payload['properties'],
283
+ 'trust' => payload['trust'],
284
+ }
285
+ end
286
+
287
+ ##
288
+ # @return [String] The account_sid
289
+ def account_sid
290
+ @properties['account_sid']
291
+ end
292
+
293
+ ##
294
+ # @return [String] The call_sid
295
+ def call_sid
296
+ @properties['call_sid']
297
+ end
298
+
299
+ ##
300
+ # @return [call_summaries.CallType] The call_type
301
+ def call_type
302
+ @properties['call_type']
303
+ end
304
+
305
+ ##
306
+ # @return [call_summaries.CallState] The call_state
307
+ def call_state
308
+ @properties['call_state']
309
+ end
310
+
311
+ ##
312
+ # @return [call_summaries.ProcessingState] The processing_state
313
+ def processing_state
314
+ @properties['processing_state']
315
+ end
316
+
317
+ ##
318
+ # @return [Time] The created_time
319
+ def created_time
320
+ @properties['created_time']
321
+ end
322
+
323
+ ##
324
+ # @return [Time] The start_time
325
+ def start_time
326
+ @properties['start_time']
327
+ end
328
+
329
+ ##
330
+ # @return [Time] The end_time
331
+ def end_time
332
+ @properties['end_time']
333
+ end
334
+
335
+ ##
336
+ # @return [String] The duration
337
+ def duration
338
+ @properties['duration']
339
+ end
340
+
341
+ ##
342
+ # @return [String] The connect_duration
343
+ def connect_duration
344
+ @properties['connect_duration']
345
+ end
346
+
347
+ ##
348
+ # @return [Hash] The from
349
+ def from
350
+ @properties['from']
351
+ end
352
+
353
+ ##
354
+ # @return [Hash] The to
355
+ def to
356
+ @properties['to']
357
+ end
358
+
359
+ ##
360
+ # @return [Hash] The carrier_edge
361
+ def carrier_edge
362
+ @properties['carrier_edge']
363
+ end
364
+
365
+ ##
366
+ # @return [Hash] The client_edge
367
+ def client_edge
368
+ @properties['client_edge']
369
+ end
370
+
371
+ ##
372
+ # @return [Hash] The sdk_edge
373
+ def sdk_edge
374
+ @properties['sdk_edge']
375
+ end
376
+
377
+ ##
378
+ # @return [Hash] The sip_edge
379
+ def sip_edge
380
+ @properties['sip_edge']
381
+ end
382
+
383
+ ##
384
+ # @return [Array[String]] The tags
385
+ def tags
386
+ @properties['tags']
387
+ end
388
+
389
+ ##
390
+ # @return [String] The url
391
+ def url
392
+ @properties['url']
393
+ end
394
+
395
+ ##
396
+ # @return [Hash] The attributes
397
+ def attributes
398
+ @properties['attributes']
399
+ end
400
+
401
+ ##
402
+ # @return [Hash] The properties
403
+ def properties
404
+ @properties['properties']
405
+ end
406
+
407
+ ##
408
+ # @return [Hash] The trust
409
+ def trust
410
+ @properties['trust']
411
+ end
412
+
413
+ ##
414
+ # Provide a user friendly representation
415
+ def to_s
416
+ "<Twilio.Insights.V1.CallSummariesInstance>"
417
+ end
418
+
419
+ ##
420
+ # Provide a detailed, user friendly representation
421
+ def inspect
422
+ "<Twilio.Insights.V1.CallSummariesInstance>"
423
+ end
424
+ end
425
+ end
426
+ end
427
+ end
428
+ end