mux_ruby 3.16.0 → 3.18.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 +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -2
- data/README.md +5 -5
- data/docs/Asset.md +3 -1
- data/docs/CreateAssetRequest.md +7 -3
- data/docs/CreateLiveStreamRequest.md +2 -0
- data/docs/CreatePlaybackIDRequest.md +3 -1
- data/docs/CreateUploadRequest.md +1 -1
- data/docs/DRMConfiguration.md +18 -0
- data/docs/DRMConfigurationResponse.md +18 -0
- data/docs/DRMConfigurationsApi.md +153 -0
- data/docs/DeliveryReport.md +3 -1
- data/docs/ListDRMConfigurationsResponse.md +18 -0
- data/docs/MetricsApi.md +8 -8
- data/docs/PlaybackID.md +3 -1
- data/gen/generator-config.json +1 -1
- data/gen/templates/README.mustache +1 -1
- data/lib/mux_ruby/api/drm_configurations_api.rb +148 -0
- data/lib/mux_ruby/api/metrics_api.rb +8 -8
- data/lib/mux_ruby/models/asset.rb +24 -2
- data/lib/mux_ruby/models/create_asset_request.rb +40 -6
- data/lib/mux_ruby/models/create_live_stream_request.rb +13 -1
- data/lib/mux_ruby/models/create_playback_id_request.rb +14 -4
- data/lib/mux_ruby/models/create_upload_request.rb +1 -0
- data/lib/mux_ruby/models/delivery_report.rb +24 -2
- data/lib/mux_ruby/models/drm_configuration.rb +219 -0
- data/lib/mux_ruby/models/drm_configuration_response.rb +218 -0
- data/lib/mux_ruby/models/list_drm_configurations_response.rb +220 -0
- data/lib/mux_ruby/models/playback_id.rb +14 -4
- data/lib/mux_ruby/models/playback_policy.rb +1 -0
- data/lib/mux_ruby/version.rb +1 -1
- data/lib/mux_ruby.rb +4 -0
- data/spec/api/drm_configurations_api_spec.rb +60 -0
- data/spec/models/drm_configuration_response_spec.rb +34 -0
- data/spec/models/drm_configuration_spec.rb +34 -0
- data/spec/models/list_drm_configurations_response_spec.rb +34 -0
- data/vendor/bundle/ruby/3.2.0/cache/jaro_winkler-1.5.6.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/byebug/byebug.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/ffi_c.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/mkmf.log +18 -18
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +29 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/mkmf.log +4 -4
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/ext/byebug/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/jaro_winkler.c +12 -7
- data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.6/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/lib/jaro_winkler/version.rb +1 -1
- data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/ext/psych/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/ext/stringio/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/lib/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{jaro_winkler-1.5.4.gemspec → jaro_winkler-1.5.6.gemspec} +5 -5
- metadata +191 -175
- data/vendor/bundle/ruby/3.2.0/cache/jaro_winkler-1.5.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/gem_make.out +0 -66
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/jaro_winkler/jaro_winkler_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/adj_matrix.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/adj_matrix.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/codepoints.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/codepoints.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/extconf.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/jaro.c +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/ext/jaro_winkler/jaro.h +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/lib/jaro_winkler/adjusting_table.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/lib/jaro_winkler/jaro_winkler_pure.rb +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{jaro_winkler-1.5.4 → jaro_winkler-1.5.6}/lib/jaro_winkler.rb +0 -0
|
@@ -39,9 +39,12 @@ module MuxRuby
|
|
|
39
39
|
# The resolution tier that the asset was ingested at, affecting billing for ingest & storage
|
|
40
40
|
attr_accessor :asset_resolution_tier
|
|
41
41
|
|
|
42
|
-
# The encoding tier that the asset was ingested at. [See the
|
|
42
|
+
# This field is deprecated. Please use `asset_video_quality` instead. The encoding tier that the asset was ingested at. [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
|
|
43
43
|
attr_accessor :asset_encoding_tier
|
|
44
44
|
|
|
45
|
+
# The video quality that the asset was ingested at. This field replaces `asset_encoding_tier`. [See the video quality guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
|
|
46
|
+
attr_accessor :asset_video_quality
|
|
47
|
+
|
|
45
48
|
# Total number of delivered seconds during this time window.
|
|
46
49
|
attr_accessor :delivered_seconds
|
|
47
50
|
|
|
@@ -81,6 +84,7 @@ module MuxRuby
|
|
|
81
84
|
:'asset_duration' => :'asset_duration',
|
|
82
85
|
:'asset_resolution_tier' => :'asset_resolution_tier',
|
|
83
86
|
:'asset_encoding_tier' => :'asset_encoding_tier',
|
|
87
|
+
:'asset_video_quality' => :'asset_video_quality',
|
|
84
88
|
:'delivered_seconds' => :'delivered_seconds',
|
|
85
89
|
:'delivered_seconds_by_resolution' => :'delivered_seconds_by_resolution'
|
|
86
90
|
}
|
|
@@ -103,6 +107,7 @@ module MuxRuby
|
|
|
103
107
|
:'asset_duration' => :'Float',
|
|
104
108
|
:'asset_resolution_tier' => :'String',
|
|
105
109
|
:'asset_encoding_tier' => :'String',
|
|
110
|
+
:'asset_video_quality' => :'String',
|
|
106
111
|
:'delivered_seconds' => :'Float',
|
|
107
112
|
:'delivered_seconds_by_resolution' => :'DeliveryReportDeliveredSecondsByResolution'
|
|
108
113
|
}
|
|
@@ -165,6 +170,10 @@ module MuxRuby
|
|
|
165
170
|
self.asset_encoding_tier = attributes[:'asset_encoding_tier']
|
|
166
171
|
end
|
|
167
172
|
|
|
173
|
+
if attributes.key?(:'asset_video_quality')
|
|
174
|
+
self.asset_video_quality = attributes[:'asset_video_quality']
|
|
175
|
+
end
|
|
176
|
+
|
|
168
177
|
if attributes.key?(:'delivered_seconds')
|
|
169
178
|
self.delivered_seconds = attributes[:'delivered_seconds']
|
|
170
179
|
end
|
|
@@ -190,6 +199,8 @@ module MuxRuby
|
|
|
190
199
|
return false unless asset_resolution_tier_validator.valid?(@asset_resolution_tier)
|
|
191
200
|
asset_encoding_tier_validator = EnumAttributeValidator.new('String', ["smart", "baseline"])
|
|
192
201
|
return false unless asset_encoding_tier_validator.valid?(@asset_encoding_tier)
|
|
202
|
+
asset_video_quality_validator = EnumAttributeValidator.new('String', ["basic", "plus"])
|
|
203
|
+
return false unless asset_video_quality_validator.valid?(@asset_video_quality)
|
|
193
204
|
true
|
|
194
205
|
end
|
|
195
206
|
|
|
@@ -223,6 +234,16 @@ module MuxRuby
|
|
|
223
234
|
@asset_encoding_tier = asset_encoding_tier
|
|
224
235
|
end
|
|
225
236
|
|
|
237
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
238
|
+
# @param [Object] asset_video_quality Object to be assigned
|
|
239
|
+
def asset_video_quality=(asset_video_quality)
|
|
240
|
+
validator = EnumAttributeValidator.new('String', ["basic", "plus"])
|
|
241
|
+
unless validator.valid?(asset_video_quality)
|
|
242
|
+
fail ArgumentError, "invalid value for \"asset_video_quality\", must be one of #{validator.allowable_values}."
|
|
243
|
+
end
|
|
244
|
+
@asset_video_quality = asset_video_quality
|
|
245
|
+
end
|
|
246
|
+
|
|
226
247
|
# Checks equality by comparing each attribute.
|
|
227
248
|
# @param [Object] Object to be compared
|
|
228
249
|
def ==(o)
|
|
@@ -237,6 +258,7 @@ module MuxRuby
|
|
|
237
258
|
asset_duration == o.asset_duration &&
|
|
238
259
|
asset_resolution_tier == o.asset_resolution_tier &&
|
|
239
260
|
asset_encoding_tier == o.asset_encoding_tier &&
|
|
261
|
+
asset_video_quality == o.asset_video_quality &&
|
|
240
262
|
delivered_seconds == o.delivered_seconds &&
|
|
241
263
|
delivered_seconds_by_resolution == o.delivered_seconds_by_resolution
|
|
242
264
|
end
|
|
@@ -250,7 +272,7 @@ module MuxRuby
|
|
|
250
272
|
# Calculates hash code according to all attributes.
|
|
251
273
|
# @return [Integer] Hash code
|
|
252
274
|
def hash
|
|
253
|
-
[live_stream_id, asset_id, passthrough, created_at, deleted_at, asset_state, asset_duration, asset_resolution_tier, asset_encoding_tier, delivered_seconds, delivered_seconds_by_resolution].hash
|
|
275
|
+
[live_stream_id, asset_id, passthrough, created_at, deleted_at, asset_state, asset_duration, asset_resolution_tier, asset_encoding_tier, asset_video_quality, delivered_seconds, delivered_seconds_by_resolution].hash
|
|
254
276
|
end
|
|
255
277
|
|
|
256
278
|
# Builds the object from hash
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Mux API
|
|
3
|
+
|
|
4
|
+
#Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
Contact: devex@mux.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 5.0.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MuxRuby
|
|
17
|
+
class DRMConfiguration
|
|
18
|
+
# Unique identifier for the DRM Configuration. Max 255 characters.
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'id' => :'id'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
|
29
|
+
def self.acceptable_attributes
|
|
30
|
+
attribute_map.values
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'id' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::DRMConfiguration` initialize method"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::DRMConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'id')
|
|
62
|
+
self.id = attributes[:'id']
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
67
|
+
# @return Array for valid properties with the reasons
|
|
68
|
+
def list_invalid_properties
|
|
69
|
+
invalid_properties = Array.new
|
|
70
|
+
invalid_properties
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Check to see if the all the properties in the model are valid
|
|
74
|
+
# @return true if the model is valid
|
|
75
|
+
def valid?
|
|
76
|
+
true
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Checks equality by comparing each attribute.
|
|
80
|
+
# @param [Object] Object to be compared
|
|
81
|
+
def ==(o)
|
|
82
|
+
return true if self.equal?(o)
|
|
83
|
+
self.class == o.class &&
|
|
84
|
+
id == o.id
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# @see the `==` method
|
|
88
|
+
# @param [Object] Object to be compared
|
|
89
|
+
def eql?(o)
|
|
90
|
+
self == o
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Calculates hash code according to all attributes.
|
|
94
|
+
# @return [Integer] Hash code
|
|
95
|
+
def hash
|
|
96
|
+
[id].hash
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Builds the object from hash
|
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
101
|
+
# @return [Object] Returns the model itself
|
|
102
|
+
def self.build_from_hash(attributes)
|
|
103
|
+
new.build_from_hash(attributes)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Builds the object from hash
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
# @return [Object] Returns the model itself
|
|
109
|
+
def build_from_hash(attributes)
|
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
112
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
113
|
+
self.send("#{key}=", nil)
|
|
114
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
115
|
+
# check to ensure the input is an array given that the attribute
|
|
116
|
+
# is documented as an array but the input is not
|
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
119
|
+
end
|
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
self
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Deserializes the data based on type
|
|
129
|
+
# @param string type Data type
|
|
130
|
+
# @param string value Value to be deserialized
|
|
131
|
+
# @return [Object] Deserialized data
|
|
132
|
+
def _deserialize(type, value)
|
|
133
|
+
case type.to_sym
|
|
134
|
+
when :Time
|
|
135
|
+
Time.parse(value)
|
|
136
|
+
when :Date
|
|
137
|
+
Date.parse(value)
|
|
138
|
+
when :String
|
|
139
|
+
value.to_s
|
|
140
|
+
when :Integer
|
|
141
|
+
value.to_i
|
|
142
|
+
when :Float
|
|
143
|
+
value.to_f
|
|
144
|
+
when :Boolean
|
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
146
|
+
true
|
|
147
|
+
else
|
|
148
|
+
false
|
|
149
|
+
end
|
|
150
|
+
when :Object
|
|
151
|
+
# generic object (usually a Hash), return directly
|
|
152
|
+
value
|
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
|
159
|
+
{}.tap do |hash|
|
|
160
|
+
value.each do |k, v|
|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
else # model
|
|
165
|
+
# models (e.g. Pet) or oneOf
|
|
166
|
+
klass = MuxRuby.const_get(type)
|
|
167
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Returns the string representation of the object
|
|
172
|
+
# @return [String] String presentation of the object
|
|
173
|
+
def to_s
|
|
174
|
+
to_hash.to_s
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
|
179
|
+
def to_body
|
|
180
|
+
to_hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the object in the form of hash
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_hash
|
|
186
|
+
hash = {}
|
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = self.send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
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
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Mux API
|
|
3
|
+
|
|
4
|
+
#Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1
|
|
7
|
+
Contact: devex@mux.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 5.0.1
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MuxRuby
|
|
17
|
+
class DRMConfigurationResponse
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'data' => :'data'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
|
28
|
+
def self.acceptable_attributes
|
|
29
|
+
attribute_map.values
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.openapi_types
|
|
34
|
+
{
|
|
35
|
+
:'data' => :'DRMConfiguration'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# List of attributes with nullable: true
|
|
40
|
+
def self.openapi_nullable
|
|
41
|
+
Set.new([
|
|
42
|
+
])
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Initializes the object
|
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
47
|
+
def initialize(attributes = {})
|
|
48
|
+
if (!attributes.is_a?(Hash))
|
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::DRMConfigurationResponse` initialize method"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::DRMConfigurationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
56
|
+
end
|
|
57
|
+
h[k.to_sym] = v
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if attributes.key?(:'data')
|
|
61
|
+
self.data = attributes[:'data']
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
+
# @return Array for valid properties with the reasons
|
|
67
|
+
def list_invalid_properties
|
|
68
|
+
invalid_properties = Array.new
|
|
69
|
+
invalid_properties
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Check to see if the all the properties in the model are valid
|
|
73
|
+
# @return true if the model is valid
|
|
74
|
+
def valid?
|
|
75
|
+
true
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Checks equality by comparing each attribute.
|
|
79
|
+
# @param [Object] Object to be compared
|
|
80
|
+
def ==(o)
|
|
81
|
+
return true if self.equal?(o)
|
|
82
|
+
self.class == o.class &&
|
|
83
|
+
data == o.data
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# @see the `==` method
|
|
87
|
+
# @param [Object] Object to be compared
|
|
88
|
+
def eql?(o)
|
|
89
|
+
self == o
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Calculates hash code according to all attributes.
|
|
93
|
+
# @return [Integer] Hash code
|
|
94
|
+
def hash
|
|
95
|
+
[data].hash
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Builds the object from hash
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
# @return [Object] Returns the model itself
|
|
101
|
+
def self.build_from_hash(attributes)
|
|
102
|
+
new.build_from_hash(attributes)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Builds the object from hash
|
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
107
|
+
# @return [Object] Returns the model itself
|
|
108
|
+
def build_from_hash(attributes)
|
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
|
110
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
111
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
112
|
+
self.send("#{key}=", nil)
|
|
113
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
114
|
+
# check to ensure the input is an array given that the attribute
|
|
115
|
+
# is documented as an array but the input is not
|
|
116
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
117
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
118
|
+
end
|
|
119
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
120
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
self
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Deserializes the data based on type
|
|
128
|
+
# @param string type Data type
|
|
129
|
+
# @param string value Value to be deserialized
|
|
130
|
+
# @return [Object] Deserialized data
|
|
131
|
+
def _deserialize(type, value)
|
|
132
|
+
case type.to_sym
|
|
133
|
+
when :Time
|
|
134
|
+
Time.parse(value)
|
|
135
|
+
when :Date
|
|
136
|
+
Date.parse(value)
|
|
137
|
+
when :String
|
|
138
|
+
value.to_s
|
|
139
|
+
when :Integer
|
|
140
|
+
value.to_i
|
|
141
|
+
when :Float
|
|
142
|
+
value.to_f
|
|
143
|
+
when :Boolean
|
|
144
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
145
|
+
true
|
|
146
|
+
else
|
|
147
|
+
false
|
|
148
|
+
end
|
|
149
|
+
when :Object
|
|
150
|
+
# generic object (usually a Hash), return directly
|
|
151
|
+
value
|
|
152
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
153
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
154
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
155
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
156
|
+
k_type = Regexp.last_match[:k_type]
|
|
157
|
+
v_type = Regexp.last_match[:v_type]
|
|
158
|
+
{}.tap do |hash|
|
|
159
|
+
value.each do |k, v|
|
|
160
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
else # model
|
|
164
|
+
# models (e.g. Pet) or oneOf
|
|
165
|
+
klass = MuxRuby.const_get(type)
|
|
166
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Returns the string representation of the object
|
|
171
|
+
# @return [String] String presentation of the object
|
|
172
|
+
def to_s
|
|
173
|
+
to_hash.to_s
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
|
178
|
+
def to_body
|
|
179
|
+
to_hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Returns the object in the form of hash
|
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
|
184
|
+
def to_hash
|
|
185
|
+
hash = {}
|
|
186
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
187
|
+
value = self.send(attr)
|
|
188
|
+
if value.nil?
|
|
189
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
190
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
hash[param] = _to_hash(value)
|
|
194
|
+
end
|
|
195
|
+
hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Outputs non-array value in the form of hash
|
|
199
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
200
|
+
# @param [Object] value Any valid value
|
|
201
|
+
# @return [Hash] Returns the value in the form of hash
|
|
202
|
+
def _to_hash(value)
|
|
203
|
+
if value.is_a?(Array)
|
|
204
|
+
value.compact.map { |v| _to_hash(v) }
|
|
205
|
+
elsif value.is_a?(Hash)
|
|
206
|
+
{}.tap do |hash|
|
|
207
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
208
|
+
end
|
|
209
|
+
elsif value.respond_to? :to_hash
|
|
210
|
+
value.to_hash
|
|
211
|
+
else
|
|
212
|
+
value
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|