mux_ruby 2.1.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +4 -4
  4. data/docs/AssetNonStandardInputReasons.md +2 -0
  5. data/docs/CreateLiveStreamRequest.md +2 -0
  6. data/docs/ExportsApi.md +1 -1
  7. data/docs/FiltersApi.md +2 -2
  8. data/docs/GetLiveStreamPlaybackIDResponse.md +18 -0
  9. data/docs/LiveStreamEmbeddedSubtitleSettings.md +24 -0
  10. data/docs/LiveStreamsApi.md +144 -0
  11. data/docs/MetricsApi.md +2 -2
  12. data/docs/RealTimeBreakdownValue.md +2 -2
  13. data/docs/RealTimeTimeseriesDatapoint.md +2 -2
  14. data/docs/UpdateLiveStreamEmbeddedSubtitlesRequest.md +18 -0
  15. data/examples/data/exercise-errors.rb +0 -2
  16. data/examples/video/exercise-assets.rb +1 -0
  17. data/gen/generator-config.json +2 -1
  18. data/gen/templates/gemspec.mustache +1 -0
  19. data/lib/mux_ruby/api/exports_api.rb +2 -2
  20. data/lib/mux_ruby/api/filters_api.rb +4 -4
  21. data/lib/mux_ruby/api/live_streams_api.rb +138 -0
  22. data/lib/mux_ruby/api/metrics_api.rb +2 -2
  23. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +23 -1
  24. data/lib/mux_ruby/models/create_live_stream_request.rb +13 -1
  25. data/lib/mux_ruby/models/get_live_stream_playback_id_response.rb +218 -0
  26. data/lib/mux_ruby/models/live_stream_embedded_subtitle_settings.rb +287 -0
  27. data/lib/mux_ruby/models/real_time_breakdown_value.rb +7 -7
  28. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +7 -7
  29. data/lib/mux_ruby/models/track.rb +0 -12
  30. data/lib/mux_ruby/models/update_live_stream_embedded_subtitles_request.rb +221 -0
  31. data/lib/mux_ruby/version.rb +1 -1
  32. data/lib/mux_ruby.rb +3 -0
  33. data/mux_ruby.gemspec +1 -0
  34. data/spec/models/get_live_stream_playback_id_response_spec.rb +34 -0
  35. data/spec/models/live_stream_embedded_subtitle_settings_spec.rb +56 -0
  36. data/spec/models/update_live_stream_embedded_subtitles_request_spec.rb +34 -0
  37. metadata +109 -96
@@ -0,0 +1,287 @@
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 LiveStreamEmbeddedSubtitleSettings
18
+ # A name for this live stream closed caption track.
19
+ attr_accessor :name
20
+
21
+ # Arbitrary metadata set for the live stream closed caption track. Max 255 characters.
22
+ attr_accessor :passthrough
23
+
24
+ # The language of the closed caption stream. Value must be BCP 47 compliant.
25
+ attr_accessor :language_code
26
+
27
+ # CEA-608 caption channel to read data from.
28
+ attr_accessor :language_channel
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'name' => :'name',
56
+ :'passthrough' => :'passthrough',
57
+ :'language_code' => :'language_code',
58
+ :'language_channel' => :'language_channel'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'name' => :'String',
71
+ :'passthrough' => :'String',
72
+ :'language_code' => :'String',
73
+ :'language_channel' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::LiveStreamEmbeddedSubtitleSettings` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::LiveStreamEmbeddedSubtitleSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ end
101
+
102
+ if attributes.key?(:'passthrough')
103
+ self.passthrough = attributes[:'passthrough']
104
+ end
105
+
106
+ if attributes.key?(:'language_code')
107
+ self.language_code = attributes[:'language_code']
108
+ else
109
+ self.language_code = 'en'
110
+ end
111
+
112
+ if attributes.key?(:'language_channel')
113
+ self.language_channel = attributes[:'language_channel']
114
+ else
115
+ self.language_channel = 'cc1'
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ language_channel_validator = EnumAttributeValidator.new('String', ["cc1"])
130
+ return false unless language_channel_validator.valid?(@language_channel)
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] language_channel Object to be assigned
136
+ def language_channel=(language_channel)
137
+ validator = EnumAttributeValidator.new('String', ["cc1"])
138
+ unless validator.valid?(language_channel)
139
+ fail ArgumentError, "invalid value for \"language_channel\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @language_channel = language_channel
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ name == o.name &&
150
+ passthrough == o.passthrough &&
151
+ language_code == o.language_code &&
152
+ language_channel == o.language_channel
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [name, passthrough, language_code, language_channel].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ new.build_from_hash(attributes)
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.openapi_types.each_pair do |key, type|
180
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
181
+ self.send("#{key}=", nil)
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = MuxRuby.const_get(type)
235
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ end
@@ -23,7 +23,7 @@ module MuxRuby
23
23
 
24
24
  attr_accessor :display_value
25
25
 
26
- attr_accessor :concurent_viewers
26
+ attr_accessor :concurrent_viewers
27
27
 
28
28
  # Attribute mapping from ruby-style variable name to JSON key.
29
29
  def self.attribute_map
@@ -32,7 +32,7 @@ module MuxRuby
32
32
  :'negative_impact' => :'negative_impact',
33
33
  :'metric_value' => :'metric_value',
34
34
  :'display_value' => :'display_value',
35
- :'concurent_viewers' => :'concurent_viewers'
35
+ :'concurrent_viewers' => :'concurrent_viewers'
36
36
  }
37
37
  end
38
38
 
@@ -48,7 +48,7 @@ module MuxRuby
48
48
  :'negative_impact' => :'Integer',
49
49
  :'metric_value' => :'Float',
50
50
  :'display_value' => :'String',
51
- :'concurent_viewers' => :'Integer'
51
+ :'concurrent_viewers' => :'Integer'
52
52
  }
53
53
  end
54
54
 
@@ -89,8 +89,8 @@ module MuxRuby
89
89
  self.display_value = attributes[:'display_value']
90
90
  end
91
91
 
92
- if attributes.key?(:'concurent_viewers')
93
- self.concurent_viewers = attributes[:'concurent_viewers']
92
+ if attributes.key?(:'concurrent_viewers')
93
+ self.concurrent_viewers = attributes[:'concurrent_viewers']
94
94
  end
95
95
  end
96
96
 
@@ -116,7 +116,7 @@ module MuxRuby
116
116
  negative_impact == o.negative_impact &&
117
117
  metric_value == o.metric_value &&
118
118
  display_value == o.display_value &&
119
- concurent_viewers == o.concurent_viewers
119
+ concurrent_viewers == o.concurrent_viewers
120
120
  end
121
121
 
122
122
  # @see the `==` method
@@ -128,7 +128,7 @@ module MuxRuby
128
128
  # Calculates hash code according to all attributes.
129
129
  # @return [Integer] Hash code
130
130
  def hash
131
- [value, negative_impact, metric_value, display_value, concurent_viewers].hash
131
+ [value, negative_impact, metric_value, display_value, concurrent_viewers].hash
132
132
  end
133
133
 
134
134
  # Builds the object from hash
@@ -19,14 +19,14 @@ module MuxRuby
19
19
 
20
20
  attr_accessor :date
21
21
 
22
- attr_accessor :concurent_viewers
22
+ attr_accessor :concurrent_viewers
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
25
25
  def self.attribute_map
26
26
  {
27
27
  :'value' => :'value',
28
28
  :'date' => :'date',
29
- :'concurent_viewers' => :'concurent_viewers'
29
+ :'concurrent_viewers' => :'concurrent_viewers'
30
30
  }
31
31
  end
32
32
 
@@ -40,7 +40,7 @@ module MuxRuby
40
40
  {
41
41
  :'value' => :'Float',
42
42
  :'date' => :'String',
43
- :'concurent_viewers' => :'Integer'
43
+ :'concurrent_viewers' => :'Integer'
44
44
  }
45
45
  end
46
46
 
@@ -73,8 +73,8 @@ module MuxRuby
73
73
  self.date = attributes[:'date']
74
74
  end
75
75
 
76
- if attributes.key?(:'concurent_viewers')
77
- self.concurent_viewers = attributes[:'concurent_viewers']
76
+ if attributes.key?(:'concurrent_viewers')
77
+ self.concurrent_viewers = attributes[:'concurrent_viewers']
78
78
  end
79
79
  end
80
80
 
@@ -98,7 +98,7 @@ module MuxRuby
98
98
  self.class == o.class &&
99
99
  value == o.value &&
100
100
  date == o.date &&
101
- concurent_viewers == o.concurent_viewers
101
+ concurrent_viewers == o.concurrent_viewers
102
102
  end
103
103
 
104
104
  # @see the `==` method
@@ -110,7 +110,7 @@ module MuxRuby
110
110
  # Calculates hash code according to all attributes.
111
111
  # @return [Integer] Hash code
112
112
  def hash
113
- [value, date, concurent_viewers].hash
113
+ [value, date, concurrent_viewers].hash
114
114
  end
115
115
 
116
116
  # Builds the object from hash
@@ -205,8 +205,6 @@ module MuxRuby
205
205
  def valid?
206
206
  type_validator = EnumAttributeValidator.new('String', ["video", "audio", "text"])
207
207
  return false unless type_validator.valid?(@type)
208
- max_channel_layout_validator = EnumAttributeValidator.new('String', ["mono", "stereo", "5.2", "7.1"])
209
- return false unless max_channel_layout_validator.valid?(@max_channel_layout)
210
208
  text_type_validator = EnumAttributeValidator.new('String', ["subtitles"])
211
209
  return false unless text_type_validator.valid?(@text_type)
212
210
  true
@@ -222,16 +220,6 @@ module MuxRuby
222
220
  @type = type
223
221
  end
224
222
 
225
- # Custom attribute writer method checking allowed values (enum).
226
- # @param [Object] max_channel_layout Object to be assigned
227
- def max_channel_layout=(max_channel_layout)
228
- validator = EnumAttributeValidator.new('String', ["mono", "stereo", "5.2", "7.1"])
229
- unless validator.valid?(max_channel_layout)
230
- fail ArgumentError, "invalid value for \"max_channel_layout\", must be one of #{validator.allowable_values}."
231
- end
232
- @max_channel_layout = max_channel_layout
233
- end
234
-
235
223
  # Custom attribute writer method checking allowed values (enum).
236
224
  # @param [Object] text_type Object to be assigned
237
225
  def text_type=(text_type)
@@ -0,0 +1,221 @@
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 UpdateLiveStreamEmbeddedSubtitlesRequest
18
+ # Describe the embedded closed caption contents of the incoming live stream.
19
+ attr_accessor :embedded_subtitles
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'embedded_subtitles' => :'embedded_subtitles'
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
+ :'embedded_subtitles' => :'Array<LiveStreamEmbeddedSubtitleSettings>'
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::UpdateLiveStreamEmbeddedSubtitlesRequest` 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::UpdateLiveStreamEmbeddedSubtitlesRequest`. 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?(:'embedded_subtitles')
62
+ if (value = attributes[:'embedded_subtitles']).is_a?(Array)
63
+ self.embedded_subtitles = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ embedded_subtitles == o.embedded_subtitles
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [embedded_subtitles].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = MuxRuby.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.0.1
11
11
  =end
12
12
 
13
13
  module MuxRuby
14
- VERSION = '2.1.0'
14
+ VERSION = '3.1.0'
15
15
  end
data/lib/mux_ruby.rb CHANGED
@@ -48,6 +48,7 @@ require 'mux_ruby/models/get_asset_or_live_stream_id_response'
48
48
  require 'mux_ruby/models/get_asset_or_live_stream_id_response_data'
49
49
  require 'mux_ruby/models/get_asset_or_live_stream_id_response_data_object'
50
50
  require 'mux_ruby/models/get_asset_playback_id_response'
51
+ require 'mux_ruby/models/get_live_stream_playback_id_response'
51
52
  require 'mux_ruby/models/get_metric_timeseries_data_response'
52
53
  require 'mux_ruby/models/get_overall_values_response'
53
54
  require 'mux_ruby/models/get_real_time_breakdown_response'
@@ -88,6 +89,7 @@ require 'mux_ruby/models/list_uploads_response'
88
89
  require 'mux_ruby/models/list_video_view_exports_response'
89
90
  require 'mux_ruby/models/list_video_views_response'
90
91
  require 'mux_ruby/models/live_stream'
92
+ require 'mux_ruby/models/live_stream_embedded_subtitle_settings'
91
93
  require 'mux_ruby/models/live_stream_response'
92
94
  require 'mux_ruby/models/metric'
93
95
  require 'mux_ruby/models/notification_rule'
@@ -108,6 +110,7 @@ require 'mux_ruby/models/simulcast_target_response'
108
110
  require 'mux_ruby/models/track'
109
111
  require 'mux_ruby/models/update_asset_mp4_support_request'
110
112
  require 'mux_ruby/models/update_asset_master_access_request'
113
+ require 'mux_ruby/models/update_live_stream_embedded_subtitles_request'
111
114
  require 'mux_ruby/models/upload'
112
115
  require 'mux_ruby/models/upload_error'
113
116
  require 'mux_ruby/models/upload_response'
data/mux_ruby.gemspec CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.homepage = "https://docs.mux.com"
25
25
  s.summary = "Mux API Ruby Gem"
26
26
  s.description = "The Ruby client for Mux Data and Mux Video."
27
+ s.metadata = { "source_code_uri" => "https://github.com/muxinc/mux-ruby" }
27
28
  s.license = "MIT"
28
29
  s.required_ruby_version = ">= 2.4"
29
30