twilio-ruby 5.63.0 → 5.65.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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +27 -3
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +84 -21
  5. data/CHANGES.md +79 -0
  6. data/Makefile +1 -4
  7. data/README.md +3 -2
  8. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +7 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  11. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -0
  12. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +447 -0
  13. data/lib/twilio-ruby/rest/conversations/v1.rb +17 -0
  14. data/lib/twilio-ruby/rest/conversations.rb +9 -0
  15. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -77
  16. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
  17. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  18. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  19. data/lib/twilio-ruby/rest/insights/v1.rb +16 -0
  20. data/lib/twilio-ruby/rest/insights.rb +8 -0
  21. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +7 -0
  22. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +75 -18
  23. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  24. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +71 -30
  25. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  26. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +9 -9
  27. data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
  28. data/lib/twilio-ruby/rest/supersim.rb +9 -0
  29. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +130 -8
  30. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +7 -0
  31. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +16 -6
  32. data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
  33. data/lib/twilio-ruby/rest/verify/v2/template.rb +1 -1
  34. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  35. data/lib/twilio-ruby/rest/verify.rb +2 -2
  36. data/lib/twilio-ruby/rest/video/v1/room.rb +7 -4
  37. data/lib/twilio-ruby/version.rb +1 -1
  38. data/sonar-project.properties +1 -1
  39. data/twilio-ruby.gemspec +0 -1
  40. metadata +7 -16
@@ -443,6 +443,7 @@ module Twilio
443
443
  @events = nil
444
444
  @payments = nil
445
445
  @siprec = nil
446
+ @streams = nil
446
447
  end
447
448
 
448
449
  ##
@@ -617,6 +618,24 @@ module Twilio
617
618
  @siprec
618
619
  end
619
620
 
621
+ ##
622
+ # Access the streams
623
+ # @return [StreamList]
624
+ # @return [StreamContext] if sid was passed.
625
+ def streams(sid=:unset)
626
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
627
+
628
+ if sid != :unset
629
+ return StreamContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
630
+ end
631
+
632
+ unless @streams
633
+ @streams = StreamList.new(@version, account_sid: @solution[:account_sid], call_sid: @solution[:sid], )
634
+ end
635
+
636
+ @streams
637
+ end
638
+
620
639
  ##
621
640
  # Provide a user friendly representation
622
641
  def to_s
@@ -958,6 +977,13 @@ module Twilio
958
977
  context.siprec
959
978
  end
960
979
 
980
+ ##
981
+ # Access the streams
982
+ # @return [streams] streams
983
+ def streams
984
+ context.streams
985
+ end
986
+
961
987
  ##
962
988
  # Provide a user friendly representation
963
989
  def to_s
@@ -0,0 +1,447 @@
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 Conversations < Domain
12
+ class V1 < Version
13
+ class AddressConfigurationList < ListResource
14
+ ##
15
+ # Initialize the AddressConfigurationList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [AddressConfigurationList] AddressConfigurationList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Configuration/Addresses"
24
+ end
25
+
26
+ ##
27
+ # Lists AddressConfigurationInstance 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 [Integer] limit Upper limit for the number of records to return. stream()
31
+ # guarantees to never return more than limit. Default is no limit
32
+ # @param [Integer] page_size Number of records to fetch per request, when
33
+ # not set will use the default value of 50 records. If no page_size is defined
34
+ # but a limit is defined, stream() will attempt to read the limit with the most
35
+ # efficient page size, i.e. min(limit, 1000)
36
+ # @return [Array] Array of up to limit results
37
+ def list(limit: nil, page_size: nil)
38
+ self.stream(limit: limit, page_size: page_size).entries
39
+ end
40
+
41
+ ##
42
+ # Streams AddressConfigurationInstance records from the API as an Enumerable.
43
+ # This operation lazily loads records as efficiently as possible until the limit
44
+ # is reached.
45
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
46
+ # guarantees to never return more than limit. Default is no limit.
47
+ # @param [Integer] page_size Number of records to fetch per request, when
48
+ # not set will use the default value of 50 records. If no page_size is defined
49
+ # but a limit is defined, stream() will attempt to read the limit with the most
50
+ # efficient page size, i.e. min(limit, 1000)
51
+ # @return [Enumerable] Enumerable that will yield up to limit results
52
+ def stream(limit: nil, page_size: nil)
53
+ limits = @version.read_limits(limit, page_size)
54
+
55
+ page = self.page(page_size: limits[:page_size], )
56
+
57
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
58
+ end
59
+
60
+ ##
61
+ # When passed a block, yields AddressConfigurationInstance records from the API.
62
+ # This operation lazily loads records as efficiently as possible until the limit
63
+ # is reached.
64
+ def each
65
+ limits = @version.read_limits
66
+
67
+ page = self.page(page_size: limits[:page_size], )
68
+
69
+ @version.stream(page,
70
+ limit: limits[:limit],
71
+ page_limit: limits[:page_limit]).each {|x| yield x}
72
+ end
73
+
74
+ ##
75
+ # Retrieve a single page of AddressConfigurationInstance records from the API.
76
+ # Request is executed immediately.
77
+ # @param [String] page_token PageToken provided by the API
78
+ # @param [Integer] page_number Page Number, this value is simply for client state
79
+ # @param [Integer] page_size Number of records to return, defaults to 50
80
+ # @return [Page] Page of AddressConfigurationInstance
81
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
82
+ params = Twilio::Values.of({
83
+ 'PageToken' => page_token,
84
+ 'Page' => page_number,
85
+ 'PageSize' => page_size,
86
+ })
87
+
88
+ response = @version.page('GET', @uri, params: params)
89
+
90
+ AddressConfigurationPage.new(@version, response, @solution)
91
+ end
92
+
93
+ ##
94
+ # Retrieve a single page of AddressConfigurationInstance records from the API.
95
+ # Request is executed immediately.
96
+ # @param [String] target_url API-generated URL for the requested results page
97
+ # @return [Page] Page of AddressConfigurationInstance
98
+ def get_page(target_url)
99
+ response = @version.domain.request(
100
+ 'GET',
101
+ target_url
102
+ )
103
+ AddressConfigurationPage.new(@version, response, @solution)
104
+ end
105
+
106
+ ##
107
+ # Create the AddressConfigurationInstance
108
+ # @param [address_configuration.Type] type Type of Address. Value can be
109
+ # `whatsapp` or `sms`.
110
+ # @param [String] address The unique address to be configured. The address can be
111
+ # a whatsapp address or phone number
112
+ # @param [String] friendly_name The human-readable name of this configuration,
113
+ # limited to 256 characters. Optional.
114
+ # @param [Boolean] auto_creation_enabled Enable/Disable auto-creating
115
+ # conversations for messages to this address
116
+ # @param [address_configuration.AutoCreationType] auto_creation_type Type of Auto
117
+ # Creation. Value can be one of `webhook`, `studio` or `default`.
118
+ # @param [String] auto_creation_conversation_service_sid Conversation Service for
119
+ # the auto-created conversation. If not set, the conversation is created in the
120
+ # default service.
121
+ # @param [String] auto_creation_webhook_url For type `webhook`, the url for the
122
+ # webhook request.
123
+ # @param [address_configuration.Method] auto_creation_webhook_method For type
124
+ # `webhook`, the HTTP method to be used when sending a webhook request.
125
+ # @param [Array[String]] auto_creation_webhook_filters The list of events, firing
126
+ # webhook event for this Conversation. Values can be any of the following:
127
+ # `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`,
128
+ # `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`,
129
+ # `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`,
130
+ # `onDeliveryUpdated`
131
+ # @param [String] auto_creation_studio_flow_sid For type `studio`, the studio flow
132
+ # SID where the webhook should be sent to.
133
+ # @param [String] auto_creation_studio_retry_count For type `studio`, number of
134
+ # times to retry the webhook request
135
+ # @return [AddressConfigurationInstance] Created AddressConfigurationInstance
136
+ def create(type: nil, address: nil, friendly_name: :unset, auto_creation_enabled: :unset, auto_creation_type: :unset, auto_creation_conversation_service_sid: :unset, auto_creation_webhook_url: :unset, auto_creation_webhook_method: :unset, auto_creation_webhook_filters: :unset, auto_creation_studio_flow_sid: :unset, auto_creation_studio_retry_count: :unset)
137
+ data = Twilio::Values.of({
138
+ 'Type' => type,
139
+ 'Address' => address,
140
+ 'FriendlyName' => friendly_name,
141
+ 'AutoCreation.Enabled' => auto_creation_enabled,
142
+ 'AutoCreation.Type' => auto_creation_type,
143
+ 'AutoCreation.ConversationServiceSid' => auto_creation_conversation_service_sid,
144
+ 'AutoCreation.WebhookUrl' => auto_creation_webhook_url,
145
+ 'AutoCreation.WebhookMethod' => auto_creation_webhook_method,
146
+ 'AutoCreation.WebhookFilters' => Twilio.serialize_list(auto_creation_webhook_filters) { |e| e },
147
+ 'AutoCreation.StudioFlowSid' => auto_creation_studio_flow_sid,
148
+ 'AutoCreation.StudioRetryCount' => auto_creation_studio_retry_count,
149
+ })
150
+
151
+ payload = @version.create('POST', @uri, data: data)
152
+
153
+ AddressConfigurationInstance.new(@version, payload, )
154
+ end
155
+
156
+ ##
157
+ # Provide a user friendly representation
158
+ def to_s
159
+ '#<Twilio.Conversations.V1.AddressConfigurationList>'
160
+ end
161
+ end
162
+
163
+ class AddressConfigurationPage < Page
164
+ ##
165
+ # Initialize the AddressConfigurationPage
166
+ # @param [Version] version Version that contains the resource
167
+ # @param [Response] response Response from the API
168
+ # @param [Hash] solution Path solution for the resource
169
+ # @return [AddressConfigurationPage] AddressConfigurationPage
170
+ def initialize(version, response, solution)
171
+ super(version, response)
172
+
173
+ # Path Solution
174
+ @solution = solution
175
+ end
176
+
177
+ ##
178
+ # Build an instance of AddressConfigurationInstance
179
+ # @param [Hash] payload Payload response from the API
180
+ # @return [AddressConfigurationInstance] AddressConfigurationInstance
181
+ def get_instance(payload)
182
+ AddressConfigurationInstance.new(@version, payload, )
183
+ end
184
+
185
+ ##
186
+ # Provide a user friendly representation
187
+ def to_s
188
+ '<Twilio.Conversations.V1.AddressConfigurationPage>'
189
+ end
190
+ end
191
+
192
+ class AddressConfigurationContext < InstanceContext
193
+ ##
194
+ # Initialize the AddressConfigurationContext
195
+ # @param [Version] version Version that contains the resource
196
+ # @param [String] sid The SID of the Address Configuration resource. This value
197
+ # can be either the `sid` or the `address` of the configuration
198
+ # @return [AddressConfigurationContext] AddressConfigurationContext
199
+ def initialize(version, sid)
200
+ super(version)
201
+
202
+ # Path Solution
203
+ @solution = {sid: sid, }
204
+ @uri = "/Configuration/Addresses/#{@solution[:sid]}"
205
+ end
206
+
207
+ ##
208
+ # Fetch the AddressConfigurationInstance
209
+ # @return [AddressConfigurationInstance] Fetched AddressConfigurationInstance
210
+ def fetch
211
+ payload = @version.fetch('GET', @uri)
212
+
213
+ AddressConfigurationInstance.new(@version, payload, sid: @solution[:sid], )
214
+ end
215
+
216
+ ##
217
+ # Update the AddressConfigurationInstance
218
+ # @param [String] friendly_name The human-readable name of this configuration,
219
+ # limited to 256 characters. Optional.
220
+ # @param [Boolean] auto_creation_enabled Enable/Disable auto-creating
221
+ # conversations for messages to this address
222
+ # @param [address_configuration.AutoCreationType] auto_creation_type Type of Auto
223
+ # Creation. Value can be one of `webhook`, `studio` or `default`.
224
+ # @param [String] auto_creation_conversation_service_sid Conversation Service for
225
+ # the auto-created conversation. If not set, the conversation is created in the
226
+ # default service.
227
+ # @param [String] auto_creation_webhook_url For type `webhook`, the url for the
228
+ # webhook request.
229
+ # @param [address_configuration.Method] auto_creation_webhook_method For type
230
+ # `webhook`, the HTTP method to be used when sending a webhook request.
231
+ # @param [Array[String]] auto_creation_webhook_filters The list of events, firing
232
+ # webhook event for this Conversation. Values can be any of the following:
233
+ # `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`,
234
+ # `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`,
235
+ # `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`,
236
+ # `onDeliveryUpdated`
237
+ # @param [String] auto_creation_studio_flow_sid For type `studio`, the studio flow
238
+ # SID where the webhook should be sent to.
239
+ # @param [String] auto_creation_studio_retry_count For type `studio`, number of
240
+ # times to retry the webhook request
241
+ # @return [AddressConfigurationInstance] Updated AddressConfigurationInstance
242
+ def update(friendly_name: :unset, auto_creation_enabled: :unset, auto_creation_type: :unset, auto_creation_conversation_service_sid: :unset, auto_creation_webhook_url: :unset, auto_creation_webhook_method: :unset, auto_creation_webhook_filters: :unset, auto_creation_studio_flow_sid: :unset, auto_creation_studio_retry_count: :unset)
243
+ data = Twilio::Values.of({
244
+ 'FriendlyName' => friendly_name,
245
+ 'AutoCreation.Enabled' => auto_creation_enabled,
246
+ 'AutoCreation.Type' => auto_creation_type,
247
+ 'AutoCreation.ConversationServiceSid' => auto_creation_conversation_service_sid,
248
+ 'AutoCreation.WebhookUrl' => auto_creation_webhook_url,
249
+ 'AutoCreation.WebhookMethod' => auto_creation_webhook_method,
250
+ 'AutoCreation.WebhookFilters' => Twilio.serialize_list(auto_creation_webhook_filters) { |e| e },
251
+ 'AutoCreation.StudioFlowSid' => auto_creation_studio_flow_sid,
252
+ 'AutoCreation.StudioRetryCount' => auto_creation_studio_retry_count,
253
+ })
254
+
255
+ payload = @version.update('POST', @uri, data: data)
256
+
257
+ AddressConfigurationInstance.new(@version, payload, sid: @solution[:sid], )
258
+ end
259
+
260
+ ##
261
+ # Delete the AddressConfigurationInstance
262
+ # @return [Boolean] true if delete succeeds, false otherwise
263
+ def delete
264
+ @version.delete('DELETE', @uri)
265
+ end
266
+
267
+ ##
268
+ # Provide a user friendly representation
269
+ def to_s
270
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
271
+ "#<Twilio.Conversations.V1.AddressConfigurationContext #{context}>"
272
+ end
273
+
274
+ ##
275
+ # Provide a detailed, user friendly representation
276
+ def inspect
277
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
278
+ "#<Twilio.Conversations.V1.AddressConfigurationContext #{context}>"
279
+ end
280
+ end
281
+
282
+ class AddressConfigurationInstance < InstanceResource
283
+ ##
284
+ # Initialize the AddressConfigurationInstance
285
+ # @param [Version] version Version that contains the resource
286
+ # @param [Hash] payload payload that contains response from Twilio
287
+ # @param [String] sid The SID of the Address Configuration resource. This value
288
+ # can be either the `sid` or the `address` of the configuration
289
+ # @return [AddressConfigurationInstance] AddressConfigurationInstance
290
+ def initialize(version, payload, sid: nil)
291
+ super(version)
292
+
293
+ # Marshaled Properties
294
+ @properties = {
295
+ 'sid' => payload['sid'],
296
+ 'account_sid' => payload['account_sid'],
297
+ 'type' => payload['type'],
298
+ 'address' => payload['address'],
299
+ 'friendly_name' => payload['friendly_name'],
300
+ 'auto_creation' => payload['auto_creation'],
301
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
302
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
303
+ 'url' => payload['url'],
304
+ }
305
+
306
+ # Context
307
+ @instance_context = nil
308
+ @params = {'sid' => sid || @properties['sid'], }
309
+ end
310
+
311
+ ##
312
+ # Generate an instance context for the instance, the context is capable of
313
+ # performing various actions. All instance actions are proxied to the context
314
+ # @return [AddressConfigurationContext] AddressConfigurationContext for this AddressConfigurationInstance
315
+ def context
316
+ unless @instance_context
317
+ @instance_context = AddressConfigurationContext.new(@version, @params['sid'], )
318
+ end
319
+ @instance_context
320
+ end
321
+
322
+ ##
323
+ # @return [String] A 34 character string that uniquely identifies this resource.
324
+ def sid
325
+ @properties['sid']
326
+ end
327
+
328
+ ##
329
+ # @return [String] The unique ID of the Account the address belongs to.
330
+ def account_sid
331
+ @properties['account_sid']
332
+ end
333
+
334
+ ##
335
+ # @return [String] Type of Address.
336
+ def type
337
+ @properties['type']
338
+ end
339
+
340
+ ##
341
+ # @return [String] The unique address to be configured.
342
+ def address
343
+ @properties['address']
344
+ end
345
+
346
+ ##
347
+ # @return [String] The human-readable name of this configuration.
348
+ def friendly_name
349
+ @properties['friendly_name']
350
+ end
351
+
352
+ ##
353
+ # @return [Hash] Auto Creation configuration for the address.
354
+ def auto_creation
355
+ @properties['auto_creation']
356
+ end
357
+
358
+ ##
359
+ # @return [Time] The date that this resource was created.
360
+ def date_created
361
+ @properties['date_created']
362
+ end
363
+
364
+ ##
365
+ # @return [Time] The date that this resource was last updated.
366
+ def date_updated
367
+ @properties['date_updated']
368
+ end
369
+
370
+ ##
371
+ # @return [String] An absolute URL for this address configuration.
372
+ def url
373
+ @properties['url']
374
+ end
375
+
376
+ ##
377
+ # Fetch the AddressConfigurationInstance
378
+ # @return [AddressConfigurationInstance] Fetched AddressConfigurationInstance
379
+ def fetch
380
+ context.fetch
381
+ end
382
+
383
+ ##
384
+ # Update the AddressConfigurationInstance
385
+ # @param [String] friendly_name The human-readable name of this configuration,
386
+ # limited to 256 characters. Optional.
387
+ # @param [Boolean] auto_creation_enabled Enable/Disable auto-creating
388
+ # conversations for messages to this address
389
+ # @param [address_configuration.AutoCreationType] auto_creation_type Type of Auto
390
+ # Creation. Value can be one of `webhook`, `studio` or `default`.
391
+ # @param [String] auto_creation_conversation_service_sid Conversation Service for
392
+ # the auto-created conversation. If not set, the conversation is created in the
393
+ # default service.
394
+ # @param [String] auto_creation_webhook_url For type `webhook`, the url for the
395
+ # webhook request.
396
+ # @param [address_configuration.Method] auto_creation_webhook_method For type
397
+ # `webhook`, the HTTP method to be used when sending a webhook request.
398
+ # @param [Array[String]] auto_creation_webhook_filters The list of events, firing
399
+ # webhook event for this Conversation. Values can be any of the following:
400
+ # `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`,
401
+ # `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`,
402
+ # `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`,
403
+ # `onDeliveryUpdated`
404
+ # @param [String] auto_creation_studio_flow_sid For type `studio`, the studio flow
405
+ # SID where the webhook should be sent to.
406
+ # @param [String] auto_creation_studio_retry_count For type `studio`, number of
407
+ # times to retry the webhook request
408
+ # @return [AddressConfigurationInstance] Updated AddressConfigurationInstance
409
+ def update(friendly_name: :unset, auto_creation_enabled: :unset, auto_creation_type: :unset, auto_creation_conversation_service_sid: :unset, auto_creation_webhook_url: :unset, auto_creation_webhook_method: :unset, auto_creation_webhook_filters: :unset, auto_creation_studio_flow_sid: :unset, auto_creation_studio_retry_count: :unset)
410
+ context.update(
411
+ friendly_name: friendly_name,
412
+ auto_creation_enabled: auto_creation_enabled,
413
+ auto_creation_type: auto_creation_type,
414
+ auto_creation_conversation_service_sid: auto_creation_conversation_service_sid,
415
+ auto_creation_webhook_url: auto_creation_webhook_url,
416
+ auto_creation_webhook_method: auto_creation_webhook_method,
417
+ auto_creation_webhook_filters: auto_creation_webhook_filters,
418
+ auto_creation_studio_flow_sid: auto_creation_studio_flow_sid,
419
+ auto_creation_studio_retry_count: auto_creation_studio_retry_count,
420
+ )
421
+ end
422
+
423
+ ##
424
+ # Delete the AddressConfigurationInstance
425
+ # @return [Boolean] true if delete succeeds, false otherwise
426
+ def delete
427
+ context.delete
428
+ end
429
+
430
+ ##
431
+ # Provide a user friendly representation
432
+ def to_s
433
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
434
+ "<Twilio.Conversations.V1.AddressConfigurationInstance #{values}>"
435
+ end
436
+
437
+ ##
438
+ # Provide a detailed, user friendly representation
439
+ def inspect
440
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
441
+ "<Twilio.Conversations.V1.AddressConfigurationInstance #{values}>"
442
+ end
443
+ end
444
+ end
445
+ end
446
+ end
447
+ end
@@ -16,6 +16,7 @@ module Twilio
16
16
  super
17
17
  @version = 'v1'
18
18
  @configuration = nil
19
+ @address_configurations = nil
19
20
  @conversations = nil
20
21
  @credentials = nil
21
22
  @participant_conversations = nil
@@ -30,6 +31,22 @@ module Twilio
30
31
  @configuration ||= ConfigurationContext.new self
31
32
  end
32
33
 
34
+ ##
35
+ # @param [String] sid The SID of the Address Configuration resource. This value
36
+ # can be either the `sid` or the `address` of the configuration
37
+ # @return [Twilio::REST::Conversations::V1::AddressConfigurationContext] if sid was passed.
38
+ # @return [Twilio::REST::Conversations::V1::AddressConfigurationList]
39
+ def address_configurations(sid=:unset)
40
+ if sid.nil?
41
+ raise ArgumentError, 'sid cannot be nil'
42
+ end
43
+ if sid == :unset
44
+ @address_configurations ||= AddressConfigurationList.new self
45
+ else
46
+ AddressConfigurationContext.new(self, sid)
47
+ end
48
+ end
49
+
33
50
  ##
34
51
  # @param [String] sid A 34 character string that uniquely identifies this
35
52
  # resource. Can also be the `unique_name` of the Conversation.
@@ -34,6 +34,15 @@ module Twilio
34
34
  self.v1.configuration()
35
35
  end
36
36
 
37
+ ##
38
+ # @param [String] sid A 34 character string that uniquely identifies this
39
+ # resource.
40
+ # @return [Twilio::REST::Conversations::V1::AddressConfigurationInstance] if sid was passed.
41
+ # @return [Twilio::REST::Conversations::V1::AddressConfigurationList]
42
+ def address_configurations(sid=:unset)
43
+ self.v1.address_configurations(sid)
44
+ end
45
+
37
46
  ##
38
47
  # @param [String] sid A 34 character string that uniquely identifies this
39
48
  # resource.
@@ -152,57 +152,6 @@ module Twilio
152
152
  FaxPage.new(@version, response, @solution)
153
153
  end
154
154
 
155
- ##
156
- # Create the FaxInstance
157
- # @param [String] to The phone number to receive the fax in
158
- # {E.164}[https://www.twilio.com/docs/glossary/what-e164] format or the
159
- # recipient's SIP URI.
160
- # @param [String] media_url The URL of the PDF that contains the fax. See our
161
- # {security}[https://www.twilio.com/docs/usage/security] page for information on
162
- # how to ensure the request for your media comes from Twilio.
163
- # @param [fax.Quality] quality The {Fax Quality
164
- # value}[https://www.twilio.com/docs/fax/api/fax-resource#fax-quality-values] that
165
- # describes the fax quality. Can be: `standard`, `fine`, or `superfine` and
166
- # defaults to `fine`.
167
- # @param [String] status_callback The URL we should call using the `POST` method
168
- # to send {status
169
- # information}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-callback]
170
- # to your application when the status of the fax changes.
171
- # @param [String] from The number the fax was sent from. Can be the phone number
172
- # in {E.164}[https://www.twilio.com/docs/glossary/what-e164] format or the SIP
173
- # `from` value. The caller ID displayed to the recipient uses this value. If this
174
- # is a phone number, it must be a Twilio number or a verified outgoing caller id
175
- # from your account. If `to` is a SIP address, this can be any alphanumeric string
176
- # (and also the characters `+`, `_`, `.`, and `-`), which will be used in the
177
- # `from` header of the SIP request.
178
- # @param [String] sip_auth_username The username to use with the
179
- # `sip_auth_password` to authenticate faxes sent to a SIP address.
180
- # @param [String] sip_auth_password The password to use with `sip_auth_username`
181
- # to authenticate faxes sent to a SIP address.
182
- # @param [Boolean] store_media Whether to store a copy of the sent media on our
183
- # servers for later retrieval. Can be: `true` or `false` and the default is
184
- # `true`.
185
- # @param [String] ttl How long in minutes from when the fax is initiated that we
186
- # should try to send the fax.
187
- # @return [FaxInstance] Created FaxInstance
188
- def create(to: nil, media_url: nil, quality: :unset, status_callback: :unset, from: :unset, sip_auth_username: :unset, sip_auth_password: :unset, store_media: :unset, ttl: :unset)
189
- data = Twilio::Values.of({
190
- 'To' => to,
191
- 'MediaUrl' => media_url,
192
- 'Quality' => quality,
193
- 'StatusCallback' => status_callback,
194
- 'From' => from,
195
- 'SipAuthUsername' => sip_auth_username,
196
- 'SipAuthPassword' => sip_auth_password,
197
- 'StoreMedia' => store_media,
198
- 'Ttl' => ttl,
199
- })
200
-
201
- payload = @version.create('POST', @uri, data: data)
202
-
203
- FaxInstance.new(@version, payload, )
204
- end
205
-
206
155
  ##
207
156
  # Provide a user friendly representation
208
157
  def to_s
@@ -270,21 +219,6 @@ module Twilio
270
219
  FaxInstance.new(@version, payload, sid: @solution[:sid], )
271
220
  end
272
221
 
273
- ##
274
- # Update the FaxInstance
275
- # @param [fax.UpdateStatus] status The new
276
- # {status}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values] of
277
- # the resource. Can be only `canceled`. This may fail if transmission has already
278
- # started.
279
- # @return [FaxInstance] Updated FaxInstance
280
- def update(status: :unset)
281
- data = Twilio::Values.of({'Status' => status, })
282
-
283
- payload = @version.update('POST', @uri, data: data)
284
-
285
- FaxInstance.new(@version, payload, sid: @solution[:sid], )
286
- end
287
-
288
222
  ##
289
223
  # Delete the FaxInstance
290
224
  # @return [Boolean] true if delete succeeds, false otherwise
@@ -491,17 +425,6 @@ module Twilio
491
425
  context.fetch
492
426
  end
493
427
 
494
- ##
495
- # Update the FaxInstance
496
- # @param [fax.UpdateStatus] status The new
497
- # {status}[https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values] of
498
- # the resource. Can be only `canceled`. This may fail if transmission has already
499
- # started.
500
- # @return [FaxInstance] Updated FaxInstance
501
- def update(status: :unset)
502
- context.update(status: status, )
503
- end
504
-
505
428
  ##
506
429
  # Delete the FaxInstance
507
430
  # @return [Boolean] true if delete succeeds, false otherwise