twilio-ruby 5.61.1 → 5.63.1

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +124 -0
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +84 -21
  5. data/CHANGES.md +96 -0
  6. data/Makefile +3 -6
  7. data/README.md +4 -4
  8. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +19 -5
  10. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +269 -0
  11. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +8 -0
  12. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  13. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
  14. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +483 -0
  15. data/lib/twilio-ruby/rest/insights/v1/conference.rb +484 -0
  16. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  17. data/lib/twilio-ruby/rest/insights/v1.rb +23 -0
  18. data/lib/twilio-ruby/rest/insights.rb +14 -0
  19. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +14 -1
  20. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +23 -0
  21. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +80 -0
  22. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  23. data/lib/twilio-ruby/rest/supersim/v1/ip_command.rb +416 -0
  24. data/lib/twilio-ruby/rest/supersim/v1.rb +32 -0
  25. data/lib/twilio-ruby/rest/supersim.rb +18 -0
  26. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +138 -10
  27. data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
  28. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -0
  29. data/lib/twilio-ruby/rest/video/v1/recording.rb +7 -0
  30. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  31. data/lib/twilio-ruby/rest/video/v1/room.rb +34 -1
  32. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  33. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  34. data/lib/twilio-ruby/rest/voice.rb +8 -0
  35. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +4 -4
  36. data/lib/twilio-ruby/version.rb +1 -1
  37. data/sonar-project.properties +1 -1
  38. data/twilio-ruby.gemspec +0 -1
  39. metadata +10 -18
  40. data/.github/workflows/deploy.yml +0 -65
  41. data/.github/workflows/test.yml +0 -51
@@ -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
@@ -0,0 +1,215 @@
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 SettingList < ListResource
14
+ ##
15
+ # Initialize the SettingList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SettingList] SettingList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Insights.V1.SettingList>'
29
+ end
30
+ end
31
+
32
+ class SettingPage < Page
33
+ ##
34
+ # Initialize the SettingPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [SettingPage] SettingPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of SettingInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [SettingInstance] SettingInstance
50
+ def get_instance(payload)
51
+ SettingInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Insights.V1.SettingPage>'
58
+ end
59
+ end
60
+
61
+ class SettingContext < InstanceContext
62
+ ##
63
+ # Initialize the SettingContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @return [SettingContext] SettingContext
66
+ def initialize(version)
67
+ super(version)
68
+
69
+ # Path Solution
70
+ @solution = {}
71
+ @uri = "/Voice/Settings"
72
+ end
73
+
74
+ ##
75
+ # Fetch the SettingInstance
76
+ # @param [String] subaccount_sid The subaccount_sid
77
+ # @return [SettingInstance] Fetched SettingInstance
78
+ def fetch(subaccount_sid: :unset)
79
+ params = Twilio::Values.of({'SubaccountSid' => subaccount_sid, })
80
+
81
+ payload = @version.fetch('GET', @uri, params: params)
82
+
83
+ SettingInstance.new(@version, payload, )
84
+ end
85
+
86
+ ##
87
+ # Update the SettingInstance
88
+ # @param [Boolean] advanced_features The advanced_features
89
+ # @param [Boolean] voice_trace The voice_trace
90
+ # @param [String] subaccount_sid The subaccount_sid
91
+ # @return [SettingInstance] Updated SettingInstance
92
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
93
+ data = Twilio::Values.of({
94
+ 'AdvancedFeatures' => advanced_features,
95
+ 'VoiceTrace' => voice_trace,
96
+ 'SubaccountSid' => subaccount_sid,
97
+ })
98
+
99
+ payload = @version.update('POST', @uri, data: data)
100
+
101
+ SettingInstance.new(@version, payload, )
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
109
+ end
110
+
111
+ ##
112
+ # Provide a detailed, user friendly representation
113
+ def inspect
114
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
116
+ end
117
+ end
118
+
119
+ class SettingInstance < InstanceResource
120
+ ##
121
+ # Initialize the SettingInstance
122
+ # @param [Version] version Version that contains the resource
123
+ # @param [Hash] payload payload that contains response from Twilio
124
+ # @return [SettingInstance] SettingInstance
125
+ def initialize(version, payload)
126
+ super(version)
127
+
128
+ # Marshaled Properties
129
+ @properties = {
130
+ 'account_sid' => payload['account_sid'],
131
+ 'advanced_features' => payload['advanced_features'],
132
+ 'voice_trace' => payload['voice_trace'],
133
+ 'url' => payload['url'],
134
+ }
135
+
136
+ # Context
137
+ @instance_context = nil
138
+ @params = {}
139
+ end
140
+
141
+ ##
142
+ # Generate an instance context for the instance, the context is capable of
143
+ # performing various actions. All instance actions are proxied to the context
144
+ # @return [SettingContext] SettingContext for this SettingInstance
145
+ def context
146
+ unless @instance_context
147
+ @instance_context = SettingContext.new(@version, )
148
+ end
149
+ @instance_context
150
+ end
151
+
152
+ ##
153
+ # @return [String] The account_sid
154
+ def account_sid
155
+ @properties['account_sid']
156
+ end
157
+
158
+ ##
159
+ # @return [Boolean] The advanced_features
160
+ def advanced_features
161
+ @properties['advanced_features']
162
+ end
163
+
164
+ ##
165
+ # @return [Boolean] The voice_trace
166
+ def voice_trace
167
+ @properties['voice_trace']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The url
172
+ def url
173
+ @properties['url']
174
+ end
175
+
176
+ ##
177
+ # Fetch the SettingInstance
178
+ # @param [String] subaccount_sid The subaccount_sid
179
+ # @return [SettingInstance] Fetched SettingInstance
180
+ def fetch(subaccount_sid: :unset)
181
+ context.fetch(subaccount_sid: subaccount_sid, )
182
+ end
183
+
184
+ ##
185
+ # Update the SettingInstance
186
+ # @param [Boolean] advanced_features The advanced_features
187
+ # @param [Boolean] voice_trace The voice_trace
188
+ # @param [String] subaccount_sid The subaccount_sid
189
+ # @return [SettingInstance] Updated SettingInstance
190
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
191
+ context.update(
192
+ advanced_features: advanced_features,
193
+ voice_trace: voice_trace,
194
+ subaccount_sid: subaccount_sid,
195
+ )
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
202
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
203
+ end
204
+
205
+ ##
206
+ # Provide a detailed, user friendly representation
207
+ def inspect
208
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
209
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end