mux_ruby 1.3.1 → 1.4.0

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: 4b0deedd1384c8570bba28d6fbb40647a70f92f4
4
- data.tar.gz: bba59bbf79426e17ba5e1eb30a53f227db79499e
3
+ metadata.gz: a82c3ff3d2f7a0856d87eeb12181161e46fd94b0
4
+ data.tar.gz: b0bc8878a363818ebf49889ccf57739a1b7d4bc1
5
5
  SHA512:
6
- metadata.gz: 84c62cb5252f550f8b2e9542cb68eaa42c51c1ee1a3ad88f237f480ac63e664ba1345b663b5923e6e9dfc2beffabc07cb5b1535a16fbdbb67f06a9c652132f91
7
- data.tar.gz: b0f0434546abde5a60e2970416670c40d12a5a10f3c128a28f57afcd76253ba2234dbc3aadda646ac55ddafa8c0ba86119cf6235f81d6b4a3df65d51e81dff88
6
+ metadata.gz: 4eb34200000fdb35dc50892d46ead7e99046cdacdd1639a88e209d398abf2b22302345a7fefc3e8524c0e09718ab48fbad3cfd84380e5ed67df1bfde85d1ade4
7
+ data.tar.gz: 481d66f9f17b8ba653ed30d2bb2b6ed2c8aa194563820e99c39063554afaa00621d9b0555f2ffe63d214a6dfecf09417831e564264e8995800fc6e82d5d5921a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mux_ruby (1.3.1)
4
+ mux_ruby (1.4.0)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
data/docs/AssetsApi.md CHANGED
@@ -14,6 +14,7 @@ Method | HTTP request | Description
14
14
  [**get_asset_input_info**](AssetsApi.md#get_asset_input_info) | **GET** /video/v1/assets/{ASSET_ID}/input-info | Retrieve asset input info
15
15
  [**get_asset_playback_id**](AssetsApi.md#get_asset_playback_id) | **GET** /video/v1/assets/{ASSET_ID}/playback-ids/{PLAYBACK_ID} | Retrieve a playback ID
16
16
  [**list_assets**](AssetsApi.md#list_assets) | **GET** /video/v1/assets | List assets
17
+ [**update_asset_master_access**](AssetsApi.md#update_asset_master_access) | **PUT** /video/v1/assets/{ASSET_ID}/master-access | Update master access
17
18
  [**update_asset_mp4_support**](AssetsApi.md#update_asset_mp4_support) | **PUT** /video/v1/assets/{ASSET_ID}/mp4-support | Update MP4 support
18
19
 
19
20
 
@@ -524,6 +525,59 @@ Name | Type | Description | Notes
524
525
 
525
526
 
526
527
 
528
+ # **update_asset_master_access**
529
+ > AssetResponse update_asset_master_access(asset_id, update_asset_master_access_request)
530
+
531
+ Update master access
532
+
533
+ Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline.
534
+
535
+ ### Example
536
+ ```ruby
537
+ # load the gem
538
+ require 'mux_ruby'
539
+ # setup authorization
540
+ MuxRuby.configure do |config|
541
+ # Configure HTTP basic authorization: accessToken
542
+ config.username = 'YOUR USERNAME'
543
+ config.password = 'YOUR PASSWORD'
544
+ end
545
+
546
+ api_instance = MuxRuby::AssetsApi.new
547
+ asset_id = 'asset_id_example' # String | The asset ID.
548
+ update_asset_master_access_request = MuxRuby::UpdateAssetMasterAccessRequest.new # UpdateAssetMasterAccessRequest |
549
+
550
+ begin
551
+ #Update master access
552
+ result = api_instance.update_asset_master_access(asset_id, update_asset_master_access_request)
553
+ p result
554
+ rescue MuxRuby::ApiError => e
555
+ puts "Exception when calling AssetsApi->update_asset_master_access: #{e}"
556
+ end
557
+ ```
558
+
559
+ ### Parameters
560
+
561
+ Name | Type | Description | Notes
562
+ ------------- | ------------- | ------------- | -------------
563
+ **asset_id** | **String**| The asset ID. |
564
+ **update_asset_master_access_request** | [**UpdateAssetMasterAccessRequest**](UpdateAssetMasterAccessRequest.md)| |
565
+
566
+ ### Return type
567
+
568
+ [**AssetResponse**](AssetResponse.md)
569
+
570
+ ### Authorization
571
+
572
+ [accessToken](../README.md#accessToken)
573
+
574
+ ### HTTP request headers
575
+
576
+ - **Content-Type**: application/json
577
+ - **Accept**: application/json
578
+
579
+
580
+
527
581
  # **update_asset_mp4_support**
528
582
  > AssetResponse update_asset_mp4_support(asset_id, update_asset_mp4_support_request)
529
583
 
@@ -0,0 +1,8 @@
1
+ # MuxRuby::UpdateAssetMasterAccessRequest
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **master_access** | **String** | Add or remove access to the master version of the video. | [optional]
7
+
8
+
@@ -77,6 +77,16 @@ assert mp4_asset.data.id == create_response.data.id
77
77
  assert mp4_asset.data.mp4_support == 'standard'
78
78
  puts "update-asset-mp4-support OK ✅"
79
79
 
80
+ # ========== update-asset-master-access ==========
81
+ master_req = MuxRuby::UpdateAssetMasterAccessRequest.new
82
+ master_req.master_access = 'temporary'
83
+ master_asset = assets_api.update_asset_master_access(create_response.data.id, master_req)
84
+ assert master_asset != nil
85
+ assert master_asset.data != nil
86
+ assert master_asset.data.id == create_response.data.id
87
+ assert master_asset.data.master_access == 'temporary'
88
+ puts "update-asset-master-access OK ✅"
89
+
80
90
  # ========== create-asset-track ==========
81
91
  cat = MuxRuby::CreateTrackRequest.new(:url => "https://tears-of-steel-subtitles.s3.amazonaws.com/tears-en.vtt", :type => "text", :text_type => "subtitles", :language_code => "en", :name => "English", :closed_captions => false)
82
92
  subtitles_track = assets_api.create_asset_track(create_response.data.id, cat)
@@ -555,6 +555,67 @@ module MuxRuby
555
555
  return data, status_code, headers
556
556
  end
557
557
 
558
+ # Update master access
559
+ # Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline.
560
+ # @param asset_id The asset ID.
561
+ # @param update_asset_master_access_request
562
+ # @param [Hash] opts the optional parameters
563
+ # @return [AssetResponse]
564
+ def update_asset_master_access(asset_id, update_asset_master_access_request, opts = {})
565
+ data, _status_code, _headers = update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, opts)
566
+ data
567
+ end
568
+
569
+ # Update master access
570
+ # Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \"none\". This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline.
571
+ # @param asset_id The asset ID.
572
+ # @param update_asset_master_access_request
573
+ # @param [Hash] opts the optional parameters
574
+ # @return [Array<(AssetResponse, Fixnum, Hash)>] AssetResponse data, response status code and response headers
575
+ def update_asset_master_access_with_http_info(asset_id, update_asset_master_access_request, opts = {})
576
+ if @api_client.config.debugging
577
+ @api_client.config.logger.debug 'Calling API: AssetsApi.update_asset_master_access ...'
578
+ end
579
+ # verify the required parameter 'asset_id' is set
580
+ if @api_client.config.client_side_validation && asset_id.nil?
581
+ fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.update_asset_master_access"
582
+ end
583
+ # verify the required parameter 'update_asset_master_access_request' is set
584
+ if @api_client.config.client_side_validation && update_asset_master_access_request.nil?
585
+ fail ArgumentError, "Missing the required parameter 'update_asset_master_access_request' when calling AssetsApi.update_asset_master_access"
586
+ end
587
+ # resource path
588
+ local_var_path = '/video/v1/assets/{ASSET_ID}/master-access'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)
589
+
590
+ # query parameters
591
+ query_params = {}
592
+
593
+ # header parameters
594
+ header_params = {}
595
+ # HTTP header 'Accept' (if needed)
596
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
597
+ # HTTP header 'Content-Type'
598
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
599
+
600
+ # form parameters
601
+ form_params = {}
602
+
603
+ # http body (model)
604
+ post_body = @api_client.object_to_http_body(update_asset_master_access_request)
605
+ auth_names = ['accessToken']
606
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
607
+ :header_params => header_params,
608
+ :query_params => query_params,
609
+ :form_params => form_params,
610
+ :body => post_body,
611
+ :auth_names => auth_names,
612
+ :return_type => 'AssetResponse')
613
+ if @api_client.config.debugging
614
+ @api_client.config.logger.debug "API called: AssetsApi#update_asset_master_access\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
615
+ end
616
+ return data, status_code, headers
617
+ end
618
+
558
619
  # Update MP4 support
559
620
  # Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, `standard` and `none`. `none` means that an asset *does not* have mp4 support, so submitting a request with `mp4_support` set to `none` will delete the mp4 assets from the asset in question.
560
621
  # @param asset_id The asset ID.
@@ -0,0 +1,219 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'date'
7
+
8
+ module MuxRuby
9
+ class UpdateAssetMasterAccessRequest
10
+ # Add or remove access to the master version of the video.
11
+ attr_accessor :master_access
12
+
13
+ class EnumAttributeValidator
14
+ attr_reader :datatype
15
+ attr_reader :allowable_values
16
+
17
+ def initialize(datatype, allowable_values)
18
+ @allowable_values = allowable_values.map do |value|
19
+ case datatype.to_s
20
+ when /Integer/i
21
+ value.to_i
22
+ when /Float/i
23
+ value.to_f
24
+ else
25
+ value
26
+ end
27
+ end
28
+ end
29
+
30
+ def valid?(value)
31
+ !value || allowable_values.include?(value)
32
+ end
33
+ end
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'master_access' => :'master_access'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'master_access' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'master_access')
58
+ self.master_access = attributes[:'master_access']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ master_access_validator = EnumAttributeValidator.new('String', ['temporary', 'none'])
73
+ return false unless master_access_validator.valid?(@master_access)
74
+ true
75
+ end
76
+
77
+ # Custom attribute writer method checking allowed values (enum).
78
+ # @param [Object] master_access Object to be assigned
79
+ def master_access=(master_access)
80
+ validator = EnumAttributeValidator.new('String', ['temporary', 'none'])
81
+ unless validator.valid?(master_access)
82
+ fail ArgumentError, 'invalid value for "master_access", must be one of #{validator.allowable_values}.'
83
+ end
84
+ @master_access = master_access
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ master_access == o.master_access
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Fixnum] Hash code
103
+ def hash
104
+ [master_access].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ self.class.openapi_types.each_pair do |key, type|
120
+ if type =~ /\AArray<(.*)>/i
121
+ # check to ensure the input is an array given that the attribute
122
+ # is documented as an array but the input is not
123
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
124
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
125
+ end
126
+ elsif !attributes[self.class.attribute_map[key]].nil?
127
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
128
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ # Deserializes the data based on type
135
+ # @param string type Data type
136
+ # @param string value Value to be deserialized
137
+ # @return [Object] Deserialized data
138
+ def _deserialize(type, value)
139
+ case type.to_sym
140
+ when :DateTime
141
+ DateTime.parse(value)
142
+ when :Date
143
+ Date.parse(value)
144
+ when :String
145
+ value.to_s
146
+ when :Integer
147
+ value.to_i
148
+ when :Float
149
+ value.to_f
150
+ when :BOOLEAN
151
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
152
+ true
153
+ else
154
+ false
155
+ end
156
+ when :Object
157
+ # generic object (usually a Hash), return directly
158
+ value
159
+ when /\AArray<(?<inner_type>.+)>\z/
160
+ inner_type = Regexp.last_match[:inner_type]
161
+ value.map { |v| _deserialize(inner_type, v) }
162
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
163
+ k_type = Regexp.last_match[:k_type]
164
+ v_type = Regexp.last_match[:v_type]
165
+ {}.tap do |hash|
166
+ value.each do |k, v|
167
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
168
+ end
169
+ end
170
+ else # model
171
+ MuxRuby.const_get(type).build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -4,5 +4,5 @@
4
4
  =end
5
5
 
6
6
  module MuxRuby
7
- VERSION = '1.3.1'
7
+ VERSION = '1.4.0'
8
8
  end
data/lib/mux_ruby.rb CHANGED
@@ -67,6 +67,7 @@ require 'mux_ruby/models/simulcast_target'
67
67
  require 'mux_ruby/models/simulcast_target_response'
68
68
  require 'mux_ruby/models/track'
69
69
  require 'mux_ruby/models/update_asset_mp4_support_request'
70
+ require 'mux_ruby/models/update_asset_master_access_request'
70
71
  require 'mux_ruby/models/upload'
71
72
  require 'mux_ruby/models/upload_error'
72
73
  require 'mux_ruby/models/upload_response'
@@ -144,6 +144,19 @@ describe 'AssetsApi' do
144
144
  end
145
145
  end
146
146
 
147
+ # unit tests for update_asset_master_access
148
+ # Update master access
149
+ # Allows you add temporary access to the master (highest-quality) version of the asset in MP4 format. A URL will be created that can be used to download the master version for 24 hours. After 24 hours Master Access will revert to \&quot;none\&quot;. This master version is not optimized for web and not meant to be streamed, only downloaded for purposes like archiving or editing the video offline.
150
+ # @param asset_id The asset ID.
151
+ # @param update_asset_master_access_request
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [AssetResponse]
154
+ describe 'update_asset_master_access test' do
155
+ it 'should work' do
156
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
157
+ end
158
+ end
159
+
147
160
  # unit tests for update_asset_mp4_support
148
161
  # Update MP4 support
149
162
  # Allows you add or remove mp4 support for assets that were created without it. Currently there are two values supported in this request, &#x60;standard&#x60; and &#x60;none&#x60;. &#x60;none&#x60; means that an asset *does not* have mp4 support, so submitting a request with &#x60;mp4_support&#x60; set to &#x60;none&#x60; will delete the mp4 assets from the asset in question.
@@ -0,0 +1,38 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'spec_helper'
7
+ require 'json'
8
+ require 'date'
9
+
10
+ # Unit tests for MuxRuby::UpdateAssetMasterAccessRequest
11
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
12
+ # Please update as you see appropriate
13
+ describe 'UpdateAssetMasterAccessRequest' do
14
+ before do
15
+ # run before each test
16
+ @instance = MuxRuby::UpdateAssetMasterAccessRequest.new
17
+ end
18
+
19
+ after do
20
+ # run after each test
21
+ end
22
+
23
+ describe 'test an instance of UpdateAssetMasterAccessRequest' do
24
+ it 'should create an instance of UpdateAssetMasterAccessRequest' do
25
+ expect(@instance).to be_instance_of(MuxRuby::UpdateAssetMasterAccessRequest)
26
+ end
27
+ end
28
+ describe 'test attribute "master_access"' do
29
+ it 'should work' do
30
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
31
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["temporary", "none"])
32
+ # validator.allowable_values.each do |value|
33
+ # expect { @instance.master_access = value }.not_to raise_error
34
+ # end
35
+ end
36
+ end
37
+
38
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mux_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mux SDK Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-10 00:00:00.000000000 Z
11
+ date: 2020-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -268,6 +268,7 @@ files:
268
268
  - docs/Track.md
269
269
  - docs/URLSigningKeysApi.md
270
270
  - docs/UpdateAssetMP4SupportRequest.md
271
+ - docs/UpdateAssetMasterAccessRequest.md
271
272
  - docs/Upload.md
272
273
  - docs/UploadError.md
273
274
  - docs/UploadResponse.md
@@ -359,6 +360,7 @@ files:
359
360
  - lib/mux_ruby/models/simulcast_target.rb
360
361
  - lib/mux_ruby/models/simulcast_target_response.rb
361
362
  - lib/mux_ruby/models/track.rb
363
+ - lib/mux_ruby/models/update_asset_master_access_request.rb
362
364
  - lib/mux_ruby/models/update_asset_mp4_support_request.rb
363
365
  - lib/mux_ruby/models/upload.rb
364
366
  - lib/mux_ruby/models/upload_error.rb
@@ -436,6 +438,7 @@ files:
436
438
  - spec/models/simulcast_target_response_spec.rb
437
439
  - spec/models/simulcast_target_spec.rb
438
440
  - spec/models/track_spec.rb
441
+ - spec/models/update_asset_master_access_request_spec.rb
439
442
  - spec/models/update_asset_mp4_support_request_spec.rb
440
443
  - spec/models/upload_error_spec.rb
441
444
  - spec/models/upload_response_spec.rb
@@ -510,6 +513,7 @@ test_files:
510
513
  - spec/models/breakdown_value_spec.rb
511
514
  - spec/models/list_live_streams_response_spec.rb
512
515
  - spec/models/list_all_metric_values_response_spec.rb
516
+ - spec/models/update_asset_master_access_request_spec.rb
513
517
  - spec/models/input_file_spec.rb
514
518
  - spec/models/abridged_video_view_spec.rb
515
519
  - spec/models/overall_values_spec.rb