twilio-ruby 5.65.0 → 5.65.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e90fafb6816881836f5ceb1a9e9fbf4c8ab7b1f
4
- data.tar.gz: 8506a936bb4d704851066cc99577b3a897a4c61a
3
+ metadata.gz: d8c2b361aa0bcd563896d6fd8ef7d05b8190b5b8
4
+ data.tar.gz: aa8937ed8cdd6e0028547310216ef1735a4c80ea
5
5
  SHA512:
6
- metadata.gz: 6ed63525ff5e54ea2002e696432752125a26a80a3d0a73959d98e96247e09e9845906bc62d9b86a5026eef22fc05a36ab1dc3555d30c91db0ef3a442e78d18a8
7
- data.tar.gz: cef0e7825363d18d6dae30e3ab444a9e1bd8187dcc46361f99c51d0258b161b693a4cbe600a259342109ef591f7649c4dc6ed7ad54788a119b4e27e4b3e3c29a
6
+ metadata.gz: a82d6f932c04746c60217ec81ef4b5708fbbcb4df2fff128a5d01933d4bb86fa45c464805da63ca96c6e0bf8c2ca1cf75d9aea18f799f674b8674aae65b45d32
7
+ data.tar.gz: 6a0ff25c7f663d9c51390deb16e9fe3f37b98ebc1fc5d7ccf973ef61bfb6655b37411da34543072cab27d8c13a5847bcceb62fe3110e1b9f785cd81ea212bf6f
@@ -105,6 +105,11 @@ jobs:
105
105
  gem build *.gemspec
106
106
  gem push *.gem
107
107
 
108
+ - name: Submit metric to Datadog
109
+ uses: sendgrid/dx-automator/actions/datadog-release-metric@main
110
+ env:
111
+ DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
112
+
108
113
  notify-on-failure:
109
114
  name: Slack notify on failure
110
115
  if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag')
data/CHANGES.md CHANGED
@@ -1,6 +1,29 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2022-03-09] Version 5.65.1
5
+ ---------------------------
6
+ **Library - Fix**
7
+ - [PR #602](https://github.com/twilio/twilio-ruby/pull/602): don't load webhook authentication if Rack not present. Thanks to [@philnash](https://github.com/philnash)!
8
+
9
+ **Library - Chore**
10
+ - [PR #599](https://github.com/twilio/twilio-ruby/pull/599): push Datadog Release Metric upon deploy success. Thanks to [@eshanholtz](https://github.com/eshanholtz)!
11
+
12
+ **Api**
13
+ - Add optional boolean include_soft_deleted parameter to retrieve soft deleted recordings
14
+
15
+ **Chat**
16
+ - Add `X-Twilio-Wehook-Enabled` header to `delete` method in UserChannel resource
17
+
18
+ **Numbers**
19
+ - Expose `failure_reason` in the Supporting Documents resources
20
+
21
+ **Verify**
22
+ - Add optional `metadata` parameter to "verify challenge" endpoint, so the SDK/App can attach relevant information from the device when responding to challenges.
23
+ - remove beta feature flag to list atempt api operations.
24
+ - Add `ttl` and `date_created` properties to `AccessTokens`.
25
+
26
+
4
27
  [2022-02-23] Version 5.65.0
5
28
  ---------------------------
6
29
  **Api**
data/README.md CHANGED
@@ -36,13 +36,13 @@ This library supports the following Ruby implementations:
36
36
  To install using [Bundler][bundler] grab the latest stable version:
37
37
 
38
38
  ```ruby
39
- gem 'twilio-ruby', '~> 5.65.0'
39
+ gem 'twilio-ruby', '~> 5.65.1'
40
40
  ```
41
41
 
42
42
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
43
43
 
44
44
  ```bash
45
- gem install twilio-ruby -v 5.65.0
45
+ gem install twilio-ruby -v 5.65.1
46
46
  ```
47
47
 
48
48
  To build and install the development branch yourself from the latest source:
@@ -39,6 +39,9 @@ module Twilio
39
39
  # to read.
40
40
  # @param [String] conference_sid The Conference SID that identifies the conference
41
41
  # associated with the recording to read.
42
+ # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
43
+ # retrieve soft deleted recordings or not. Recordings are kept after deletion for
44
+ # a retention period of 40 days.
42
45
  # @param [Integer] limit Upper limit for the number of records to return. stream()
43
46
  # guarantees to never return more than limit. Default is no limit
44
47
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -46,13 +49,14 @@ module Twilio
46
49
  # but a limit is defined, stream() will attempt to read the limit with the most
47
50
  # efficient page size, i.e. min(limit, 1000)
48
51
  # @return [Array] Array of up to limit results
49
- def list(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, limit: nil, page_size: nil)
52
+ def list(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, include_soft_deleted: :unset, limit: nil, page_size: nil)
50
53
  self.stream(
51
54
  date_created_before: date_created_before,
52
55
  date_created: date_created,
53
56
  date_created_after: date_created_after,
54
57
  call_sid: call_sid,
55
58
  conference_sid: conference_sid,
59
+ include_soft_deleted: include_soft_deleted,
56
60
  limit: limit,
57
61
  page_size: page_size
58
62
  ).entries
@@ -70,6 +74,9 @@ module Twilio
70
74
  # to read.
71
75
  # @param [String] conference_sid The Conference SID that identifies the conference
72
76
  # associated with the recording to read.
77
+ # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
78
+ # retrieve soft deleted recordings or not. Recordings are kept after deletion for
79
+ # a retention period of 40 days.
73
80
  # @param [Integer] limit Upper limit for the number of records to return. stream()
74
81
  # guarantees to never return more than limit. Default is no limit.
75
82
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -77,7 +84,7 @@ module Twilio
77
84
  # but a limit is defined, stream() will attempt to read the limit with the most
78
85
  # efficient page size, i.e. min(limit, 1000)
79
86
  # @return [Enumerable] Enumerable that will yield up to limit results
80
- def stream(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, limit: nil, page_size: nil)
87
+ def stream(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, include_soft_deleted: :unset, limit: nil, page_size: nil)
81
88
  limits = @version.read_limits(limit, page_size)
82
89
 
83
90
  page = self.page(
@@ -86,6 +93,7 @@ module Twilio
86
93
  date_created_after: date_created_after,
87
94
  call_sid: call_sid,
88
95
  conference_sid: conference_sid,
96
+ include_soft_deleted: include_soft_deleted,
89
97
  page_size: limits[:page_size],
90
98
  )
91
99
 
@@ -117,17 +125,21 @@ module Twilio
117
125
  # to read.
118
126
  # @param [String] conference_sid The Conference SID that identifies the conference
119
127
  # associated with the recording to read.
128
+ # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
129
+ # retrieve soft deleted recordings or not. Recordings are kept after deletion for
130
+ # a retention period of 40 days.
120
131
  # @param [String] page_token PageToken provided by the API
121
132
  # @param [Integer] page_number Page Number, this value is simply for client state
122
133
  # @param [Integer] page_size Number of records to return, defaults to 50
123
134
  # @return [Page] Page of RecordingInstance
124
- def page(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
135
+ def page(date_created_before: :unset, date_created: :unset, date_created_after: :unset, call_sid: :unset, conference_sid: :unset, include_soft_deleted: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
125
136
  params = Twilio::Values.of({
126
137
  'DateCreated<' => Twilio.serialize_iso8601_datetime(date_created_before),
127
138
  'DateCreated' => Twilio.serialize_iso8601_datetime(date_created),
128
139
  'DateCreated>' => Twilio.serialize_iso8601_datetime(date_created_after),
129
140
  'CallSid' => call_sid,
130
141
  'ConferenceSid' => conference_sid,
142
+ 'IncludeSoftDeleted' => include_soft_deleted,
131
143
  'PageToken' => page_token,
132
144
  'Page' => page_number,
133
145
  'PageSize' => page_size,
@@ -211,9 +223,14 @@ module Twilio
211
223
 
212
224
  ##
213
225
  # Fetch the RecordingInstance
226
+ # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
227
+ # retrieve soft deleted recordings or not. Recordings are kept after deletion for
228
+ # a retention period of 40 days.
214
229
  # @return [RecordingInstance] Fetched RecordingInstance
215
- def fetch
216
- payload = @version.fetch('GET', @uri)
230
+ def fetch(include_soft_deleted: :unset)
231
+ params = Twilio::Values.of({'IncludeSoftDeleted' => include_soft_deleted, })
232
+
233
+ payload = @version.fetch('GET', @uri, params: params)
217
234
 
218
235
  RecordingInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
219
236
  end
@@ -446,9 +463,12 @@ module Twilio
446
463
 
447
464
  ##
448
465
  # Fetch the RecordingInstance
466
+ # @param [Boolean] include_soft_deleted A boolean parameter indicating whether to
467
+ # retrieve soft deleted recordings or not. Recordings are kept after deletion for
468
+ # a retention period of 40 days.
449
469
  # @return [RecordingInstance] Fetched RecordingInstance
450
- def fetch
451
- context.fetch
470
+ def fetch(include_soft_deleted: :unset)
471
+ context.fetch(include_soft_deleted: include_soft_deleted, )
452
472
  end
453
473
 
454
474
  ##
@@ -193,9 +193,13 @@ module Twilio
193
193
 
194
194
  ##
195
195
  # Delete the UserChannelInstance
196
+ # @param [user_channel.WebhookEnabledType] x_twilio_webhook_enabled The
197
+ # X-Twilio-Webhook-Enabled HTTP request header
196
198
  # @return [Boolean] true if delete succeeds, false otherwise
197
- def delete
198
- @version.delete('DELETE', @uri)
199
+ def delete(x_twilio_webhook_enabled: :unset)
200
+ headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, })
201
+
202
+ @version.delete('DELETE', @uri, headers: headers)
199
203
  end
200
204
 
201
205
  ##
@@ -377,9 +381,11 @@ module Twilio
377
381
 
378
382
  ##
379
383
  # Delete the UserChannelInstance
384
+ # @param [user_channel.WebhookEnabledType] x_twilio_webhook_enabled The
385
+ # X-Twilio-Webhook-Enabled HTTP request header
380
386
  # @return [Boolean] true if delete succeeds, false otherwise
381
- def delete
382
- context.delete
387
+ def delete(x_twilio_webhook_enabled: :unset)
388
+ context.delete(x_twilio_webhook_enabled: x_twilio_webhook_enabled, )
383
389
  end
384
390
 
385
391
  ##
@@ -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.
@@ -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
@@ -36,12 +36,15 @@ module Twilio
36
36
  # `push`
37
37
  # @param [String] factor_friendly_name The friendly name of the factor that is
38
38
  # going to be created with this access token
39
+ # @param [String] ttl How long, in seconds, the access token is valid. Can be an
40
+ # integer between 60 and 300. Default is 60.
39
41
  # @return [AccessTokenInstance] Created AccessTokenInstance
40
- def create(identity: nil, factor_type: nil, factor_friendly_name: :unset)
42
+ def create(identity: nil, factor_type: nil, factor_friendly_name: :unset, ttl: :unset)
41
43
  data = Twilio::Values.of({
42
44
  'Identity' => identity,
43
45
  'FactorType' => factor_type,
44
46
  'FactorFriendlyName' => factor_friendly_name,
47
+ 'Ttl' => ttl,
45
48
  })
46
49
 
47
50
  payload = @version.create('POST', @uri, data: data)
@@ -158,6 +161,8 @@ module Twilio
158
161
  'factor_friendly_name' => payload['factor_friendly_name'],
159
162
  'token' => payload['token'],
160
163
  'url' => payload['url'],
164
+ 'ttl' => payload['ttl'].to_i,
165
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
161
166
  }
162
167
 
163
168
  # Context
@@ -224,6 +229,18 @@ module Twilio
224
229
  @properties['url']
225
230
  end
226
231
 
232
+ ##
233
+ # @return [String] How long, in seconds, the access token is valid.
234
+ def ttl
235
+ @properties['ttl']
236
+ end
237
+
238
+ ##
239
+ # @return [Time] The date this access token was created
240
+ def date_created
241
+ @properties['date_created']
242
+ end
243
+
227
244
  ##
228
245
  # Fetch the AccessTokenInstance
229
246
  # @return [AccessTokenInstance] Fetched AccessTokenInstance
@@ -277,9 +277,16 @@ module Twilio
277
277
  # Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must
278
278
  # be between 3 and 8 characters long. For `Push` this value can be up to 5456
279
279
  # characters in length
280
+ # @param [Hash] metadata Custom metadata associated with the challenge. This is
281
+ # added by the Device/SDK directly to allow for the inclusion of device
282
+ # information. It must be a stringified JSON with only strings values eg. `{"os":
283
+ # "Android"}`. Can be up to 1024 characters in length.
280
284
  # @return [ChallengeInstance] Updated ChallengeInstance
281
- def update(auth_payload: :unset)
282
- data = Twilio::Values.of({'AuthPayload' => auth_payload, })
285
+ def update(auth_payload: :unset, metadata: :unset)
286
+ data = Twilio::Values.of({
287
+ 'AuthPayload' => auth_payload,
288
+ 'Metadata' => Twilio.serialize_object(metadata),
289
+ })
283
290
 
284
291
  payload = @version.update('POST', @uri, data: data)
285
292
 
@@ -358,6 +365,7 @@ module Twilio
358
365
  'responded_reason' => payload['responded_reason'],
359
366
  'details' => payload['details'],
360
367
  'hidden_details' => payload['hidden_details'],
368
+ 'metadata' => payload['metadata'],
361
369
  'factor_type' => payload['factor_type'],
362
370
  'url' => payload['url'],
363
371
  'links' => payload['links'],
@@ -468,6 +476,12 @@ module Twilio
468
476
  @properties['hidden_details']
469
477
  end
470
478
 
479
+ ##
480
+ # @return [Hash] Metadata of the challenge.
481
+ def metadata
482
+ @properties['metadata']
483
+ end
484
+
471
485
  ##
472
486
  # @return [challenge.FactorTypes] The Factor Type of this Challenge
473
487
  def factor_type
@@ -499,9 +513,13 @@ module Twilio
499
513
  # Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must
500
514
  # be between 3 and 8 characters long. For `Push` this value can be up to 5456
501
515
  # characters in length
516
+ # @param [Hash] metadata Custom metadata associated with the challenge. This is
517
+ # added by the Device/SDK directly to allow for the inclusion of device
518
+ # information. It must be a stringified JSON with only strings values eg. `{"os":
519
+ # "Android"}`. Can be up to 1024 characters in length.
502
520
  # @return [ChallengeInstance] Updated ChallengeInstance
503
- def update(auth_payload: :unset)
504
- context.update(auth_payload: auth_payload, )
521
+ def update(auth_payload: :unset, metadata: :unset)
522
+ context.update(auth_payload: auth_payload, metadata: metadata, )
505
523
  end
506
524
 
507
525
  ##
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.65.0'
2
+ VERSION = '5.65.1'
3
3
  end
data/lib/twilio-ruby.rb CHANGED
@@ -10,7 +10,7 @@ require 'time'
10
10
  require 'json'
11
11
 
12
12
  require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
13
- require 'rack/twilio_webhook_authentication'
13
+ require 'rack/twilio_webhook_authentication' if defined?(Rack)
14
14
 
15
15
  require 'twilio-ruby/util'
16
16
  require 'twilio-ruby/security/request_validator'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.65.0
4
+ version: 5.65.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twilio API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -470,6 +470,7 @@ files:
470
470
  - lib/twilio-ruby/rest/media.rb
471
471
  - lib/twilio-ruby/rest/media/v1.rb
472
472
  - lib/twilio-ruby/rest/media/v1/media_processor.rb
473
+ - lib/twilio-ruby/rest/media/v1/media_recording.rb
473
474
  - lib/twilio-ruby/rest/media/v1/player_streamer.rb
474
475
  - lib/twilio-ruby/rest/media/v1/player_streamer/playback_grant.rb
475
476
  - lib/twilio-ruby/rest/messaging.rb