twilio-ruby 5.61.2 → 5.64.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 (50) 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 +99 -0
  6. data/Makefile +3 -6
  7. data/README.md +5 -4
  8. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +667 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -0
  11. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +19 -5
  12. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +435 -0
  13. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +20 -20
  14. data/lib/twilio-ruby/rest/conversations/v1.rb +17 -0
  15. data/lib/twilio-ruby/rest/conversations.rb +9 -0
  16. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -77
  17. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
  18. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  19. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  20. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  21. data/lib/twilio-ruby/rest/insights/v1.rb +23 -0
  22. data/lib/twilio-ruby/rest/insights.rb +14 -0
  23. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +14 -1
  24. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +23 -0
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +80 -0
  26. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +75 -18
  27. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  28. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +71 -30
  29. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  30. data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
  31. data/lib/twilio-ruby/rest/supersim.rb +9 -0
  32. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +130 -8
  33. data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
  34. data/lib/twilio-ruby/rest/verify/v2/template.rb +1 -1
  35. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  36. data/lib/twilio-ruby/rest/verify.rb +2 -2
  37. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -0
  38. data/lib/twilio-ruby/rest/video/v1/recording.rb +7 -0
  39. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  40. data/lib/twilio-ruby/rest/video/v1/room.rb +30 -5
  41. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  42. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  43. data/lib/twilio-ruby/rest/voice.rb +8 -0
  44. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +4 -4
  45. data/lib/twilio-ruby/version.rb +1 -1
  46. data/sonar-project.properties +1 -1
  47. data/twilio-ruby.gemspec +0 -1
  48. metadata +10 -18
  49. data/.github/workflows/deploy.yml +0 -65
  50. data/.github/workflows/test.yml +0 -52
@@ -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
@@ -78,6 +78,13 @@ module Twilio
78
78
  # @param [Boolean] smart_encoded Whether to detect Unicode characters that have a
79
79
  # similar GSM-7 character and replace them. Can be: `true` or `false`.
80
80
  # @param [Array[String]] persistent_action Rich actions for Channels Messages.
81
+ # @param [message.ScheduleType] schedule_type Indicates your intent to schedule a
82
+ # message. Pass the value `fixed` to schedule a message at a fixed time.
83
+ # @param [Time] send_at The time that Twilio will send the message. Must be in ISO
84
+ # 8601 format.
85
+ # @param [Boolean] send_as_mms If set to True, Twilio will deliver the message as
86
+ # a single MMS message, regardless of the presence of media. This is a Beta
87
+ # Feature.
81
88
  # @param [String] from A Twilio phone number in
82
89
  # {E.164}[https://www.twilio.com/docs/glossary/what-e164] format, an {alphanumeric
83
90
  # sender
@@ -108,7 +115,7 @@ module Twilio
108
115
  # parameters in the POST request. You can include up to 10 `media_url` parameters
109
116
  # per message. You can send images in an SMS message in only the US and Canada.
110
117
  # @return [MessageInstance] Created MessageInstance
111
- def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, attempt: :unset, validity_period: :unset, force_delivery: :unset, content_retention: :unset, address_retention: :unset, smart_encoded: :unset, persistent_action: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
118
+ def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, attempt: :unset, validity_period: :unset, force_delivery: :unset, content_retention: :unset, address_retention: :unset, smart_encoded: :unset, persistent_action: :unset, schedule_type: :unset, send_at: :unset, send_as_mms: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
112
119
  data = Twilio::Values.of({
113
120
  'To' => to,
114
121
  'From' => from,
@@ -126,6 +133,9 @@ module Twilio
126
133
  'AddressRetention' => address_retention,
127
134
  'SmartEncoded' => smart_encoded,
128
135
  'PersistentAction' => Twilio.serialize_list(persistent_action) { |e| e },
136
+ 'ScheduleType' => schedule_type,
137
+ 'SendAt' => Twilio.serialize_iso8601_datetime(send_at),
138
+ 'SendAsMms' => send_as_mms,
129
139
  })
130
140
 
131
141
  payload = @version.create('POST', @uri, data: data)
@@ -329,9 +339,11 @@ module Twilio
329
339
  # Update the MessageInstance
330
340
  # @param [String] body The text of the message you want to send. Can be up to
331
341
  # 1,600 characters long.
342
+ # @param [message.UpdateStatus] status When set as `canceled`, allows a message
343
+ # cancelation request if a message has not yet been sent.
332
344
  # @return [MessageInstance] Updated MessageInstance
333
- def update(body: :unset)
334
- data = Twilio::Values.of({'Body' => body, })
345
+ def update(body: :unset, status: :unset)
346
+ data = Twilio::Values.of({'Body' => body, 'Status' => status, })
335
347
 
336
348
  payload = @version.update('POST', @uri, data: data)
337
349
 
@@ -579,9 +591,11 @@ module Twilio
579
591
  # Update the MessageInstance
580
592
  # @param [String] body The text of the message you want to send. Can be up to
581
593
  # 1,600 characters long.
594
+ # @param [message.UpdateStatus] status When set as `canceled`, allows a message
595
+ # cancelation request if a message has not yet been sent.
582
596
  # @return [MessageInstance] Updated MessageInstance
583
- def update(body: :unset)
584
- context.update(body: body, )
597
+ def update(body: :unset, status: :unset)
598
+ context.update(body: body, status: status, )
585
599
  end
586
600
 
587
601
  ##
@@ -0,0 +1,435 @@
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`, `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.
127
+ # @param [String] auto_creation_studio_flow_sid For type `studio`, the studio flow
128
+ # SID, where the webhook should be sent to.
129
+ # @param [String] auto_creation_studio_retry_count For type `studio`, number of
130
+ # times to retry the webhook request
131
+ # @return [AddressConfigurationInstance] Created AddressConfigurationInstance
132
+ 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)
133
+ data = Twilio::Values.of({
134
+ 'Type' => type,
135
+ 'Address' => address,
136
+ 'FriendlyName' => friendly_name,
137
+ 'AutoCreation.Enabled' => auto_creation_enabled,
138
+ 'AutoCreation.Type' => auto_creation_type,
139
+ 'AutoCreation.ConversationServiceSid' => auto_creation_conversation_service_sid,
140
+ 'AutoCreation.WebhookUrl' => auto_creation_webhook_url,
141
+ 'AutoCreation.WebhookMethod' => auto_creation_webhook_method,
142
+ 'AutoCreation.WebhookFilters' => Twilio.serialize_list(auto_creation_webhook_filters) { |e| e },
143
+ 'AutoCreation.StudioFlowSid' => auto_creation_studio_flow_sid,
144
+ 'AutoCreation.StudioRetryCount' => auto_creation_studio_retry_count,
145
+ })
146
+
147
+ payload = @version.create('POST', @uri, data: data)
148
+
149
+ AddressConfigurationInstance.new(@version, payload, )
150
+ end
151
+
152
+ ##
153
+ # Provide a user friendly representation
154
+ def to_s
155
+ '#<Twilio.Conversations.V1.AddressConfigurationList>'
156
+ end
157
+ end
158
+
159
+ class AddressConfigurationPage < Page
160
+ ##
161
+ # Initialize the AddressConfigurationPage
162
+ # @param [Version] version Version that contains the resource
163
+ # @param [Response] response Response from the API
164
+ # @param [Hash] solution Path solution for the resource
165
+ # @return [AddressConfigurationPage] AddressConfigurationPage
166
+ def initialize(version, response, solution)
167
+ super(version, response)
168
+
169
+ # Path Solution
170
+ @solution = solution
171
+ end
172
+
173
+ ##
174
+ # Build an instance of AddressConfigurationInstance
175
+ # @param [Hash] payload Payload response from the API
176
+ # @return [AddressConfigurationInstance] AddressConfigurationInstance
177
+ def get_instance(payload)
178
+ AddressConfigurationInstance.new(@version, payload, )
179
+ end
180
+
181
+ ##
182
+ # Provide a user friendly representation
183
+ def to_s
184
+ '<Twilio.Conversations.V1.AddressConfigurationPage>'
185
+ end
186
+ end
187
+
188
+ class AddressConfigurationContext < InstanceContext
189
+ ##
190
+ # Initialize the AddressConfigurationContext
191
+ # @param [Version] version Version that contains the resource
192
+ # @param [String] sid The SID of the Address Configuration resource. This value
193
+ # can be either the `sid` or the `address` of the configuration
194
+ # @return [AddressConfigurationContext] AddressConfigurationContext
195
+ def initialize(version, sid)
196
+ super(version)
197
+
198
+ # Path Solution
199
+ @solution = {sid: sid, }
200
+ @uri = "/Configuration/Addresses/#{@solution[:sid]}"
201
+ end
202
+
203
+ ##
204
+ # Fetch the AddressConfigurationInstance
205
+ # @return [AddressConfigurationInstance] Fetched AddressConfigurationInstance
206
+ def fetch
207
+ payload = @version.fetch('GET', @uri)
208
+
209
+ AddressConfigurationInstance.new(@version, payload, sid: @solution[:sid], )
210
+ end
211
+
212
+ ##
213
+ # Update the AddressConfigurationInstance
214
+ # @param [String] friendly_name The human-readable name of this configuration,
215
+ # limited to 256 characters. Optional.
216
+ # @param [Boolean] auto_creation_enabled Enable/Disable auto-creating
217
+ # conversations for messages to this address
218
+ # @param [address_configuration.AutoCreationType] auto_creation_type Type of Auto
219
+ # Creation. Value can be one of `webhook`, `studio`, `default`.
220
+ # @param [String] auto_creation_conversation_service_sid Conversation Service for
221
+ # the auto-created conversation. If not set, the conversation is created in the
222
+ # default service.
223
+ # @param [String] auto_creation_webhook_url For type `webhook`, the url for the
224
+ # webhook request.
225
+ # @param [address_configuration.Method] auto_creation_webhook_method For type
226
+ # `webhook`, the HTTP method to be used when sending a webhook request.
227
+ # @param [Array[String]] auto_creation_webhook_filters The list of events, firing
228
+ # webhook event for this Conversation.
229
+ # @param [String] auto_creation_studio_flow_sid For type `studio`, the studio flow
230
+ # SID, where the webhook should be sent to.
231
+ # @param [String] auto_creation_studio_retry_count For type `studio`, number of
232
+ # times to retry the webhook request
233
+ # @return [AddressConfigurationInstance] Updated AddressConfigurationInstance
234
+ 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)
235
+ data = Twilio::Values.of({
236
+ 'FriendlyName' => friendly_name,
237
+ 'AutoCreation.Enabled' => auto_creation_enabled,
238
+ 'AutoCreation.Type' => auto_creation_type,
239
+ 'AutoCreation.ConversationServiceSid' => auto_creation_conversation_service_sid,
240
+ 'AutoCreation.WebhookUrl' => auto_creation_webhook_url,
241
+ 'AutoCreation.WebhookMethod' => auto_creation_webhook_method,
242
+ 'AutoCreation.WebhookFilters' => Twilio.serialize_list(auto_creation_webhook_filters) { |e| e },
243
+ 'AutoCreation.StudioFlowSid' => auto_creation_studio_flow_sid,
244
+ 'AutoCreation.StudioRetryCount' => auto_creation_studio_retry_count,
245
+ })
246
+
247
+ payload = @version.update('POST', @uri, data: data)
248
+
249
+ AddressConfigurationInstance.new(@version, payload, sid: @solution[:sid], )
250
+ end
251
+
252
+ ##
253
+ # Delete the AddressConfigurationInstance
254
+ # @return [Boolean] true if delete succeeds, false otherwise
255
+ def delete
256
+ @version.delete('DELETE', @uri)
257
+ end
258
+
259
+ ##
260
+ # Provide a user friendly representation
261
+ def to_s
262
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
263
+ "#<Twilio.Conversations.V1.AddressConfigurationContext #{context}>"
264
+ end
265
+
266
+ ##
267
+ # Provide a detailed, user friendly representation
268
+ def inspect
269
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
270
+ "#<Twilio.Conversations.V1.AddressConfigurationContext #{context}>"
271
+ end
272
+ end
273
+
274
+ class AddressConfigurationInstance < InstanceResource
275
+ ##
276
+ # Initialize the AddressConfigurationInstance
277
+ # @param [Version] version Version that contains the resource
278
+ # @param [Hash] payload payload that contains response from Twilio
279
+ # @param [String] sid The SID of the Address Configuration resource. This value
280
+ # can be either the `sid` or the `address` of the configuration
281
+ # @return [AddressConfigurationInstance] AddressConfigurationInstance
282
+ def initialize(version, payload, sid: nil)
283
+ super(version)
284
+
285
+ # Marshaled Properties
286
+ @properties = {
287
+ 'sid' => payload['sid'],
288
+ 'account_sid' => payload['account_sid'],
289
+ 'type' => payload['type'],
290
+ 'address' => payload['address'],
291
+ 'friendly_name' => payload['friendly_name'],
292
+ 'auto_creation' => payload['auto_creation'],
293
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
294
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
295
+ 'url' => payload['url'],
296
+ }
297
+
298
+ # Context
299
+ @instance_context = nil
300
+ @params = {'sid' => sid || @properties['sid'], }
301
+ end
302
+
303
+ ##
304
+ # Generate an instance context for the instance, the context is capable of
305
+ # performing various actions. All instance actions are proxied to the context
306
+ # @return [AddressConfigurationContext] AddressConfigurationContext for this AddressConfigurationInstance
307
+ def context
308
+ unless @instance_context
309
+ @instance_context = AddressConfigurationContext.new(@version, @params['sid'], )
310
+ end
311
+ @instance_context
312
+ end
313
+
314
+ ##
315
+ # @return [String] A 34 character string that uniquely identifies this resource.
316
+ def sid
317
+ @properties['sid']
318
+ end
319
+
320
+ ##
321
+ # @return [String] The unique ID of the Account the address belongs to.
322
+ def account_sid
323
+ @properties['account_sid']
324
+ end
325
+
326
+ ##
327
+ # @return [String] Type of Address, value can be `whatsapp` or `sms`.
328
+ def type
329
+ @properties['type']
330
+ end
331
+
332
+ ##
333
+ # @return [String] The unique address to be configured.
334
+ def address
335
+ @properties['address']
336
+ end
337
+
338
+ ##
339
+ # @return [String] The human-readable name of this configuration.
340
+ def friendly_name
341
+ @properties['friendly_name']
342
+ end
343
+
344
+ ##
345
+ # @return [Hash] Auto Creation configuration for the address.
346
+ def auto_creation
347
+ @properties['auto_creation']
348
+ end
349
+
350
+ ##
351
+ # @return [Time] The date that this resource was created.
352
+ def date_created
353
+ @properties['date_created']
354
+ end
355
+
356
+ ##
357
+ # @return [Time] The date that this resource was last updated.
358
+ def date_updated
359
+ @properties['date_updated']
360
+ end
361
+
362
+ ##
363
+ # @return [String] An absolute URL for this address configuration.
364
+ def url
365
+ @properties['url']
366
+ end
367
+
368
+ ##
369
+ # Fetch the AddressConfigurationInstance
370
+ # @return [AddressConfigurationInstance] Fetched AddressConfigurationInstance
371
+ def fetch
372
+ context.fetch
373
+ end
374
+
375
+ ##
376
+ # Update the AddressConfigurationInstance
377
+ # @param [String] friendly_name The human-readable name of this configuration,
378
+ # limited to 256 characters. Optional.
379
+ # @param [Boolean] auto_creation_enabled Enable/Disable auto-creating
380
+ # conversations for messages to this address
381
+ # @param [address_configuration.AutoCreationType] auto_creation_type Type of Auto
382
+ # Creation. Value can be one of `webhook`, `studio`, `default`.
383
+ # @param [String] auto_creation_conversation_service_sid Conversation Service for
384
+ # the auto-created conversation. If not set, the conversation is created in the
385
+ # default service.
386
+ # @param [String] auto_creation_webhook_url For type `webhook`, the url for the
387
+ # webhook request.
388
+ # @param [address_configuration.Method] auto_creation_webhook_method For type
389
+ # `webhook`, the HTTP method to be used when sending a webhook request.
390
+ # @param [Array[String]] auto_creation_webhook_filters The list of events, firing
391
+ # webhook event for this Conversation.
392
+ # @param [String] auto_creation_studio_flow_sid For type `studio`, the studio flow
393
+ # SID, where the webhook should be sent to.
394
+ # @param [String] auto_creation_studio_retry_count For type `studio`, number of
395
+ # times to retry the webhook request
396
+ # @return [AddressConfigurationInstance] Updated AddressConfigurationInstance
397
+ 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)
398
+ context.update(
399
+ friendly_name: friendly_name,
400
+ auto_creation_enabled: auto_creation_enabled,
401
+ auto_creation_type: auto_creation_type,
402
+ auto_creation_conversation_service_sid: auto_creation_conversation_service_sid,
403
+ auto_creation_webhook_url: auto_creation_webhook_url,
404
+ auto_creation_webhook_method: auto_creation_webhook_method,
405
+ auto_creation_webhook_filters: auto_creation_webhook_filters,
406
+ auto_creation_studio_flow_sid: auto_creation_studio_flow_sid,
407
+ auto_creation_studio_retry_count: auto_creation_studio_retry_count,
408
+ )
409
+ end
410
+
411
+ ##
412
+ # Delete the AddressConfigurationInstance
413
+ # @return [Boolean] true if delete succeeds, false otherwise
414
+ def delete
415
+ context.delete
416
+ end
417
+
418
+ ##
419
+ # Provide a user friendly representation
420
+ def to_s
421
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
422
+ "<Twilio.Conversations.V1.AddressConfigurationInstance #{values}>"
423
+ end
424
+
425
+ ##
426
+ # Provide a detailed, user friendly representation
427
+ def inspect
428
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
429
+ "<Twilio.Conversations.V1.AddressConfigurationInstance #{values}>"
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end
435
+ end
@@ -84,15 +84,15 @@ module Twilio
84
84
  # should be sent to.
85
85
  # @param [String] post_webhook_url The absolute url the post-event webhook request
86
86
  # should be sent to.
87
- # @param [Array[String]] filters The list of webhook event triggers that are
88
- # enabled for this Service. Possible values are `onParticipantAdd`,
89
- # `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`,
90
- # `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`,
91
- # `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`,
92
- # `onConversationAdded`, `onMessageAdded`, `onConversationAdd`,
93
- # `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`,
94
- # `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or
95
- # `onConversationStateUpdated`.
87
+ # @param [Array[String]] filters The list of events that your configured webhook
88
+ # targets will receive. Events not configured here will not fire. Possible values
89
+ # are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`,
90
+ # `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`,
91
+ # `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`,
92
+ # `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`,
93
+ # `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`,
94
+ # `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate`
95
+ # or `onConversationStateUpdated`.
96
96
  # @param [String] method The HTTP method to be used when sending a webhook
97
97
  # request. One of `GET` or `POST`.
98
98
  # @return [WebhookInstance] Updated WebhookInstance
@@ -178,7 +178,7 @@ module Twilio
178
178
  end
179
179
 
180
180
  ##
181
- # @return [String] The chat_service_sid
181
+ # @return [String] The unique ID of the {Conversation Service}[https://www.twilio.com/docs/conversations/api/service-resource] this conversation belongs to.
182
182
  def chat_service_sid
183
183
  @properties['chat_service_sid']
184
184
  end
@@ -196,7 +196,7 @@ module Twilio
196
196
  end
197
197
 
198
198
  ##
199
- # @return [Array[String]] The list of webhook event triggers that are enabled for this Service.
199
+ # @return [Array[String]] The list of events that your configured webhook targets will receive. Events not configured here will not fire.
200
200
  def filters
201
201
  @properties['filters']
202
202
  end
@@ -219,15 +219,15 @@ module Twilio
219
219
  # should be sent to.
220
220
  # @param [String] post_webhook_url The absolute url the post-event webhook request
221
221
  # should be sent to.
222
- # @param [Array[String]] filters The list of webhook event triggers that are
223
- # enabled for this Service. Possible values are `onParticipantAdd`,
224
- # `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`,
225
- # `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`,
226
- # `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`,
227
- # `onConversationAdded`, `onMessageAdded`, `onConversationAdd`,
228
- # `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`,
229
- # `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or
230
- # `onConversationStateUpdated`.
222
+ # @param [Array[String]] filters The list of events that your configured webhook
223
+ # targets will receive. Events not configured here will not fire. Possible values
224
+ # are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`,
225
+ # `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`,
226
+ # `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`,
227
+ # `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`,
228
+ # `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`,
229
+ # `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate`
230
+ # or `onConversationStateUpdated`.
231
231
  # @param [String] method The HTTP method to be used when sending a webhook
232
232
  # request. One of `GET` or `POST`.
233
233
  # @return [WebhookInstance] Updated WebhookInstance
@@ -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.