mux_ruby 1.0.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +37 -35
  4. data/README.md +5 -0
  5. data/docs/Asset.md +2 -1
  6. data/docs/AssetsApi.md +157 -0
  7. data/docs/CreateAssetRequest.md +3 -1
  8. data/docs/CreateLiveStreamRequest.md +4 -0
  9. data/docs/CreateSimulcastTargetRequest.md +10 -0
  10. data/docs/CreateTrackRequest.md +14 -0
  11. data/docs/CreateTrackResponse.md +8 -0
  12. data/docs/CreateUploadRequest.md +1 -0
  13. data/docs/DeliveryReport.md +14 -0
  14. data/docs/DeliveryUsageApi.md +68 -0
  15. data/docs/GetMetricTimeseriesDataResponse.md +1 -1
  16. data/docs/GetOverallValuesResponse.md +1 -1
  17. data/docs/InputSettings.md +6 -1
  18. data/docs/InputTrack.md +0 -2
  19. data/docs/Insight.md +2 -2
  20. data/docs/ListAllMetricValuesResponse.md +1 -1
  21. data/docs/ListBreakdownValuesResponse.md +1 -1
  22. data/docs/ListDeliveryUsageResponse.md +11 -0
  23. data/docs/ListErrorsResponse.md +1 -1
  24. data/docs/ListExportsResponse.md +1 -1
  25. data/docs/ListFilterValuesResponse.md +1 -1
  26. data/docs/ListFiltersResponse.md +1 -1
  27. data/docs/ListInsightsResponse.md +1 -1
  28. data/docs/ListVideoViewsResponse.md +1 -1
  29. data/docs/LiveStream.md +3 -0
  30. data/docs/LiveStreamsApi.md +161 -0
  31. data/docs/SigningKeyResponse.md +1 -1
  32. data/docs/SimulcastTarget.md +12 -0
  33. data/docs/SimulcastTargetResponse.md +8 -0
  34. data/docs/Track.md +5 -2
  35. data/docs/UpdateAssetMasterAccessRequest.md +8 -0
  36. data/docs/Upload.md +1 -0
  37. data/docs/VideoViewResponse.md +1 -1
  38. data/examples/data/exercise-errors.rb +1 -1
  39. data/examples/data/exercise-metrics.rb +0 -7
  40. data/examples/video/exercise-assets.rb +27 -1
  41. data/examples/video/exercise-delivery-usage.rb +23 -0
  42. data/examples/video/exercise-live-streams.rb +28 -1
  43. data/lib/mux_ruby.rb +9 -0
  44. data/lib/mux_ruby/api/assets_api.rb +174 -0
  45. data/lib/mux_ruby/api/delivery_usage_api.rb +75 -0
  46. data/lib/mux_ruby/api/live_streams_api.rb +176 -0
  47. data/lib/mux_ruby/api_client.rb +7 -2
  48. data/lib/mux_ruby/api_error.rb +3 -0
  49. data/lib/mux_ruby/configuration.rb +1 -4
  50. data/lib/mux_ruby/models/asset.rb +24 -13
  51. data/lib/mux_ruby/models/create_asset_request.rb +46 -13
  52. data/lib/mux_ruby/models/create_live_stream_request.rb +66 -4
  53. data/lib/mux_ruby/models/create_simulcast_target_request.rb +210 -0
  54. data/lib/mux_ruby/models/create_track_request.rb +304 -0
  55. data/lib/mux_ruby/models/create_track_response.rb +184 -0
  56. data/lib/mux_ruby/models/create_upload_request.rb +13 -4
  57. data/lib/mux_ruby/models/delivery_report.rb +238 -0
  58. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +1 -1
  59. data/lib/mux_ruby/models/get_overall_values_response.rb +1 -1
  60. data/lib/mux_ruby/models/input_settings.rb +104 -13
  61. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +46 -0
  62. data/lib/mux_ruby/models/input_track.rb +4 -22
  63. data/lib/mux_ruby/models/insight.rb +2 -2
  64. data/lib/mux_ruby/models/list_all_metric_values_response.rb +1 -1
  65. data/lib/mux_ruby/models/list_breakdown_values_response.rb +1 -1
  66. data/lib/mux_ruby/models/list_delivery_usage_response.rb +216 -0
  67. data/lib/mux_ruby/models/list_errors_response.rb +1 -1
  68. data/lib/mux_ruby/models/list_exports_response.rb +1 -1
  69. data/lib/mux_ruby/models/list_filter_values_response.rb +1 -1
  70. data/lib/mux_ruby/models/list_filters_response.rb +1 -1
  71. data/lib/mux_ruby/models/list_insights_response.rb +1 -1
  72. data/lib/mux_ruby/models/list_video_views_response.rb +1 -1
  73. data/lib/mux_ruby/models/live_stream.rb +33 -4
  74. data/lib/mux_ruby/models/simulcast_target.rb +259 -0
  75. data/lib/mux_ruby/models/simulcast_target_response.rb +184 -0
  76. data/lib/mux_ruby/models/track.rb +86 -13
  77. data/lib/mux_ruby/models/update_asset_master_access_request.rb +219 -0
  78. data/lib/mux_ruby/models/upload.rb +13 -4
  79. data/lib/mux_ruby/models/video_view_response.rb +1 -1
  80. data/lib/mux_ruby/version.rb +1 -1
  81. data/spec/api/assets_api_spec.rb +37 -0
  82. data/spec/api/delivery_usage_api_spec.rb +43 -0
  83. data/spec/api/live_streams_api_spec.rb +39 -0
  84. data/spec/models/asset_spec.rb +12 -6
  85. data/spec/models/create_asset_request_spec.rb +22 -6
  86. data/spec/models/create_live_stream_request_spec.rb +24 -0
  87. data/spec/models/create_simulcast_target_request_spec.rb +46 -0
  88. data/spec/models/create_track_request_spec.rb +78 -0
  89. data/spec/models/create_track_response_spec.rb +34 -0
  90. data/spec/models/create_upload_request_spec.rb +6 -0
  91. data/spec/models/delivery_report_spec.rb +70 -0
  92. data/spec/models/input_settings_overlay_settings_spec.rb +8 -0
  93. data/spec/models/input_settings_spec.rb +40 -2
  94. data/spec/models/input_track_spec.rb +0 -12
  95. data/spec/models/list_delivery_usage_response_spec.rb +52 -0
  96. data/spec/models/live_stream_spec.rb +18 -0
  97. data/spec/models/simulcast_target_response_spec.rb +34 -0
  98. data/spec/models/simulcast_target_spec.rb +62 -0
  99. data/spec/models/track_spec.rb +28 -2
  100. data/spec/models/update_asset_master_access_request_spec.rb +38 -0
  101. data/spec/models/upload_spec.rb +6 -0
  102. data/test.sh +28 -0
  103. metadata +91 -54
@@ -0,0 +1,259 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'date'
7
+
8
+ module MuxRuby
9
+ class SimulcastTarget
10
+ # ID of the Simulcast Target
11
+ attr_accessor :id
12
+
13
+ # Arbitrary Metadata set when creating a simulcast target.
14
+ attr_accessor :passthrough
15
+
16
+ # The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established.
17
+ attr_accessor :status
18
+
19
+ # Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too.
20
+ attr_accessor :stream_key
21
+
22
+ # RTMP hostname including the application name for the third party live streaming service.
23
+ attr_accessor :url
24
+
25
+ class EnumAttributeValidator
26
+ attr_reader :datatype
27
+ attr_reader :allowable_values
28
+
29
+ def initialize(datatype, allowable_values)
30
+ @allowable_values = allowable_values.map do |value|
31
+ case datatype.to_s
32
+ when /Integer/i
33
+ value.to_i
34
+ when /Float/i
35
+ value.to_f
36
+ else
37
+ value
38
+ end
39
+ end
40
+ end
41
+
42
+ def valid?(value)
43
+ !value || allowable_values.include?(value)
44
+ end
45
+ end
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'id' => :'id',
51
+ :'passthrough' => :'passthrough',
52
+ :'status' => :'status',
53
+ :'stream_key' => :'stream_key',
54
+ :'url' => :'url'
55
+ }
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'id' => :'String',
62
+ :'passthrough' => :'String',
63
+ :'status' => :'String',
64
+ :'stream_key' => :'String',
65
+ :'url' => :'String'
66
+ }
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ return unless attributes.is_a?(Hash)
73
+
74
+ # convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
76
+
77
+ if attributes.has_key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes.has_key?(:'passthrough')
82
+ self.passthrough = attributes[:'passthrough']
83
+ end
84
+
85
+ if attributes.has_key?(:'status')
86
+ self.status = attributes[:'status']
87
+ end
88
+
89
+ if attributes.has_key?(:'stream_key')
90
+ self.stream_key = attributes[:'stream_key']
91
+ end
92
+
93
+ if attributes.has_key?(:'url')
94
+ self.url = attributes[:'url']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ status_validator = EnumAttributeValidator.new('String', ['idle', 'starting', 'broadcasting', 'errored'])
109
+ return false unless status_validator.valid?(@status)
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method checking allowed values (enum).
114
+ # @param [Object] status Object to be assigned
115
+ def status=(status)
116
+ validator = EnumAttributeValidator.new('String', ['idle', 'starting', 'broadcasting', 'errored'])
117
+ unless validator.valid?(status)
118
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
119
+ end
120
+ @status = status
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ id == o.id &&
129
+ passthrough == o.passthrough &&
130
+ status == o.status &&
131
+ stream_key == o.stream_key &&
132
+ url == o.url
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Fixnum] Hash code
143
+ def hash
144
+ [id, passthrough, status, stream_key, url].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ new.build_from_hash(attributes)
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ self.class.openapi_types.each_pair do |key, type|
160
+ if type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :DateTime
181
+ DateTime.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :BOOLEAN
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ MuxRuby.const_get(type).build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ next if value.nil?
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -0,0 +1,184 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'date'
7
+
8
+ module MuxRuby
9
+ class SimulcastTargetResponse
10
+ attr_accessor :data
11
+
12
+ # Attribute mapping from ruby-style variable name to JSON key.
13
+ def self.attribute_map
14
+ {
15
+ :'data' => :'data'
16
+ }
17
+ end
18
+
19
+ # Attribute type mapping.
20
+ def self.openapi_types
21
+ {
22
+ :'data' => :'SimulcastTarget'
23
+ }
24
+ end
25
+
26
+ # Initializes the object
27
+ # @param [Hash] attributes Model attributes in the form of hash
28
+ def initialize(attributes = {})
29
+ return unless attributes.is_a?(Hash)
30
+
31
+ # convert string to symbol for hash key
32
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
33
+
34
+ if attributes.has_key?(:'data')
35
+ self.data = attributes[:'data']
36
+ end
37
+ end
38
+
39
+ # Show invalid properties with the reasons. Usually used together with valid?
40
+ # @return Array for valid properties with the reasons
41
+ def list_invalid_properties
42
+ invalid_properties = Array.new
43
+ invalid_properties
44
+ end
45
+
46
+ # Check to see if the all the properties in the model are valid
47
+ # @return true if the model is valid
48
+ def valid?
49
+ true
50
+ end
51
+
52
+ # Checks equality by comparing each attribute.
53
+ # @param [Object] Object to be compared
54
+ def ==(o)
55
+ return true if self.equal?(o)
56
+ self.class == o.class &&
57
+ data == o.data
58
+ end
59
+
60
+ # @see the `==` method
61
+ # @param [Object] Object to be compared
62
+ def eql?(o)
63
+ self == o
64
+ end
65
+
66
+ # Calculates hash code according to all attributes.
67
+ # @return [Fixnum] Hash code
68
+ def hash
69
+ [data].hash
70
+ end
71
+
72
+ # Builds the object from hash
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ # @return [Object] Returns the model itself
75
+ def self.build_from_hash(attributes)
76
+ new.build_from_hash(attributes)
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ self.class.openapi_types.each_pair do |key, type|
85
+ if type =~ /\AArray<(.*)>/i
86
+ # check to ensure the input is an array given that the attribute
87
+ # is documented as an array but the input is not
88
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
89
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
90
+ end
91
+ elsif !attributes[self.class.attribute_map[key]].nil?
92
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
94
+ end
95
+
96
+ self
97
+ end
98
+
99
+ # Deserializes the data based on type
100
+ # @param string type Data type
101
+ # @param string value Value to be deserialized
102
+ # @return [Object] Deserialized data
103
+ def _deserialize(type, value)
104
+ case type.to_sym
105
+ when :DateTime
106
+ DateTime.parse(value)
107
+ when :Date
108
+ Date.parse(value)
109
+ when :String
110
+ value.to_s
111
+ when :Integer
112
+ value.to_i
113
+ when :Float
114
+ value.to_f
115
+ when :BOOLEAN
116
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
+ true
118
+ else
119
+ false
120
+ end
121
+ when :Object
122
+ # generic object (usually a Hash), return directly
123
+ value
124
+ when /\AArray<(?<inner_type>.+)>\z/
125
+ inner_type = Regexp.last_match[:inner_type]
126
+ value.map { |v| _deserialize(inner_type, v) }
127
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
128
+ k_type = Regexp.last_match[:k_type]
129
+ v_type = Regexp.last_match[:v_type]
130
+ {}.tap do |hash|
131
+ value.each do |k, v|
132
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
133
+ end
134
+ end
135
+ else # model
136
+ MuxRuby.const_get(type).build_from_hash(value)
137
+ end
138
+ end
139
+
140
+ # Returns the string representation of the object
141
+ # @return [String] String presentation of the object
142
+ def to_s
143
+ to_hash.to_s
144
+ end
145
+
146
+ # to_body is an alias to to_hash (backward compatibility)
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_body
149
+ to_hash
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ next if value.nil?
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ # Outputs non-array value in the form of hash
165
+ # For object, use to_hash. Otherwise, just return the value
166
+ # @param [Object] value Any valid value
167
+ # @return [Hash] Returns the value in the form of hash
168
+ def _to_hash(value)
169
+ if value.is_a?(Array)
170
+ value.compact.map { |v| _to_hash(v) }
171
+ elsif value.is_a?(Hash)
172
+ {}.tap do |hash|
173
+ value.each { |k, v| hash[k] = _to_hash(v) }
174
+ end
175
+ elsif value.respond_to? :to_hash
176
+ value.to_hash
177
+ else
178
+ value
179
+ end
180
+ end
181
+
182
+ end
183
+
184
+ end
@@ -23,9 +23,37 @@ module MuxRuby
23
23
 
24
24
  attr_accessor :max_channel_layout
25
25
 
26
- attr_accessor :text_track_type
26
+ attr_accessor :text_type
27
27
 
28
- attr_accessor :language
28
+ attr_accessor :language_code
29
+
30
+ attr_accessor :name
31
+
32
+ attr_accessor :closed_captions
33
+
34
+ attr_accessor :passthrough
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
29
57
 
30
58
  # Attribute mapping from ruby-style variable name to JSON key.
31
59
  def self.attribute_map
@@ -38,8 +66,11 @@ module MuxRuby
38
66
  :'max_frame_rate' => :'max_frame_rate',
39
67
  :'max_channels' => :'max_channels',
40
68
  :'max_channel_layout' => :'max_channel_layout',
41
- :'text_track_type' => :'text_track_type',
42
- :'language' => :'language'
69
+ :'text_type' => :'text_type',
70
+ :'language_code' => :'language_code',
71
+ :'name' => :'name',
72
+ :'closed_captions' => :'closed_captions',
73
+ :'passthrough' => :'passthrough'
43
74
  }
44
75
  end
45
76
 
@@ -54,8 +85,11 @@ module MuxRuby
54
85
  :'max_frame_rate' => :'Float',
55
86
  :'max_channels' => :'Integer',
56
87
  :'max_channel_layout' => :'String',
57
- :'text_track_type' => :'String',
58
- :'language' => :'String'
88
+ :'text_type' => :'String',
89
+ :'language_code' => :'String',
90
+ :'name' => :'String',
91
+ :'closed_captions' => :'BOOLEAN',
92
+ :'passthrough' => :'String'
59
93
  }
60
94
  end
61
95
 
@@ -99,12 +133,24 @@ module MuxRuby
99
133
  self.max_channel_layout = attributes[:'max_channel_layout']
100
134
  end
101
135
 
102
- if attributes.has_key?(:'text_track_type')
103
- self.text_track_type = attributes[:'text_track_type']
136
+ if attributes.has_key?(:'text_type')
137
+ self.text_type = attributes[:'text_type']
104
138
  end
105
139
 
106
- if attributes.has_key?(:'language')
107
- self.language = attributes[:'language']
140
+ if attributes.has_key?(:'language_code')
141
+ self.language_code = attributes[:'language_code']
142
+ end
143
+
144
+ if attributes.has_key?(:'name')
145
+ self.name = attributes[:'name']
146
+ end
147
+
148
+ if attributes.has_key?(:'closed_captions')
149
+ self.closed_captions = attributes[:'closed_captions']
150
+ end
151
+
152
+ if attributes.has_key?(:'passthrough')
153
+ self.passthrough = attributes[:'passthrough']
108
154
  end
109
155
  end
110
156
 
@@ -118,9 +164,33 @@ module MuxRuby
118
164
  # Check to see if the all the properties in the model are valid
119
165
  # @return true if the model is valid
120
166
  def valid?
167
+ type_validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
168
+ return false unless type_validator.valid?(@type)
169
+ text_type_validator = EnumAttributeValidator.new('String', ['subtitles'])
170
+ return false unless text_type_validator.valid?(@text_type)
121
171
  true
122
172
  end
123
173
 
174
+ # Custom attribute writer method checking allowed values (enum).
175
+ # @param [Object] type Object to be assigned
176
+ def type=(type)
177
+ validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
178
+ unless validator.valid?(type)
179
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
180
+ end
181
+ @type = type
182
+ end
183
+
184
+ # Custom attribute writer method checking allowed values (enum).
185
+ # @param [Object] text_type Object to be assigned
186
+ def text_type=(text_type)
187
+ validator = EnumAttributeValidator.new('String', ['subtitles'])
188
+ unless validator.valid?(text_type)
189
+ fail ArgumentError, 'invalid value for "text_type", must be one of #{validator.allowable_values}.'
190
+ end
191
+ @text_type = text_type
192
+ end
193
+
124
194
  # Checks equality by comparing each attribute.
125
195
  # @param [Object] Object to be compared
126
196
  def ==(o)
@@ -134,8 +204,11 @@ module MuxRuby
134
204
  max_frame_rate == o.max_frame_rate &&
135
205
  max_channels == o.max_channels &&
136
206
  max_channel_layout == o.max_channel_layout &&
137
- text_track_type == o.text_track_type &&
138
- language == o.language
207
+ text_type == o.text_type &&
208
+ language_code == o.language_code &&
209
+ name == o.name &&
210
+ closed_captions == o.closed_captions &&
211
+ passthrough == o.passthrough
139
212
  end
140
213
 
141
214
  # @see the `==` method
@@ -147,7 +220,7 @@ module MuxRuby
147
220
  # Calculates hash code according to all attributes.
148
221
  # @return [Fixnum] Hash code
149
222
  def hash
150
- [id, type, duration, max_width, max_height, max_frame_rate, max_channels, max_channel_layout, text_track_type, language].hash
223
+ [id, type, duration, max_width, max_height, max_frame_rate, max_channels, max_channel_layout, text_type, language_code, name, closed_captions, passthrough].hash
151
224
  end
152
225
 
153
226
  # Builds the object from hash