mux_ruby 3.3.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +13 -7
  4. data/docs/Asset.md +1 -1
  5. data/docs/AssetNonStandardInputReasons.md +2 -2
  6. data/docs/AssetResponse.md +1 -1
  7. data/docs/AssetsApi.md +8 -0
  8. data/docs/Broadcast.md +30 -0
  9. data/docs/BroadcastLayout.md +15 -0
  10. data/docs/BroadcastResolution.md +15 -0
  11. data/docs/BroadcastResponse.md +18 -0
  12. data/docs/BroadcastStatus.md +15 -0
  13. data/docs/CreateBroadcastRequest.md +26 -0
  14. data/docs/CreateLiveStreamRequest.md +3 -1
  15. data/docs/CreatePlaybackIDResponse.md +1 -1
  16. data/docs/CreatePlaybackRestrictionRequest.md +1 -1
  17. data/docs/CreateSimulcastTargetRequest.md +1 -1
  18. data/docs/CreateSpaceRequest.md +22 -0
  19. data/docs/CreateTrackResponse.md +1 -1
  20. data/docs/DirectUploadsApi.md +6 -0
  21. data/docs/GetAssetPlaybackIDResponse.md +1 -1
  22. data/docs/GetLiveStreamPlaybackIDResponse.md +1 -1
  23. data/docs/IncidentResponse.md +1 -1
  24. data/docs/InputSettings.md +3 -3
  25. data/docs/ListPlaybackRestrictionsResponse.md +18 -0
  26. data/docs/ListSpacesResponse.md +18 -0
  27. data/docs/LiveStream.md +3 -1
  28. data/docs/LiveStreamResponse.md +1 -1
  29. data/docs/LiveStreamsApi.md +16 -4
  30. data/docs/MetricsApi.md +3 -3
  31. data/docs/PlaybackRestrictionResponse.md +4 -1
  32. data/docs/PlaybackRestrictionsApi.md +21 -21
  33. data/docs/SigningKeyResponse.md +1 -1
  34. data/docs/SimulcastTargetResponse.md +1 -1
  35. data/docs/Space.md +30 -0
  36. data/docs/SpaceResponse.md +18 -0
  37. data/docs/SpaceStatus.md +15 -0
  38. data/docs/SpaceType.md +15 -0
  39. data/docs/SpacesApi.md +658 -0
  40. data/docs/StartSpaceBroadcastResponse.md +18 -0
  41. data/docs/StopSpaceBroadcastResponse.md +18 -0
  42. data/docs/Track.md +9 -7
  43. data/docs/UpdateLiveStreamRequest.md +3 -1
  44. data/docs/UpdateReferrerDomainRestrictionRequest.md +37 -5
  45. data/docs/UploadResponse.md +1 -1
  46. data/docs/VideoViewResponse.md +1 -1
  47. data/gen/generator-config.json +1 -1
  48. data/gen/templates/README.mustache +9 -3
  49. data/lib/mux_ruby/api/assets_api.rb +8 -0
  50. data/lib/mux_ruby/api/direct_uploads_api.rb +6 -0
  51. data/lib/mux_ruby/api/live_streams_api.rb +14 -2
  52. data/lib/mux_ruby/api/metrics_api.rb +5 -5
  53. data/lib/mux_ruby/api/playback_restrictions_api.rb +23 -23
  54. data/lib/mux_ruby/api/spaces_api.rb +619 -0
  55. data/lib/mux_ruby/models/abridged_video_view.rb +7 -0
  56. data/lib/mux_ruby/models/asset.rb +1 -1
  57. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +2 -2
  58. data/lib/mux_ruby/models/broadcast.rb +305 -0
  59. data/lib/mux_ruby/models/broadcast_layout.rb +37 -0
  60. data/lib/mux_ruby/models/broadcast_resolution.rb +41 -0
  61. data/lib/mux_ruby/models/broadcast_response.rb +223 -0
  62. data/lib/mux_ruby/models/broadcast_status.rb +37 -0
  63. data/lib/mux_ruby/models/create_broadcast_request.rb +266 -0
  64. data/lib/mux_ruby/models/create_live_stream_request.rb +40 -4
  65. data/lib/mux_ruby/models/create_simulcast_target_request.rb +1 -1
  66. data/lib/mux_ruby/models/create_space_request.rb +242 -0
  67. data/lib/mux_ruby/models/input_settings.rb +3 -3
  68. data/lib/mux_ruby/models/list_playback_restrictions_response.rb +220 -0
  69. data/lib/mux_ruby/models/list_spaces_response.rb +225 -0
  70. data/lib/mux_ruby/models/live_stream.rb +40 -4
  71. data/lib/mux_ruby/models/playback_restriction_response.rb +11 -2
  72. data/lib/mux_ruby/models/space.rb +301 -0
  73. data/lib/mux_ruby/models/space_response.rb +223 -0
  74. data/lib/mux_ruby/models/space_status.rb +37 -0
  75. data/lib/mux_ruby/models/space_type.rb +36 -0
  76. data/lib/mux_ruby/models/start_space_broadcast_response.rb +218 -0
  77. data/lib/mux_ruby/models/stop_space_broadcast_response.rb +218 -0
  78. data/lib/mux_ruby/models/track.rb +32 -10
  79. data/lib/mux_ruby/models/update_live_stream_request.rb +40 -4
  80. data/lib/mux_ruby/models/update_referrer_domain_restriction_request.rb +74 -179
  81. data/lib/mux_ruby/models/video_view.rb +103 -0
  82. data/lib/mux_ruby/version.rb +1 -1
  83. data/lib/mux_ruby.rb +16 -0
  84. data/spec/api/spaces_api_spec.rb +149 -0
  85. data/spec/models/broadcast_layout_spec.rb +28 -0
  86. data/spec/models/broadcast_resolution_spec.rb +28 -0
  87. data/spec/models/broadcast_response_spec.rb +34 -0
  88. data/spec/models/broadcast_spec.rb +70 -0
  89. data/spec/models/broadcast_status_spec.rb +28 -0
  90. data/spec/models/create_broadcast_request_spec.rb +58 -0
  91. data/spec/models/create_space_request_spec.rb +46 -0
  92. data/spec/models/list_playback_restrictions_response_spec.rb +34 -0
  93. data/spec/models/list_spaces_response_spec.rb +34 -0
  94. data/spec/models/space_response_spec.rb +34 -0
  95. data/spec/models/space_spec.rb +70 -0
  96. data/spec/models/space_status_spec.rb +28 -0
  97. data/spec/models/space_type_spec.rb +28 -0
  98. data/spec/models/start_space_broadcast_response_spec.rb +34 -0
  99. data/spec/models/stop_space_broadcast_response_spec.rb +34 -0
  100. metadata +169 -105
@@ -0,0 +1,301 @@
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 Space
18
+ # Unique identifier for the space. Max 255 characters.
19
+ attr_accessor :id
20
+
21
+ # Time the space was created, defined as a Unix timestamp (seconds since epoch).
22
+ attr_accessor :created_at
23
+
24
+ attr_accessor :type
25
+
26
+ attr_accessor :status
27
+
28
+ # Arbitrary user-supplied metadata that will be included in the space details and related webhooks. Max: 255 characters.
29
+ attr_accessor :passthrough
30
+
31
+ # An array of broadcast destinations.
32
+ attr_accessor :broadcasts
33
+
34
+ # Unique identifier for the current lifecycle of the space. Only set when the space is `active` and is set to a new value each time the space transitions from `idle` to `active`. This value is useful for logging and debugging issues. Max 255 characters.
35
+ attr_accessor :active_session_id
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'id' => :'id',
41
+ :'created_at' => :'created_at',
42
+ :'type' => :'type',
43
+ :'status' => :'status',
44
+ :'passthrough' => :'passthrough',
45
+ :'broadcasts' => :'broadcasts',
46
+ :'active_session_id' => :'active_session_id'
47
+ }
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'id' => :'String',
59
+ :'created_at' => :'String',
60
+ :'type' => :'SpaceType',
61
+ :'status' => :'SpaceStatus',
62
+ :'passthrough' => :'String',
63
+ :'broadcasts' => :'Array<Broadcast>',
64
+ :'active_session_id' => :'String'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::Space` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::Space`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'id')
90
+ self.id = attributes[:'id']
91
+ end
92
+
93
+ if attributes.key?(:'created_at')
94
+ self.created_at = attributes[:'created_at']
95
+ end
96
+
97
+ if attributes.key?(:'type')
98
+ self.type = attributes[:'type']
99
+ else
100
+ self.type = 'server'
101
+ end
102
+
103
+ if attributes.key?(:'status')
104
+ self.status = attributes[:'status']
105
+ end
106
+
107
+ if attributes.key?(:'passthrough')
108
+ self.passthrough = attributes[:'passthrough']
109
+ end
110
+
111
+ if attributes.key?(:'broadcasts')
112
+ if (value = attributes[:'broadcasts']).is_a?(Array)
113
+ self.broadcasts = value
114
+ end
115
+ end
116
+
117
+ if attributes.key?(:'active_session_id')
118
+ self.active_session_id = attributes[:'active_session_id']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = Array.new
126
+ if @id.nil?
127
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
128
+ end
129
+
130
+ if @created_at.nil?
131
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
132
+ end
133
+
134
+ if @type.nil?
135
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
136
+ end
137
+
138
+ if @status.nil?
139
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
140
+ end
141
+
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ return false if @id.nil?
149
+ return false if @created_at.nil?
150
+ return false if @type.nil?
151
+ return false if @status.nil?
152
+ true
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ id == o.id &&
161
+ created_at == o.created_at &&
162
+ type == o.type &&
163
+ status == o.status &&
164
+ passthrough == o.passthrough &&
165
+ broadcasts == o.broadcasts &&
166
+ active_session_id == o.active_session_id
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [id, created_at, type, status, passthrough, broadcasts, active_session_id].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ new.build_from_hash(attributes)
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def build_from_hash(attributes)
192
+ return nil unless attributes.is_a?(Hash)
193
+ self.class.openapi_types.each_pair do |key, type|
194
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
195
+ self.send("#{key}=", nil)
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !attributes[self.class.attribute_map[key]].nil?
203
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ end
205
+ end
206
+
207
+ self
208
+ end
209
+
210
+ # Deserializes the data based on type
211
+ # @param string type Data type
212
+ # @param string value Value to be deserialized
213
+ # @return [Object] Deserialized data
214
+ def _deserialize(type, value)
215
+ case type.to_sym
216
+ when :Time
217
+ Time.parse(value)
218
+ when :Date
219
+ Date.parse(value)
220
+ when :String
221
+ value.to_s
222
+ when :Integer
223
+ value.to_i
224
+ when :Float
225
+ value.to_f
226
+ when :Boolean
227
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
228
+ true
229
+ else
230
+ false
231
+ end
232
+ when :Object
233
+ # generic object (usually a Hash), return directly
234
+ value
235
+ when /\AArray<(?<inner_type>.+)>\z/
236
+ inner_type = Regexp.last_match[:inner_type]
237
+ value.map { |v| _deserialize(inner_type, v) }
238
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
239
+ k_type = Regexp.last_match[:k_type]
240
+ v_type = Regexp.last_match[:v_type]
241
+ {}.tap do |hash|
242
+ value.each do |k, v|
243
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
244
+ end
245
+ end
246
+ else # model
247
+ # models (e.g. Pet) or oneOf
248
+ klass = MuxRuby.const_get(type)
249
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end
298
+
299
+ end
300
+
301
+ end
@@ -0,0 +1,223 @@
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 SpaceResponse
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' => :'Space'
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::SpaceResponse` 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::SpaceResponse`. 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
+ self.data = attributes[:'data']
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
+ if @data.nil?
70
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @data.nil?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ data == o.data
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [data].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ new.build_from_hash(attributes)
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = MuxRuby.const_get(type)
171
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -0,0 +1,37 @@
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 SpaceStatus
18
+ IDLE = "idle".freeze
19
+ ACTIVE = "active".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = SpaceStatus.constants.select { |c| SpaceStatus::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #SpaceStatus" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,36 @@
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 SpaceType
18
+ SERVER = "server".freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ constantValues = SpaceType.constants.select { |c| SpaceType::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #SpaceType" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end