twilio-ruby 7.0.0.pre.rc.1 → 7.0.0.pre.rc.3

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +9 -9
  3. data/CHANGES.md +46 -0
  4. data/README.md +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +28 -37
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +27 -3
  7. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -5
  8. data/lib/twilio-ruby/rest/client.rb +5 -0
  9. data/lib/twilio-ruby/rest/content/v1/content.rb +60 -1
  10. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +10 -5
  11. data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +11 -1
  12. data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +384 -0
  13. data/lib/twilio-ruby/rest/flex_api/v1/plugin.rb +446 -0
  14. data/lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb +247 -0
  15. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb +393 -0
  16. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration.rb +386 -0
  17. data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration_archive.rb +233 -0
  18. data/lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb +332 -0
  19. data/lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb +256 -0
  20. data/lib/twilio-ruby/rest/flex_api/v1.rb +112 -30
  21. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +1 -1
  22. data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +6 -6
  23. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +9 -2
  24. data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +11 -4
  25. data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +5 -3
  26. data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +5 -3
  27. data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +5 -3
  28. data/lib/twilio-ruby/rest/numbers/v1.rb +3 -3
  29. data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +5 -3
  30. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +15 -3
  31. data/lib/twilio-ruby/rest/oauth/v1/authorize.rb +143 -0
  32. data/lib/twilio-ruby/rest/oauth/v1/token.rb +175 -0
  33. data/lib/twilio-ruby/rest/oauth/v1.rb +46 -0
  34. data/lib/twilio-ruby/rest/oauth.rb +6 -0
  35. data/lib/twilio-ruby/rest/oauth_base.rb +38 -0
  36. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +5 -3
  37. data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +26 -2
  38. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +9 -3
  39. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +9 -3
  40. data/lib/twilio-ruby/twiml/messaging_response.rb +1 -1
  41. data/lib/twilio-ruby/version.rb +1 -1
  42. metadata +15 -6
  43. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +0 -267
  44. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +0 -332
  45. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversational_ai.rb +0 -274
  46. data/lib/twilio-ruby/rest/flex_api/v1/insights_conversational_ai_report_insights.rb +0 -253
@@ -26,8 +26,6 @@ module Twilio
26
26
  @configuration = nil
27
27
  @flex_flow = nil
28
28
  @insights_assessments_comment = nil
29
- @insights_conversational_ai = nil
30
- @insights_conversational_ai_report_insights = nil
31
29
  @insights_conversations = nil
32
30
  @insights_questionnaires = nil
33
31
  @insights_questionnaires_category = nil
@@ -38,6 +36,12 @@ module Twilio
38
36
  @insights_settings_comment = nil
39
37
  @insights_user_roles = nil
40
38
  @interaction = nil
39
+ @plugins = nil
40
+ @plugin_archive = nil
41
+ @plugin_configurations = nil
42
+ @plugin_configuration_archive = nil
43
+ @plugin_releases = nil
44
+ @plugin_version_archive = nil
41
45
  @provisioning_status = nil
42
46
  @web_channel = nil
43
47
  end
@@ -95,34 +99,6 @@ module Twilio
95
99
  @insights_assessments_comment ||= InsightsAssessmentsCommentList.new self
96
100
  end
97
101
  ##
98
- # @param [String] instance_sid Sid of Flex Service Instance
99
- # @return [Twilio::REST::FlexApi::V1::InsightsConversationalAiContext] if instanceSid was passed.
100
- # @return [Twilio::REST::FlexApi::V1::InsightsConversationalAiList]
101
- def insights_conversational_ai(instance_sid=:unset)
102
- if instance_sid.nil?
103
- raise ArgumentError, 'instance_sid cannot be nil'
104
- end
105
- if instance_sid == :unset
106
- @insights_conversational_ai ||= InsightsConversationalAiList.new self
107
- else
108
- InsightsConversationalAiContext.new(self, instance_sid)
109
- end
110
- end
111
- ##
112
- # @param [String] instance_sid The Instance SID of the instance for which report insights will be fetched
113
- # @return [Twilio::REST::FlexApi::V1::InsightsConversationalAiReportInsightsContext] if instanceSid was passed.
114
- # @return [Twilio::REST::FlexApi::V1::InsightsConversationalAiReportInsightsList]
115
- def insights_conversational_ai_report_insights(instance_sid=:unset)
116
- if instance_sid.nil?
117
- raise ArgumentError, 'instance_sid cannot be nil'
118
- end
119
- if instance_sid == :unset
120
- @insights_conversational_ai_report_insights ||= InsightsConversationalAiReportInsightsList.new self
121
- else
122
- InsightsConversationalAiReportInsightsContext.new(self, instance_sid)
123
- end
124
- end
125
- ##
126
102
  # @return [Twilio::REST::FlexApi::V1::InsightsConversationsList]
127
103
  def insights_conversations
128
104
  @insights_conversations ||= InsightsConversationsList.new self
@@ -209,6 +185,112 @@ module Twilio
209
185
  end
210
186
  end
211
187
  ##
188
+ # @param [String] sid The SID of the Flex Plugin resource to fetch.
189
+ # @return [Twilio::REST::FlexApi::V1::PluginContext] if sid was passed.
190
+ # @return [Twilio::REST::FlexApi::V1::PluginList]
191
+ def plugins(sid=:unset)
192
+ if sid.nil?
193
+ raise ArgumentError, 'sid cannot be nil'
194
+ end
195
+ if sid == :unset
196
+ @plugins ||= PluginList.new self
197
+ else
198
+ PluginContext.new(self, sid)
199
+ end
200
+ end
201
+ ##
202
+ # @param [String] sid The SID of the Flex Plugin resource to archive.
203
+ # @return [Twilio::REST::FlexApi::V1::PluginArchiveContext] if sid was passed.
204
+ # @return [Twilio::REST::FlexApi::V1::PluginArchiveList]
205
+ def plugin_archive(sid=:unset)
206
+ if sid.nil?
207
+ raise ArgumentError, 'sid cannot be nil'
208
+ end
209
+ if sid == :unset
210
+ @plugin_archive ||= PluginArchiveList.new self
211
+ else
212
+ PluginArchiveContext.new(self, sid)
213
+ end
214
+ end
215
+ ##
216
+ # @param [String] sid The SID of the Flex Plugin Configuration resource to fetch.
217
+ # @return [Twilio::REST::FlexApi::V1::PluginConfigurationContext] if sid was passed.
218
+ # @return [Twilio::REST::FlexApi::V1::PluginConfigurationList]
219
+ def plugin_configurations(sid=:unset)
220
+ if sid.nil?
221
+ raise ArgumentError, 'sid cannot be nil'
222
+ end
223
+ if sid == :unset
224
+ @plugin_configurations ||= PluginConfigurationList.new self
225
+ else
226
+ PluginConfigurationContext.new(self, sid)
227
+ end
228
+ end
229
+ ##
230
+ # @param [String] sid The SID of the Flex Plugin Configuration resource to archive.
231
+ # @return [Twilio::REST::FlexApi::V1::PluginConfigurationArchiveContext] if sid was passed.
232
+ # @return [Twilio::REST::FlexApi::V1::PluginConfigurationArchiveList]
233
+ def plugin_configuration_archive(sid=:unset)
234
+ if sid.nil?
235
+ raise ArgumentError, 'sid cannot be nil'
236
+ end
237
+ if sid == :unset
238
+ @plugin_configuration_archive ||= PluginConfigurationArchiveList.new self
239
+ else
240
+ PluginConfigurationArchiveContext.new(self, sid)
241
+ end
242
+ end
243
+ ##
244
+ # @param [String] sid The SID of the Flex Plugin Release resource to fetch.
245
+ # @return [Twilio::REST::FlexApi::V1::PluginReleaseContext] if sid was passed.
246
+ # @return [Twilio::REST::FlexApi::V1::PluginReleaseList]
247
+ def plugin_releases(sid=:unset)
248
+ if sid.nil?
249
+ raise ArgumentError, 'sid cannot be nil'
250
+ end
251
+ if sid == :unset
252
+ @plugin_releases ||= PluginReleaseList.new self
253
+ else
254
+ PluginReleaseContext.new(self, sid)
255
+ end
256
+ end
257
+ ##
258
+ # @param [String] plugin_sid The SID of the Flex Plugin the resource to belongs to.
259
+ # @param [String] sid The SID of the Flex Plugin Version resource to archive.
260
+ # @return [Twilio::REST::FlexApi::V1::PluginVersionArchiveContext] if pluginSid was passed.
261
+ # @return [Twilio::REST::FlexApi::V1::PluginVersionArchiveList]
262
+ def plugin_version_archive(plugin_sid=:unset, sid=:unset)
263
+ if plugin_sid.nil?
264
+ raise ArgumentError, 'plugin_sid cannot be nil'
265
+ end
266
+ if sid.nil?
267
+ raise ArgumentError, 'sid cannot be nil'
268
+ end
269
+ if plugin_sid == :unset && sid == :unset
270
+ @plugin_version_archive ||= PluginVersionArchiveList.new self
271
+ else
272
+ PluginVersionArchiveContext.new(self, plugin_sid, sid)
273
+ end
274
+ end
275
+ ##
276
+ # @param [String] plugin_sid The SID of the Flex Plugin the resource to belongs to.
277
+ # @param [String] sid The SID of the Flex Plugin Version resource to archive.
278
+ # @return [Twilio::REST::FlexApi::V1::PluginVersionArchiveContext] if sid was passed.
279
+ # @return [Twilio::REST::FlexApi::V1::PluginVersionArchiveList]
280
+ def plugin_version_archive(plugin_sid=:unset, sid=:unset)
281
+ if plugin_sid.nil?
282
+ raise ArgumentError, 'plugin_sid cannot be nil'
283
+ end
284
+ if sid.nil?
285
+ raise ArgumentError, 'sid cannot be nil'
286
+ end
287
+ if plugin_sid == :unset && sid == :unset
288
+ @plugin_version_archive ||= PluginVersionArchiveList.new self
289
+ else
290
+ PluginVersionArchiveContext.new(self, plugin_sid, sid)
291
+ end
292
+ end
293
+ ##
212
294
  # @return [Twilio::REST::FlexApi::V1::provisioningStatusContext]
213
295
  def provisioning_status
214
296
  @provisioning_status ||= ProvisioningStatusContext.new self
@@ -51,7 +51,7 @@ module Twilio
51
51
 
52
52
  # Path Solution
53
53
  @solution = { phone_number: phone_number, }
54
- @uri = "/PhoneNumbers/#{CGI.escape(@solution[:phone_number]).gsub("+", "%20")}"
54
+ @uri = "/PhoneNumbers/#{@solution[:phone_number]}"
55
55
 
56
56
 
57
57
  end
@@ -57,7 +57,7 @@ module Twilio
57
57
  end
58
58
  ##
59
59
  # Fetch the PhoneNumberInstance
60
- # @param [String] fields A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number.
60
+ # @param [String] fields A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score.
61
61
  # @param [String] country_code The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format.
62
62
  # @param [String] first_name User’s first name. This query parameter is only used (optionally) for identity_match package requests.
63
63
  # @param [String] last_name User’s last name. This query parameter is only used (optionally) for identity_match package requests.
@@ -179,7 +179,7 @@ module Twilio
179
179
  'caller_name' => payload['caller_name'],
180
180
  'sim_swap' => payload['sim_swap'],
181
181
  'call_forwarding' => payload['call_forwarding'],
182
- 'live_activity' => payload['live_activity'],
182
+ 'line_status' => payload['line_status'],
183
183
  'line_type_intelligence' => payload['line_type_intelligence'],
184
184
  'identity_match' => payload['identity_match'],
185
185
  'reassigned_number' => payload['reassigned_number'],
@@ -259,9 +259,9 @@ module Twilio
259
259
  end
260
260
 
261
261
  ##
262
- # @return [Hash] An object that contains live activity information for a mobile phone number.
263
- def live_activity
264
- @properties['live_activity']
262
+ # @return [Hash] An object that contains line status information for a mobile phone number.
263
+ def line_status
264
+ @properties['line_status']
265
265
  end
266
266
 
267
267
  ##
@@ -302,7 +302,7 @@ module Twilio
302
302
 
303
303
  ##
304
304
  # Fetch the PhoneNumberInstance
305
- # @param [String] fields A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number.
305
+ # @param [String] fields A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score.
306
306
  # @param [String] country_code The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format.
307
307
  # @param [String] first_name User’s first name. This query parameter is only used (optionally) for identity_match package requests.
308
308
  # @param [String] last_name User’s last name. This query parameter is only used (optionally) for identity_match package requests.
@@ -300,6 +300,7 @@ module Twilio
300
300
  'status' => payload['status'],
301
301
  'tcr_id' => payload['tcr_id'],
302
302
  'failure_reason' => payload['failure_reason'],
303
+ 'errors' => payload['errors'],
303
304
  'url' => payload['url'],
304
305
  'brand_score' => payload['brand_score'] == nil ? payload['brand_score'] : payload['brand_score'].to_i,
305
306
  'brand_feedback' => payload['brand_feedback'],
@@ -383,11 +384,17 @@ module Twilio
383
384
  end
384
385
 
385
386
  ##
386
- # @return [String] A reason why brand registration has failed. Only applicable when status is FAILED.
387
+ # @return [String] DEPRECATED. A reason why brand registration has failed. Only applicable when status is FAILED.
387
388
  def failure_reason
388
389
  @properties['failure_reason']
389
390
  end
390
391
 
392
+ ##
393
+ # @return [Array<Hash>] A list of errors that occurred during the brand registration process.
394
+ def errors
395
+ @properties['errors']
396
+ end
397
+
391
398
  ##
392
399
  # @return [String] The absolute URL of the Brand Registration resource.
393
400
  def url
@@ -401,7 +408,7 @@ module Twilio
401
408
  end
402
409
 
403
410
  ##
404
- # @return [Array<BrandFeedback>] Feedback on how to improve brand score
411
+ # @return [Array<BrandFeedback>] DEPRECATED. Feedback on how to improve brand score
405
412
  def brand_feedback
406
413
  @properties['brand_feedback']
407
414
  end
@@ -53,7 +53,7 @@ module Twilio
53
53
  # @param [String] business_contact_first_name The first name of the contact for the business or organization using the Tollfree number.
54
54
  # @param [String] business_contact_last_name The last name of the contact for the business or organization using the Tollfree number.
55
55
  # @param [String] business_contact_email The email address of the contact for the business or organization using the Tollfree number.
56
- # @param [String] business_contact_phone The phone number of the contact for the business or organization using the Tollfree number.
56
+ # @param [String] business_contact_phone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.
57
57
  # @param [String] external_reference_id An optional external reference ID supplied by customer and echoed back on status retrieval.
58
58
  # @return [TollfreeVerificationInstance] Created TollfreeVerificationInstance
59
59
  def create(
@@ -281,7 +281,7 @@ module Twilio
281
281
  # @param [String] business_contact_first_name The first name of the contact for the business or organization using the Tollfree number.
282
282
  # @param [String] business_contact_last_name The last name of the contact for the business or organization using the Tollfree number.
283
283
  # @param [String] business_contact_email The email address of the contact for the business or organization using the Tollfree number.
284
- # @param [String] business_contact_phone The phone number of the contact for the business or organization using the Tollfree number.
284
+ # @param [String] business_contact_phone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.
285
285
  # @param [String] edit_reason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'.
286
286
  # @return [TollfreeVerificationInstance] Updated TollfreeVerificationInstance
287
287
  def update(
@@ -434,6 +434,7 @@ module Twilio
434
434
  'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
435
435
  'edit_expiration' => Twilio.deserialize_iso8601_datetime(payload['edit_expiration']),
436
436
  'edit_allowed' => payload['edit_allowed'],
437
+ 'rejection_reasons' => payload['rejection_reasons'],
437
438
  'resource_links' => payload['resource_links'],
438
439
  'external_reference_id' => payload['external_reference_id'],
439
440
  }
@@ -563,7 +564,7 @@ module Twilio
563
564
  end
564
565
 
565
566
  ##
566
- # @return [String] The phone number of the contact for the business or organization using the Tollfree number.
567
+ # @return [String] The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.
567
568
  def business_contact_phone
568
569
  @properties['business_contact_phone']
569
570
  end
@@ -658,6 +659,12 @@ module Twilio
658
659
  @properties['edit_allowed']
659
660
  end
660
661
 
662
+ ##
663
+ # @return [Array<Hash>] A list of rejection reasons and codes describing why a Tollfree Verification has been rejected.
664
+ def rejection_reasons
665
+ @properties['rejection_reasons']
666
+ end
667
+
661
668
  ##
662
669
  # @return [Hash] The URLs of the documents associated with the Tollfree Verification resource.
663
670
  def resource_links
@@ -707,7 +714,7 @@ module Twilio
707
714
  # @param [String] business_contact_first_name The first name of the contact for the business or organization using the Tollfree number.
708
715
  # @param [String] business_contact_last_name The last name of the contact for the business or organization using the Tollfree number.
709
716
  # @param [String] business_contact_email The email address of the contact for the business or organization using the Tollfree number.
710
- # @param [String] business_contact_phone The phone number of the contact for the business or organization using the Tollfree number.
717
+ # @param [String] business_contact_phone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.
711
718
  # @param [String] edit_reason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'.
712
719
  # @return [TollfreeVerificationInstance] Updated TollfreeVerificationInstance
713
720
  def update(
@@ -32,11 +32,13 @@ module Twilio
32
32
  end
33
33
  ##
34
34
  # Create the BulkEligibilityInstance
35
+ # @param [Object] body
35
36
  # @return [BulkEligibilityInstance] Created BulkEligibilityInstance
36
- def create
37
+ def create(body: :unset
38
+ )
37
39
 
38
-
39
- payload = @version.create('POST', @uri)
40
+ headers = Twilio::Values.of({"Content-Type"=> "application/json"})
41
+ payload = @version.create('POST', @uri, data: body.to_json, headers: headers)
40
42
  BulkEligibilityInstance.new(
41
43
  @version,
42
44
  payload,
@@ -32,11 +32,13 @@ module Twilio
32
32
  end
33
33
  ##
34
34
  # Create the EligibilityInstance
35
+ # @param [Object] body
35
36
  # @return [EligibilityInstance] Created EligibilityInstance
36
- def create
37
+ def create(body: :unset
38
+ )
37
39
 
38
-
39
- payload = @version.create('POST', @uri)
40
+ headers = Twilio::Values.of({"Content-Type"=> "application/json"})
41
+ payload = @version.create('POST', @uri, data: body.to_json, headers: headers)
40
42
  EligibilityInstance.new(
41
43
  @version,
42
44
  payload,
@@ -32,11 +32,13 @@ module Twilio
32
32
  end
33
33
  ##
34
34
  # Create the PortingPortInInstance
35
+ # @param [Object] body
35
36
  # @return [PortingPortInInstance] Created PortingPortInInstance
36
- def create
37
+ def create(body: :unset
38
+ )
37
39
 
38
-
39
- payload = @version.create('POST', @uri)
40
+ headers = Twilio::Values.of({"Content-Type"=> "application/json"})
41
+ payload = @version.create('POST', @uri, data: body.to_json, headers: headers)
40
42
  PortingPortInInstance.new(
41
43
  @version,
42
44
  payload,
@@ -25,7 +25,7 @@ module Twilio
25
25
  @eligibilities = nil
26
26
  @porting_bulk_portabilities = nil
27
27
  @porting_port_ins = nil
28
- @porting_port_ins = nil
28
+ @porting_port_ins_fetch = nil
29
29
  @porting_portabilities = nil
30
30
  end
31
31
 
@@ -71,12 +71,12 @@ module Twilio
71
71
  # @param [String] port_in_request_sid The SID of the Port In request. This is a unique identifier of the port in request.
72
72
  # @return [Twilio::REST::Numbers::V1::PortingPortInFetchContext] if portInRequestSid was passed.
73
73
  # @return [Twilio::REST::Numbers::V1::PortingPortInFetchList]
74
- def porting_port_ins(port_in_request_sid=:unset)
74
+ def porting_port_ins_fetch(port_in_request_sid=:unset)
75
75
  if port_in_request_sid.nil?
76
76
  raise ArgumentError, 'port_in_request_sid cannot be nil'
77
77
  end
78
78
  if port_in_request_sid == :unset
79
- @porting_port_ins ||= PortingPortInFetchList.new self
79
+ @porting_port_ins_fetch ||= PortingPortInFetchList.new self
80
80
  else
81
81
  PortingPortInFetchContext.new(self, port_in_request_sid)
82
82
  end
@@ -32,11 +32,13 @@ module Twilio
32
32
  end
33
33
  ##
34
34
  # Create the BulkHostedNumberOrderInstance
35
+ # @param [Object] body
35
36
  # @return [BulkHostedNumberOrderInstance] Created BulkHostedNumberOrderInstance
36
- def create
37
+ def create(body: :unset
38
+ )
37
39
 
38
-
39
- payload = @version.create('POST', @uri)
40
+ headers = Twilio::Values.of({"Content-Type"=> "application/json"})
41
+ payload = @version.create('POST', @uri, data: body.to_json, headers: headers)
40
42
  BulkHostedNumberOrderInstance.new(
41
43
  @version,
42
44
  payload,
@@ -84,6 +84,8 @@ module Twilio
84
84
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
85
85
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
86
86
  # @param [Time] valid_until_date Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
87
+ # @param [Time] valid_until_date_before Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
88
+ # @param [Time] valid_until_date_after Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
87
89
  # @param [Integer] limit Upper limit for the number of records to return. stream()
88
90
  # guarantees to never return more than limit. Default is no limit
89
91
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -91,7 +93,7 @@ module Twilio
91
93
  # but a limit is defined, stream() will attempt to read the limit with the most
92
94
  # efficient page size, i.e. min(limit, 1000)
93
95
  # @return [Array] Array of up to limit results
94
- def list(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, limit: nil, page_size: nil)
96
+ def list(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
95
97
  self.stream(
96
98
  status: status,
97
99
  friendly_name: friendly_name,
@@ -102,6 +104,8 @@ module Twilio
102
104
  sort_by: sort_by,
103
105
  sort_direction: sort_direction,
104
106
  valid_until_date: valid_until_date,
107
+ valid_until_date_before: valid_until_date_before,
108
+ valid_until_date_after: valid_until_date_after,
105
109
  limit: limit,
106
110
  page_size: page_size
107
111
  ).entries
@@ -120,6 +124,8 @@ module Twilio
120
124
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
121
125
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
122
126
  # @param [Time] valid_until_date Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
127
+ # @param [Time] valid_until_date_before Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
128
+ # @param [Time] valid_until_date_after Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
123
129
  # @param [Integer] limit Upper limit for the number of records to return. stream()
124
130
  # guarantees to never return more than limit. Default is no limit
125
131
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -127,7 +133,7 @@ module Twilio
127
133
  # but a limit is defined, stream() will attempt to read the limit with the most
128
134
  # efficient page size, i.e. min(limit, 1000)
129
135
  # @return [Enumerable] Enumerable that will yield up to limit results
130
- def stream(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, limit: nil, page_size: nil)
136
+ def stream(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
131
137
  limits = @version.read_limits(limit, page_size)
132
138
 
133
139
  page = self.page(
@@ -140,6 +146,8 @@ module Twilio
140
146
  sort_by: sort_by,
141
147
  sort_direction: sort_direction,
142
148
  valid_until_date: valid_until_date,
149
+ valid_until_date_before: valid_until_date_before,
150
+ valid_until_date_after: valid_until_date_after,
143
151
  page_size: limits[:page_size], )
144
152
 
145
153
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
@@ -171,11 +179,13 @@ module Twilio
171
179
  # @param [SortBy] sort_by Can be `valid-until` or `date-updated`. Defaults to `date-created`.
172
180
  # @param [SortDirection] sort_direction Default is `DESC`. Can be `ASC` or `DESC`.
173
181
  # @param [Time] valid_until_date Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
182
+ # @param [Time] valid_until_date_before Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
183
+ # @param [Time] valid_until_date_after Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format.
174
184
  # @param [String] page_token PageToken provided by the API
175
185
  # @param [Integer] page_number Page Number, this value is simply for client state
176
186
  # @param [Integer] page_size Number of records to return, defaults to 50
177
187
  # @return [Page] Page of BundleInstance
178
- def page(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
188
+ def page(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, has_valid_until_date: :unset, sort_by: :unset, sort_direction: :unset, valid_until_date: :unset, valid_until_date_before: :unset, valid_until_date_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
179
189
  params = Twilio::Values.of({
180
190
  'Status' => status,
181
191
  'FriendlyName' => friendly_name,
@@ -186,6 +196,8 @@ module Twilio
186
196
  'SortBy' => sort_by,
187
197
  'SortDirection' => sort_direction,
188
198
  'ValidUntilDate' => Twilio.serialize_iso8601_datetime(valid_until_date),
199
+ 'ValidUntilDate<' => Twilio.serialize_iso8601_datetime(valid_until_date_before),
200
+ 'ValidUntilDate>' => Twilio.serialize_iso8601_datetime(valid_until_date_after),
189
201
  'PageToken' => page_token,
190
202
  'Page' => page_number,
191
203
  'PageSize' => page_size,
@@ -0,0 +1,143 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Oauth
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Oauth < OauthBase
19
+ class V1 < Version
20
+ class AuthorizeList < ListResource
21
+
22
+ ##
23
+ # Initialize the AuthorizeList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [AuthorizeList] AuthorizeList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+ @uri = "/authorize"
31
+
32
+ end
33
+ ##
34
+ # Fetch the AuthorizeInstance
35
+ # @param [String] response_type Response Type
36
+ # @param [String] client_id The Client Identifier
37
+ # @param [String] redirect_uri The url to which response will be redirected to
38
+ # @param [String] scope The scope of the access request
39
+ # @param [String] state An opaque value which can be used to maintain state between the request and callback
40
+ # @return [AuthorizeInstance] Fetched AuthorizeInstance
41
+ def fetch(
42
+ response_type: :unset,
43
+ client_id: :unset,
44
+ redirect_uri: :unset,
45
+ scope: :unset,
46
+ state: :unset
47
+ )
48
+
49
+ params = Twilio::Values.of({
50
+ 'ResponseType' => response_type,
51
+ 'ClientId' => client_id,
52
+ 'RedirectUri' => redirect_uri,
53
+ 'Scope' => scope,
54
+ 'State' => state,
55
+ })
56
+
57
+ payload = @version.fetch('GET', @uri, params: params)
58
+ AuthorizeInstance.new(
59
+ @version,
60
+ payload,
61
+ )
62
+ end
63
+
64
+
65
+
66
+
67
+ # Provide a user friendly representation
68
+ def to_s
69
+ '#<Twilio.Oauth.V1.AuthorizeList>'
70
+ end
71
+ end
72
+
73
+ class AuthorizePage < Page
74
+ ##
75
+ # Initialize the AuthorizePage
76
+ # @param [Version] version Version that contains the resource
77
+ # @param [Response] response Response from the API
78
+ # @param [Hash] solution Path solution for the resource
79
+ # @return [AuthorizePage] AuthorizePage
80
+ def initialize(version, response, solution)
81
+ super(version, response)
82
+
83
+ # Path Solution
84
+ @solution = solution
85
+ end
86
+
87
+ ##
88
+ # Build an instance of AuthorizeInstance
89
+ # @param [Hash] payload Payload response from the API
90
+ # @return [AuthorizeInstance] AuthorizeInstance
91
+ def get_instance(payload)
92
+ AuthorizeInstance.new(@version, payload)
93
+ end
94
+
95
+ ##
96
+ # Provide a user friendly representation
97
+ def to_s
98
+ '<Twilio.Oauth.V1.AuthorizePage>'
99
+ end
100
+ end
101
+ class AuthorizeInstance < InstanceResource
102
+ ##
103
+ # Initialize the AuthorizeInstance
104
+ # @param [Version] version Version that contains the resource
105
+ # @param [Hash] payload payload that contains response from Twilio
106
+ # @param [String] account_sid The SID of the
107
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Authorize
108
+ # resource.
109
+ # @param [String] sid The SID of the Call resource to fetch.
110
+ # @return [AuthorizeInstance] AuthorizeInstance
111
+ def initialize(version, payload )
112
+ super(version)
113
+
114
+ # Marshaled Properties
115
+ @properties = {
116
+ 'redirect_to' => payload['redirect_to'],
117
+ }
118
+ end
119
+
120
+
121
+ ##
122
+ # @return [String] The callback URL
123
+ def redirect_to
124
+ @properties['redirect_to']
125
+ end
126
+
127
+ ##
128
+ # Provide a user friendly representation
129
+ def to_s
130
+ "<Twilio.Oauth.V1.AuthorizeInstance>"
131
+ end
132
+
133
+ ##
134
+ # Provide a detailed, user friendly representation
135
+ def inspect
136
+ "<Twilio.Oauth.V1.AuthorizeInstance>"
137
+ end
138
+ end
139
+
140
+ end
141
+ end
142
+ end
143
+ end