mux_ruby 3.2.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) 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 -2
  5. data/docs/AssetResponse.md +1 -1
  6. data/docs/AssetsApi.md +8 -0
  7. data/docs/CreateLiveStreamRequest.md +3 -1
  8. data/docs/CreatePlaybackIDResponse.md +1 -1
  9. data/docs/CreatePlaybackRestrictionRequest.md +1 -1
  10. data/docs/CreateTrackResponse.md +1 -1
  11. data/docs/DirectUploadsApi.md +6 -0
  12. data/docs/GetAssetPlaybackIDResponse.md +1 -1
  13. data/docs/GetLiveStreamPlaybackIDResponse.md +1 -1
  14. data/docs/IncidentResponse.md +1 -1
  15. data/docs/InputSettings.md +3 -3
  16. data/docs/ListPlaybackRestrictionsResponse.md +18 -0
  17. data/docs/LiveStream.md +4 -2
  18. data/docs/LiveStreamResponse.md +1 -1
  19. data/docs/LiveStreamStatus.md +15 -0
  20. data/docs/LiveStreamsApi.md +19 -5
  21. data/docs/MetricsApi.md +3 -3
  22. data/docs/PlaybackRestrictionResponse.md +4 -1
  23. data/docs/PlaybackRestrictionsApi.md +21 -21
  24. data/docs/SigningKeyResponse.md +1 -1
  25. data/docs/SimulcastTargetResponse.md +1 -1
  26. data/docs/Track.md +9 -7
  27. data/docs/UpdateLiveStreamRequest.md +3 -1
  28. data/docs/UpdateReferrerDomainRestrictionRequest.md +37 -5
  29. data/docs/UploadResponse.md +1 -1
  30. data/docs/VideoViewResponse.md +1 -1
  31. data/gen/generator-config.json +1 -1
  32. data/lib/mux_ruby/api/assets_api.rb +8 -0
  33. data/lib/mux_ruby/api/direct_uploads_api.rb +6 -0
  34. data/lib/mux_ruby/api/live_streams_api.rb +17 -2
  35. data/lib/mux_ruby/api/metrics_api.rb +5 -5
  36. data/lib/mux_ruby/api/playback_restrictions_api.rb +23 -23
  37. data/lib/mux_ruby/models/abridged_video_view.rb +7 -0
  38. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +2 -2
  39. data/lib/mux_ruby/models/create_live_stream_request.rb +40 -4
  40. data/lib/mux_ruby/models/input_settings.rb +3 -3
  41. data/lib/mux_ruby/models/list_playback_restrictions_response.rb +220 -0
  42. data/lib/mux_ruby/models/live_stream.rb +41 -18
  43. data/lib/mux_ruby/models/live_stream_status.rb +38 -0
  44. data/lib/mux_ruby/models/playback_restriction_response.rb +11 -2
  45. data/lib/mux_ruby/models/track.rb +32 -10
  46. data/lib/mux_ruby/models/update_live_stream_request.rb +40 -4
  47. data/lib/mux_ruby/models/update_referrer_domain_restriction_request.rb +74 -179
  48. data/lib/mux_ruby/models/video_view.rb +103 -0
  49. data/lib/mux_ruby/version.rb +1 -1
  50. data/lib/mux_ruby.rb +2 -0
  51. data/spec/models/list_playback_restrictions_response_spec.rb +34 -0
  52. data/spec/models/live_stream_status_spec.rb +28 -0
  53. metadata +109 -101
@@ -44,6 +44,9 @@ module MuxRuby
44
44
 
45
45
  attr_accessor :simulcast_targets
46
46
 
47
+ # The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours.
48
+ attr_accessor :max_continuous_duration
49
+
47
50
  class EnumAttributeValidator
48
51
  attr_reader :datatype
49
52
  attr_reader :allowable_values
@@ -79,7 +82,8 @@ module MuxRuby
79
82
  :'low_latency' => :'low_latency',
80
83
  :'latency_mode' => :'latency_mode',
81
84
  :'test' => :'test',
82
- :'simulcast_targets' => :'simulcast_targets'
85
+ :'simulcast_targets' => :'simulcast_targets',
86
+ :'max_continuous_duration' => :'max_continuous_duration'
83
87
  }
84
88
  end
85
89
 
@@ -101,7 +105,8 @@ module MuxRuby
101
105
  :'low_latency' => :'Boolean',
102
106
  :'latency_mode' => :'String',
103
107
  :'test' => :'Boolean',
104
- :'simulcast_targets' => :'Array<CreateSimulcastTargetRequest>'
108
+ :'simulcast_targets' => :'Array<CreateSimulcastTargetRequest>',
109
+ :'max_continuous_duration' => :'Integer'
105
110
  }
106
111
  end
107
112
 
@@ -175,6 +180,12 @@ module MuxRuby
175
180
  self.simulcast_targets = value
176
181
  end
177
182
  end
183
+
184
+ if attributes.key?(:'max_continuous_duration')
185
+ self.max_continuous_duration = attributes[:'max_continuous_duration']
186
+ else
187
+ self.max_continuous_duration = 43200
188
+ end
178
189
  end
179
190
 
180
191
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -189,6 +200,14 @@ module MuxRuby
189
200
  invalid_properties.push('invalid value for "reconnect_window", must be greater than or equal to 0.1.')
190
201
  end
191
202
 
203
+ if !@max_continuous_duration.nil? && @max_continuous_duration > 43200
204
+ invalid_properties.push('invalid value for "max_continuous_duration", must be smaller than or equal to 43200.')
205
+ end
206
+
207
+ if !@max_continuous_duration.nil? && @max_continuous_duration < 60
208
+ invalid_properties.push('invalid value for "max_continuous_duration", must be greater than or equal to 60.')
209
+ end
210
+
192
211
  invalid_properties
193
212
  end
194
213
 
@@ -199,6 +218,8 @@ module MuxRuby
199
218
  return false if !@reconnect_window.nil? && @reconnect_window < 0.1
200
219
  latency_mode_validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
201
220
  return false unless latency_mode_validator.valid?(@latency_mode)
221
+ return false if !@max_continuous_duration.nil? && @max_continuous_duration > 43200
222
+ return false if !@max_continuous_duration.nil? && @max_continuous_duration < 60
202
223
  true
203
224
  end
204
225
 
@@ -226,6 +247,20 @@ module MuxRuby
226
247
  @latency_mode = latency_mode
227
248
  end
228
249
 
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] max_continuous_duration Value to be assigned
252
+ def max_continuous_duration=(max_continuous_duration)
253
+ if !max_continuous_duration.nil? && max_continuous_duration > 43200
254
+ fail ArgumentError, 'invalid value for "max_continuous_duration", must be smaller than or equal to 43200.'
255
+ end
256
+
257
+ if !max_continuous_duration.nil? && max_continuous_duration < 60
258
+ fail ArgumentError, 'invalid value for "max_continuous_duration", must be greater than or equal to 60.'
259
+ end
260
+
261
+ @max_continuous_duration = max_continuous_duration
262
+ end
263
+
229
264
  # Checks equality by comparing each attribute.
230
265
  # @param [Object] Object to be compared
231
266
  def ==(o)
@@ -241,7 +276,8 @@ module MuxRuby
241
276
  low_latency == o.low_latency &&
242
277
  latency_mode == o.latency_mode &&
243
278
  test == o.test &&
244
- simulcast_targets == o.simulcast_targets
279
+ simulcast_targets == o.simulcast_targets &&
280
+ max_continuous_duration == o.max_continuous_duration
245
281
  end
246
282
 
247
283
  # @see the `==` method
@@ -253,7 +289,7 @@ module MuxRuby
253
289
  # Calculates hash code according to all attributes.
254
290
  # @return [Integer] Hash code
255
291
  def hash
256
- [playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, embedded_subtitles, reduced_latency, low_latency, latency_mode, test, simulcast_targets].hash
292
+ [playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, embedded_subtitles, reduced_latency, low_latency, latency_mode, test, simulcast_targets, max_continuous_duration].hash
257
293
  end
258
294
 
259
295
  # Builds the object from hash
@@ -27,16 +27,16 @@ module MuxRuby
27
27
  # The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format.
28
28
  attr_accessor :end_time
29
29
 
30
- # This parameter is required for the `text` track type.
30
+ # This parameter is required for `text` type tracks.
31
31
  attr_accessor :type
32
32
 
33
- # Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type.
33
+ # Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` type tracks.
34
34
  attr_accessor :text_type
35
35
 
36
36
  # The language code value must be a valid [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, en for English or en-US for the US version of English. This parameter is required for text type and subtitles text type track.
37
37
  attr_accessor :language_code
38
38
 
39
- # The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type track. If this parameter is not included, Mux will auto-populate based on the `input[].language_code` value.
39
+ # The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type tracks. If this parameter is not included, Mux will auto-populate based on the `input[].language_code` value.
40
40
  attr_accessor :name
41
41
 
42
42
  # Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This optional parameter should be used for `text` type and subtitles `text` type tracks.
@@ -0,0 +1,220 @@
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 ListPlaybackRestrictionsResponse
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' => :'Array<PlaybackRestriction>'
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::ListPlaybackRestrictionsResponse` 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::ListPlaybackRestrictionsResponse`. 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
+ if (value = attributes[:'data']).is_a?(Array)
62
+ self.data = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ data == o.data
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [data].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = MuxRuby.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -30,7 +30,6 @@ module MuxRuby
30
30
  # An array of strings with the most recent Assets that were created from this live stream.
31
31
  attr_accessor :recent_asset_ids
32
32
 
33
- # `idle` indicates that there is no active broadcast. `active` indicates that there is an active broadcast and `disabled` status indicates that no future RTMP streams can be published.
34
33
  attr_accessor :status
35
34
 
36
35
  # An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details.
@@ -65,6 +64,9 @@ module MuxRuby
65
64
  # True means this live stream is a test live stream. Test live streams can be used to help evaluate the Mux Video APIs for free. There is no limit on the number of test live streams, but they are watermarked with the Mux logo, and limited to 5 minutes. The test live stream is disabled after the stream is active for 5 mins and the recorded asset also deleted after 24 hours.
66
65
  attr_accessor :test
67
66
 
67
+ # The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours.
68
+ attr_accessor :max_continuous_duration
69
+
68
70
  class EnumAttributeValidator
69
71
  attr_reader :datatype
70
72
  attr_reader :allowable_values
@@ -106,7 +108,8 @@ module MuxRuby
106
108
  :'low_latency' => :'low_latency',
107
109
  :'simulcast_targets' => :'simulcast_targets',
108
110
  :'latency_mode' => :'latency_mode',
109
- :'test' => :'test'
111
+ :'test' => :'test',
112
+ :'max_continuous_duration' => :'max_continuous_duration'
110
113
  }
111
114
  end
112
115
 
@@ -123,7 +126,7 @@ module MuxRuby
123
126
  :'stream_key' => :'String',
124
127
  :'active_asset_id' => :'String',
125
128
  :'recent_asset_ids' => :'Array<String>',
126
- :'status' => :'String',
129
+ :'status' => :'LiveStreamStatus',
127
130
  :'playback_ids' => :'Array<PlaybackID>',
128
131
  :'new_asset_settings' => :'CreateAssetRequest',
129
132
  :'passthrough' => :'String',
@@ -134,7 +137,8 @@ module MuxRuby
134
137
  :'low_latency' => :'Boolean',
135
138
  :'simulcast_targets' => :'Array<SimulcastTarget>',
136
139
  :'latency_mode' => :'String',
137
- :'test' => :'Boolean'
140
+ :'test' => :'Boolean',
141
+ :'max_continuous_duration' => :'Integer'
138
142
  }
139
143
  end
140
144
 
@@ -236,35 +240,39 @@ module MuxRuby
236
240
  if attributes.key?(:'test')
237
241
  self.test = attributes[:'test']
238
242
  end
243
+
244
+ if attributes.key?(:'max_continuous_duration')
245
+ self.max_continuous_duration = attributes[:'max_continuous_duration']
246
+ else
247
+ self.max_continuous_duration = 43200
248
+ end
239
249
  end
240
250
 
241
251
  # Show invalid properties with the reasons. Usually used together with valid?
242
252
  # @return Array for valid properties with the reasons
243
253
  def list_invalid_properties
244
254
  invalid_properties = Array.new
255
+ if !@max_continuous_duration.nil? && @max_continuous_duration > 43200
256
+ invalid_properties.push('invalid value for "max_continuous_duration", must be smaller than or equal to 43200.')
257
+ end
258
+
259
+ if !@max_continuous_duration.nil? && @max_continuous_duration < 60
260
+ invalid_properties.push('invalid value for "max_continuous_duration", must be greater than or equal to 60.')
261
+ end
262
+
245
263
  invalid_properties
246
264
  end
247
265
 
248
266
  # Check to see if the all the properties in the model are valid
249
267
  # @return true if the model is valid
250
268
  def valid?
251
- status_validator = EnumAttributeValidator.new('String', ["active", "idle", "disabled"])
252
- return false unless status_validator.valid?(@status)
253
269
  latency_mode_validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
254
270
  return false unless latency_mode_validator.valid?(@latency_mode)
271
+ return false if !@max_continuous_duration.nil? && @max_continuous_duration > 43200
272
+ return false if !@max_continuous_duration.nil? && @max_continuous_duration < 60
255
273
  true
256
274
  end
257
275
 
258
- # Custom attribute writer method checking allowed values (enum).
259
- # @param [Object] status Object to be assigned
260
- def status=(status)
261
- validator = EnumAttributeValidator.new('String', ["active", "idle", "disabled"])
262
- unless validator.valid?(status)
263
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
264
- end
265
- @status = status
266
- end
267
-
268
276
  # Custom attribute writer method checking allowed values (enum).
269
277
  # @param [Object] latency_mode Object to be assigned
270
278
  def latency_mode=(latency_mode)
@@ -275,6 +283,20 @@ module MuxRuby
275
283
  @latency_mode = latency_mode
276
284
  end
277
285
 
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] max_continuous_duration Value to be assigned
288
+ def max_continuous_duration=(max_continuous_duration)
289
+ if !max_continuous_duration.nil? && max_continuous_duration > 43200
290
+ fail ArgumentError, 'invalid value for "max_continuous_duration", must be smaller than or equal to 43200.'
291
+ end
292
+
293
+ if !max_continuous_duration.nil? && max_continuous_duration < 60
294
+ fail ArgumentError, 'invalid value for "max_continuous_duration", must be greater than or equal to 60.'
295
+ end
296
+
297
+ @max_continuous_duration = max_continuous_duration
298
+ end
299
+
278
300
  # Checks equality by comparing each attribute.
279
301
  # @param [Object] Object to be compared
280
302
  def ==(o)
@@ -296,7 +318,8 @@ module MuxRuby
296
318
  low_latency == o.low_latency &&
297
319
  simulcast_targets == o.simulcast_targets &&
298
320
  latency_mode == o.latency_mode &&
299
- test == o.test
321
+ test == o.test &&
322
+ max_continuous_duration == o.max_continuous_duration
300
323
  end
301
324
 
302
325
  # @see the `==` method
@@ -308,7 +331,7 @@ module MuxRuby
308
331
  # Calculates hash code according to all attributes.
309
332
  # @return [Integer] Hash code
310
333
  def hash
311
- [id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, embedded_subtitles, reconnect_window, reduced_latency, low_latency, simulcast_targets, latency_mode, test].hash
334
+ [id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, embedded_subtitles, reconnect_window, reduced_latency, low_latency, simulcast_targets, latency_mode, test, max_continuous_duration].hash
312
335
  end
313
336
 
314
337
  # Builds the object from hash
@@ -0,0 +1,38 @@
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 LiveStreamStatus
18
+ ACTIVE = "active".freeze
19
+ IDLE = "idle".freeze
20
+ DISABLED = "disabled".freeze
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ constantValues = LiveStreamStatus.constants.select { |c| LiveStreamStatus::const_get(c) == value }
34
+ raise "Invalid ENUM value #{value} for class #LiveStreamStatus" if constantValues.empty?
35
+ value
36
+ end
37
+ end
38
+ end
@@ -15,9 +15,12 @@ require 'time'
15
15
 
16
16
  module MuxRuby
17
17
  class PlaybackRestrictionResponse
18
+ attr_accessor :data
19
+
18
20
  # Attribute mapping from ruby-style variable name to JSON key.
19
21
  def self.attribute_map
20
22
  {
23
+ :'data' => :'data'
21
24
  }
22
25
  end
23
26
 
@@ -29,6 +32,7 @@ module MuxRuby
29
32
  # Attribute type mapping.
30
33
  def self.openapi_types
31
34
  {
35
+ :'data' => :'PlaybackRestriction'
32
36
  }
33
37
  end
34
38
 
@@ -52,6 +56,10 @@ module MuxRuby
52
56
  end
53
57
  h[k.to_sym] = v
54
58
  }
59
+
60
+ if attributes.key?(:'data')
61
+ self.data = attributes[:'data']
62
+ end
55
63
  end
56
64
 
57
65
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -71,7 +79,8 @@ module MuxRuby
71
79
  # @param [Object] Object to be compared
72
80
  def ==(o)
73
81
  return true if self.equal?(o)
74
- self.class == o.class
82
+ self.class == o.class &&
83
+ data == o.data
75
84
  end
76
85
 
77
86
  # @see the `==` method
@@ -83,7 +92,7 @@ module MuxRuby
83
92
  # Calculates hash code according to all attributes.
84
93
  # @return [Integer] Hash code
85
94
  def hash
86
- [].hash
95
+ [data].hash
87
96
  end
88
97
 
89
98
  # Builds the object from hash
@@ -21,7 +21,7 @@ module MuxRuby
21
21
  # The type of track
22
22
  attr_accessor :type
23
23
 
24
- # The duration in seconds of the track media. This parameter is not set for the `text` type track. This field is optional and may not be set. The top level `duration` field of an asset will always be set.
24
+ # The duration in seconds of the track media. This parameter is not set for `text` type tracks. This field is optional and may not be set. The top level `duration` field of an asset will always be set.
25
25
  attr_accessor :duration
26
26
 
27
27
  # The maximum width in pixels available for the track. Only set for the `video` type track.
@@ -39,21 +39,24 @@ module MuxRuby
39
39
  # Only set for the `audio` type track.
40
40
  attr_accessor :max_channel_layout
41
41
 
42
- # This parameter is set only for the `text` type track.
42
+ # This parameter is only set for `text` type tracks.
43
43
  attr_accessor :text_type
44
44
 
45
- # The language code value represents [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is set for `text` type and `subtitles` text type track.
45
+ # The language code value represents [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is only set for `text` type and `subtitles` text type tracks.
46
46
  attr_accessor :language_code
47
47
 
48
- # The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is set for the `text` type and `subtitles` text type track.
48
+ # The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is only set for `text` type and `subtitles` text type tracks.
49
49
  attr_accessor :name
50
50
 
51
- # Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is set for the `text` type and `subtitles` text type track.
51
+ # Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is only set for `text` type and `subtitles` text type tracks.
52
52
  attr_accessor :closed_captions
53
53
 
54
- # Arbitrary user-supplied metadata set for the track either when creating the asset or track. This parameter is set for `text` type and `subtitles` text type track. Max 255 characters.
54
+ # Arbitrary user-supplied metadata set for the track either when creating the asset or track. This parameter is only set for `text` type tracks. Max 255 characters.
55
55
  attr_accessor :passthrough
56
56
 
57
+ # The status of the track. This parameter is only set for `text` type tracks.
58
+ attr_accessor :status
59
+
57
60
  class EnumAttributeValidator
58
61
  attr_reader :datatype
59
62
  attr_reader :allowable_values
@@ -91,7 +94,8 @@ module MuxRuby
91
94
  :'language_code' => :'language_code',
92
95
  :'name' => :'name',
93
96
  :'closed_captions' => :'closed_captions',
94
- :'passthrough' => :'passthrough'
97
+ :'passthrough' => :'passthrough',
98
+ :'status' => :'status'
95
99
  }
96
100
  end
97
101
 
@@ -115,7 +119,8 @@ module MuxRuby
115
119
  :'language_code' => :'String',
116
120
  :'name' => :'String',
117
121
  :'closed_captions' => :'Boolean',
118
- :'passthrough' => :'String'
122
+ :'passthrough' => :'String',
123
+ :'status' => :'String'
119
124
  }
120
125
  end
121
126
 
@@ -191,6 +196,10 @@ module MuxRuby
191
196
  if attributes.key?(:'passthrough')
192
197
  self.passthrough = attributes[:'passthrough']
193
198
  end
199
+
200
+ if attributes.key?(:'status')
201
+ self.status = attributes[:'status']
202
+ end
194
203
  end
195
204
 
196
205
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -207,6 +216,8 @@ module MuxRuby
207
216
  return false unless type_validator.valid?(@type)
208
217
  text_type_validator = EnumAttributeValidator.new('String', ["subtitles"])
209
218
  return false unless text_type_validator.valid?(@text_type)
219
+ status_validator = EnumAttributeValidator.new('String', ["preparing", "ready", "errored"])
220
+ return false unless status_validator.valid?(@status)
210
221
  true
211
222
  end
212
223
 
@@ -230,6 +241,16 @@ module MuxRuby
230
241
  @text_type = text_type
231
242
  end
232
243
 
244
+ # Custom attribute writer method checking allowed values (enum).
245
+ # @param [Object] status Object to be assigned
246
+ def status=(status)
247
+ validator = EnumAttributeValidator.new('String', ["preparing", "ready", "errored"])
248
+ unless validator.valid?(status)
249
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
250
+ end
251
+ @status = status
252
+ end
253
+
233
254
  # Checks equality by comparing each attribute.
234
255
  # @param [Object] Object to be compared
235
256
  def ==(o)
@@ -247,7 +268,8 @@ module MuxRuby
247
268
  language_code == o.language_code &&
248
269
  name == o.name &&
249
270
  closed_captions == o.closed_captions &&
250
- passthrough == o.passthrough
271
+ passthrough == o.passthrough &&
272
+ status == o.status
251
273
  end
252
274
 
253
275
  # @see the `==` method
@@ -259,7 +281,7 @@ module MuxRuby
259
281
  # Calculates hash code according to all attributes.
260
282
  # @return [Integer] Hash code
261
283
  def hash
262
- [id, type, duration, max_width, max_height, max_frame_rate, max_channels, max_channel_layout, text_type, language_code, name, closed_captions, passthrough].hash
284
+ [id, type, duration, max_width, max_height, max_frame_rate, max_channels, max_channel_layout, text_type, language_code, name, closed_captions, passthrough, status].hash
263
285
  end
264
286
 
265
287
  # Builds the object from hash