twilio-ruby 5.63.1 → 5.65.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test-and-deploy.yml +7 -2
  3. data/CHANGES.md +81 -0
  4. data/README.md +3 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +7 -0
  6. data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +674 -0
  7. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +26 -0
  8. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +27 -7
  9. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +10 -4
  10. data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +447 -0
  11. data/lib/twilio-ruby/rest/conversations/v1.rb +17 -0
  12. data/lib/twilio-ruby/rest/conversations.rb +9 -0
  13. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -77
  14. data/lib/twilio-ruby/rest/insights/v1/conference/conference_participant.rb +56 -65
  15. data/lib/twilio-ruby/rest/insights/v1/conference.rb +82 -54
  16. data/lib/twilio-ruby/rest/insights/v1.rb +1 -1
  17. data/lib/twilio-ruby/rest/insights.rb +1 -1
  18. data/lib/twilio-ruby/rest/media/v1/media_recording.rb +385 -0
  19. data/lib/twilio-ruby/rest/media/v1.rb +16 -0
  20. data/lib/twilio-ruby/rest/media.rb +9 -0
  21. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +75 -18
  22. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document.rb +7 -0
  23. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +71 -30
  24. data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +1 -1
  25. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +9 -9
  26. data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +18 -1
  27. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +22 -4
  28. data/lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb +7 -0
  29. data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +16 -6
  30. data/lib/twilio-ruby/rest/verify/v2/template.rb +1 -1
  31. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +89 -21
  32. data/lib/twilio-ruby/rest/verify.rb +2 -2
  33. data/lib/twilio-ruby/rest/video/v1/room.rb +7 -4
  34. data/lib/twilio-ruby/version.rb +1 -1
  35. data/lib/twilio-ruby.rb +1 -1
  36. metadata +5 -2
@@ -0,0 +1,385 @@
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 Media < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
+ class MediaRecordingList < ListResource
16
+ ##
17
+ # Initialize the MediaRecordingList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [MediaRecordingList] MediaRecordingList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ @uri = "/MediaRecordings"
26
+ end
27
+
28
+ ##
29
+ # Lists MediaRecordingInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [media_recording.Order] order The sort order of the list by
33
+ # `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as
34
+ # the default.
35
+ # @param [media_recording.Status] status Status to filter by, with possible values
36
+ # `processing`, `completed`, `deleted`, or `failed`.
37
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
38
+ # guarantees to never return more than limit. Default is no limit
39
+ # @param [Integer] page_size Number of records to fetch per request, when
40
+ # not set will use the default value of 50 records. If no page_size is defined
41
+ # but a limit is defined, stream() will attempt to read the limit with the most
42
+ # efficient page size, i.e. min(limit, 1000)
43
+ # @return [Array] Array of up to limit results
44
+ def list(order: :unset, status: :unset, limit: nil, page_size: nil)
45
+ self.stream(order: order, status: status, limit: limit, page_size: page_size).entries
46
+ end
47
+
48
+ ##
49
+ # Streams MediaRecordingInstance records from the API as an Enumerable.
50
+ # This operation lazily loads records as efficiently as possible until the limit
51
+ # is reached.
52
+ # @param [media_recording.Order] order The sort order of the list by
53
+ # `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as
54
+ # the default.
55
+ # @param [media_recording.Status] status Status to filter by, with possible values
56
+ # `processing`, `completed`, `deleted`, or `failed`.
57
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
58
+ # guarantees to never return more than limit. Default is no limit.
59
+ # @param [Integer] page_size Number of records to fetch per request, when
60
+ # not set will use the default value of 50 records. If no page_size is defined
61
+ # but a limit is defined, stream() will attempt to read the limit with the most
62
+ # efficient page size, i.e. min(limit, 1000)
63
+ # @return [Enumerable] Enumerable that will yield up to limit results
64
+ def stream(order: :unset, status: :unset, limit: nil, page_size: nil)
65
+ limits = @version.read_limits(limit, page_size)
66
+
67
+ page = self.page(order: order, status: status, page_size: limits[:page_size], )
68
+
69
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
70
+ end
71
+
72
+ ##
73
+ # When passed a block, yields MediaRecordingInstance records from the API.
74
+ # This operation lazily loads records as efficiently as possible until the limit
75
+ # is reached.
76
+ def each
77
+ limits = @version.read_limits
78
+
79
+ page = self.page(page_size: limits[:page_size], )
80
+
81
+ @version.stream(page,
82
+ limit: limits[:limit],
83
+ page_limit: limits[:page_limit]).each {|x| yield x}
84
+ end
85
+
86
+ ##
87
+ # Retrieve a single page of MediaRecordingInstance records from the API.
88
+ # Request is executed immediately.
89
+ # @param [media_recording.Order] order The sort order of the list by
90
+ # `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as
91
+ # the default.
92
+ # @param [media_recording.Status] status Status to filter by, with possible values
93
+ # `processing`, `completed`, `deleted`, or `failed`.
94
+ # @param [String] page_token PageToken provided by the API
95
+ # @param [Integer] page_number Page Number, this value is simply for client state
96
+ # @param [Integer] page_size Number of records to return, defaults to 50
97
+ # @return [Page] Page of MediaRecordingInstance
98
+ def page(order: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
99
+ params = Twilio::Values.of({
100
+ 'Order' => order,
101
+ 'Status' => status,
102
+ 'PageToken' => page_token,
103
+ 'Page' => page_number,
104
+ 'PageSize' => page_size,
105
+ })
106
+
107
+ response = @version.page('GET', @uri, params: params)
108
+
109
+ MediaRecordingPage.new(@version, response, @solution)
110
+ end
111
+
112
+ ##
113
+ # Retrieve a single page of MediaRecordingInstance 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 MediaRecordingInstance
117
+ def get_page(target_url)
118
+ response = @version.domain.request(
119
+ 'GET',
120
+ target_url
121
+ )
122
+ MediaRecordingPage.new(@version, response, @solution)
123
+ end
124
+
125
+ ##
126
+ # Provide a user friendly representation
127
+ def to_s
128
+ '#<Twilio.Media.V1.MediaRecordingList>'
129
+ end
130
+ end
131
+
132
+ ##
133
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
134
+ class MediaRecordingPage < Page
135
+ ##
136
+ # Initialize the MediaRecordingPage
137
+ # @param [Version] version Version that contains the resource
138
+ # @param [Response] response Response from the API
139
+ # @param [Hash] solution Path solution for the resource
140
+ # @return [MediaRecordingPage] MediaRecordingPage
141
+ def initialize(version, response, solution)
142
+ super(version, response)
143
+
144
+ # Path Solution
145
+ @solution = solution
146
+ end
147
+
148
+ ##
149
+ # Build an instance of MediaRecordingInstance
150
+ # @param [Hash] payload Payload response from the API
151
+ # @return [MediaRecordingInstance] MediaRecordingInstance
152
+ def get_instance(payload)
153
+ MediaRecordingInstance.new(@version, payload, )
154
+ end
155
+
156
+ ##
157
+ # Provide a user friendly representation
158
+ def to_s
159
+ '<Twilio.Media.V1.MediaRecordingPage>'
160
+ end
161
+ end
162
+
163
+ ##
164
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
165
+ class MediaRecordingContext < InstanceContext
166
+ ##
167
+ # Initialize the MediaRecordingContext
168
+ # @param [Version] version Version that contains the resource
169
+ # @param [String] sid The SID of the MediaRecording resource to fetch.
170
+ # @return [MediaRecordingContext] MediaRecordingContext
171
+ def initialize(version, sid)
172
+ super(version)
173
+
174
+ # Path Solution
175
+ @solution = {sid: sid, }
176
+ @uri = "/MediaRecordings/#{@solution[:sid]}"
177
+ end
178
+
179
+ ##
180
+ # Delete the MediaRecordingInstance
181
+ # @return [Boolean] true if delete succeeds, false otherwise
182
+ def delete
183
+ @version.delete('DELETE', @uri)
184
+ end
185
+
186
+ ##
187
+ # Fetch the MediaRecordingInstance
188
+ # @return [MediaRecordingInstance] Fetched MediaRecordingInstance
189
+ def fetch
190
+ payload = @version.fetch('GET', @uri)
191
+
192
+ MediaRecordingInstance.new(@version, payload, sid: @solution[:sid], )
193
+ end
194
+
195
+ ##
196
+ # Provide a user friendly representation
197
+ def to_s
198
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
199
+ "#<Twilio.Media.V1.MediaRecordingContext #{context}>"
200
+ end
201
+
202
+ ##
203
+ # Provide a detailed, user friendly representation
204
+ def inspect
205
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
206
+ "#<Twilio.Media.V1.MediaRecordingContext #{context}>"
207
+ end
208
+ end
209
+
210
+ ##
211
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
212
+ class MediaRecordingInstance < InstanceResource
213
+ ##
214
+ # Initialize the MediaRecordingInstance
215
+ # @param [Version] version Version that contains the resource
216
+ # @param [Hash] payload payload that contains response from Twilio
217
+ # @param [String] sid The SID of the MediaRecording resource to fetch.
218
+ # @return [MediaRecordingInstance] MediaRecordingInstance
219
+ def initialize(version, payload, sid: nil)
220
+ super(version)
221
+
222
+ # Marshaled Properties
223
+ @properties = {
224
+ 'account_sid' => payload['account_sid'],
225
+ 'bitrate' => payload['bitrate'].to_i,
226
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
227
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
228
+ 'duration' => payload['duration'].to_i,
229
+ 'format' => payload['format'],
230
+ 'links' => payload['links'],
231
+ 'processor_sid' => payload['processor_sid'],
232
+ 'resolution' => payload['resolution'],
233
+ 'source_sid' => payload['source_sid'],
234
+ 'sid' => payload['sid'],
235
+ 'size' => payload['size'].to_i,
236
+ 'status' => payload['status'],
237
+ 'status_callback' => payload['status_callback'],
238
+ 'status_callback_method' => payload['status_callback_method'],
239
+ 'url' => payload['url'],
240
+ }
241
+
242
+ # Context
243
+ @instance_context = nil
244
+ @params = {'sid' => sid || @properties['sid'], }
245
+ end
246
+
247
+ ##
248
+ # Generate an instance context for the instance, the context is capable of
249
+ # performing various actions. All instance actions are proxied to the context
250
+ # @return [MediaRecordingContext] MediaRecordingContext for this MediaRecordingInstance
251
+ def context
252
+ unless @instance_context
253
+ @instance_context = MediaRecordingContext.new(@version, @params['sid'], )
254
+ end
255
+ @instance_context
256
+ end
257
+
258
+ ##
259
+ # @return [String] The SID of the Account that created the resource
260
+ def account_sid
261
+ @properties['account_sid']
262
+ end
263
+
264
+ ##
265
+ # @return [String] The bitrate of the media
266
+ def bitrate
267
+ @properties['bitrate']
268
+ end
269
+
270
+ ##
271
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
272
+ def date_created
273
+ @properties['date_created']
274
+ end
275
+
276
+ ##
277
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
278
+ def date_updated
279
+ @properties['date_updated']
280
+ end
281
+
282
+ ##
283
+ # @return [String] The duration of the MediaRecording
284
+ def duration
285
+ @properties['duration']
286
+ end
287
+
288
+ ##
289
+ # @return [media_recording.Format] The format of the MediaRecording
290
+ def format
291
+ @properties['format']
292
+ end
293
+
294
+ ##
295
+ # @return [String] The URLs of related resources
296
+ def links
297
+ @properties['links']
298
+ end
299
+
300
+ ##
301
+ # @return [String] The SID of the MediaProcessor
302
+ def processor_sid
303
+ @properties['processor_sid']
304
+ end
305
+
306
+ ##
307
+ # @return [String] The dimensions of the video image in pixels
308
+ def resolution
309
+ @properties['resolution']
310
+ end
311
+
312
+ ##
313
+ # @return [String] The SID of the resource that generated the original media
314
+ def source_sid
315
+ @properties['source_sid']
316
+ end
317
+
318
+ ##
319
+ # @return [String] The unique string that identifies the resource
320
+ def sid
321
+ @properties['sid']
322
+ end
323
+
324
+ ##
325
+ # @return [String] The size of the recording
326
+ def size
327
+ @properties['size']
328
+ end
329
+
330
+ ##
331
+ # @return [media_recording.Status] The status of the MediaRecording
332
+ def status
333
+ @properties['status']
334
+ end
335
+
336
+ ##
337
+ # @return [String] The URL to which Twilio will send MediaRecording event updates
338
+ def status_callback
339
+ @properties['status_callback']
340
+ end
341
+
342
+ ##
343
+ # @return [String] The HTTP method Twilio should use to call the `status_callback` URL
344
+ def status_callback_method
345
+ @properties['status_callback_method']
346
+ end
347
+
348
+ ##
349
+ # @return [String] The absolute URL of the resource
350
+ def url
351
+ @properties['url']
352
+ end
353
+
354
+ ##
355
+ # Delete the MediaRecordingInstance
356
+ # @return [Boolean] true if delete succeeds, false otherwise
357
+ def delete
358
+ context.delete
359
+ end
360
+
361
+ ##
362
+ # Fetch the MediaRecordingInstance
363
+ # @return [MediaRecordingInstance] Fetched MediaRecordingInstance
364
+ def fetch
365
+ context.fetch
366
+ end
367
+
368
+ ##
369
+ # Provide a user friendly representation
370
+ def to_s
371
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
372
+ "<Twilio.Media.V1.MediaRecordingInstance #{values}>"
373
+ end
374
+
375
+ ##
376
+ # Provide a detailed, user friendly representation
377
+ def inspect
378
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
379
+ "<Twilio.Media.V1.MediaRecordingInstance #{values}>"
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end
385
+ end
@@ -16,6 +16,7 @@ module Twilio
16
16
  super
17
17
  @version = 'v1'
18
18
  @media_processor = nil
19
+ @media_recording = nil
19
20
  @player_streamer = nil
20
21
  end
21
22
 
@@ -34,6 +35,21 @@ module Twilio
34
35
  end
35
36
  end
36
37
 
38
+ ##
39
+ # @param [String] sid The SID of the MediaRecording resource to fetch.
40
+ # @return [Twilio::REST::Media::V1::MediaRecordingContext] if sid was passed.
41
+ # @return [Twilio::REST::Media::V1::MediaRecordingList]
42
+ def media_recording(sid=:unset)
43
+ if sid.nil?
44
+ raise ArgumentError, 'sid cannot be nil'
45
+ end
46
+ if sid == :unset
47
+ @media_recording ||= MediaRecordingList.new self
48
+ else
49
+ MediaRecordingContext.new(self, sid)
50
+ end
51
+ end
52
+
37
53
  ##
38
54
  # @param [String] sid The SID of the PlayerStreamer resource to fetch.
39
55
  # @return [Twilio::REST::Media::V1::PlayerStreamerContext] if sid was passed.
@@ -37,6 +37,15 @@ module Twilio
37
37
  self.v1.media_processor(sid)
38
38
  end
39
39
 
40
+ ##
41
+ # @param [String] sid The unique string generated to identify the MediaRecording
42
+ # resource.
43
+ # @return [Twilio::REST::Media::V1::MediaRecordingInstance] if sid was passed.
44
+ # @return [Twilio::REST::Media::V1::MediaRecordingList]
45
+ def media_recording(sid=:unset)
46
+ self.v1.media_recording(sid)
47
+ end
48
+
40
49
  ##
41
50
  # @param [String] sid The unique string generated to identify the PlayerStreamer
42
51
  # resource.
@@ -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 `valid-until` or `date-updated`. Defaults
83
+ # to `date-created`.
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 `valid-until` or `date-updated`. Defaults
135
+ # to `date-created`.
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 `valid-until` or `date-updated`. Defaults
203
+ # to `date-created`.
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,
@@ -242,6 +242,7 @@ module Twilio
242
242
  'friendly_name' => payload['friendly_name'],
243
243
  'mime_type' => payload['mime_type'],
244
244
  'status' => payload['status'],
245
+ 'failure_reason' => payload['failure_reason'],
245
246
  'type' => payload['type'],
246
247
  'attributes' => payload['attributes'],
247
248
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
@@ -295,6 +296,12 @@ module Twilio
295
296
  @properties['status']
296
297
  end
297
298
 
299
+ ##
300
+ # @return [String] The failure reason of the Supporting Document Resource.
301
+ def failure_reason
302
+ @properties['failure_reason']
303
+ end
304
+
298
305
  ##
299
306
  # @return [String] The type of the Supporting Document
300
307
  def type