mux_ruby 1.5.0 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +4 -1
  4. data/docs/Asset.md +15 -12
  5. data/docs/AssetErrors.md +2 -2
  6. data/docs/AssetNonStandardInputReasons.md +16 -0
  7. data/docs/AssetRecordingTimes.md +9 -0
  8. data/docs/AssetStaticRenditions.md +1 -1
  9. data/docs/AssetsApi.md +4 -0
  10. data/docs/CreateAssetRequest.md +6 -6
  11. data/docs/CreateLiveStreamRequest.md +1 -0
  12. data/docs/CreateTrackRequest.md +4 -4
  13. data/docs/DimensionValue.md +9 -0
  14. data/docs/DimensionsApi.md +118 -0
  15. data/docs/DisableLiveStreamResponse.md +8 -0
  16. data/docs/EnableLiveStreamResponse.md +8 -0
  17. data/docs/FiltersApi.md +2 -2
  18. data/docs/GetAssetOrLiveStreamIdResponse.md +8 -0
  19. data/docs/GetAssetOrLiveStreamIdResponseData.md +10 -0
  20. data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +9 -0
  21. data/docs/GetRealTimeBreakdownResponse.md +10 -0
  22. data/docs/GetRealTimeHistogramTimeseriesResponse.md +11 -0
  23. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +8 -0
  24. data/docs/GetRealTimeTimeseriesResponse.md +10 -0
  25. data/docs/Incident.md +28 -0
  26. data/docs/IncidentBreakdown.md +10 -0
  27. data/docs/IncidentNotification.md +10 -0
  28. data/docs/IncidentNotificationRule.md +12 -0
  29. data/docs/IncidentResponse.md +9 -0
  30. data/docs/IncidentsApi.md +186 -0
  31. data/docs/InputSettings.md +9 -7
  32. data/docs/InputSettingsOverlaySettings.md +7 -7
  33. data/docs/ListDimensionValuesResponse.md +10 -0
  34. data/docs/ListDimensionsResponse.md +10 -0
  35. data/docs/ListIncidentsResponse.md +10 -0
  36. data/docs/ListRealTimeDimensionsResponse.md +10 -0
  37. data/docs/ListRealTimeDimensionsResponseData.md +9 -0
  38. data/docs/ListRealTimeMetricsResponse.md +10 -0
  39. data/docs/ListRelatedIncidentsResponse.md +10 -0
  40. data/docs/LiveStream.md +1 -1
  41. data/docs/LiveStreamsApi.md +104 -0
  42. data/docs/NotificationRule.md +10 -0
  43. data/docs/PlaybackID.md +1 -1
  44. data/docs/PlaybackIDApi.md +60 -0
  45. data/docs/RealTimeApi.md +280 -0
  46. data/docs/RealTimeBreakdownValue.md +12 -0
  47. data/docs/RealTimeHistogramTimeseriesBucket.md +9 -0
  48. data/docs/RealTimeHistogramTimeseriesBucketValues.md +9 -0
  49. data/docs/RealTimeHistogramTimeseriesDatapoint.md +14 -0
  50. data/docs/RealTimeTimeseriesDatapoint.md +10 -0
  51. data/docs/Track.md +13 -13
  52. data/docs/VideoView.md +16 -14
  53. data/examples/data/exercise-dimensions.rb +29 -0
  54. data/examples/data/exercise-incidents.rb +29 -0
  55. data/examples/data/exercise-realtime.rb +60 -0
  56. data/examples/video/exercise-assets.rb +21 -0
  57. data/examples/video/exercise-live-streams.rb +30 -0
  58. data/lib/mux_ruby.rb +34 -0
  59. data/lib/mux_ruby/api/assets_api.rb +4 -0
  60. data/lib/mux_ruby/api/dimensions_api.rb +128 -0
  61. data/lib/mux_ruby/api/filters_api.rb +4 -4
  62. data/lib/mux_ruby/api/incidents_api.rb +217 -0
  63. data/lib/mux_ruby/api/live_streams_api.rb +106 -0
  64. data/lib/mux_ruby/api/playback_id_api.rb +69 -0
  65. data/lib/mux_ruby/api/real_time_api.rb +311 -0
  66. data/lib/mux_ruby/api_client.rb +13 -13
  67. data/lib/mux_ruby/configuration.rb +1 -4
  68. data/lib/mux_ruby/models/asset.rb +70 -3
  69. data/lib/mux_ruby/models/asset_errors.rb +2 -0
  70. data/lib/mux_ruby/models/asset_master.rb +35 -0
  71. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +335 -0
  72. data/lib/mux_ruby/models/asset_recording_times.rb +195 -0
  73. data/lib/mux_ruby/models/asset_static_renditions.rb +2 -2
  74. data/lib/mux_ruby/models/asset_static_renditions_files.rb +6 -6
  75. data/lib/mux_ruby/models/create_asset_request.rb +8 -2
  76. data/lib/mux_ruby/models/create_live_stream_request.rb +15 -4
  77. data/lib/mux_ruby/models/create_track_request.rb +6 -2
  78. data/lib/mux_ruby/models/dimension_value.rb +193 -0
  79. data/lib/mux_ruby/models/disable_live_stream_response.rb +184 -0
  80. data/lib/mux_ruby/models/enable_live_stream_response.rb +184 -0
  81. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +184 -0
  82. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +203 -0
  83. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +230 -0
  84. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +206 -0
  85. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +215 -0
  86. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +186 -0
  87. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +206 -0
  88. data/lib/mux_ruby/models/incident.rb +370 -0
  89. data/lib/mux_ruby/models/incident_breakdown.rb +202 -0
  90. data/lib/mux_ruby/models/incident_notification.rb +202 -0
  91. data/lib/mux_ruby/models/incident_notification_rule.rb +222 -0
  92. data/lib/mux_ruby/models/incident_response.rb +195 -0
  93. data/lib/mux_ruby/models/input_settings.rb +31 -4
  94. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +10 -2
  95. data/lib/mux_ruby/models/list_dimension_values_response.rb +206 -0
  96. data/lib/mux_ruby/models/list_dimensions_response.rb +204 -0
  97. data/lib/mux_ruby/models/list_incidents_response.rb +206 -0
  98. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +206 -0
  99. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +193 -0
  100. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +206 -0
  101. data/lib/mux_ruby/models/list_related_incidents_response.rb +206 -0
  102. data/lib/mux_ruby/models/live_stream.rb +1 -1
  103. data/lib/mux_ruby/models/notification_rule.rb +202 -0
  104. data/lib/mux_ruby/models/playback_id.rb +1 -0
  105. data/lib/mux_ruby/models/real_time_breakdown_value.rb +220 -0
  106. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +193 -0
  107. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +193 -0
  108. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +240 -0
  109. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +202 -0
  110. data/lib/mux_ruby/models/simulcast_target.rb +1 -1
  111. data/lib/mux_ruby/models/track.rb +27 -2
  112. data/lib/mux_ruby/models/update_asset_master_access_request.rb +1 -1
  113. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +1 -1
  114. data/lib/mux_ruby/models/upload.rb +1 -1
  115. data/lib/mux_ruby/models/video_view.rb +36 -18
  116. data/lib/mux_ruby/version.rb +1 -1
  117. data/mux_ruby.gemspec +2 -0
  118. data/spec/api/assets_api_spec.rb +2 -0
  119. data/spec/api/dimensions_api_spec.rb +55 -0
  120. data/spec/api/filters_api_spec.rb +2 -2
  121. data/spec/api/incidents_api_spec.rb +73 -0
  122. data/spec/api/live_streams_api_spec.rb +24 -0
  123. data/spec/api/playback_id_api_spec.rb +40 -0
  124. data/spec/api/real_time_api_spec.rb +93 -0
  125. data/spec/models/asset_master_spec.rb +4 -0
  126. data/spec/models/asset_non_standard_input_reasons_spec.rb +98 -0
  127. data/spec/models/asset_recording_times_spec.rb +40 -0
  128. data/spec/models/asset_spec.rb +26 -0
  129. data/spec/models/asset_static_renditions_files_spec.rb +2 -2
  130. data/spec/models/create_live_stream_request_spec.rb +6 -0
  131. data/spec/models/dimension_value_spec.rb +40 -0
  132. data/spec/models/disable_live_stream_response_spec.rb +34 -0
  133. data/spec/models/enable_live_stream_response_spec.rb +34 -0
  134. data/spec/models/get_asset_or_live_stream_id_response_data_object_spec.rb +44 -0
  135. data/spec/models/get_asset_or_live_stream_id_response_data_spec.rb +46 -0
  136. data/spec/models/get_asset_or_live_stream_id_response_spec.rb +34 -0
  137. data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
  138. data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
  139. data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
  140. data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
  141. data/spec/models/incident_breakdown_spec.rb +46 -0
  142. data/spec/models/incident_notification_rule_spec.rb +58 -0
  143. data/spec/models/incident_notification_spec.rb +46 -0
  144. data/spec/models/incident_response_spec.rb +40 -0
  145. data/spec/models/incident_spec.rb +154 -0
  146. data/spec/models/input_settings_spec.rb +12 -0
  147. data/spec/models/list_dimension_values_response_spec.rb +46 -0
  148. data/spec/models/list_dimensions_response_spec.rb +46 -0
  149. data/spec/models/list_incidents_response_spec.rb +46 -0
  150. data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
  151. data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
  152. data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
  153. data/spec/models/list_related_incidents_response_spec.rb +46 -0
  154. data/spec/models/notification_rule_spec.rb +46 -0
  155. data/spec/models/real_time_breakdown_value_spec.rb +58 -0
  156. data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
  157. data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
  158. data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
  159. data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
  160. data/spec/models/track_spec.rb +4 -0
  161. data/spec/models/video_view_spec.rb +12 -0
  162. metadata +200 -60
@@ -0,0 +1,195 @@
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 AssetRecordingTimes
10
+ # The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format.
11
+ attr_accessor :started_at
12
+
13
+ # The duration of the live stream recorded. The time value is in seconds.
14
+ attr_accessor :duration
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :'started_at' => :'started_at',
20
+ :'duration' => :'duration'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'started_at' => :'DateTime',
28
+ :'duration' => :'Float'
29
+ }
30
+ end
31
+
32
+ # Initializes the object
33
+ # @param [Hash] attributes Model attributes in the form of hash
34
+ def initialize(attributes = {})
35
+ return unless attributes.is_a?(Hash)
36
+
37
+ # convert string to symbol for hash key
38
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
39
+
40
+ if attributes.has_key?(:'started_at')
41
+ self.started_at = attributes[:'started_at']
42
+ end
43
+
44
+ if attributes.has_key?(:'duration')
45
+ self.duration = attributes[:'duration']
46
+ end
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properties with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class &&
67
+ started_at == o.started_at &&
68
+ duration == o.duration
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [started_at, duration].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def self.build_from_hash(attributes)
87
+ new.build_from_hash(attributes)
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.openapi_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ MuxRuby.const_get(type).build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ next if value.nil?
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+
193
+ end
194
+
195
+ end
@@ -7,7 +7,7 @@ require 'date'
7
7
 
8
8
  module MuxRuby
9
9
  class AssetStaticRenditions
10
- # * `ready`: All MP4s are downloadable * `preparing`: We are preparing the MP4s * `disabled`: MP4 support was not requested or has been removed * `errored`: There was a Mux internal error that prevented the MP4s from being created
10
+ # Indicates the status of downloadable MP4 versions of this asset.
11
11
  attr_accessor :status
12
12
 
13
13
  attr_accessor :files
@@ -91,7 +91,7 @@ module MuxRuby
91
91
  def status=(status)
92
92
  validator = EnumAttributeValidator.new('String', ['ready', 'preparing', 'disabled', 'errored'])
93
93
  unless validator.valid?(status)
94
- fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
94
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
95
95
  end
96
96
  @status = status
97
97
  end
@@ -112,9 +112,9 @@ module MuxRuby
112
112
  # Check to see if the all the properties in the model are valid
113
113
  # @return true if the model is valid
114
114
  def valid?
115
- name_validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4'])
115
+ name_validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4', 'audio.m4a'])
116
116
  return false unless name_validator.valid?(@name)
117
- ext_validator = EnumAttributeValidator.new('String', ['mp4'])
117
+ ext_validator = EnumAttributeValidator.new('String', ['mp4', 'm4a'])
118
118
  return false unless ext_validator.valid?(@ext)
119
119
  true
120
120
  end
@@ -122,9 +122,9 @@ module MuxRuby
122
122
  # Custom attribute writer method checking allowed values (enum).
123
123
  # @param [Object] name Object to be assigned
124
124
  def name=(name)
125
- validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4'])
125
+ validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4', 'audio.m4a'])
126
126
  unless validator.valid?(name)
127
- fail ArgumentError, 'invalid value for "name", must be one of #{validator.allowable_values}.'
127
+ fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
128
128
  end
129
129
  @name = name
130
130
  end
@@ -132,9 +132,9 @@ module MuxRuby
132
132
  # Custom attribute writer method checking allowed values (enum).
133
133
  # @param [Object] ext Object to be assigned
134
134
  def ext=(ext)
135
- validator = EnumAttributeValidator.new('String', ['mp4'])
135
+ validator = EnumAttributeValidator.new('String', ['mp4', 'm4a'])
136
136
  unless validator.valid?(ext)
137
- fail ArgumentError, 'invalid value for "ext", must be one of #{validator.allowable_values}.'
137
+ fail ArgumentError, "invalid value for \"ext\", must be one of #{validator.allowable_values}."
138
138
  end
139
139
  @ext = ext
140
140
  end
@@ -7,21 +7,27 @@ require 'date'
7
7
 
8
8
  module MuxRuby
9
9
  class CreateAssetRequest
10
+ # 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.
10
11
  attr_accessor :input
11
12
 
13
+ # An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy.
12
14
  attr_accessor :playback_policy
13
15
 
14
16
  attr_accessor :per_title_encode
15
17
 
18
+ # Arbitrary metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**.
16
19
  attr_accessor :passthrough
17
20
 
21
+ # Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information.
18
22
  attr_accessor :mp4_support
19
23
 
20
24
  # Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets.
21
25
  attr_accessor :normalize_audio
22
26
 
27
+ # Specify what level (if any) of support for master access. Master access can be enabled temporarily for your asset to be downloaded. See the [Download your vidoes guide](/guides/video/download-your-videos) for more information.
23
28
  attr_accessor :master_access
24
29
 
30
+ # Marks the asset as a test asset when the value is set to true. A Test asset can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test assets created. Test asset are watermarked with the Mux logo, limited to 10 seconds, deleted after 24 hrs.
25
31
  attr_accessor :test
26
32
 
27
33
  class EnumAttributeValidator
@@ -143,7 +149,7 @@ module MuxRuby
143
149
  def mp4_support=(mp4_support)
144
150
  validator = EnumAttributeValidator.new('String', ['none', 'standard'])
145
151
  unless validator.valid?(mp4_support)
146
- fail ArgumentError, 'invalid value for "mp4_support", must be one of #{validator.allowable_values}.'
152
+ fail ArgumentError, "invalid value for \"mp4_support\", must be one of #{validator.allowable_values}."
147
153
  end
148
154
  @mp4_support = mp4_support
149
155
  end
@@ -153,7 +159,7 @@ module MuxRuby
153
159
  def master_access=(master_access)
154
160
  validator = EnumAttributeValidator.new('String', ['none', 'temporary'])
155
161
  unless validator.valid?(master_access)
156
- fail ArgumentError, 'invalid value for "master_access", must be one of #{validator.allowable_values}.'
162
+ fail ArgumentError, "invalid value for \"master_access\", must be one of #{validator.allowable_values}."
157
163
  end
158
164
  @master_access = master_access
159
165
  end
@@ -21,6 +21,8 @@ module MuxRuby
21
21
 
22
22
  attr_accessor :test
23
23
 
24
+ attr_accessor :simulcast_targets
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
@@ -29,7 +31,8 @@ module MuxRuby
29
31
  :'reconnect_window' => :'reconnect_window',
30
32
  :'passthrough' => :'passthrough',
31
33
  :'reduced_latency' => :'reduced_latency',
32
- :'test' => :'test'
34
+ :'test' => :'test',
35
+ :'simulcast_targets' => :'simulcast_targets'
33
36
  }
34
37
  end
35
38
 
@@ -41,7 +44,8 @@ module MuxRuby
41
44
  :'reconnect_window' => :'Float',
42
45
  :'passthrough' => :'String',
43
46
  :'reduced_latency' => :'BOOLEAN',
44
- :'test' => :'BOOLEAN'
47
+ :'test' => :'BOOLEAN',
48
+ :'simulcast_targets' => :'Array<CreateSimulcastTargetRequest>'
45
49
  }
46
50
  end
47
51
 
@@ -78,6 +82,12 @@ module MuxRuby
78
82
  if attributes.has_key?(:'test')
79
83
  self.test = attributes[:'test']
80
84
  end
85
+
86
+ if attributes.has_key?(:'simulcast_targets')
87
+ if (value = attributes[:'simulcast_targets']).is_a?(Array)
88
+ self.simulcast_targets = value
89
+ end
90
+ end
81
91
  end
82
92
 
83
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -127,7 +137,8 @@ module MuxRuby
127
137
  reconnect_window == o.reconnect_window &&
128
138
  passthrough == o.passthrough &&
129
139
  reduced_latency == o.reduced_latency &&
130
- test == o.test
140
+ test == o.test &&
141
+ simulcast_targets == o.simulcast_targets
131
142
  end
132
143
 
133
144
  # @see the `==` method
@@ -139,7 +150,7 @@ module MuxRuby
139
150
  # Calculates hash code according to all attributes.
140
151
  # @return [Fixnum] Hash code
141
152
  def hash
142
- [playback_policy, new_asset_settings, reconnect_window, passthrough, reduced_latency, test].hash
153
+ [playback_policy, new_asset_settings, reconnect_window, passthrough, reduced_latency, test, simulcast_targets].hash
143
154
  end
144
155
 
145
156
  # Builds the object from hash
@@ -13,12 +13,16 @@ module MuxRuby
13
13
 
14
14
  attr_accessor :text_type
15
15
 
16
+ # The language code value must be a valid BCP 47 specification compliant value. For example, en for English or en-US for the US version of English.
16
17
  attr_accessor :language_code
17
18
 
19
+ # The name of the track containing a human-readable description. This value must be unqiue across all the text type and subtitles text type tracks. HLS manifest will associate subtitle text track with this value. For example, set the value to \"English\" for subtitles text track with language_code as en-US. If this parameter is not included, Mux will auto-populate based on the language_code value.
18
20
  attr_accessor :name
19
21
 
22
+ # Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH).
20
23
  attr_accessor :closed_captions
21
24
 
25
+ # Arbitrary metadata set for the track either when creating the asset or track.
22
26
  attr_accessor :passthrough
23
27
 
24
28
  class EnumAttributeValidator
@@ -148,7 +152,7 @@ module MuxRuby
148
152
  def type=(type)
149
153
  validator = EnumAttributeValidator.new('String', ['text'])
150
154
  unless validator.valid?(type)
151
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
155
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
152
156
  end
153
157
  @type = type
154
158
  end
@@ -158,7 +162,7 @@ module MuxRuby
158
162
  def text_type=(text_type)
159
163
  validator = EnumAttributeValidator.new('String', ['subtitles'])
160
164
  unless validator.valid?(text_type)
161
- fail ArgumentError, 'invalid value for "text_type", must be one of #{validator.allowable_values}.'
165
+ fail ArgumentError, "invalid value for \"text_type\", must be one of #{validator.allowable_values}."
162
166
  end
163
167
  @text_type = text_type
164
168
  end
@@ -0,0 +1,193 @@
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 DimensionValue
10
+ attr_accessor :value
11
+
12
+ attr_accessor :total_count
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :'value' => :'value',
18
+ :'total_count' => :'total_count'
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.openapi_types
24
+ {
25
+ :'value' => :'String',
26
+ :'total_count' => :'Integer'
27
+ }
28
+ end
29
+
30
+ # Initializes the object
31
+ # @param [Hash] attributes Model attributes in the form of hash
32
+ def initialize(attributes = {})
33
+ return unless attributes.is_a?(Hash)
34
+
35
+ # convert string to symbol for hash key
36
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
37
+
38
+ if attributes.has_key?(:'value')
39
+ self.value = attributes[:'value']
40
+ end
41
+
42
+ if attributes.has_key?(:'total_count')
43
+ self.total_count = attributes[:'total_count']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ value == o.value &&
66
+ total_count == o.total_count
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [value, total_count].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def self.build_from_hash(attributes)
85
+ new.build_from_hash(attributes)
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.openapi_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param string type Data type
110
+ # @param string value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ MuxRuby.const_get(type).build_from_hash(value)
146
+ end
147
+ end
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # to_body is an alias to to_hash (backward compatibility)
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_body
158
+ to_hash
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ next if value.nil?
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+
191
+ end
192
+
193
+ end