twilio-ruby 7.10.6 → 7.11.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 (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +43 -67
  3. data/.gitignore +0 -1
  4. data/CHANGES.md +57 -0
  5. data/Gemfile +2 -0
  6. data/Gemfile.lock +154 -0
  7. data/README.md +3 -3
  8. data/Rakefile +1 -1
  9. data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -6
  10. data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -12
  11. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
  12. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
  13. data/lib/twilio-ruby/rest/client.rb +0 -5
  14. data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -1
  15. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
  16. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
  17. data/lib/twilio-ruby/rest/conversations/v2/action.rb +507 -0
  18. data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
  19. data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +59 -21
  20. data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
  21. data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -10
  22. data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
  23. data/lib/twilio-ruby/rest/conversations/v2.rb +61 -45
  24. data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -2
  25. data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -2
  26. data/lib/twilio-ruby/rest/iam_base.rb +6 -1
  27. data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -0
  28. data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
  29. data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
  30. data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -1
  31. data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -1
  32. data/lib/twilio-ruby/rest/insights/v3.rb +1 -1
  33. data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
  34. data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +502 -0
  35. data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
  36. data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
  37. data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
  38. data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -117
  39. data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
  40. data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -118
  41. data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +13 -5
  42. data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
  43. data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -1
  44. data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -132
  45. data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
  46. data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -1
  47. data/lib/twilio-ruby/rest/memory/v1/observation.rb +70 -18
  48. data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -1
  49. data/lib/twilio-ruby/rest/memory/v1/profile.rb +87 -2
  50. data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -1
  51. data/lib/twilio-ruby/rest/memory/v1/revision.rb +1 -1
  52. data/lib/twilio-ruby/rest/memory/v1/store.rb +46 -1
  53. data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
  54. data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
  55. data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
  56. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
  57. data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
  58. data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -4
  59. data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +231 -0
  60. data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +238 -0
  61. data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +245 -0
  62. data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +224 -0
  63. data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
  64. data/lib/twilio-ruby/rest/{assistants/v1/session.rb → numbers/v2/caller_id.rb} +141 -127
  65. data/lib/twilio-ruby/rest/numbers/v2.rb +16 -0
  66. data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -2
  67. data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +259 -0
  68. data/lib/twilio-ruby/rest/oauth/v2/token.rb +8 -2
  69. data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -19
  70. data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +465 -0
  71. data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
  72. data/lib/twilio-ruby/rest/routes_base.rb +6 -1
  73. data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +330 -0
  74. data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +233 -0
  75. data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +321 -0
  76. data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +233 -0
  77. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +445 -0
  78. data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +445 -0
  79. data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
  80. data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +556 -0
  81. data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +356 -0
  82. data/lib/twilio-ruby/rest/voice/v2/configuration.rb +412 -0
  83. data/lib/twilio-ruby/rest/voice/v2/recording.rb +616 -0
  84. data/lib/twilio-ruby/rest/voice/v2/transcription.rb +591 -0
  85. data/lib/twilio-ruby/rest/voice/v2/type.rb +518 -0
  86. data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
  87. data/lib/twilio-ruby/rest/voice_base.rb +5 -0
  88. data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
  89. data/lib/twilio-ruby/version.rb +1 -1
  90. data/twilio-ruby.gemspec +1 -1
  91. metadata +34 -21
  92. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
  93. data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
  94. data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
  95. data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
  96. data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
  97. data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
  98. data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
  99. data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
  100. data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
  101. data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
  102. data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
  103. data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
  104. data/lib/twilio-ruby/rest/assistants.rb +0 -6
  105. data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
@@ -4,7 +4,7 @@
4
4
  # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
5
  # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
6
  #
7
- # Twilio - Assistants
7
+ # Twilio - Numbers
8
8
  # This is the public Twilio REST API.
9
9
  #
10
10
  # NOTE: This class is auto generated by OpenAPI Generator.
@@ -15,25 +15,25 @@
15
15
 
16
16
  module Twilio
17
17
  module REST
18
- class Assistants < AssistantsBase
19
- class V1 < Version
20
- class SessionList < ListResource
18
+ class Numbers < NumbersBase
19
+ class V2 < Version
20
+ class CallerIdList < ListResource
21
21
 
22
22
  ##
23
- # Initialize the SessionList
23
+ # Initialize the CallerIdList
24
24
  # @param [Version] version Version that contains the resource
25
- # @return [SessionList] SessionList
25
+ # @return [CallerIdList] CallerIdList
26
26
  def initialize(version)
27
27
  super(version)
28
28
 
29
29
  # Path Solution
30
30
  @solution = { }
31
- @uri = "/Sessions"
31
+ @uri = "/CallerIds"
32
32
 
33
33
  end
34
34
 
35
35
  ##
36
- # Lists SessionInstance records from the API as a list.
36
+ # Lists CallerIdInstance records from the API as a list.
37
37
  # Unlike stream(), this operation is eager and will load `limit` records into
38
38
  # memory before returning.
39
39
  # @param [Integer] limit Upper limit for the number of records to return. stream()
@@ -75,7 +75,7 @@ module Twilio
75
75
  end
76
76
 
77
77
  ##
78
- # Lists SessionPageMetadata records from the API as a list.
78
+ # Lists CallerIdPageMetadata records from the API as a list.
79
79
  # @param [Integer] limit Upper limit for the number of records to return. stream()
80
80
  # guarantees to never return more than limit. Default is no limit
81
81
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -93,11 +93,11 @@ module Twilio
93
93
 
94
94
  response = @version.page('GET', @uri, params: params, headers: headers)
95
95
 
96
- SessionPageMetadata.new(@version, response, @solution, limits[:limit])
96
+ CallerIdPageMetadata.new(@version, response, @solution, limits[:limit])
97
97
  end
98
98
 
99
99
  ##
100
- # When passed a block, yields SessionInstance records from the API.
100
+ # When passed a block, yields CallerIdInstance records from the API.
101
101
  # This operation lazily loads records as efficiently as possible until the limit
102
102
  # is reached.
103
103
  def each
@@ -115,12 +115,12 @@ module Twilio
115
115
  end
116
116
 
117
117
  ##
118
- # Retrieve a single page of SessionInstance records from the API.
118
+ # Retrieve a single page of CallerIdInstance records from the API.
119
119
  # Request is executed immediately.
120
120
  # @param [String] page_token PageToken provided by the API
121
121
  # @param [Integer] page_number Page Number, this value is simply for client state
122
122
  # @param [Integer] page_size Number of records to return, defaults to 50
123
- # @return [Page] Page of SessionInstance
123
+ # @return [Page] Page of CallerIdInstance
124
124
  def page(page_token: :unset, page_number: :unset,page_size: :unset)
125
125
  params = Twilio::Values.of({
126
126
  'PageToken' => page_token,
@@ -133,71 +133,102 @@ module Twilio
133
133
 
134
134
  response = @version.page('GET', @uri, params: params, headers: headers)
135
135
 
136
- SessionPage.new(@version, response, @solution)
136
+ CallerIdPage.new(@version, response, @solution)
137
137
  end
138
138
 
139
139
  ##
140
- # Retrieve a single page of SessionInstance records from the API.
140
+ # Retrieve a single page of CallerIdInstance records from the API.
141
141
  # Request is executed immediately.
142
142
  # @param [String] target_url API-generated URL for the requested results page
143
- # @return [Page] Page of SessionInstance
143
+ # @return [Page] Page of CallerIdInstance
144
144
  def get_page(target_url)
145
145
  response = @version.domain.request(
146
146
  'GET',
147
147
  target_url
148
148
  )
149
- SessionPage.new(@version, response, @solution)
149
+ CallerIdPage.new(@version, response, @solution)
150
150
  end
151
151
 
152
152
 
153
153
 
154
154
  # Provide a user friendly representation
155
155
  def to_s
156
- '#<Twilio.Assistants.V1.SessionList>'
156
+ '#<Twilio.Numbers.V2.CallerIdList>'
157
157
  end
158
158
  end
159
159
 
160
160
 
161
- class SessionContext < InstanceContext
161
+ class CallerIdContext < InstanceContext
162
162
  ##
163
- # Initialize the SessionContext
163
+ # Initialize the CallerIdContext
164
164
  # @param [Version] version Version that contains the resource
165
- # @param [String] id
166
- # @return [SessionContext] SessionContext
167
- def initialize(version, id)
165
+ # @param [String] caller_id_sid
166
+ # @return [CallerIdContext] CallerIdContext
167
+ def initialize(version, caller_id_sid)
168
168
  super(version)
169
169
 
170
170
 
171
171
  # Path Solution
172
- @solution = { id: id, }
173
- @uri = "/Sessions/#{@solution[:id]}"
172
+ @solution = { caller_id_sid: caller_id_sid, }
173
+ @uri = "/CallerIds/#{@solution[:caller_id_sid]}"
174
174
 
175
- # Dependents
176
- @messages = nil
175
+
177
176
  end
178
177
  ##
179
- # Fetch the SessionInstance
180
- # @return [SessionInstance] Fetched SessionInstance
181
- def fetch
178
+ # Delete the CallerIdInstance
179
+ # @return [Boolean] True if delete succeeds, false otherwise
180
+ def delete
182
181
 
183
182
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
184
183
 
185
184
 
186
185
 
186
+
187
+ @version.delete('DELETE', @uri, headers: headers)
188
+ end
189
+
190
+ ##
191
+ # Delete the CallerIdInstanceMetadata
192
+ # @return [Boolean] True if delete succeeds, false otherwise
193
+ def delete_with_metadata
194
+
195
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
187
196
 
188
197
 
189
- payload = @version.fetch('GET', @uri, headers: headers)
190
- SessionInstance.new(
198
+
199
+ response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
200
+ callerId_instance = CallerIdInstance.new(
201
+ @version,
202
+ response.body,
203
+ account_sid: @solution[:account_sid],
204
+ sid: @solution[:sid],
205
+ )
206
+ CallerIdInstanceMetadata.new(@version, callerId_instance, response.headers, response.status_code)
207
+ end
208
+
209
+ ##
210
+ # Update the CallerIdInstance
211
+ # @return [CallerIdInstance] Updated CallerIdInstance
212
+ def update
213
+
214
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
215
+
216
+
217
+
218
+
219
+
220
+ payload = @version.update('POST', @uri, headers: headers)
221
+ CallerIdInstance.new(
191
222
  @version,
192
223
  payload,
193
- id: @solution[:id],
224
+ caller_id_sid: @solution[:caller_id_sid],
194
225
  )
195
226
  end
196
227
 
197
228
  ##
198
- # Fetch the SessionInstanceMetadata
199
- # @return [SessionInstance] Fetched SessionInstance
200
- def fetch_with_metadata
229
+ # Update the CallerIdInstanceMetadata
230
+ # @return [CallerIdInstance] Updated CallerIdInstance
231
+ def update_with_metadata
201
232
 
202
233
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
203
234
 
@@ -205,62 +236,51 @@ module Twilio
205
236
 
206
237
 
207
238
 
208
- response = @version.fetch_with_metadata('GET', @uri, headers: headers)
209
- session_instance = SessionInstance.new(
239
+ response = @version.update_with_metadata('POST', @uri, headers: headers)
240
+ caller_id_instance = CallerIdInstance.new(
210
241
  @version,
211
242
  response.body,
212
- id: @solution[:id],
243
+ caller_id_sid: @solution[:caller_id_sid],
213
244
  )
214
- SessionInstanceMetadata.new(
245
+ CallerIdInstanceMetadata.new(
215
246
  @version,
216
- session_instance,
247
+ caller_id_instance,
217
248
  response.headers,
218
249
  response.status_code
219
250
  )
220
251
  end
221
252
 
222
- ##
223
- # Access the messages
224
- # @return [MessageList]
225
- # @return [MessageContext]
226
- def messages
227
- unless @messages
228
- @messages = MessageList.new(
229
- @version, )
230
- end
231
- @messages
232
- end
233
253
 
234
254
  ##
235
255
  # Provide a user friendly representation
236
256
  def to_s
237
257
  context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
238
- "#<Twilio.Assistants.V1.SessionContext #{context}>"
258
+ "#<Twilio.Numbers.V2.CallerIdContext #{context}>"
239
259
  end
240
260
 
241
261
  ##
242
262
  # Provide a detailed, user friendly representation
243
263
  def inspect
244
264
  context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
245
- "#<Twilio.Assistants.V1.SessionContext #{context}>"
265
+ "#<Twilio.Numbers.V2.CallerIdContext #{context}>"
246
266
  end
247
267
  end
248
268
 
249
- class SessionInstanceMetadata < InstanceResourceMetadata
269
+ class CallerIdInstanceMetadata < InstanceResourceMetadata
250
270
  ##
251
- # Initializes a new SessionInstanceMetadata.
271
+ # Initializes a new CallerIdInstanceMetadata.
252
272
  # @param [Version] version Version that contains the resource
253
- # @param [}SessionInstance] session_instance The instance associated with the metadata.
273
+ # @param [}CallerIdInstance] caller_id_instance The instance associated with the metadata.
254
274
  # @param [Hash] headers Header object with response headers.
255
275
  # @param [Integer] status_code The HTTP status code of the response.
256
- # @return [SessionInstanceMetadata] The initialized instance with metadata.
257
- def initialize(version, session_instance, headers, status_code)
276
+ # @return [CallerIdInstanceMetadata] The initialized instance with metadata.
277
+ def initialize(version, caller_id_instance, headers, status_code)
258
278
  super(version, headers, status_code)
259
- @session_instance = session_instance
279
+ @caller_id_instance = caller_id_instance
260
280
  end
261
281
 
262
- def session
263
- @session_instance
282
+ def caller_id
283
+ @caller_id_instance
264
284
  end
265
285
 
266
286
  def headers
@@ -272,34 +292,34 @@ module Twilio
272
292
  end
273
293
 
274
294
  def to_s
275
- "<Twilio.Api.V2010.SessionInstanceMetadata status=#{@status_code}>"
295
+ "<Twilio.Api.V2010.CallerIdInstanceMetadata status=#{@status_code}>"
276
296
  end
277
297
  end
278
298
 
279
- class SessionListResponse < InstanceListResource
280
- # @param [Array<SessionInstance>] instance
299
+ class CallerIdListResponse < InstanceListResource
300
+ # @param [Array<CallerIdInstance>] instance
281
301
  # @param [Hash{String => Object}] headers
282
302
  # @param [Integer] status_code
283
303
  def initialize(version, payload, key)
284
- @session_instance = payload.body[key].map do |data|
285
- SessionInstance.new(version, data)
304
+ @caller_id_instance = payload.body[key].map do |data|
305
+ CallerIdInstance.new(version, data)
286
306
  end
287
307
  @headers = payload.headers
288
308
  @status_code = payload.status_code
289
309
  end
290
310
 
291
- def session_instance
311
+ def caller_id_instance
292
312
  @instance
293
313
  end
294
314
  end
295
315
 
296
- class SessionPage < Page
316
+ class CallerIdPage < Page
297
317
  ##
298
- # Initialize the SessionPage
318
+ # Initialize the CallerIdPage
299
319
  # @param [Version] version Version that contains the resource
300
320
  # @param [Response] response Response from the API
301
321
  # @param [Hash] solution Path solution for the resource
302
- # @return [SessionPage] SessionPage
322
+ # @return [CallerIdPage] CallerIdPage
303
323
  def initialize(version, response, solution)
304
324
  super(version, response)
305
325
 
@@ -309,31 +329,31 @@ module Twilio
309
329
  end
310
330
 
311
331
  ##
312
- # Build an instance of SessionInstance
332
+ # Build an instance of CallerIdInstance
313
333
  # @param [Hash] payload Payload response from the API
314
- # @return [SessionInstance] SessionInstance
334
+ # @return [CallerIdInstance] CallerIdInstance
315
335
  def get_instance(payload)
316
- SessionInstance.new(@version, payload)
336
+ CallerIdInstance.new(@version, payload)
317
337
  end
318
338
 
319
339
  ##
320
340
  # Provide a user friendly representation
321
341
  def to_s
322
- '<Twilio.Assistants.V1.SessionPage>'
342
+ '<Twilio.Numbers.V2.CallerIdPage>'
323
343
  end
324
344
  end
325
345
 
326
- class SessionPageMetadata < PageMetadata
327
- attr_reader :session_page
346
+ class CallerIdPageMetadata < PageMetadata
347
+ attr_reader :caller_id_page
328
348
 
329
349
  def initialize(version, response, solution, limit)
330
350
  super(version, response)
331
- @session_page = []
351
+ @caller_id_page = []
332
352
  @limit = limit
333
353
  key = get_key(response.body)
334
354
  records = 0
335
355
  while( limit != :unset && records < limit )
336
- @session_page << SessionListResponse.new(version, @payload, key, limit - records)
356
+ @caller_id_page << CallerIdListResponse.new(version, @payload, key, limit - records)
337
357
  @payload = self.next_page
338
358
  break unless @payload
339
359
  records += (@payload.body[key] || []).size
@@ -343,18 +363,18 @@ module Twilio
343
363
  end
344
364
 
345
365
  def each
346
- @session_page.each do |record|
366
+ @caller_id_page.each do |record|
347
367
  yield record
348
368
  end
349
369
  end
350
370
 
351
371
  def to_s
352
- '<Twilio::REST::Assistants::V1PageMetadata>';
372
+ '<Twilio::REST::Numbers::V2PageMetadata>';
353
373
  end
354
374
  end
355
- class SessionListResponse < InstanceListResource
375
+ class CallerIdListResponse < InstanceListResource
356
376
 
357
- # @param [Array<SessionInstance>] instance
377
+ # @param [Array<CallerIdInstance>] instance
358
378
  # @param [Hash{String => Object}] headers
359
379
  # @param [Integer] status_code
360
380
  def initialize(version, payload, key, limit = :unset)
@@ -362,15 +382,15 @@ module Twilio
362
382
  if limit != :unset
363
383
  data_list = data_list[0, limit]
364
384
  end
365
- @session = data_list.map do |data|
366
- SessionInstance.new(version, data)
385
+ @caller_id = data_list.map do |data|
386
+ CallerIdInstance.new(version, data)
367
387
  end
368
388
  @headers = payload.headers
369
389
  @status_code = payload.status_code
370
390
  end
371
391
 
372
- def session
373
- @session
392
+ def caller_id
393
+ @caller_id
374
394
  end
375
395
 
376
396
  def headers
@@ -382,116 +402,110 @@ module Twilio
382
402
  end
383
403
  end
384
404
 
385
- class SessionInstance < InstanceResource
405
+ class CallerIdInstance < InstanceResource
386
406
  ##
387
- # Initialize the SessionInstance
407
+ # Initialize the CallerIdInstance
388
408
  # @param [Version] version Version that contains the resource
389
409
  # @param [Hash] payload payload that contains response from Twilio
390
410
  # @param [String] account_sid The SID of the
391
- # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Session
411
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this CallerId
392
412
  # resource.
393
413
  # @param [String] sid The SID of the Call resource to fetch.
394
- # @return [SessionInstance] SessionInstance
395
- def initialize(version, payload , id: nil)
414
+ # @return [CallerIdInstance] CallerIdInstance
415
+ def initialize(version, payload , caller_id_sid: nil)
396
416
  super(version)
397
417
 
398
418
 
399
419
  # Marshaled Properties
400
420
  @properties = {
401
- 'id' => payload['id'],
421
+ 'sid' => payload['sid'],
402
422
  'account_sid' => payload['account_sid'],
403
- 'assistant_id' => payload['assistant_id'],
404
- 'verified' => payload['verified'],
405
- 'identity' => payload['identity'],
423
+ 'phone_number' => payload['phone_number'],
424
+ 'friendly_name' => payload['friendly_name'],
406
425
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
407
426
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
408
427
  }
409
428
 
410
429
  # Context
411
430
  @instance_context = nil
412
- @params = { 'id' => id || @properties['id'] , }
431
+ @params = { 'caller_id_sid' => caller_id_sid || @properties['caller_id_sid'] , }
413
432
  end
414
433
 
415
434
  ##
416
435
  # Generate an instance context for the instance, the context is capable of
417
436
  # performing various actions. All instance actions are proxied to the context
418
- # @return [SessionContext] CallContext for this CallInstance
437
+ # @return [CallerIdContext] CallContext for this CallInstance
419
438
  def context
420
439
  unless @instance_context
421
- @instance_context = SessionContext.new(@version , @params['id'])
440
+ @instance_context = CallerIdContext.new(@version , @params['caller_id_sid'])
422
441
  end
423
442
  @instance_context
424
443
  end
425
444
 
426
445
  ##
427
- # @return [String] The Session ID.
428
- def id
429
- @properties['id']
446
+ # @return [String] The unique SID of this Caller ID resource.
447
+ def sid
448
+ @properties['sid']
430
449
  end
431
450
 
432
451
  ##
433
- # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Session resource.
452
+ # @return [String] The Account SID that owns this Caller ID.
434
453
  def account_sid
435
454
  @properties['account_sid']
436
455
  end
437
456
 
438
457
  ##
439
- # @return [String] The Assistant ID.
440
- def assistant_id
441
- @properties['assistant_id']
442
- end
443
-
444
- ##
445
- # @return [Boolean] True if the session is verified.
446
- def verified
447
- @properties['verified']
458
+ # @return [String] The phone number in E.164 format.
459
+ def phone_number
460
+ @properties['phone_number']
448
461
  end
449
462
 
450
463
  ##
451
- # @return [String] The unique identity of user for the session.
452
- def identity
453
- @properties['identity']
464
+ # @return [String] A human-readable name for this caller ID.
465
+ def friendly_name
466
+ @properties['friendly_name']
454
467
  end
455
468
 
456
469
  ##
457
- # @return [Time] The date and time in GMT when the Session was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
470
+ # @return [Time] The date this resource was created.
458
471
  def date_created
459
472
  @properties['date_created']
460
473
  end
461
474
 
462
475
  ##
463
- # @return [Time] The date and time in GMT when the Session was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
476
+ # @return [Time] The date this resource was last updated.
464
477
  def date_updated
465
478
  @properties['date_updated']
466
479
  end
467
480
 
468
481
  ##
469
- # Fetch the SessionInstance
470
- # @return [SessionInstance] Fetched SessionInstance
471
- def fetch
482
+ # Delete the CallerIdInstance
483
+ # @return [Boolean] True if delete succeeds, false otherwise
484
+ def delete
472
485
 
473
- context.fetch
486
+ context.delete
474
487
  end
475
488
 
476
489
  ##
477
- # Access the messages
478
- # @return [messages] messages
479
- def messages
480
- context.messages
490
+ # Update the CallerIdInstance
491
+ # @return [CallerIdInstance] Updated CallerIdInstance
492
+ def update
493
+
494
+ context.update
481
495
  end
482
496
 
483
497
  ##
484
498
  # Provide a user friendly representation
485
499
  def to_s
486
500
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
487
- "<Twilio.Assistants.V1.SessionInstance #{values}>"
501
+ "<Twilio.Numbers.V2.CallerIdInstance #{values}>"
488
502
  end
489
503
 
490
504
  ##
491
505
  # Provide a detailed, user friendly representation
492
506
  def inspect
493
507
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
494
- "<Twilio.Assistants.V1.SessionInstance #{values}>"
508
+ "<Twilio.Numbers.V2.CallerIdInstance #{values}>"
495
509
  end
496
510
  end
497
511
 
@@ -25,6 +25,7 @@ module Twilio
25
25
  @authorization_documents = nil
26
26
  @bulk_hosted_number_orders = nil
27
27
  @bundle_clone = nil
28
+ @caller_ids = nil
28
29
  @hosted_number_orders = nil
29
30
  @regulatory_compliance = nil
30
31
  end
@@ -90,6 +91,21 @@ module Twilio
90
91
  end
91
92
  end
92
93
  ##
94
+ # @param [String] caller_id_sid
95
+ # @return [Twilio::REST::Numbers::V2::CallerIdContext] if callerIdSid was passed.
96
+ # @return [Twilio::REST::Numbers::V2::CallerIdList]
97
+ def caller_ids(caller_id_sid=:unset)
98
+ if caller_id_sid.nil?
99
+ raise ArgumentError, 'caller_id_sid cannot be nil'
100
+ end
101
+
102
+ if caller_id_sid == :unset
103
+ @caller_ids ||= CallerIdList.new self
104
+ else
105
+ CallerIdContext.new(self, caller_id_sid)
106
+ end
107
+ end
108
+ ##
93
109
  # @param [String] sid A 34 character string that uniquely identifies this HostedNumberOrder.
94
110
  # @return [Twilio::REST::Numbers::V2::HostedNumberOrderContext] if sid was passed.
95
111
  # @return [Twilio::REST::Numbers::V2::HostedNumberOrderList]
@@ -38,13 +38,17 @@ module Twilio
38
38
  # @param [String] redirect_uri
39
39
  # @param [String] scope
40
40
  # @param [String] state
41
+ # @param [String] code_challenge
42
+ # @param [String] code_challenge_method
41
43
  # @return [AuthorizeInstance] Fetched AuthorizeInstance
42
44
  def fetch(
43
45
  response_type: :unset,
44
46
  client_id: :unset,
45
47
  redirect_uri: :unset,
46
48
  scope: :unset,
47
- state: :unset
49
+ state: :unset,
50
+ code_challenge: :unset,
51
+ code_challenge_method: :unset
48
52
  )
49
53
 
50
54
  params = Twilio::Values.of({
@@ -53,6 +57,8 @@ module Twilio
53
57
  'redirect_uri' => redirect_uri,
54
58
  'scope' => scope,
55
59
  'state' => state,
60
+ 'code_challenge' => code_challenge,
61
+ 'code_challenge_method' => code_challenge_method,
56
62
  })
57
63
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
58
64
 
@@ -74,13 +80,17 @@ module Twilio
74
80
  # @param [String] redirect_uri
75
81
  # @param [String] scope
76
82
  # @param [String] state
83
+ # @param [String] code_challenge
84
+ # @param [String] code_challenge_method
77
85
  # @return [AuthorizeInstance] Fetched AuthorizeInstance
78
86
  def fetch_with_metadata(
79
87
  response_type: :unset,
80
88
  client_id: :unset,
81
89
  redirect_uri: :unset,
82
90
  scope: :unset,
83
- state: :unset
91
+ state: :unset,
92
+ code_challenge: :unset,
93
+ code_challenge_method: :unset
84
94
  )
85
95
 
86
96
  params = Twilio::Values.of({
@@ -89,6 +99,8 @@ module Twilio
89
99
  'redirect_uri' => redirect_uri,
90
100
  'scope' => scope,
91
101
  'state' => state,
102
+ 'code_challenge' => code_challenge,
103
+ 'code_challenge_method' => code_challenge_method,
92
104
  })
93
105
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
94
106