twilio-ruby 7.4.5 → 7.6.2

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +1 -1
  3. data/.github/workflows/test-and-deploy.yml +2 -2
  4. data/CHANGES.md +88 -0
  5. data/Dockerfile +2 -1
  6. data/README.md +2 -2
  7. data/lib/twilio-ruby/http/client_token_manager.rb +2 -2
  8. data/lib/twilio-ruby/http/org_token_manager.rb +2 -2
  9. data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +1 -1
  10. data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +4 -4
  11. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +5 -5
  12. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +9 -3
  13. data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +1 -1
  14. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +1 -1
  15. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +4 -4
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +1 -1
  17. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -0
  18. data/lib/twilio-ruby/rest/client.rb +5 -0
  19. data/lib/twilio-ruby/rest/content/v1/content.rb +11 -2
  20. data/lib/twilio-ruby/rest/events/v1/subscription.rb +3 -19
  21. data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +50 -1
  22. data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +0 -39
  23. data/lib/twilio-ruby/rest/iam/v1/{key.rb → new_api_key.rb} +20 -20
  24. data/lib/twilio-ruby/rest/iam/v1/token.rb +186 -0
  25. data/lib/twilio-ruby/rest/iam/v1.rb +10 -4
  26. data/lib/twilio-ruby/rest/knowledge/v1/knowledge/chunk.rb +232 -0
  27. data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +213 -0
  28. data/lib/twilio-ruby/rest/knowledge/v1/knowledge.rb +617 -0
  29. data/lib/twilio-ruby/rest/knowledge/v1.rb +49 -0
  30. data/lib/twilio-ruby/rest/knowledge.rb +6 -0
  31. data/lib/twilio-ruby/rest/knowledge_base.rb +38 -0
  32. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +2 -2
  33. data/lib/twilio-ruby/rest/{preview/sync/service.rb → messaging/v2/channels_sender.rb} +189 -226
  34. data/lib/twilio-ruby/rest/{preview/sync.rb → messaging/v2.rb} +13 -13
  35. data/lib/twilio-ruby/rest/messaging_base.rb +6 -1
  36. data/lib/twilio-ruby/rest/monitor/v1/event.rb +1 -1
  37. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +3 -3
  38. data/lib/twilio-ruby/rest/preview_base.rb +0 -5
  39. data/lib/twilio-ruby/rest/studio/v1/flow/engagement/step.rb +7 -0
  40. data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step.rb +7 -0
  41. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +7 -0
  42. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +2 -2
  43. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +2 -2
  44. data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
  45. data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +1 -1
  46. data/lib/twilio-ruby/rest/video/v1/room.rb +6 -0
  47. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -1
  48. data/lib/twilio-ruby/twiml/voice_response.rb +24 -14
  49. data/lib/twilio-ruby/version.rb +1 -1
  50. data/twilio-ruby.gemspec +0 -2
  51. metadata +12 -41
  52. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -407
  53. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -472
  54. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -467
  55. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -407
  56. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -444
  57. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -470
  58. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -407
  59. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -444
@@ -4,7 +4,7 @@
4
4
  # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
5
  # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
6
  #
7
- # Twilio - Preview
7
+ # Twilio - Messaging
8
8
  # This is the public Twilio REST API.
9
9
  #
10
10
  # NOTE: This class is auto generated by OpenAPI Generator.
@@ -15,50 +15,120 @@
15
15
 
16
16
  module Twilio
17
17
  module REST
18
- class Preview < PreviewBase
19
- class Sync < Version
20
- class ServiceList < ListResource
18
+ class Messaging < MessagingBase
19
+ class V2 < Version
20
+ class ChannelsSenderList < ListResource
21
21
 
22
+ class MessagingV2ChannelsSenderRequestsCreate
23
+ # @param [sender_id]: [String] The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164`
24
+ # @param [configuration]: [ChannelsSenderList.MessagingV2ChannelsSenderConfiguration]
25
+ # @param [webhook]: [ChannelsSenderList.MessagingV2ChannelsSenderWebhook]
26
+ # @param [profile]: [ChannelsSenderList.MessagingV2ChannelsSenderProfile]
27
+ attr_accessor :sender_id, :configuration, :webhook, :profile
28
+ def initialize(payload)
29
+ @sender_id = payload["sender_id"]
30
+ @configuration = payload["configuration"]
31
+ @webhook = payload["webhook"]
32
+ @profile = payload["profile"]
33
+ end
34
+ def to_json(options = {})
35
+ {
36
+ "sender_id": @sender_id,
37
+ "configuration": @configuration,
38
+ "webhook": @webhook,
39
+ "profile": @profile,
40
+ }.to_json(options)
41
+ end
42
+ end
43
+
44
+ class MessagingV2ChannelsSenderRequestsUpdate
45
+ # @param [configuration]: [ChannelsSenderList.MessagingV2ChannelsSenderConfiguration]
46
+ # @param [webhook]: [ChannelsSenderList.MessagingV2ChannelsSenderWebhook]
47
+ # @param [profile]: [ChannelsSenderList.MessagingV2ChannelsSenderProfile]
48
+ attr_accessor :configuration, :webhook, :profile
49
+ def initialize(payload)
50
+ @configuration = payload["configuration"]
51
+ @webhook = payload["webhook"]
52
+ @profile = payload["profile"]
53
+ end
54
+ def to_json(options = {})
55
+ {
56
+ "configuration": @configuration,
57
+ "webhook": @webhook,
58
+ "profile": @profile,
59
+ }.to_json(options)
60
+ end
61
+ end
62
+
63
+
64
+ class MessagingV2ChannelsSenderRequestsCreate
65
+ # @param [sender_id]: [String] The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164`
66
+ # @param [configuration]: [ChannelsSenderList.MessagingV2ChannelsSenderConfiguration]
67
+ # @param [webhook]: [ChannelsSenderList.MessagingV2ChannelsSenderWebhook]
68
+ # @param [profile]: [ChannelsSenderList.MessagingV2ChannelsSenderProfile]
69
+ attr_accessor :sender_id, :configuration, :webhook, :profile
70
+ def initialize(payload)
71
+ @sender_id = payload["sender_id"]
72
+ @configuration = payload["configuration"]
73
+ @webhook = payload["webhook"]
74
+ @profile = payload["profile"]
75
+ end
76
+ def to_json(options = {})
77
+ {
78
+ "sender_id": @sender_id,
79
+ "configuration": @configuration,
80
+ "webhook": @webhook,
81
+ "profile": @profile,
82
+ }.to_json(options)
83
+ end
84
+ end
85
+
86
+ class MessagingV2ChannelsSenderRequestsUpdate
87
+ # @param [configuration]: [ChannelsSenderList.MessagingV2ChannelsSenderConfiguration]
88
+ # @param [webhook]: [ChannelsSenderList.MessagingV2ChannelsSenderWebhook]
89
+ # @param [profile]: [ChannelsSenderList.MessagingV2ChannelsSenderProfile]
90
+ attr_accessor :configuration, :webhook, :profile
91
+ def initialize(payload)
92
+ @configuration = payload["configuration"]
93
+ @webhook = payload["webhook"]
94
+ @profile = payload["profile"]
95
+ end
96
+ def to_json(options = {})
97
+ {
98
+ "configuration": @configuration,
99
+ "webhook": @webhook,
100
+ "profile": @profile,
101
+ }.to_json(options)
102
+ end
103
+ end
104
+
105
+
22
106
  ##
23
- # Initialize the ServiceList
107
+ # Initialize the ChannelsSenderList
24
108
  # @param [Version] version Version that contains the resource
25
- # @return [ServiceList] ServiceList
109
+ # @return [ChannelsSenderList] ChannelsSenderList
26
110
  def initialize(version)
27
111
  super(version)
28
112
  # Path Solution
29
113
  @solution = { }
30
- @uri = "/Services"
114
+ @uri = "/Channels/Senders"
31
115
 
32
116
  end
33
117
  ##
34
- # Create the ServiceInstance
35
- # @param [String] friendly_name
36
- # @param [String] webhook_url
37
- # @param [Boolean] reachability_webhooks_enabled
38
- # @param [Boolean] acl_enabled
39
- # @return [ServiceInstance] Created ServiceInstance
40
- def create(
41
- friendly_name: :unset,
42
- webhook_url: :unset,
43
- reachability_webhooks_enabled: :unset,
44
- acl_enabled: :unset
118
+ # Create the ChannelsSenderInstance
119
+ # @param [MessagingV2ChannelsSenderRequestsCreate] messaging_v2_channels_sender_requests_create
120
+ # @return [ChannelsSenderInstance] Created ChannelsSenderInstance
121
+ def create(messaging_v2_channels_sender_requests_create: nil
45
122
  )
46
123
 
47
- data = Twilio::Values.of({
48
- 'FriendlyName' => friendly_name,
49
- 'WebhookUrl' => webhook_url,
50
- 'ReachabilityWebhooksEnabled' => reachability_webhooks_enabled,
51
- 'AclEnabled' => acl_enabled,
52
- })
53
-
54
124
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
125
+ headers['Content-Type'] = 'application/json'
55
126
 
56
127
 
57
128
 
58
129
 
59
-
60
- payload = @version.create('POST', @uri, data: data, headers: headers)
61
- ServiceInstance.new(
130
+ payload = @version.create('POST', @uri, headers: headers, data: messaging_v2_channels_sender_requests_create.to_json)
131
+ ChannelsSenderInstance.new(
62
132
  @version,
63
133
  payload,
64
134
  )
@@ -66,9 +136,10 @@ module Twilio
66
136
 
67
137
 
68
138
  ##
69
- # Lists ServiceInstance records from the API as a list.
139
+ # Lists ChannelsSenderInstance records from the API as a list.
70
140
  # Unlike stream(), this operation is eager and will load `limit` records into
71
141
  # memory before returning.
142
+ # @param [String] channel
72
143
  # @param [Integer] limit Upper limit for the number of records to return. stream()
73
144
  # guarantees to never return more than limit. Default is no limit
74
145
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -76,8 +147,9 @@ module Twilio
76
147
  # but a limit is defined, stream() will attempt to read the limit with the most
77
148
  # efficient page size, i.e. min(limit, 1000)
78
149
  # @return [Array] Array of up to limit results
79
- def list(limit: nil, page_size: nil)
150
+ def list(channel: nil, limit: nil, page_size: nil)
80
151
  self.stream(
152
+ channel: channel,
81
153
  limit: limit,
82
154
  page_size: page_size
83
155
  ).entries
@@ -87,6 +159,7 @@ module Twilio
87
159
  # Streams Instance records from the API as an Enumerable.
88
160
  # This operation lazily loads records as efficiently as possible until the limit
89
161
  # is reached.
162
+ # @param [String] channel
90
163
  # @param [Integer] limit Upper limit for the number of records to return. stream()
91
164
  # guarantees to never return more than limit. Default is no limit
92
165
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -94,17 +167,18 @@ module Twilio
94
167
  # but a limit is defined, stream() will attempt to read the limit with the most
95
168
  # efficient page size, i.e. min(limit, 1000)
96
169
  # @return [Enumerable] Enumerable that will yield up to limit results
97
- def stream(limit: nil, page_size: nil)
170
+ def stream(channel: nil, limit: nil, page_size: nil)
98
171
  limits = @version.read_limits(limit, page_size)
99
172
 
100
173
  page = self.page(
174
+ channel: channel,
101
175
  page_size: limits[:page_size], )
102
176
 
103
177
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
104
178
  end
105
179
 
106
180
  ##
107
- # When passed a block, yields ServiceInstance records from the API.
181
+ # When passed a block, yields ChannelsSenderInstance records from the API.
108
182
  # This operation lazily loads records as efficiently as possible until the limit
109
183
  # is reached.
110
184
  def each
@@ -118,14 +192,16 @@ module Twilio
118
192
  end
119
193
 
120
194
  ##
121
- # Retrieve a single page of ServiceInstance records from the API.
195
+ # Retrieve a single page of ChannelsSenderInstance records from the API.
122
196
  # Request is executed immediately.
197
+ # @param [String] channel
123
198
  # @param [String] page_token PageToken provided by the API
124
199
  # @param [Integer] page_number Page Number, this value is simply for client state
125
200
  # @param [Integer] page_size Number of records to return, defaults to 50
126
- # @return [Page] Page of ServiceInstance
127
- def page(page_token: :unset, page_number: :unset, page_size: :unset)
201
+ # @return [Page] Page of ChannelsSenderInstance
202
+ def page(channel: nil, page_token: :unset, page_number: :unset, page_size: :unset)
128
203
  params = Twilio::Values.of({
204
+ 'Channel' => channel,
129
205
  'PageToken' => page_token,
130
206
  'Page' => page_number,
131
207
  'PageSize' => page_size,
@@ -136,51 +212,48 @@ module Twilio
136
212
 
137
213
  response = @version.page('GET', @uri, params: params, headers: headers)
138
214
 
139
- ServicePage.new(@version, response, @solution)
215
+ ChannelsSenderPage.new(@version, response, @solution)
140
216
  end
141
217
 
142
218
  ##
143
- # Retrieve a single page of ServiceInstance records from the API.
219
+ # Retrieve a single page of ChannelsSenderInstance records from the API.
144
220
  # Request is executed immediately.
145
221
  # @param [String] target_url API-generated URL for the requested results page
146
- # @return [Page] Page of ServiceInstance
222
+ # @return [Page] Page of ChannelsSenderInstance
147
223
  def get_page(target_url)
148
224
  response = @version.domain.request(
149
225
  'GET',
150
226
  target_url
151
227
  )
152
- ServicePage.new(@version, response, @solution)
228
+ ChannelsSenderPage.new(@version, response, @solution)
153
229
  end
154
230
 
155
231
 
156
232
 
157
233
  # Provide a user friendly representation
158
234
  def to_s
159
- '#<Twilio.Preview.Sync.ServiceList>'
235
+ '#<Twilio.Messaging.V2.ChannelsSenderList>'
160
236
  end
161
237
  end
162
238
 
163
239
 
164
- class ServiceContext < InstanceContext
240
+ class ChannelsSenderContext < InstanceContext
165
241
  ##
166
- # Initialize the ServiceContext
242
+ # Initialize the ChannelsSenderContext
167
243
  # @param [Version] version Version that contains the resource
168
- # @param [String] sid
169
- # @return [ServiceContext] ServiceContext
244
+ # @param [String] sid A 34 character string that uniquely identifies this Sender.
245
+ # @return [ChannelsSenderContext] ChannelsSenderContext
170
246
  def initialize(version, sid)
171
247
  super(version)
172
248
 
173
249
  # Path Solution
174
250
  @solution = { sid: sid, }
175
- @uri = "/Services/#{@solution[:sid]}"
251
+ @uri = "/Channels/Senders/#{@solution[:sid]}"
176
252
 
177
- # Dependents
178
- @sync_maps = nil
179
- @documents = nil
180
- @sync_lists = nil
253
+
181
254
  end
182
255
  ##
183
- # Delete the ServiceInstance
256
+ # Delete the ChannelsSenderInstance
184
257
  # @return [Boolean] True if delete succeeds, false otherwise
185
258
  def delete
186
259
 
@@ -192,8 +265,8 @@ module Twilio
192
265
  end
193
266
 
194
267
  ##
195
- # Fetch the ServiceInstance
196
- # @return [ServiceInstance] Fetched ServiceInstance
268
+ # Fetch the ChannelsSenderInstance
269
+ # @return [ChannelsSenderInstance] Fetched ChannelsSenderInstance
197
270
  def fetch
198
271
 
199
272
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -203,7 +276,7 @@ module Twilio
203
276
 
204
277
 
205
278
  payload = @version.fetch('GET', @uri, headers: headers)
206
- ServiceInstance.new(
279
+ ChannelsSenderInstance.new(
207
280
  @version,
208
281
  payload,
209
282
  sid: @solution[:sid],
@@ -211,120 +284,49 @@ module Twilio
211
284
  end
212
285
 
213
286
  ##
214
- # Update the ServiceInstance
215
- # @param [String] webhook_url
216
- # @param [String] friendly_name
217
- # @param [Boolean] reachability_webhooks_enabled
218
- # @param [Boolean] acl_enabled
219
- # @return [ServiceInstance] Updated ServiceInstance
220
- def update(
221
- webhook_url: :unset,
222
- friendly_name: :unset,
223
- reachability_webhooks_enabled: :unset,
224
- acl_enabled: :unset
287
+ # Update the ChannelsSenderInstance
288
+ # @param [MessagingV2ChannelsSenderRequestsUpdate] messaging_v2_channels_sender_requests_update
289
+ # @return [ChannelsSenderInstance] Updated ChannelsSenderInstance
290
+ def update(messaging_v2_channels_sender_requests_update: :unset
225
291
  )
226
292
 
227
- data = Twilio::Values.of({
228
- 'WebhookUrl' => webhook_url,
229
- 'FriendlyName' => friendly_name,
230
- 'ReachabilityWebhooksEnabled' => reachability_webhooks_enabled,
231
- 'AclEnabled' => acl_enabled,
232
- })
233
-
234
293
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
294
+ headers['Content-Type'] = 'application/json'
235
295
 
236
296
 
237
297
 
238
298
 
239
-
240
- payload = @version.update('POST', @uri, data: data, headers: headers)
241
- ServiceInstance.new(
299
+ payload = @version.update('POST', @uri, headers: headers, data: messaging_v2_channels_sender_requests_update.to_json)
300
+ ChannelsSenderInstance.new(
242
301
  @version,
243
302
  payload,
244
303
  sid: @solution[:sid],
245
304
  )
246
305
  end
247
306
 
248
- ##
249
- # Access the sync_maps
250
- # @return [SyncMapList]
251
- # @return [SyncMapContext] if sid was passed.
252
- def sync_maps(sid=:unset)
253
-
254
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
255
-
256
- if sid != :unset
257
- return SyncMapContext.new(@version, @solution[:sid],sid )
258
- end
259
-
260
- unless @sync_maps
261
- @sync_maps = SyncMapList.new(
262
- @version, service_sid: @solution[:sid], )
263
- end
264
-
265
- @sync_maps
266
- end
267
- ##
268
- # Access the documents
269
- # @return [DocumentList]
270
- # @return [DocumentContext] if sid was passed.
271
- def documents(sid=:unset)
272
-
273
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
274
-
275
- if sid != :unset
276
- return DocumentContext.new(@version, @solution[:sid],sid )
277
- end
278
-
279
- unless @documents
280
- @documents = DocumentList.new(
281
- @version, service_sid: @solution[:sid], )
282
- end
283
-
284
- @documents
285
- end
286
- ##
287
- # Access the sync_lists
288
- # @return [SyncListList]
289
- # @return [SyncListContext] if sid was passed.
290
- def sync_lists(sid=:unset)
291
-
292
- raise ArgumentError, 'sid cannot be nil' if sid.nil?
293
-
294
- if sid != :unset
295
- return SyncListContext.new(@version, @solution[:sid],sid )
296
- end
297
-
298
- unless @sync_lists
299
- @sync_lists = SyncListList.new(
300
- @version, service_sid: @solution[:sid], )
301
- end
302
-
303
- @sync_lists
304
- end
305
307
 
306
308
  ##
307
309
  # Provide a user friendly representation
308
310
  def to_s
309
311
  context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
310
- "#<Twilio.Preview.Sync.ServiceContext #{context}>"
312
+ "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>"
311
313
  end
312
314
 
313
315
  ##
314
316
  # Provide a detailed, user friendly representation
315
317
  def inspect
316
318
  context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
317
- "#<Twilio.Preview.Sync.ServiceContext #{context}>"
319
+ "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>"
318
320
  end
319
321
  end
320
322
 
321
- class ServicePage < Page
323
+ class ChannelsSenderPage < Page
322
324
  ##
323
- # Initialize the ServicePage
325
+ # Initialize the ChannelsSenderPage
324
326
  # @param [Version] version Version that contains the resource
325
327
  # @param [Response] response Response from the API
326
328
  # @param [Hash] solution Path solution for the resource
327
- # @return [ServicePage] ServicePage
329
+ # @return [ChannelsSenderPage] ChannelsSenderPage
328
330
  def initialize(version, response, solution)
329
331
  super(version, response)
330
332
 
@@ -333,44 +335,43 @@ module Twilio
333
335
  end
334
336
 
335
337
  ##
336
- # Build an instance of ServiceInstance
338
+ # Build an instance of ChannelsSenderInstance
337
339
  # @param [Hash] payload Payload response from the API
338
- # @return [ServiceInstance] ServiceInstance
340
+ # @return [ChannelsSenderInstance] ChannelsSenderInstance
339
341
  def get_instance(payload)
340
- ServiceInstance.new(@version, payload)
342
+ ChannelsSenderInstance.new(@version, payload)
341
343
  end
342
344
 
343
345
  ##
344
346
  # Provide a user friendly representation
345
347
  def to_s
346
- '<Twilio.Preview.Sync.ServicePage>'
348
+ '<Twilio.Messaging.V2.ChannelsSenderPage>'
347
349
  end
348
350
  end
349
- class ServiceInstance < InstanceResource
351
+ class ChannelsSenderInstance < InstanceResource
350
352
  ##
351
- # Initialize the ServiceInstance
353
+ # Initialize the ChannelsSenderInstance
352
354
  # @param [Version] version Version that contains the resource
353
355
  # @param [Hash] payload payload that contains response from Twilio
354
356
  # @param [String] account_sid The SID of the
355
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Service
357
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this ChannelsSender
356
358
  # resource.
357
359
  # @param [String] sid The SID of the Call resource to fetch.
358
- # @return [ServiceInstance] ServiceInstance
360
+ # @return [ChannelsSenderInstance] ChannelsSenderInstance
359
361
  def initialize(version, payload , sid: nil)
360
362
  super(version)
361
363
 
362
364
  # Marshaled Properties
363
365
  @properties = {
364
366
  'sid' => payload['sid'],
365
- 'account_sid' => payload['account_sid'],
366
- 'friendly_name' => payload['friendly_name'],
367
- 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
368
- 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
367
+ 'status' => payload['status'],
368
+ 'sender_id' => payload['sender_id'],
369
+ 'configuration' => payload['configuration'],
370
+ 'webhook' => payload['webhook'],
371
+ 'profile' => payload['profile'],
372
+ 'properties' => payload['properties'],
373
+ 'offline_reasons' => payload['offline_reasons'],
369
374
  'url' => payload['url'],
370
- 'webhook_url' => payload['webhook_url'],
371
- 'reachability_webhooks_enabled' => payload['reachability_webhooks_enabled'],
372
- 'acl_enabled' => payload['acl_enabled'],
373
- 'links' => payload['links'],
374
375
  }
375
376
 
376
377
  # Context
@@ -381,76 +382,70 @@ module Twilio
381
382
  ##
382
383
  # Generate an instance context for the instance, the context is capable of
383
384
  # performing various actions. All instance actions are proxied to the context
384
- # @return [ServiceContext] CallContext for this CallInstance
385
+ # @return [ChannelsSenderContext] CallContext for this CallInstance
385
386
  def context
386
387
  unless @instance_context
387
- @instance_context = ServiceContext.new(@version , @params['sid'])
388
+ @instance_context = ChannelsSenderContext.new(@version , @params['sid'])
388
389
  end
389
390
  @instance_context
390
391
  end
391
392
 
392
393
  ##
393
- # @return [String]
394
+ # @return [String] A 34 character string that uniquely identifies this Sender.
394
395
  def sid
395
396
  @properties['sid']
396
397
  end
397
398
 
398
399
  ##
399
- # @return [String]
400
- def account_sid
401
- @properties['account_sid']
400
+ # @return [Status]
401
+ def status
402
+ @properties['status']
402
403
  end
403
404
 
404
405
  ##
405
- # @return [String]
406
- def friendly_name
407
- @properties['friendly_name']
406
+ # @return [String] The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164`
407
+ def sender_id
408
+ @properties['sender_id']
408
409
  end
409
410
 
410
411
  ##
411
- # @return [Time]
412
- def date_created
413
- @properties['date_created']
412
+ # @return [MessagingV2ChannelsSenderConfiguration]
413
+ def configuration
414
+ @properties['configuration']
414
415
  end
415
416
 
416
417
  ##
417
- # @return [Time]
418
- def date_updated
419
- @properties['date_updated']
418
+ # @return [MessagingV2ChannelsSenderWebhook]
419
+ def webhook
420
+ @properties['webhook']
420
421
  end
421
422
 
422
423
  ##
423
- # @return [String]
424
- def url
425
- @properties['url']
426
- end
427
-
428
- ##
429
- # @return [String]
430
- def webhook_url
431
- @properties['webhook_url']
424
+ # @return [MessagingV2ChannelsSenderProfile]
425
+ def profile
426
+ @properties['profile']
432
427
  end
433
428
 
434
429
  ##
435
- # @return [Boolean]
436
- def reachability_webhooks_enabled
437
- @properties['reachability_webhooks_enabled']
430
+ # @return [MessagingV2ChannelsSenderProperties]
431
+ def properties
432
+ @properties['properties']
438
433
  end
439
434
 
440
435
  ##
441
- # @return [Boolean]
442
- def acl_enabled
443
- @properties['acl_enabled']
436
+ # @return [Array<MessagingV2ChannelsSenderOfflineReasonsItems>] Reasons why the sender is offline., e.g., [{\"code\": \"21211400\", \"message\": \"Whatsapp business account is banned by provider {provider_name} | Credit line is assigned to another BSP\", \"more_info\": \"https://www.twilio.com/docs/errors/21211400\"}]
437
+ def offline_reasons
438
+ @properties['offline_reasons']
444
439
  end
445
440
 
446
441
  ##
447
- # @return [Hash]
448
- def links
449
- @properties['links']
442
+ # @return [String] The URL of this resource, relative to `https://messaging.twilio.com`.
443
+ def url
444
+ @properties['url']
450
445
  end
451
446
 
452
447
  ##
453
- # Delete the ServiceInstance
448
+ # Delete the ChannelsSenderInstance
454
449
  # @return [Boolean] True if delete succeeds, false otherwise
455
450
  def delete
456
451
 
@@ -458,68 +453,36 @@ module Twilio
458
453
  end
459
454
 
460
455
  ##
461
- # Fetch the ServiceInstance
462
- # @return [ServiceInstance] Fetched ServiceInstance
456
+ # Fetch the ChannelsSenderInstance
457
+ # @return [ChannelsSenderInstance] Fetched ChannelsSenderInstance
463
458
  def fetch
464
459
 
465
460
  context.fetch
466
461
  end
467
462
 
468
463
  ##
469
- # Update the ServiceInstance
470
- # @param [String] webhook_url
471
- # @param [String] friendly_name
472
- # @param [Boolean] reachability_webhooks_enabled
473
- # @param [Boolean] acl_enabled
474
- # @return [ServiceInstance] Updated ServiceInstance
475
- def update(
476
- webhook_url: :unset,
477
- friendly_name: :unset,
478
- reachability_webhooks_enabled: :unset,
479
- acl_enabled: :unset
464
+ # Update the ChannelsSenderInstance
465
+ # @param [MessagingV2ChannelsSenderRequestsUpdate] messaging_v2_channels_sender_requests_update
466
+ # @return [ChannelsSenderInstance] Updated ChannelsSenderInstance
467
+ def update(messaging_v2_channels_sender_requests_update: :unset
480
468
  )
481
469
 
482
470
  context.update(
483
- webhook_url: webhook_url,
484
- friendly_name: friendly_name,
485
- reachability_webhooks_enabled: reachability_webhooks_enabled,
486
- acl_enabled: acl_enabled,
487
471
  )
488
472
  end
489
473
 
490
- ##
491
- # Access the sync_maps
492
- # @return [sync_maps] sync_maps
493
- def sync_maps
494
- context.sync_maps
495
- end
496
-
497
- ##
498
- # Access the documents
499
- # @return [documents] documents
500
- def documents
501
- context.documents
502
- end
503
-
504
- ##
505
- # Access the sync_lists
506
- # @return [sync_lists] sync_lists
507
- def sync_lists
508
- context.sync_lists
509
- end
510
-
511
474
  ##
512
475
  # Provide a user friendly representation
513
476
  def to_s
514
477
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
515
- "<Twilio.Preview.Sync.ServiceInstance #{values}>"
478
+ "<Twilio.Messaging.V2.ChannelsSenderInstance #{values}>"
516
479
  end
517
480
 
518
481
  ##
519
482
  # Provide a detailed, user friendly representation
520
483
  def inspect
521
484
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
522
- "<Twilio.Preview.Sync.ServiceInstance #{values}>"
485
+ "<Twilio.Messaging.V2.ChannelsSenderInstance #{values}>"
523
486
  end
524
487
  end
525
488