twilio-ruby 5.59.0 → 5.60.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 416d1c29fdeda590addf0bc8929befb23540a3cf775993f2ab89ed27b340dae3
4
- data.tar.gz: e779a8b50ef32067bdc24360a332e7a55e321012676504073901fcd44fd16ebb
3
+ metadata.gz: 449133db663db3b60cc607933b4783cb0aceaeae1d433b4ab0a49b3479a67e21
4
+ data.tar.gz: 9fb3a8f43bdcfa5fbe10924c2dcfd08c52ef5e81c65993c238987476e7743460
5
5
  SHA512:
6
- metadata.gz: d3a8c48365975f47830c676157d8b6ef8c8140727816f84c670985d604e5528562f4300ccbdf4b07c76191e2c14ceea3cce9707b5812c1904df10bea2d5a0c7e
7
- data.tar.gz: b58105471c3e9affa6df43a40047c6fa698e1121b2a568883ac2e4c038d1c21ce715b8c51a00ba013eb7c2a90249784308706e2266f49d07fef7186a664325f4
6
+ metadata.gz: 2378219ca67c2272011f66eff0327e903a99abe47b1cf770df03fe831d31e31efc39a6f84764a433b7159b0f2bb43ecf466665b58ca26507613c5037cc2bca2c
7
+ data.tar.gz: 439ea62d619c181d829a03e5f50e9d20c0271e479ef23abe8363478c09dfa1a25672627de7f3e5617570044af2f48e6250e8f3d87990bd2082a6460148ba2fd8
data/CHANGES.md CHANGED
@@ -1,6 +1,24 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2021-10-18] Version 5.60.0
5
+ ---------------------------
6
+ **Library - Feature**
7
+ - [PR #574](https://github.com/twilio/twilio-ruby/pull/574): Add PlaybackGrant. Thanks to [@sarahcstringer](https://github.com/sarahcstringer)!
8
+
9
+ **Api**
10
+ - Corrected enum values for `emergency_address_status` values in `/IncomingPhoneNumbers` response. **(breaking change)**
11
+ - Clarify `emergency_address_status` values in `/IncomingPhoneNumbers` response.
12
+
13
+ **Messaging**
14
+ - Add PUT and List brand vettings api
15
+ - Removes beta feature flag based visibility for us_app_to_person_registered and usecase field.Updates test cases to add POLITICAL usecase. **(breaking change)**
16
+ - Add brand_feedback as optional field to BrandRegistrations
17
+
18
+ **Video**
19
+ - Add `AudioOnly` to create room
20
+
21
+
4
22
  [2021-10-06] Version 5.59.0
5
23
  ---------------------------
6
24
  **Library - Fix**
data/README.md CHANGED
@@ -35,13 +35,13 @@ This library supports the following Ruby implementations:
35
35
  To install using [Bundler][bundler] grab the latest stable version:
36
36
 
37
37
  ```ruby
38
- gem 'twilio-ruby', '~> 5.59.0'
38
+ gem 'twilio-ruby', '~> 5.60.0'
39
39
  ```
40
40
 
41
41
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
42
42
 
43
43
  ```bash
44
- gem install twilio-ruby -v 5.59.0
44
+ gem install twilio-ruby -v 5.60.0
45
45
  ```
46
46
 
47
47
  To build and install the development branch yourself from the latest source:
@@ -267,6 +267,19 @@ module Twilio
267
267
  payload
268
268
  end
269
269
  end
270
+
271
+ class PlaybackGrant
272
+ include AccessTokenGrant
273
+ attr_accessor :grant
274
+
275
+ def _key
276
+ 'player'
277
+ end
278
+
279
+ def _generate_payload
280
+ grant
281
+ end
282
+ end
270
283
  end
271
284
  end
272
285
  end
@@ -331,6 +331,7 @@ module Twilio
331
331
  'voice_url' => payload['voice_url'],
332
332
  'emergency_status' => payload['emergency_status'],
333
333
  'emergency_address_sid' => payload['emergency_address_sid'],
334
+ 'emergency_address_status' => payload['emergency_address_status'],
334
335
  'bundle_sid' => payload['bundle_sid'],
335
336
  'status' => payload['status'],
336
337
  }
@@ -522,6 +523,12 @@ module Twilio
522
523
  @properties['emergency_address_sid']
523
524
  end
524
525
 
526
+ ##
527
+ # @return [local.EmergencyAddressStatus] State of the emergency address configuration for the phone number
528
+ def emergency_address_status
529
+ @properties['emergency_address_status']
530
+ end
531
+
525
532
  ##
526
533
  # @return [String] The SID of the Bundle resource associated with number
527
534
  def bundle_sid
@@ -330,6 +330,7 @@ module Twilio
330
330
  'voice_url' => payload['voice_url'],
331
331
  'emergency_status' => payload['emergency_status'],
332
332
  'emergency_address_sid' => payload['emergency_address_sid'],
333
+ 'emergency_address_status' => payload['emergency_address_status'],
333
334
  'bundle_sid' => payload['bundle_sid'],
334
335
  'status' => payload['status'],
335
336
  }
@@ -521,6 +522,12 @@ module Twilio
521
522
  @properties['emergency_address_sid']
522
523
  end
523
524
 
525
+ ##
526
+ # @return [mobile.EmergencyAddressStatus] State of the emergency address configuration for the phone number
527
+ def emergency_address_status
528
+ @properties['emergency_address_status']
529
+ end
530
+
524
531
  ##
525
532
  # @return [String] The SID of the Bundle resource associated with number
526
533
  def bundle_sid
@@ -330,6 +330,7 @@ module Twilio
330
330
  'voice_url' => payload['voice_url'],
331
331
  'emergency_status' => payload['emergency_status'],
332
332
  'emergency_address_sid' => payload['emergency_address_sid'],
333
+ 'emergency_address_status' => payload['emergency_address_status'],
333
334
  'bundle_sid' => payload['bundle_sid'],
334
335
  'status' => payload['status'],
335
336
  }
@@ -521,6 +522,12 @@ module Twilio
521
522
  @properties['emergency_address_sid']
522
523
  end
523
524
 
525
+ ##
526
+ # @return [toll_free.EmergencyAddressStatus] State of the emergency address configuration for the phone number
527
+ def emergency_address_status
528
+ @properties['emergency_address_status']
529
+ end
530
+
524
531
  ##
525
532
  # @return [String] The SID of the Bundle resource associated with number
526
533
  def bundle_sid
@@ -550,6 +550,7 @@ module Twilio
550
550
  'voice_url' => payload['voice_url'],
551
551
  'emergency_status' => payload['emergency_status'],
552
552
  'emergency_address_sid' => payload['emergency_address_sid'],
553
+ 'emergency_address_status' => payload['emergency_address_status'],
553
554
  'bundle_sid' => payload['bundle_sid'],
554
555
  'status' => payload['status'],
555
556
  }
@@ -756,6 +757,12 @@ module Twilio
756
757
  @properties['emergency_address_sid']
757
758
  end
758
759
 
760
+ ##
761
+ # @return [incoming_phone_number.EmergencyAddressStatus] State of the emergency address configuration for the phone number
762
+ def emergency_address_status
763
+ @properties['emergency_address_status']
764
+ end
765
+
759
766
  ##
760
767
  # @return [String] The SID of the Bundle resource associated with number
761
768
  def bundle_sid
@@ -41,6 +41,7 @@ module Twilio
41
41
  @insights = nil
42
42
  @ip_messaging = nil
43
43
  @lookups = nil
44
+ @media = nil
44
45
  @messaging = nil
45
46
  @monitor = nil
46
47
  @notify = nil
@@ -231,6 +232,12 @@ module Twilio
231
232
  @lookups ||= Lookups.new self
232
233
  end
233
234
 
235
+ ##
236
+ # Access the Media Twilio Domain
237
+ def media
238
+ @media ||= Media.new self
239
+ end
240
+
234
241
  ##
235
242
  # Access the Messaging Twilio Domain
236
243
  def messaging
@@ -0,0 +1,384 @@
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
+ class MediaProcessorList < ListResource
14
+ ##
15
+ # Initialize the MediaProcessorList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [MediaProcessorList] MediaProcessorList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/MediaProcessors"
24
+ end
25
+
26
+ ##
27
+ # Create the MediaProcessorInstance
28
+ # @param [String] extension The {Media
29
+ # Extension}[/docs/live/api/media-extensions-overview] name or URL. Ex:
30
+ # `video-composer-v1-preview`
31
+ # @param [String] extension_context The context of the Media Extension,
32
+ # represented as a JSON dictionary. See the documentation for the specific {Media
33
+ # Extension}[/docs/live/api/media-extensions-overview] you are using for more
34
+ # information about the context to send.
35
+ # @param [Hash] extension_environment User-defined environment variables for the
36
+ # Media Extension, represented as a JSON dictionary of key/value strings. See the
37
+ # documentation for the specific {Media
38
+ # Extension}[/docs/live/api/media-extensions-overview] you are using for more
39
+ # information about whether you need to provide this.
40
+ # @param [String] status_callback The URL to which Twilio will send asynchronous
41
+ # webhook requests for every MediaProcessor event. See {Status
42
+ # Callbacks}[/docs/live/status-callbacks] for details.
43
+ # @param [String] status_callback_method The HTTP method Twilio should use to call
44
+ # the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
45
+ # @return [MediaProcessorInstance] Created MediaProcessorInstance
46
+ def create(extension: nil, extension_context: nil, extension_environment: :unset, status_callback: :unset, status_callback_method: :unset)
47
+ data = Twilio::Values.of({
48
+ 'Extension' => extension,
49
+ 'ExtensionContext' => extension_context,
50
+ 'ExtensionEnvironment' => Twilio.serialize_object(extension_environment),
51
+ 'StatusCallback' => status_callback,
52
+ 'StatusCallbackMethod' => status_callback_method,
53
+ })
54
+
55
+ payload = @version.create('POST', @uri, data: data)
56
+
57
+ MediaProcessorInstance.new(@version, payload, )
58
+ end
59
+
60
+ ##
61
+ # Lists MediaProcessorInstance records from the API as a list.
62
+ # Unlike stream(), this operation is eager and will load `limit` records into
63
+ # memory before returning.
64
+ # @param [media_processor.Order] order The sort order of the list by
65
+ # `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as
66
+ # the default.
67
+ # @param [media_processor.Status] status Status to filter by, with possible values
68
+ # `started`, `ended` or `failed`.
69
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
70
+ # guarantees to never return more than limit. Default is no limit
71
+ # @param [Integer] page_size Number of records to fetch per request, when
72
+ # not set will use the default value of 50 records. If no page_size is defined
73
+ # but a limit is defined, stream() will attempt to read the limit with the most
74
+ # efficient page size, i.e. min(limit, 1000)
75
+ # @return [Array] Array of up to limit results
76
+ def list(order: :unset, status: :unset, limit: nil, page_size: nil)
77
+ self.stream(order: order, status: status, limit: limit, page_size: page_size).entries
78
+ end
79
+
80
+ ##
81
+ # Streams MediaProcessorInstance records from the API as an Enumerable.
82
+ # This operation lazily loads records as efficiently as possible until the limit
83
+ # is reached.
84
+ # @param [media_processor.Order] order The sort order of the list by
85
+ # `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as
86
+ # the default.
87
+ # @param [media_processor.Status] status Status to filter by, with possible values
88
+ # `started`, `ended` or `failed`.
89
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
90
+ # guarantees to never return more than limit. Default is no limit.
91
+ # @param [Integer] page_size Number of records to fetch per request, when
92
+ # not set will use the default value of 50 records. If no page_size is defined
93
+ # but a limit is defined, stream() will attempt to read the limit with the most
94
+ # efficient page size, i.e. min(limit, 1000)
95
+ # @return [Enumerable] Enumerable that will yield up to limit results
96
+ def stream(order: :unset, status: :unset, limit: nil, page_size: nil)
97
+ limits = @version.read_limits(limit, page_size)
98
+
99
+ page = self.page(order: order, status: status, page_size: limits[:page_size], )
100
+
101
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
102
+ end
103
+
104
+ ##
105
+ # When passed a block, yields MediaProcessorInstance records from the API.
106
+ # This operation lazily loads records as efficiently as possible until the limit
107
+ # is reached.
108
+ def each
109
+ limits = @version.read_limits
110
+
111
+ page = self.page(page_size: limits[:page_size], )
112
+
113
+ @version.stream(page,
114
+ limit: limits[:limit],
115
+ page_limit: limits[:page_limit]).each {|x| yield x}
116
+ end
117
+
118
+ ##
119
+ # Retrieve a single page of MediaProcessorInstance records from the API.
120
+ # Request is executed immediately.
121
+ # @param [media_processor.Order] order The sort order of the list by
122
+ # `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as
123
+ # the default.
124
+ # @param [media_processor.Status] status Status to filter by, with possible values
125
+ # `started`, `ended` or `failed`.
126
+ # @param [String] page_token PageToken provided by the API
127
+ # @param [Integer] page_number Page Number, this value is simply for client state
128
+ # @param [Integer] page_size Number of records to return, defaults to 50
129
+ # @return [Page] Page of MediaProcessorInstance
130
+ def page(order: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
131
+ params = Twilio::Values.of({
132
+ 'Order' => order,
133
+ 'Status' => status,
134
+ 'PageToken' => page_token,
135
+ 'Page' => page_number,
136
+ 'PageSize' => page_size,
137
+ })
138
+
139
+ response = @version.page('GET', @uri, params: params)
140
+
141
+ MediaProcessorPage.new(@version, response, @solution)
142
+ end
143
+
144
+ ##
145
+ # Retrieve a single page of MediaProcessorInstance records from the API.
146
+ # Request is executed immediately.
147
+ # @param [String] target_url API-generated URL for the requested results page
148
+ # @return [Page] Page of MediaProcessorInstance
149
+ def get_page(target_url)
150
+ response = @version.domain.request(
151
+ 'GET',
152
+ target_url
153
+ )
154
+ MediaProcessorPage.new(@version, response, @solution)
155
+ end
156
+
157
+ ##
158
+ # Provide a user friendly representation
159
+ def to_s
160
+ '#<Twilio.Media.V1.MediaProcessorList>'
161
+ end
162
+ end
163
+
164
+ class MediaProcessorPage < Page
165
+ ##
166
+ # Initialize the MediaProcessorPage
167
+ # @param [Version] version Version that contains the resource
168
+ # @param [Response] response Response from the API
169
+ # @param [Hash] solution Path solution for the resource
170
+ # @return [MediaProcessorPage] MediaProcessorPage
171
+ def initialize(version, response, solution)
172
+ super(version, response)
173
+
174
+ # Path Solution
175
+ @solution = solution
176
+ end
177
+
178
+ ##
179
+ # Build an instance of MediaProcessorInstance
180
+ # @param [Hash] payload Payload response from the API
181
+ # @return [MediaProcessorInstance] MediaProcessorInstance
182
+ def get_instance(payload)
183
+ MediaProcessorInstance.new(@version, payload, )
184
+ end
185
+
186
+ ##
187
+ # Provide a user friendly representation
188
+ def to_s
189
+ '<Twilio.Media.V1.MediaProcessorPage>'
190
+ end
191
+ end
192
+
193
+ class MediaProcessorContext < InstanceContext
194
+ ##
195
+ # Initialize the MediaProcessorContext
196
+ # @param [Version] version Version that contains the resource
197
+ # @param [String] sid The SID of the MediaProcessor resource to fetch.
198
+ # @return [MediaProcessorContext] MediaProcessorContext
199
+ def initialize(version, sid)
200
+ super(version)
201
+
202
+ # Path Solution
203
+ @solution = {sid: sid, }
204
+ @uri = "/MediaProcessors/#{@solution[:sid]}"
205
+ end
206
+
207
+ ##
208
+ # Fetch the MediaProcessorInstance
209
+ # @return [MediaProcessorInstance] Fetched MediaProcessorInstance
210
+ def fetch
211
+ payload = @version.fetch('GET', @uri)
212
+
213
+ MediaProcessorInstance.new(@version, payload, sid: @solution[:sid], )
214
+ end
215
+
216
+ ##
217
+ # Update the MediaProcessorInstance
218
+ # @param [media_processor.UpdateStatus] status The status of the MediaProcessor.
219
+ # Can be `ended`.
220
+ # @return [MediaProcessorInstance] Updated MediaProcessorInstance
221
+ def update(status: nil)
222
+ data = Twilio::Values.of({'Status' => status, })
223
+
224
+ payload = @version.update('POST', @uri, data: data)
225
+
226
+ MediaProcessorInstance.new(@version, payload, sid: @solution[:sid], )
227
+ end
228
+
229
+ ##
230
+ # Provide a user friendly representation
231
+ def to_s
232
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
233
+ "#<Twilio.Media.V1.MediaProcessorContext #{context}>"
234
+ end
235
+
236
+ ##
237
+ # Provide a detailed, user friendly representation
238
+ def inspect
239
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
240
+ "#<Twilio.Media.V1.MediaProcessorContext #{context}>"
241
+ end
242
+ end
243
+
244
+ class MediaProcessorInstance < InstanceResource
245
+ ##
246
+ # Initialize the MediaProcessorInstance
247
+ # @param [Version] version Version that contains the resource
248
+ # @param [Hash] payload payload that contains response from Twilio
249
+ # @param [String] sid The SID of the MediaProcessor resource to fetch.
250
+ # @return [MediaProcessorInstance] MediaProcessorInstance
251
+ def initialize(version, payload, sid: nil)
252
+ super(version)
253
+
254
+ # Marshaled Properties
255
+ @properties = {
256
+ 'account_sid' => payload['account_sid'],
257
+ 'sid' => payload['sid'],
258
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
259
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
260
+ 'extension' => payload['extension'],
261
+ 'extension_context' => payload['extension_context'],
262
+ 'status' => payload['status'],
263
+ 'url' => payload['url'],
264
+ 'ended_reason' => payload['ended_reason'],
265
+ 'status_callback' => payload['status_callback'],
266
+ 'status_callback_method' => payload['status_callback_method'],
267
+ }
268
+
269
+ # Context
270
+ @instance_context = nil
271
+ @params = {'sid' => sid || @properties['sid'], }
272
+ end
273
+
274
+ ##
275
+ # Generate an instance context for the instance, the context is capable of
276
+ # performing various actions. All instance actions are proxied to the context
277
+ # @return [MediaProcessorContext] MediaProcessorContext for this MediaProcessorInstance
278
+ def context
279
+ unless @instance_context
280
+ @instance_context = MediaProcessorContext.new(@version, @params['sid'], )
281
+ end
282
+ @instance_context
283
+ end
284
+
285
+ ##
286
+ # @return [String] The SID of the Account that created the resource
287
+ def account_sid
288
+ @properties['account_sid']
289
+ end
290
+
291
+ ##
292
+ # @return [String] The unique string that identifies the resource
293
+ def sid
294
+ @properties['sid']
295
+ end
296
+
297
+ ##
298
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
299
+ def date_created
300
+ @properties['date_created']
301
+ end
302
+
303
+ ##
304
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
305
+ def date_updated
306
+ @properties['date_updated']
307
+ end
308
+
309
+ ##
310
+ # @return [String] The Media Extension name or URL
311
+ def extension
312
+ @properties['extension']
313
+ end
314
+
315
+ ##
316
+ # @return [String] The Media Extension context
317
+ def extension_context
318
+ @properties['extension_context']
319
+ end
320
+
321
+ ##
322
+ # @return [media_processor.Status] The status of the MediaProcessor
323
+ def status
324
+ @properties['status']
325
+ end
326
+
327
+ ##
328
+ # @return [String] The absolute URL of the resource
329
+ def url
330
+ @properties['url']
331
+ end
332
+
333
+ ##
334
+ # @return [String] The reason why a MediaProcessor ended
335
+ def ended_reason
336
+ @properties['ended_reason']
337
+ end
338
+
339
+ ##
340
+ # @return [String] The URL to which Twilio will send MediaProcessor event updates
341
+ def status_callback
342
+ @properties['status_callback']
343
+ end
344
+
345
+ ##
346
+ # @return [String] The HTTP method Twilio should use to call the `status_callback` URL
347
+ def status_callback_method
348
+ @properties['status_callback_method']
349
+ end
350
+
351
+ ##
352
+ # Fetch the MediaProcessorInstance
353
+ # @return [MediaProcessorInstance] Fetched MediaProcessorInstance
354
+ def fetch
355
+ context.fetch
356
+ end
357
+
358
+ ##
359
+ # Update the MediaProcessorInstance
360
+ # @param [media_processor.UpdateStatus] status The status of the MediaProcessor.
361
+ # Can be `ended`.
362
+ # @return [MediaProcessorInstance] Updated MediaProcessorInstance
363
+ def update(status: nil)
364
+ context.update(status: status, )
365
+ end
366
+
367
+ ##
368
+ # Provide a user friendly representation
369
+ def to_s
370
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
371
+ "<Twilio.Media.V1.MediaProcessorInstance #{values}>"
372
+ end
373
+
374
+ ##
375
+ # Provide a detailed, user friendly representation
376
+ def inspect
377
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
378
+ "<Twilio.Media.V1.MediaProcessorInstance #{values}>"
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end