twilio-ruby 5.63.0 → 5.63.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,484 @@
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 ConferenceList < ListResource
14
+ ##
15
+ # Initialize the ConferenceList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [ConferenceList] ConferenceList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Conferences"
24
+ end
25
+
26
+ ##
27
+ # Lists ConferenceInstance 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 [String] conference_sid The conference_sid
31
+ # @param [String] friendly_name The friendly_name
32
+ # @param [String] status The status
33
+ # @param [String] created_after The created_after
34
+ # @param [String] created_before The created_before
35
+ # @param [String] mixer_region The mixer_region
36
+ # @param [String] tags The tags
37
+ # @param [String] subaccount The subaccount
38
+ # @param [String] detected_issues The detected_issues
39
+ # @param [String] end_reason The end_reason
40
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
41
+ # guarantees to never return more than limit. Default is no limit
42
+ # @param [Integer] page_size Number of records to fetch per request, when
43
+ # not set will use the default value of 50 records. If no page_size is defined
44
+ # but a limit is defined, stream() will attempt to read the limit with the most
45
+ # efficient page size, i.e. min(limit, 1000)
46
+ # @return [Array] Array of up to limit results
47
+ def list(conference_sid: :unset, friendly_name: :unset, status: :unset, created_after: :unset, created_before: :unset, mixer_region: :unset, tags: :unset, subaccount: :unset, detected_issues: :unset, end_reason: :unset, limit: nil, page_size: nil)
48
+ self.stream(
49
+ conference_sid: conference_sid,
50
+ friendly_name: friendly_name,
51
+ status: status,
52
+ created_after: created_after,
53
+ created_before: created_before,
54
+ mixer_region: mixer_region,
55
+ tags: tags,
56
+ subaccount: subaccount,
57
+ detected_issues: detected_issues,
58
+ end_reason: end_reason,
59
+ limit: limit,
60
+ page_size: page_size
61
+ ).entries
62
+ end
63
+
64
+ ##
65
+ # Streams ConferenceInstance records from the API as an Enumerable.
66
+ # This operation lazily loads records as efficiently as possible until the limit
67
+ # is reached.
68
+ # @param [String] conference_sid The conference_sid
69
+ # @param [String] friendly_name The friendly_name
70
+ # @param [String] status The status
71
+ # @param [String] created_after The created_after
72
+ # @param [String] created_before The created_before
73
+ # @param [String] mixer_region The mixer_region
74
+ # @param [String] tags The tags
75
+ # @param [String] subaccount The subaccount
76
+ # @param [String] detected_issues The detected_issues
77
+ # @param [String] end_reason The end_reason
78
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
79
+ # guarantees to never return more than limit. Default is no limit.
80
+ # @param [Integer] page_size Number of records to fetch per request, when
81
+ # not set will use the default value of 50 records. If no page_size is defined
82
+ # but a limit is defined, stream() will attempt to read the limit with the most
83
+ # efficient page size, i.e. min(limit, 1000)
84
+ # @return [Enumerable] Enumerable that will yield up to limit results
85
+ def stream(conference_sid: :unset, friendly_name: :unset, status: :unset, created_after: :unset, created_before: :unset, mixer_region: :unset, tags: :unset, subaccount: :unset, detected_issues: :unset, end_reason: :unset, limit: nil, page_size: nil)
86
+ limits = @version.read_limits(limit, page_size)
87
+
88
+ page = self.page(
89
+ conference_sid: conference_sid,
90
+ friendly_name: friendly_name,
91
+ status: status,
92
+ created_after: created_after,
93
+ created_before: created_before,
94
+ mixer_region: mixer_region,
95
+ tags: tags,
96
+ subaccount: subaccount,
97
+ detected_issues: detected_issues,
98
+ end_reason: end_reason,
99
+ page_size: limits[:page_size],
100
+ )
101
+
102
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
103
+ end
104
+
105
+ ##
106
+ # When passed a block, yields ConferenceInstance records from the API.
107
+ # This operation lazily loads records as efficiently as possible until the limit
108
+ # is reached.
109
+ def each
110
+ limits = @version.read_limits
111
+
112
+ page = self.page(page_size: limits[:page_size], )
113
+
114
+ @version.stream(page,
115
+ limit: limits[:limit],
116
+ page_limit: limits[:page_limit]).each {|x| yield x}
117
+ end
118
+
119
+ ##
120
+ # Retrieve a single page of ConferenceInstance records from the API.
121
+ # Request is executed immediately.
122
+ # @param [String] conference_sid The conference_sid
123
+ # @param [String] friendly_name The friendly_name
124
+ # @param [String] status The status
125
+ # @param [String] created_after The created_after
126
+ # @param [String] created_before The created_before
127
+ # @param [String] mixer_region The mixer_region
128
+ # @param [String] tags The tags
129
+ # @param [String] subaccount The subaccount
130
+ # @param [String] detected_issues The detected_issues
131
+ # @param [String] end_reason The end_reason
132
+ # @param [String] page_token PageToken provided by the API
133
+ # @param [Integer] page_number Page Number, this value is simply for client state
134
+ # @param [Integer] page_size Number of records to return, defaults to 50
135
+ # @return [Page] Page of ConferenceInstance
136
+ def page(conference_sid: :unset, friendly_name: :unset, status: :unset, created_after: :unset, created_before: :unset, mixer_region: :unset, tags: :unset, subaccount: :unset, detected_issues: :unset, end_reason: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
137
+ params = Twilio::Values.of({
138
+ 'ConferenceSid' => conference_sid,
139
+ 'FriendlyName' => friendly_name,
140
+ 'Status' => status,
141
+ 'CreatedAfter' => created_after,
142
+ 'CreatedBefore' => created_before,
143
+ 'MixerRegion' => mixer_region,
144
+ 'Tags' => tags,
145
+ 'Subaccount' => subaccount,
146
+ 'DetectedIssues' => detected_issues,
147
+ 'EndReason' => end_reason,
148
+ 'PageToken' => page_token,
149
+ 'Page' => page_number,
150
+ 'PageSize' => page_size,
151
+ })
152
+
153
+ response = @version.page('GET', @uri, params: params)
154
+
155
+ ConferencePage.new(@version, response, @solution)
156
+ end
157
+
158
+ ##
159
+ # Retrieve a single page of ConferenceInstance records from the API.
160
+ # Request is executed immediately.
161
+ # @param [String] target_url API-generated URL for the requested results page
162
+ # @return [Page] Page of ConferenceInstance
163
+ def get_page(target_url)
164
+ response = @version.domain.request(
165
+ 'GET',
166
+ target_url
167
+ )
168
+ ConferencePage.new(@version, response, @solution)
169
+ end
170
+
171
+ ##
172
+ # Provide a user friendly representation
173
+ def to_s
174
+ '#<Twilio.Insights.V1.ConferenceList>'
175
+ end
176
+ end
177
+
178
+ class ConferencePage < Page
179
+ ##
180
+ # Initialize the ConferencePage
181
+ # @param [Version] version Version that contains the resource
182
+ # @param [Response] response Response from the API
183
+ # @param [Hash] solution Path solution for the resource
184
+ # @return [ConferencePage] ConferencePage
185
+ def initialize(version, response, solution)
186
+ super(version, response)
187
+
188
+ # Path Solution
189
+ @solution = solution
190
+ end
191
+
192
+ ##
193
+ # Build an instance of ConferenceInstance
194
+ # @param [Hash] payload Payload response from the API
195
+ # @return [ConferenceInstance] ConferenceInstance
196
+ def get_instance(payload)
197
+ ConferenceInstance.new(@version, payload, )
198
+ end
199
+
200
+ ##
201
+ # Provide a user friendly representation
202
+ def to_s
203
+ '<Twilio.Insights.V1.ConferencePage>'
204
+ end
205
+ end
206
+
207
+ class ConferenceContext < InstanceContext
208
+ ##
209
+ # Initialize the ConferenceContext
210
+ # @param [Version] version Version that contains the resource
211
+ # @param [String] conference_sid The conference_sid
212
+ # @return [ConferenceContext] ConferenceContext
213
+ def initialize(version, conference_sid)
214
+ super(version)
215
+
216
+ # Path Solution
217
+ @solution = {conference_sid: conference_sid, }
218
+ @uri = "/Conferences/#{@solution[:conference_sid]}"
219
+
220
+ # Dependents
221
+ @conference_participants = nil
222
+ end
223
+
224
+ ##
225
+ # Fetch the ConferenceInstance
226
+ # @return [ConferenceInstance] Fetched ConferenceInstance
227
+ def fetch
228
+ payload = @version.fetch('GET', @uri)
229
+
230
+ ConferenceInstance.new(@version, payload, conference_sid: @solution[:conference_sid], )
231
+ end
232
+
233
+ ##
234
+ # Access the conference_participants
235
+ # @return [ConferenceParticipantList]
236
+ # @return [ConferenceParticipantContext] if participant_sid was passed.
237
+ def conference_participants(participant_sid=:unset)
238
+ raise ArgumentError, 'participant_sid cannot be nil' if participant_sid.nil?
239
+
240
+ if participant_sid != :unset
241
+ return ConferenceParticipantContext.new(@version, @solution[:conference_sid], participant_sid, )
242
+ end
243
+
244
+ unless @conference_participants
245
+ @conference_participants = ConferenceParticipantList.new(
246
+ @version,
247
+ conference_sid: @solution[:conference_sid],
248
+ )
249
+ end
250
+
251
+ @conference_participants
252
+ end
253
+
254
+ ##
255
+ # Provide a user friendly representation
256
+ def to_s
257
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
258
+ "#<Twilio.Insights.V1.ConferenceContext #{context}>"
259
+ end
260
+
261
+ ##
262
+ # Provide a detailed, user friendly representation
263
+ def inspect
264
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
265
+ "#<Twilio.Insights.V1.ConferenceContext #{context}>"
266
+ end
267
+ end
268
+
269
+ class ConferenceInstance < InstanceResource
270
+ ##
271
+ # Initialize the ConferenceInstance
272
+ # @param [Version] version Version that contains the resource
273
+ # @param [Hash] payload payload that contains response from Twilio
274
+ # @param [String] conference_sid The conference_sid
275
+ # @return [ConferenceInstance] ConferenceInstance
276
+ def initialize(version, payload, conference_sid: nil)
277
+ super(version)
278
+
279
+ # Marshaled Properties
280
+ @properties = {
281
+ 'conference_sid' => payload['conference_sid'],
282
+ 'account_sid' => payload['account_sid'],
283
+ 'friendly_name' => payload['friendly_name'],
284
+ 'create_time' => Twilio.deserialize_iso8601_datetime(payload['create_time']),
285
+ 'start_time' => Twilio.deserialize_iso8601_datetime(payload['start_time']),
286
+ 'end_time' => Twilio.deserialize_iso8601_datetime(payload['end_time']),
287
+ 'duration_seconds' => payload['duration_seconds'] == nil ? payload['duration_seconds'] : payload['duration_seconds'].to_i,
288
+ 'connect_duration_seconds' => payload['connect_duration_seconds'] == nil ? payload['connect_duration_seconds'] : payload['connect_duration_seconds'].to_i,
289
+ 'status' => payload['status'],
290
+ 'max_participants' => payload['max_participants'] == nil ? payload['max_participants'] : payload['max_participants'].to_i,
291
+ 'max_concurrent_participants' => payload['max_concurrent_participants'] == nil ? payload['max_concurrent_participants'] : payload['max_concurrent_participants'].to_i,
292
+ 'unique_participants' => payload['unique_participants'] == nil ? payload['unique_participants'] : payload['unique_participants'].to_i,
293
+ 'end_reason' => payload['end_reason'],
294
+ 'ended_by' => payload['ended_by'],
295
+ 'mixer_region' => payload['mixer_region'],
296
+ 'mixer_region_requested' => payload['mixer_region_requested'],
297
+ 'recording_enabled' => payload['recording_enabled'],
298
+ 'detected_issues' => payload['detected_issues'],
299
+ 'tags' => payload['tags'],
300
+ 'tag_info' => payload['tag_info'],
301
+ 'url' => payload['url'],
302
+ 'links' => payload['links'],
303
+ }
304
+
305
+ # Context
306
+ @instance_context = nil
307
+ @params = {'conference_sid' => conference_sid || @properties['conference_sid'], }
308
+ end
309
+
310
+ ##
311
+ # Generate an instance context for the instance, the context is capable of
312
+ # performing various actions. All instance actions are proxied to the context
313
+ # @return [ConferenceContext] ConferenceContext for this ConferenceInstance
314
+ def context
315
+ unless @instance_context
316
+ @instance_context = ConferenceContext.new(@version, @params['conference_sid'], )
317
+ end
318
+ @instance_context
319
+ end
320
+
321
+ ##
322
+ # @return [String] The conference_sid
323
+ def conference_sid
324
+ @properties['conference_sid']
325
+ end
326
+
327
+ ##
328
+ # @return [String] The account_sid
329
+ def account_sid
330
+ @properties['account_sid']
331
+ end
332
+
333
+ ##
334
+ # @return [String] The friendly_name
335
+ def friendly_name
336
+ @properties['friendly_name']
337
+ end
338
+
339
+ ##
340
+ # @return [Time] The create_time
341
+ def create_time
342
+ @properties['create_time']
343
+ end
344
+
345
+ ##
346
+ # @return [Time] The start_time
347
+ def start_time
348
+ @properties['start_time']
349
+ end
350
+
351
+ ##
352
+ # @return [Time] The end_time
353
+ def end_time
354
+ @properties['end_time']
355
+ end
356
+
357
+ ##
358
+ # @return [String] The duration_seconds
359
+ def duration_seconds
360
+ @properties['duration_seconds']
361
+ end
362
+
363
+ ##
364
+ # @return [String] The connect_duration_seconds
365
+ def connect_duration_seconds
366
+ @properties['connect_duration_seconds']
367
+ end
368
+
369
+ ##
370
+ # @return [conference.ConferenceStatus] The status
371
+ def status
372
+ @properties['status']
373
+ end
374
+
375
+ ##
376
+ # @return [String] The max_participants
377
+ def max_participants
378
+ @properties['max_participants']
379
+ end
380
+
381
+ ##
382
+ # @return [String] The max_concurrent_participants
383
+ def max_concurrent_participants
384
+ @properties['max_concurrent_participants']
385
+ end
386
+
387
+ ##
388
+ # @return [String] The unique_participants
389
+ def unique_participants
390
+ @properties['unique_participants']
391
+ end
392
+
393
+ ##
394
+ # @return [conference.ConferenceEndReason] The end_reason
395
+ def end_reason
396
+ @properties['end_reason']
397
+ end
398
+
399
+ ##
400
+ # @return [String] The ended_by
401
+ def ended_by
402
+ @properties['ended_by']
403
+ end
404
+
405
+ ##
406
+ # @return [conference.Region] The mixer_region
407
+ def mixer_region
408
+ @properties['mixer_region']
409
+ end
410
+
411
+ ##
412
+ # @return [conference.Region] The mixer_region_requested
413
+ def mixer_region_requested
414
+ @properties['mixer_region_requested']
415
+ end
416
+
417
+ ##
418
+ # @return [Boolean] The recording_enabled
419
+ def recording_enabled
420
+ @properties['recording_enabled']
421
+ end
422
+
423
+ ##
424
+ # @return [Hash] The detected_issues
425
+ def detected_issues
426
+ @properties['detected_issues']
427
+ end
428
+
429
+ ##
430
+ # @return [Array[conference.Tag]] The tags
431
+ def tags
432
+ @properties['tags']
433
+ end
434
+
435
+ ##
436
+ # @return [Hash] The tag_info
437
+ def tag_info
438
+ @properties['tag_info']
439
+ end
440
+
441
+ ##
442
+ # @return [String] The url
443
+ def url
444
+ @properties['url']
445
+ end
446
+
447
+ ##
448
+ # @return [String] The links
449
+ def links
450
+ @properties['links']
451
+ end
452
+
453
+ ##
454
+ # Fetch the ConferenceInstance
455
+ # @return [ConferenceInstance] Fetched ConferenceInstance
456
+ def fetch
457
+ context.fetch
458
+ end
459
+
460
+ ##
461
+ # Access the conference_participants
462
+ # @return [conference_participants] conference_participants
463
+ def conference_participants
464
+ context.conference_participants
465
+ end
466
+
467
+ ##
468
+ # Provide a user friendly representation
469
+ def to_s
470
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
471
+ "<Twilio.Insights.V1.ConferenceInstance #{values}>"
472
+ end
473
+
474
+ ##
475
+ # Provide a detailed, user friendly representation
476
+ def inspect
477
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
478
+ "<Twilio.Insights.V1.ConferenceInstance #{values}>"
479
+ end
480
+ end
481
+ end
482
+ end
483
+ end
484
+ end
@@ -18,6 +18,7 @@ module Twilio
18
18
  @settings = nil
19
19
  @calls = nil
20
20
  @call_summaries = nil
21
+ @conferences = nil
21
22
  @rooms = nil
22
23
  end
23
24
 
@@ -48,6 +49,21 @@ module Twilio
48
49
  @call_summaries ||= CallSummariesList.new self
49
50
  end
50
51
 
52
+ ##
53
+ # @param [String] conference_sid The conference_sid
54
+ # @return [Twilio::REST::Insights::V1::ConferenceContext] if conference_sid was passed.
55
+ # @return [Twilio::REST::Insights::V1::ConferenceList]
56
+ def conferences(conference_sid=:unset)
57
+ if conference_sid.nil?
58
+ raise ArgumentError, 'conference_sid cannot be nil'
59
+ end
60
+ if conference_sid == :unset
61
+ @conferences ||= ConferenceList.new self
62
+ else
63
+ ConferenceContext.new(self, conference_sid)
64
+ end
65
+ end
66
+
51
67
  ##
52
68
  # @param [String] room_sid The SID of the Room resource.
53
69
  # @return [Twilio::REST::Insights::V1::RoomContext] if room_sid was passed.
@@ -48,6 +48,14 @@ module Twilio
48
48
  self.v1.call_summaries()
49
49
  end
50
50
 
51
+ ##
52
+ # @param [String] conference_sid The conference_sid
53
+ # @return [Twilio::REST::Insights::V1::ConferenceInstance] if conference_sid was passed.
54
+ # @return [Twilio::REST::Insights::V1::ConferenceList]
55
+ def conferences(conference_sid=:unset)
56
+ self.v1.conferences(conference_sid)
57
+ end
58
+
51
59
  ##
52
60
  # @param [String] room_sid Unique identifier for the room.
53
61
  # @return [Twilio::REST::Insights::V1::RoomInstance] if room_sid was passed.
@@ -269,6 +269,7 @@ module Twilio
269
269
  'brand_feedback' => payload['brand_feedback'],
270
270
  'identity_status' => payload['identity_status'],
271
271
  'russell_3000' => payload['russell_3000'],
272
+ 'government_entity' => payload['government_entity'],
272
273
  'tax_exempt_status' => payload['tax_exempt_status'],
273
274
  'skip_automatic_sec_vet' => payload['skip_automatic_sec_vet'],
274
275
  'mock' => payload['mock'],
@@ -381,6 +382,12 @@ module Twilio
381
382
  @properties['russell_3000']
382
383
  end
383
384
 
385
+ ##
386
+ # @return [Boolean] Government Entity
387
+ def government_entity
388
+ @properties['government_entity']
389
+ end
390
+
384
391
  ##
385
392
  # @return [String] Tax Exempt Status
386
393
  def tax_exempt_status