twilio-ruby 5.61.2 → 5.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +124 -0
  3. data/.rubocop.yml +1 -1
  4. data/.rubocop_todo.yml +84 -21
  5. data/CHANGES.md +99 -0
  6. data/Makefile +3 -6
  7. data/README.md +5 -4
  8. data/lib/rack/twilio_webhook_authentication.rb +25 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +667 -0
  10. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -0
  11. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +19 -5
  12. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +435 -0
  13. data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +20 -20
  14. data/lib/twilio-ruby/rest/conversations/v1.rb +17 -0
  15. data/lib/twilio-ruby/rest/conversations.rb +9 -0
  16. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -77
  17. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +33 -18
  18. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +474 -0
  19. data/lib/twilio-ruby/rest/insights/v1/conference.rb +512 -0
  20. data/lib/twilio-ruby/rest/insights/v1/setting.rb +215 -0
  21. data/lib/twilio-ruby/rest/insights/v1.rb +23 -0
  22. data/lib/twilio-ruby/rest/insights.rb +14 -0
  23. data/lib/twilio-ruby/rest/media/v1/media_processor.rb +14 -1
  24. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +23 -0
  25. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb +80 -0
  26. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +75 -18
  27. data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +372 -0
  28. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +71 -30
  29. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  30. data/lib/twilio-ruby/rest/supersim/v1.rb +16 -0
  31. data/lib/twilio-ruby/rest/supersim.rb +9 -0
  32. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +130 -8
  33. data/lib/twilio-ruby/rest/verify/v2/service.rb +8 -2
  34. data/lib/twilio-ruby/rest/verify/v2/template.rb +1 -1
  35. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  36. data/lib/twilio-ruby/rest/verify.rb +2 -2
  37. data/lib/twilio-ruby/rest/video/v1/composition.rb +7 -0
  38. data/lib/twilio-ruby/rest/video/v1/recording.rb +7 -0
  39. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +7 -0
  40. data/lib/twilio-ruby/rest/video/v1/room.rb +30 -5
  41. data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +184 -0
  42. data/lib/twilio-ruby/rest/voice/v1.rb +21 -0
  43. data/lib/twilio-ruby/rest/voice.rb +8 -0
  44. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +4 -4
  45. data/lib/twilio-ruby/version.rb +1 -1
  46. data/sonar-project.properties +1 -1
  47. data/twilio-ruby.gemspec +0 -1
  48. metadata +10 -18
  49. data/.github/workflows/deploy.yml +0 -65
  50. data/.github/workflows/test.yml +0 -52
@@ -0,0 +1,215 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Insights < Domain
12
+ class V1 < Version
13
+ class SettingList < ListResource
14
+ ##
15
+ # Initialize the SettingList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SettingList] SettingList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ end
24
+
25
+ ##
26
+ # Provide a user friendly representation
27
+ def to_s
28
+ '#<Twilio.Insights.V1.SettingList>'
29
+ end
30
+ end
31
+
32
+ class SettingPage < Page
33
+ ##
34
+ # Initialize the SettingPage
35
+ # @param [Version] version Version that contains the resource
36
+ # @param [Response] response Response from the API
37
+ # @param [Hash] solution Path solution for the resource
38
+ # @return [SettingPage] SettingPage
39
+ def initialize(version, response, solution)
40
+ super(version, response)
41
+
42
+ # Path Solution
43
+ @solution = solution
44
+ end
45
+
46
+ ##
47
+ # Build an instance of SettingInstance
48
+ # @param [Hash] payload Payload response from the API
49
+ # @return [SettingInstance] SettingInstance
50
+ def get_instance(payload)
51
+ SettingInstance.new(@version, payload, )
52
+ end
53
+
54
+ ##
55
+ # Provide a user friendly representation
56
+ def to_s
57
+ '<Twilio.Insights.V1.SettingPage>'
58
+ end
59
+ end
60
+
61
+ class SettingContext < InstanceContext
62
+ ##
63
+ # Initialize the SettingContext
64
+ # @param [Version] version Version that contains the resource
65
+ # @return [SettingContext] SettingContext
66
+ def initialize(version)
67
+ super(version)
68
+
69
+ # Path Solution
70
+ @solution = {}
71
+ @uri = "/Voice/Settings"
72
+ end
73
+
74
+ ##
75
+ # Fetch the SettingInstance
76
+ # @param [String] subaccount_sid The subaccount_sid
77
+ # @return [SettingInstance] Fetched SettingInstance
78
+ def fetch(subaccount_sid: :unset)
79
+ params = Twilio::Values.of({'SubaccountSid' => subaccount_sid, })
80
+
81
+ payload = @version.fetch('GET', @uri, params: params)
82
+
83
+ SettingInstance.new(@version, payload, )
84
+ end
85
+
86
+ ##
87
+ # Update the SettingInstance
88
+ # @param [Boolean] advanced_features The advanced_features
89
+ # @param [Boolean] voice_trace The voice_trace
90
+ # @param [String] subaccount_sid The subaccount_sid
91
+ # @return [SettingInstance] Updated SettingInstance
92
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
93
+ data = Twilio::Values.of({
94
+ 'AdvancedFeatures' => advanced_features,
95
+ 'VoiceTrace' => voice_trace,
96
+ 'SubaccountSid' => subaccount_sid,
97
+ })
98
+
99
+ payload = @version.update('POST', @uri, data: data)
100
+
101
+ SettingInstance.new(@version, payload, )
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
109
+ end
110
+
111
+ ##
112
+ # Provide a detailed, user friendly representation
113
+ def inspect
114
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Insights.V1.SettingContext #{context}>"
116
+ end
117
+ end
118
+
119
+ class SettingInstance < InstanceResource
120
+ ##
121
+ # Initialize the SettingInstance
122
+ # @param [Version] version Version that contains the resource
123
+ # @param [Hash] payload payload that contains response from Twilio
124
+ # @return [SettingInstance] SettingInstance
125
+ def initialize(version, payload)
126
+ super(version)
127
+
128
+ # Marshaled Properties
129
+ @properties = {
130
+ 'account_sid' => payload['account_sid'],
131
+ 'advanced_features' => payload['advanced_features'],
132
+ 'voice_trace' => payload['voice_trace'],
133
+ 'url' => payload['url'],
134
+ }
135
+
136
+ # Context
137
+ @instance_context = nil
138
+ @params = {}
139
+ end
140
+
141
+ ##
142
+ # Generate an instance context for the instance, the context is capable of
143
+ # performing various actions. All instance actions are proxied to the context
144
+ # @return [SettingContext] SettingContext for this SettingInstance
145
+ def context
146
+ unless @instance_context
147
+ @instance_context = SettingContext.new(@version, )
148
+ end
149
+ @instance_context
150
+ end
151
+
152
+ ##
153
+ # @return [String] The account_sid
154
+ def account_sid
155
+ @properties['account_sid']
156
+ end
157
+
158
+ ##
159
+ # @return [Boolean] The advanced_features
160
+ def advanced_features
161
+ @properties['advanced_features']
162
+ end
163
+
164
+ ##
165
+ # @return [Boolean] The voice_trace
166
+ def voice_trace
167
+ @properties['voice_trace']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The url
172
+ def url
173
+ @properties['url']
174
+ end
175
+
176
+ ##
177
+ # Fetch the SettingInstance
178
+ # @param [String] subaccount_sid The subaccount_sid
179
+ # @return [SettingInstance] Fetched SettingInstance
180
+ def fetch(subaccount_sid: :unset)
181
+ context.fetch(subaccount_sid: subaccount_sid, )
182
+ end
183
+
184
+ ##
185
+ # Update the SettingInstance
186
+ # @param [Boolean] advanced_features The advanced_features
187
+ # @param [Boolean] voice_trace The voice_trace
188
+ # @param [String] subaccount_sid The subaccount_sid
189
+ # @return [SettingInstance] Updated SettingInstance
190
+ def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
191
+ context.update(
192
+ advanced_features: advanced_features,
193
+ voice_trace: voice_trace,
194
+ subaccount_sid: subaccount_sid,
195
+ )
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
202
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
203
+ end
204
+
205
+ ##
206
+ # Provide a detailed, user friendly representation
207
+ def inspect
208
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
209
+ "<Twilio.Insights.V1.SettingInstance #{values}>"
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -15,11 +15,19 @@ module Twilio
15
15
  def initialize(domain)
16
16
  super
17
17
  @version = 'v1'
18
+ @settings = nil
18
19
  @calls = nil
19
20
  @call_summaries = nil
21
+ @conferences = nil
20
22
  @rooms = nil
21
23
  end
22
24
 
25
+ ##
26
+ # @return [Twilio::REST::Insights::V1::SettingContext]
27
+ def settings
28
+ @settings ||= SettingContext.new self
29
+ end
30
+
23
31
  ##
24
32
  # @param [String] sid The sid
25
33
  # @return [Twilio::REST::Insights::V1::CallContext] if sid was passed.
@@ -41,6 +49,21 @@ module Twilio
41
49
  @call_summaries ||= CallSummariesList.new self
42
50
  end
43
51
 
52
+ ##
53
+ # @param [String] conference_sid The unique SID identifier of the Conference.
54
+ # @return [Twilio::REST::Insights::V1::ConferenceContext] if conference_sid was passed.
55
+ # @return [Twilio::REST::Insights::V1::ConferenceList]
56
+ def conferences(conference_sid=:unset)
57
+ if conference_sid.nil?
58
+ raise ArgumentError, 'conference_sid cannot be nil'
59
+ end
60
+ if conference_sid == :unset
61
+ @conferences ||= ConferenceList.new self
62
+ else
63
+ ConferenceContext.new(self, conference_sid)
64
+ end
65
+ end
66
+
44
67
  ##
45
68
  # @param [String] room_sid The SID of the Room resource.
46
69
  # @return [Twilio::REST::Insights::V1::RoomContext] if room_sid was passed.
@@ -28,6 +28,12 @@ module Twilio
28
28
  @v1 ||= V1.new self
29
29
  end
30
30
 
31
+ ##
32
+ # @return [Twilio::REST::Insights::V1::SettingInstance]
33
+ def settings
34
+ self.v1.settings()
35
+ end
36
+
31
37
  ##
32
38
  # @param [String] sid The sid
33
39
  # @return [Twilio::REST::Insights::V1::CallInstance] if sid was passed.
@@ -42,6 +48,14 @@ module Twilio
42
48
  self.v1.call_summaries()
43
49
  end
44
50
 
51
+ ##
52
+ # @param [String] conference_sid The unique SID identifier of the Conference.
53
+ # @return [Twilio::REST::Insights::V1::ConferenceInstance] if conference_sid was passed.
54
+ # @return [Twilio::REST::Insights::V1::ConferenceList]
55
+ def conferences(conference_sid=:unset)
56
+ self.v1.conferences(conference_sid)
57
+ end
58
+
45
59
  ##
46
60
  # @param [String] room_sid Unique identifier for the room.
47
61
  # @return [Twilio::REST::Insights::V1::RoomInstance] if room_sid was passed.
@@ -42,14 +42,20 @@ module Twilio
42
42
  # Callbacks}[/docs/live/status-callbacks] for details.
43
43
  # @param [String] status_callback_method The HTTP method Twilio should use to call
44
44
  # the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
45
+ # @param [String] max_duration The maximum time, in seconds, that the
46
+ # MediaProcessor can run before automatically ends. The default value is 300
47
+ # seconds, and the maximum value is 90000 seconds. Once this maximum duration is
48
+ # reached, Twilio will end the MediaProcessor, regardless of whether media is
49
+ # still streaming.
45
50
  # @return [MediaProcessorInstance] Created MediaProcessorInstance
46
- def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset)
51
+ def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset, max_duration: :unset)
47
52
  data = Twilio::Values.of({
48
53
  'Extension' => extension,
49
54
  'ExtensionContext' => extension_context,
50
55
  'ExtensionEnvironment' => Twilio.serialize_object(extension_environment),
51
56
  'StatusCallback' => status_callback,
52
57
  'StatusCallbackMethod' => status_callback_method,
58
+ 'MaxDuration' => max_duration,
53
59
  })
54
60
 
55
61
  payload = @version.create('POST', @uri, data: data)
@@ -264,6 +270,7 @@ module Twilio
264
270
  'ended_reason' => payload['ended_reason'],
265
271
  'status_callback' => payload['status_callback'],
266
272
  'status_callback_method' => payload['status_callback_method'],
273
+ 'max_duration' => payload['max_duration'].to_i,
267
274
  }
268
275
 
269
276
  # Context
@@ -348,6 +355,12 @@ module Twilio
348
355
  @properties['status_callback_method']
349
356
  end
350
357
 
358
+ ##
359
+ # @return [String] Maximum MediaProcessor duration in minutes
360
+ def max_duration
361
+ @properties['max_duration']
362
+ end
363
+
351
364
  ##
352
365
  # Fetch the MediaProcessorInstance
353
366
  # @return [MediaProcessorInstance] Fetched MediaProcessorInstance
@@ -198,6 +198,15 @@ module Twilio
198
198
  BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
199
199
  end
200
200
 
201
+ ##
202
+ # Update the BrandRegistrationInstance
203
+ # @return [BrandRegistrationInstance] Updated BrandRegistrationInstance
204
+ def update
205
+ payload = @version.update('POST', @uri)
206
+
207
+ BrandRegistrationInstance.new(@version, payload, sid: @solution[:sid], )
208
+ end
209
+
201
210
  ##
202
211
  # Access the brand_vettings
203
212
  # @return [BrandVettingList]
@@ -260,6 +269,7 @@ module Twilio
260
269
  'brand_feedback' => payload['brand_feedback'],
261
270
  'identity_status' => payload['identity_status'],
262
271
  'russell_3000' => payload['russell_3000'],
272
+ 'government_entity' => payload['government_entity'],
263
273
  'tax_exempt_status' => payload['tax_exempt_status'],
264
274
  'skip_automatic_sec_vet' => payload['skip_automatic_sec_vet'],
265
275
  'mock' => payload['mock'],
@@ -372,6 +382,12 @@ module Twilio
372
382
  @properties['russell_3000']
373
383
  end
374
384
 
385
+ ##
386
+ # @return [Boolean] Government Entity
387
+ def government_entity
388
+ @properties['government_entity']
389
+ end
390
+
375
391
  ##
376
392
  # @return [String] Tax Exempt Status
377
393
  def tax_exempt_status
@@ -403,6 +419,13 @@ module Twilio
403
419
  context.fetch
404
420
  end
405
421
 
422
+ ##
423
+ # Update the BrandRegistrationInstance
424
+ # @return [BrandRegistrationInstance] Updated BrandRegistrationInstance
425
+ def update
426
+ context.update
427
+ end
428
+
406
429
  ##
407
430
  # Access the brand_vettings
408
431
  # @return [brand_vettings] brand_vettings
@@ -42,6 +42,86 @@ module Twilio
42
42
  BundleCopyInstance.new(@version, payload, bundle_sid: @solution[:bundle_sid], )
43
43
  end
44
44
 
45
+ ##
46
+ # Lists BundleCopyInstance records from the API as a list.
47
+ # Unlike stream(), this operation is eager and will load `limit` records into
48
+ # memory before returning.
49
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
50
+ # guarantees to never return more than limit. Default is no limit
51
+ # @param [Integer] page_size Number of records to fetch per request, when
52
+ # not set will use the default value of 50 records. If no page_size is defined
53
+ # but a limit is defined, stream() will attempt to read the limit with the most
54
+ # efficient page size, i.e. min(limit, 1000)
55
+ # @return [Array] Array of up to limit results
56
+ def list(limit: nil, page_size: nil)
57
+ self.stream(limit: limit, page_size: page_size).entries
58
+ end
59
+
60
+ ##
61
+ # Streams BundleCopyInstance records from the API as an Enumerable.
62
+ # This operation lazily loads records as efficiently as possible until the limit
63
+ # is reached.
64
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
65
+ # guarantees to never return more than limit. Default is no limit.
66
+ # @param [Integer] page_size Number of records to fetch per request, when
67
+ # not set will use the default value of 50 records. If no page_size is defined
68
+ # but a limit is defined, stream() will attempt to read the limit with the most
69
+ # efficient page size, i.e. min(limit, 1000)
70
+ # @return [Enumerable] Enumerable that will yield up to limit results
71
+ def stream(limit: nil, page_size: nil)
72
+ limits = @version.read_limits(limit, page_size)
73
+
74
+ page = self.page(page_size: limits[:page_size], )
75
+
76
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
77
+ end
78
+
79
+ ##
80
+ # When passed a block, yields BundleCopyInstance records from the API.
81
+ # This operation lazily loads records as efficiently as possible until the limit
82
+ # is reached.
83
+ def each
84
+ limits = @version.read_limits
85
+
86
+ page = self.page(page_size: limits[:page_size], )
87
+
88
+ @version.stream(page,
89
+ limit: limits[:limit],
90
+ page_limit: limits[:page_limit]).each {|x| yield x}
91
+ end
92
+
93
+ ##
94
+ # Retrieve a single page of BundleCopyInstance records from the API.
95
+ # Request is executed immediately.
96
+ # @param [String] page_token PageToken provided by the API
97
+ # @param [Integer] page_number Page Number, this value is simply for client state
98
+ # @param [Integer] page_size Number of records to return, defaults to 50
99
+ # @return [Page] Page of BundleCopyInstance
100
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
101
+ params = Twilio::Values.of({
102
+ 'PageToken' => page_token,
103
+ 'Page' => page_number,
104
+ 'PageSize' => page_size,
105
+ })
106
+
107
+ response = @version.page('GET', @uri, params: params)
108
+
109
+ BundleCopyPage.new(@version, response, @solution)
110
+ end
111
+
112
+ ##
113
+ # Retrieve a single page of BundleCopyInstance records from the API.
114
+ # Request is executed immediately.
115
+ # @param [String] target_url API-generated URL for the requested results page
116
+ # @return [Page] Page of BundleCopyInstance
117
+ def get_page(target_url)
118
+ response = @version.domain.request(
119
+ 'GET',
120
+ target_url
121
+ )
122
+ BundleCopyPage.new(@version, response, @solution)
123
+ end
124
+
45
125
  ##
46
126
  # Provide a user friendly representation
47
127
  def to_s
@@ -64,15 +64,28 @@ module Twilio
64
64
  # Unlike stream(), this operation is eager and will load `limit` records into
65
65
  # memory before returning.
66
66
  # @param [bundle.Status] status The verification status of the Bundle resource.
67
+ # Please refer to {Bundle
68
+ # Statuses}[https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses]
69
+ # for more details.
67
70
  # @param [String] friendly_name The string that you assigned to describe the
68
- # resource.
69
- # @param [String] regulation_sid The unique string of a regulation that is
70
- # associated to the Bundle resource.
71
- # @param [String] iso_country The {ISO country
71
+ # resource. The column can contain 255 variable characters.
72
+ # @param [String] regulation_sid The unique string of a {Regulation
73
+ # resource}[https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations]
74
+ # that is associated to the Bundle resource.
75
+ # @param [String] iso_country The 2-digit {ISO country
72
76
  # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
73
77
  # number country ownership request.
74
78
  # @param [String] number_type The type of phone number of the Bundle's ownership
75
- # request. Can be `local`, `mobile`, `national`, or `toll free`.
79
+ # request. Can be `local`, `mobile`, `national`, or `tollfree`.
80
+ # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid
81
+ # Bundle until a specified expiration date.
82
+ # @param [bundle.SortBy] sort_by Can be `ValidUntilDate` or `DateUpdated`.
83
+ # Defaults to `DateCreated`
84
+ # @param [bundle.SortDirection] sort_direction Default is `DESC`. Can be `ASC` or
85
+ # `DESC`.
86
+ # @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.
87
+ # @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.
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.
76
89
  # @param [Integer] limit Upper limit for the number of records to return. stream()
77
90
  # guarantees to never return more than limit. Default is no limit
78
91
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -80,13 +93,19 @@ module Twilio
80
93
  # but a limit is defined, stream() will attempt to read the limit with the most
81
94
  # efficient page size, i.e. min(limit, 1000)
82
95
  # @return [Array] Array of up to limit results
83
- def list(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :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_before: :unset, valid_until_date: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
84
97
  self.stream(
85
98
  status: status,
86
99
  friendly_name: friendly_name,
87
100
  regulation_sid: regulation_sid,
88
101
  iso_country: iso_country,
89
102
  number_type: number_type,
103
+ has_valid_until_date: has_valid_until_date,
104
+ sort_by: sort_by,
105
+ sort_direction: sort_direction,
106
+ valid_until_date_before: valid_until_date_before,
107
+ valid_until_date: valid_until_date,
108
+ valid_until_date_after: valid_until_date_after,
90
109
  limit: limit,
91
110
  page_size: page_size
92
111
  ).entries
@@ -97,15 +116,28 @@ module Twilio
97
116
  # This operation lazily loads records as efficiently as possible until the limit
98
117
  # is reached.
99
118
  # @param [bundle.Status] status The verification status of the Bundle resource.
119
+ # Please refer to {Bundle
120
+ # Statuses}[https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses]
121
+ # for more details.
100
122
  # @param [String] friendly_name The string that you assigned to describe the
101
- # resource.
102
- # @param [String] regulation_sid The unique string of a regulation that is
103
- # associated to the Bundle resource.
104
- # @param [String] iso_country The {ISO country
123
+ # resource. The column can contain 255 variable characters.
124
+ # @param [String] regulation_sid The unique string of a {Regulation
125
+ # resource}[https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations]
126
+ # that is associated to the Bundle resource.
127
+ # @param [String] iso_country The 2-digit {ISO country
105
128
  # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
106
129
  # number country ownership request.
107
130
  # @param [String] number_type The type of phone number of the Bundle's ownership
108
- # request. Can be `local`, `mobile`, `national`, or `toll free`.
131
+ # request. Can be `local`, `mobile`, `national`, or `tollfree`.
132
+ # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid
133
+ # Bundle until a specified expiration date.
134
+ # @param [bundle.SortBy] sort_by Can be `ValidUntilDate` or `DateUpdated`.
135
+ # Defaults to `DateCreated`
136
+ # @param [bundle.SortDirection] sort_direction Default is `DESC`. Can be `ASC` or
137
+ # `DESC`.
138
+ # @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.
139
+ # @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.
140
+ # @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.
109
141
  # @param [Integer] limit Upper limit for the number of records to return. stream()
110
142
  # guarantees to never return more than limit. Default is no limit.
111
143
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -113,7 +145,7 @@ module Twilio
113
145
  # but a limit is defined, stream() will attempt to read the limit with the most
114
146
  # efficient page size, i.e. min(limit, 1000)
115
147
  # @return [Enumerable] Enumerable that will yield up to limit results
116
- def stream(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, limit: nil, page_size: nil)
148
+ 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_before: :unset, valid_until_date: :unset, valid_until_date_after: :unset, limit: nil, page_size: nil)
117
149
  limits = @version.read_limits(limit, page_size)
118
150
 
119
151
  page = self.page(
@@ -122,6 +154,12 @@ module Twilio
122
154
  regulation_sid: regulation_sid,
123
155
  iso_country: iso_country,
124
156
  number_type: number_type,
157
+ has_valid_until_date: has_valid_until_date,
158
+ sort_by: sort_by,
159
+ sort_direction: sort_direction,
160
+ valid_until_date_before: valid_until_date_before,
161
+ valid_until_date: valid_until_date,
162
+ valid_until_date_after: valid_until_date_after,
125
163
  page_size: limits[:page_size],
126
164
  )
127
165
 
@@ -146,26 +184,45 @@ module Twilio
146
184
  # Retrieve a single page of BundleInstance records from the API.
147
185
  # Request is executed immediately.
148
186
  # @param [bundle.Status] status The verification status of the Bundle resource.
187
+ # Please refer to {Bundle
188
+ # Statuses}[https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses]
189
+ # for more details.
149
190
  # @param [String] friendly_name The string that you assigned to describe the
150
- # resource.
151
- # @param [String] regulation_sid The unique string of a regulation that is
152
- # associated to the Bundle resource.
153
- # @param [String] iso_country The {ISO country
191
+ # resource. The column can contain 255 variable characters.
192
+ # @param [String] regulation_sid The unique string of a {Regulation
193
+ # resource}[https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations]
194
+ # that is associated to the Bundle resource.
195
+ # @param [String] iso_country The 2-digit {ISO country
154
196
  # code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the Bundle's phone
155
197
  # number country ownership request.
156
198
  # @param [String] number_type The type of phone number of the Bundle's ownership
157
- # request. Can be `local`, `mobile`, `national`, or `toll free`.
199
+ # request. Can be `local`, `mobile`, `national`, or `tollfree`.
200
+ # @param [Boolean] has_valid_until_date Indicates that the Bundle is a valid
201
+ # Bundle until a specified expiration date.
202
+ # @param [bundle.SortBy] sort_by Can be `ValidUntilDate` or `DateUpdated`.
203
+ # Defaults to `DateCreated`
204
+ # @param [bundle.SortDirection] sort_direction Default is `DESC`. Can be `ASC` or
205
+ # `DESC`.
206
+ # @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.
207
+ # @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.
208
+ # @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.
158
209
  # @param [String] page_token PageToken provided by the API
159
210
  # @param [Integer] page_number Page Number, this value is simply for client state
160
211
  # @param [Integer] page_size Number of records to return, defaults to 50
161
212
  # @return [Page] Page of BundleInstance
162
- def page(status: :unset, friendly_name: :unset, regulation_sid: :unset, iso_country: :unset, number_type: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
213
+ 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_before: :unset, valid_until_date: :unset, valid_until_date_after: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
163
214
  params = Twilio::Values.of({
164
215
  'Status' => status,
165
216
  'FriendlyName' => friendly_name,
166
217
  'RegulationSid' => regulation_sid,
167
218
  'IsoCountry' => iso_country,
168
219
  'NumberType' => number_type,
220
+ 'HasValidUntilDate' => has_valid_until_date,
221
+ 'SortBy' => sort_by,
222
+ 'SortDirection' => sort_direction,
223
+ 'ValidUntilDate<' => Twilio.serialize_iso8601_datetime(valid_until_date_before),
224
+ 'ValidUntilDate' => Twilio.serialize_iso8601_datetime(valid_until_date),
225
+ 'ValidUntilDate>' => Twilio.serialize_iso8601_datetime(valid_until_date_after),
169
226
  'PageToken' => page_token,
170
227
  'Page' => page_number,
171
228
  'PageSize' => page_size,