mux_ruby 3.0.0 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +4 -4
- data/docs/Asset.md +1 -1
- data/docs/AssetsApi.md +73 -0
- data/docs/CreateAssetRequest.md +1 -1
- data/docs/CreateLiveStreamRequest.md +4 -2
- data/docs/CreatePlaybackRestrictionRequest.md +18 -0
- data/docs/CreateSimulcastTargetRequest.md +1 -1
- data/docs/CreateTrackRequest.md +1 -1
- data/docs/DeliveryUsageApi.md +4 -2
- data/docs/DimensionsApi.md +4 -4
- data/docs/ErrorsApi.md +4 -4
- data/docs/FiltersApi.md +4 -4
- data/docs/InputSettings.md +1 -1
- data/docs/ListPlaybackRestrictionsResponse.md +18 -0
- data/docs/LiveStream.md +8 -4
- data/docs/LiveStreamEmbeddedSubtitleSettings.md +1 -1
- data/docs/LiveStreamStatus.md +15 -0
- data/docs/LiveStreamsApi.md +76 -1
- data/docs/MetricsApi.md +21 -21
- data/docs/PlaybackRestriction.md +24 -0
- data/docs/PlaybackRestrictionResponse.md +18 -0
- data/docs/PlaybackRestrictionsApi.md +367 -0
- data/docs/RealTimeApi.md +6 -6
- data/docs/ReferrerDomainRestriction.md +20 -0
- data/docs/SimulcastTarget.md +1 -1
- data/docs/Track.md +1 -1
- data/docs/UpdateAssetRequest.md +18 -0
- data/docs/UpdateLiveStreamRequest.md +22 -0
- data/docs/UpdateReferrerDomainRestrictionRequest.md +15 -0
- data/docs/VideoViewsApi.md +4 -4
- data/examples/data/exercise-errors.rb +0 -1
- data/gen/generator-config.json +1 -1
- data/lib/mux_ruby/api/assets_api.rb +71 -0
- data/lib/mux_ruby/api/delivery_usage_api.rb +5 -2
- data/lib/mux_ruby/api/dimensions_api.rb +4 -4
- data/lib/mux_ruby/api/errors_api.rb +4 -4
- data/lib/mux_ruby/api/filters_api.rb +4 -4
- data/lib/mux_ruby/api/live_streams_api.rb +74 -0
- data/lib/mux_ruby/api/metrics_api.rb +22 -22
- data/lib/mux_ruby/api/playback_restrictions_api.rb +345 -0
- data/lib/mux_ruby/api/real_time_api.rb +6 -6
- data/lib/mux_ruby/api/video_views_api.rb +4 -4
- data/lib/mux_ruby/models/asset.rb +1 -1
- data/lib/mux_ruby/models/create_asset_request.rb +1 -1
- data/lib/mux_ruby/models/create_live_stream_request.rb +47 -3
- data/lib/mux_ruby/models/create_playback_restriction_request.rb +218 -0
- data/lib/mux_ruby/models/create_simulcast_target_request.rb +1 -1
- data/lib/mux_ruby/models/create_track_request.rb +1 -1
- data/lib/mux_ruby/models/input_settings.rb +1 -1
- data/lib/mux_ruby/models/input_settings_overlay_settings.rb +1 -1
- data/lib/mux_ruby/models/list_playback_restrictions_response.rb +220 -0
- data/lib/mux_ruby/models/live_stream.rb +35 -14
- data/lib/mux_ruby/models/live_stream_embedded_subtitle_settings.rb +1 -1
- data/lib/mux_ruby/models/live_stream_status.rb +38 -0
- data/lib/mux_ruby/models/playback_restriction.rb +248 -0
- data/lib/mux_ruby/models/playback_restriction_response.rb +218 -0
- data/lib/mux_ruby/models/referrer_domain_restriction.rb +234 -0
- data/lib/mux_ruby/models/simulcast_target.rb +1 -1
- data/lib/mux_ruby/models/track.rb +1 -1
- data/lib/mux_ruby/models/update_asset_request.rb +219 -0
- data/lib/mux_ruby/models/update_live_stream_request.rb +297 -0
- data/lib/mux_ruby/models/update_referrer_domain_restriction_request.rb +209 -0
- data/lib/mux_ruby/version.rb +1 -1
- data/lib/mux_ruby.rb +10 -0
- data/spec/api/playback_restrictions_api_spec.rb +97 -0
- data/spec/models/create_playback_restriction_request_spec.rb +34 -0
- data/spec/models/list_playback_restrictions_response_spec.rb +34 -0
- data/spec/models/live_stream_status_spec.rb +28 -0
- data/spec/models/playback_restriction_response_spec.rb +28 -0
- data/spec/models/playback_restriction_spec.rb +52 -0
- data/spec/models/referrer_domain_restriction_spec.rb +40 -0
- data/spec/models/update_asset_request_spec.rb +34 -0
- data/spec/models/update_live_stream_request_spec.rb +50 -0
- data/spec/models/update_referrer_domain_restriction_request_spec.rb +28 -0
- metadata +135 -95
@@ -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 CreatePlaybackRestrictionRequest
|
18
|
+
attr_accessor :referrer
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'referrer' => :'referrer'
|
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
|
+
:'referrer' => :'ReferrerDomainRestriction'
|
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::CreatePlaybackRestrictionRequest` 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::CreatePlaybackRestrictionRequest`. 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?(:'referrer')
|
61
|
+
self.referrer = attributes[:'referrer']
|
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
|
+
referrer == o.referrer
|
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
|
+
[referrer].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
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module MuxRuby
|
17
17
|
class CreateSimulcastTargetRequest
|
18
|
-
# Arbitrary metadata set by you when creating a simulcast target.
|
18
|
+
# Arbitrary user-supplied metadata set by you when creating a simulcast target.
|
19
19
|
attr_accessor :passthrough
|
20
20
|
|
21
21
|
# Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to.
|
@@ -30,7 +30,7 @@ module MuxRuby
|
|
30
30
|
# Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH).
|
31
31
|
attr_accessor :closed_captions
|
32
32
|
|
33
|
-
# Arbitrary metadata set for the track either when creating the asset or track.
|
33
|
+
# Arbitrary user-supplied metadata set for the track either when creating the asset or track.
|
34
34
|
attr_accessor :passthrough
|
35
35
|
|
36
36
|
class EnumAttributeValidator
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module MuxRuby
|
17
17
|
# An array of objects that each describe an input file to be used to create the asset. As a shortcut, `input` can also be a string URL for a file when only one input file is used. See `input[].url` for requirements.
|
18
18
|
class InputSettings
|
19
|
-
# The
|
19
|
+
# The URL of the file that Mux should download and use. * For subtitles text tracks, the URL is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the URL is the location of the watermark image. * When creating clips from existing Mux assets, the URL is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from.
|
20
20
|
attr_accessor :url
|
21
21
|
|
22
22
|
attr_accessor :overlay_settings
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MuxRuby
|
17
|
-
# An object that describes how the image file referenced in
|
17
|
+
# An object that describes how the image file referenced in URL should be placed over the video (i.e. watermarking). Ensure that the URL is active and persists the entire lifespan of the video object.
|
18
18
|
class InputSettingsOverlaySettings
|
19
19
|
# Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"`
|
20
20
|
attr_accessor :vertical_align
|
@@ -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.
|
@@ -38,24 +37,30 @@ module MuxRuby
|
|
38
37
|
|
39
38
|
attr_accessor :new_asset_settings
|
40
39
|
|
41
|
-
# Arbitrary metadata set for the asset. Max 255 characters.
|
40
|
+
# Arbitrary user-supplied metadata set for the asset. Max 255 characters.
|
42
41
|
attr_accessor :passthrough
|
43
42
|
|
44
43
|
# The live stream only processes the audio track if the value is set to true. Mux drops the video track if broadcasted.
|
45
44
|
attr_accessor :audio_only
|
46
45
|
|
46
|
+
# Describes the embedded closed caption configuration of the incoming live stream.
|
47
|
+
attr_accessor :embedded_subtitles
|
48
|
+
|
47
49
|
# When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. **Min**: 0.1s. **Max**: 300s (5 minutes).
|
48
50
|
attr_accessor :reconnect_window
|
49
51
|
|
50
|
-
# Latency is the time from when the streamer
|
52
|
+
# This field is deprecated. Please use latency_mode instead. Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this if you want lower latency for your live stream. **Note**: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. See the [Reduce live stream latency guide](https://docs.mux.com/guides/video/reduce-live-stream-latency) to understand the tradeoffs.
|
51
53
|
attr_accessor :reduced_latency
|
52
54
|
|
53
|
-
# Latency is the time from when the streamer
|
55
|
+
# This field is deprecated. Please use latency_mode instead. Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Setting this option will enable compatibility with the LL-HLS specification for low-latency streaming. This typically has lower latency than Reduced Latency streams, and cannot be combined with Reduced Latency. Note: Reconnect windows are incompatible with Low Latency and will always be set to zero (0) seconds.
|
54
56
|
attr_accessor :low_latency
|
55
57
|
|
56
58
|
# Each Simulcast Target contains configuration details to broadcast (or \"restream\") a live stream to a third-party streaming service. [See the Stream live to 3rd party platforms guide](https://docs.mux.com/guides/video/stream-live-to-3rd-party-platforms).
|
57
59
|
attr_accessor :simulcast_targets
|
58
60
|
|
61
|
+
# Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this as an alternative to setting low latency or reduced latency flags. The Low Latency value is a beta feature. Note: Reconnect windows are incompatible with Reduced Latency and Low Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/introducing-low-latency-live-streaming/
|
62
|
+
attr_accessor :latency_mode
|
63
|
+
|
59
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.
|
60
65
|
attr_accessor :test
|
61
66
|
|
@@ -94,10 +99,12 @@ module MuxRuby
|
|
94
99
|
:'new_asset_settings' => :'new_asset_settings',
|
95
100
|
:'passthrough' => :'passthrough',
|
96
101
|
:'audio_only' => :'audio_only',
|
102
|
+
:'embedded_subtitles' => :'embedded_subtitles',
|
97
103
|
:'reconnect_window' => :'reconnect_window',
|
98
104
|
:'reduced_latency' => :'reduced_latency',
|
99
105
|
:'low_latency' => :'low_latency',
|
100
106
|
:'simulcast_targets' => :'simulcast_targets',
|
107
|
+
:'latency_mode' => :'latency_mode',
|
101
108
|
:'test' => :'test'
|
102
109
|
}
|
103
110
|
end
|
@@ -115,15 +122,17 @@ module MuxRuby
|
|
115
122
|
:'stream_key' => :'String',
|
116
123
|
:'active_asset_id' => :'String',
|
117
124
|
:'recent_asset_ids' => :'Array<String>',
|
118
|
-
:'status' => :'
|
125
|
+
:'status' => :'LiveStreamStatus',
|
119
126
|
:'playback_ids' => :'Array<PlaybackID>',
|
120
127
|
:'new_asset_settings' => :'CreateAssetRequest',
|
121
128
|
:'passthrough' => :'String',
|
122
129
|
:'audio_only' => :'Boolean',
|
130
|
+
:'embedded_subtitles' => :'Array<LiveStreamEmbeddedSubtitleSettings>',
|
123
131
|
:'reconnect_window' => :'Float',
|
124
132
|
:'reduced_latency' => :'Boolean',
|
125
133
|
:'low_latency' => :'Boolean',
|
126
134
|
:'simulcast_targets' => :'Array<SimulcastTarget>',
|
135
|
+
:'latency_mode' => :'String',
|
127
136
|
:'test' => :'Boolean'
|
128
137
|
}
|
129
138
|
end
|
@@ -193,6 +202,12 @@ module MuxRuby
|
|
193
202
|
self.audio_only = attributes[:'audio_only']
|
194
203
|
end
|
195
204
|
|
205
|
+
if attributes.key?(:'embedded_subtitles')
|
206
|
+
if (value = attributes[:'embedded_subtitles']).is_a?(Array)
|
207
|
+
self.embedded_subtitles = value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
196
211
|
if attributes.key?(:'reconnect_window')
|
197
212
|
self.reconnect_window = attributes[:'reconnect_window']
|
198
213
|
else
|
@@ -213,6 +228,10 @@ module MuxRuby
|
|
213
228
|
end
|
214
229
|
end
|
215
230
|
|
231
|
+
if attributes.key?(:'latency_mode')
|
232
|
+
self.latency_mode = attributes[:'latency_mode']
|
233
|
+
end
|
234
|
+
|
216
235
|
if attributes.key?(:'test')
|
217
236
|
self.test = attributes[:'test']
|
218
237
|
end
|
@@ -228,19 +247,19 @@ module MuxRuby
|
|
228
247
|
# Check to see if the all the properties in the model are valid
|
229
248
|
# @return true if the model is valid
|
230
249
|
def valid?
|
231
|
-
|
232
|
-
return false unless
|
250
|
+
latency_mode_validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
|
251
|
+
return false unless latency_mode_validator.valid?(@latency_mode)
|
233
252
|
true
|
234
253
|
end
|
235
254
|
|
236
255
|
# Custom attribute writer method checking allowed values (enum).
|
237
|
-
# @param [Object]
|
238
|
-
def
|
239
|
-
validator = EnumAttributeValidator.new('String', ["
|
240
|
-
unless validator.valid?(
|
241
|
-
fail ArgumentError, "invalid value for \"
|
256
|
+
# @param [Object] latency_mode Object to be assigned
|
257
|
+
def latency_mode=(latency_mode)
|
258
|
+
validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
|
259
|
+
unless validator.valid?(latency_mode)
|
260
|
+
fail ArgumentError, "invalid value for \"latency_mode\", must be one of #{validator.allowable_values}."
|
242
261
|
end
|
243
|
-
@
|
262
|
+
@latency_mode = latency_mode
|
244
263
|
end
|
245
264
|
|
246
265
|
# Checks equality by comparing each attribute.
|
@@ -258,10 +277,12 @@ module MuxRuby
|
|
258
277
|
new_asset_settings == o.new_asset_settings &&
|
259
278
|
passthrough == o.passthrough &&
|
260
279
|
audio_only == o.audio_only &&
|
280
|
+
embedded_subtitles == o.embedded_subtitles &&
|
261
281
|
reconnect_window == o.reconnect_window &&
|
262
282
|
reduced_latency == o.reduced_latency &&
|
263
283
|
low_latency == o.low_latency &&
|
264
284
|
simulcast_targets == o.simulcast_targets &&
|
285
|
+
latency_mode == o.latency_mode &&
|
265
286
|
test == o.test
|
266
287
|
end
|
267
288
|
|
@@ -274,7 +295,7 @@ module MuxRuby
|
|
274
295
|
# Calculates hash code according to all attributes.
|
275
296
|
# @return [Integer] Hash code
|
276
297
|
def hash
|
277
|
-
[id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, reconnect_window, reduced_latency, low_latency, simulcast_targets, test].hash
|
298
|
+
[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
|
278
299
|
end
|
279
300
|
|
280
301
|
# Builds the object from hash
|
@@ -18,7 +18,7 @@ module MuxRuby
|
|
18
18
|
# A name for this live stream closed caption track.
|
19
19
|
attr_accessor :name
|
20
20
|
|
21
|
-
# Arbitrary metadata set for the live stream closed caption track. Max 255 characters.
|
21
|
+
# Arbitrary user-supplied metadata set for the live stream closed caption track. Max 255 characters.
|
22
22
|
attr_accessor :passthrough
|
23
23
|
|
24
24
|
# The language of the closed caption stream. Value must be BCP 47 compliant.
|
@@ -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
|