mux_ruby 3.12.0 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +4 -4
  4. data/docs/AbridgedVideoView.md +5 -1
  5. data/docs/Asset.md +3 -1
  6. data/docs/AssetsApi.md +79 -4
  7. data/docs/CreateSimulcastTargetRequest.md +2 -2
  8. data/docs/DimensionsApi.md +2 -0
  9. data/docs/Error.md +3 -1
  10. data/docs/ErrorsApi.md +2 -0
  11. data/docs/GenerateTrackSubtitlesRequest.md +18 -0
  12. data/docs/GenerateTrackSubtitlesResponse.md +18 -0
  13. data/docs/InputSettings.md +2 -2
  14. data/docs/LiveStream.md +5 -1
  15. data/docs/LiveStreamsApi.md +8 -8
  16. data/docs/MetricsApi.md +13 -1
  17. data/docs/MonitoringBreakdownTimeseriesDatapoint.md +3 -1
  18. data/docs/PlaybackIDApi.md +4 -4
  19. data/docs/ReferrerDomainRestriction.md +1 -1
  20. data/docs/SimulcastTarget.md +6 -4
  21. data/docs/Track.md +3 -1
  22. data/docs/VideoView.md +30 -2
  23. data/docs/VideoViewsApi.md +2 -0
  24. data/gen/generator-config.json +1 -1
  25. data/lib/mux_ruby/api/assets_api.rb +79 -2
  26. data/lib/mux_ruby/api/dimensions_api.rb +3 -0
  27. data/lib/mux_ruby/api/errors_api.rb +3 -0
  28. data/lib/mux_ruby/api/live_streams_api.rb +4 -4
  29. data/lib/mux_ruby/api/metrics_api.rb +24 -6
  30. data/lib/mux_ruby/api/playback_id_api.rb +2 -2
  31. data/lib/mux_ruby/api/video_views_api.rb +3 -0
  32. data/lib/mux_ruby/models/abridged_video_view.rb +24 -4
  33. data/lib/mux_ruby/models/asset.rb +26 -4
  34. data/lib/mux_ruby/models/asset_generated_subtitle_settings.rb +2 -2
  35. data/lib/mux_ruby/models/create_simulcast_target_request.rb +2 -2
  36. data/lib/mux_ruby/models/error.rb +16 -5
  37. data/lib/mux_ruby/models/generate_track_subtitles_request.rb +221 -0
  38. data/lib/mux_ruby/models/generate_track_subtitles_response.rb +218 -0
  39. data/lib/mux_ruby/models/input_settings.rb +2 -2
  40. data/lib/mux_ruby/models/live_stream.rb +36 -4
  41. data/lib/mux_ruby/models/monitoring_breakdown_timeseries_datapoint.rb +13 -4
  42. data/lib/mux_ruby/models/referrer_domain_restriction.rb +1 -1
  43. data/lib/mux_ruby/models/simulcast_target.rb +29 -7
  44. data/lib/mux_ruby/models/track.rb +14 -4
  45. data/lib/mux_ruby/models/video_view.rb +142 -5
  46. data/lib/mux_ruby/version.rb +1 -1
  47. data/lib/mux_ruby.rb +2 -0
  48. data/spec/models/generate_track_subtitles_request_spec.rb +34 -0
  49. data/spec/models/generate_track_subtitles_response_spec.rb +34 -0
  50. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/byebug/byebug.so +0 -0
  51. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +6 -6
  52. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/ffi_c.so +0 -0
  53. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/gem_make.out +6 -6
  54. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/mkmf.log +16 -16
  55. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/gem_make.out +14 -14
  56. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/jaro_winkler/jaro_winkler_ext.so +0 -0
  57. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/gem_make.out +6 -6
  58. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/mkmf.log +4 -4
  59. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/psych.so +0 -0
  60. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/gem_make.out +6 -6
  61. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/mkmf.log +2 -2
  62. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/stringio.so +0 -0
  63. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/ext/byebug/Makefile +6 -6
  64. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
  65. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/Makefile +6 -6
  66. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so +0 -0
  67. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +6 -6
  68. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
  69. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/ext/psych/Makefile +6 -6
  70. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/lib/psych.so +0 -0
  71. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/ext/stringio/Makefile +6 -6
  72. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/lib/stringio.so +0 -0
  73. data/vendor/bundle/ruby/3.2.0/specifications/ast-2.4.2.gemspec +2 -2
  74. data/vendor/bundle/ruby/3.2.0/specifications/byebug-11.1.3.gemspec +2 -2
  75. data/vendor/bundle/ruby/3.2.0/specifications/coderay-1.1.3.gemspec +2 -2
  76. data/vendor/bundle/ruby/3.2.0/specifications/diff-lcs-1.5.0.gemspec +2 -2
  77. data/vendor/bundle/ruby/3.2.0/specifications/ethon-0.16.0.gemspec +2 -2
  78. data/vendor/bundle/ruby/3.2.0/specifications/ffi-1.16.3.gemspec +2 -2
  79. data/vendor/bundle/ruby/3.2.0/specifications/jaro_winkler-1.5.4.gemspec +2 -2
  80. data/vendor/bundle/ruby/3.2.0/specifications/method_source-1.0.0.gemspec +2 -2
  81. data/vendor/bundle/ruby/3.2.0/specifications/parallel-1.22.1.gemspec +2 -2
  82. data/vendor/bundle/ruby/3.2.0/specifications/parser-3.1.2.0.gemspec +2 -2
  83. data/vendor/bundle/ruby/3.2.0/specifications/pry-0.13.1.gemspec +2 -2
  84. data/vendor/bundle/ruby/3.2.0/specifications/pry-byebug-3.9.0.gemspec +2 -2
  85. data/vendor/bundle/ruby/3.2.0/specifications/psych-4.0.4.gemspec +2 -2
  86. data/vendor/bundle/ruby/3.2.0/specifications/rainbow-3.1.1.gemspec +2 -2
  87. data/vendor/bundle/ruby/3.2.0/specifications/rake-13.0.6.gemspec +2 -2
  88. data/vendor/bundle/ruby/3.2.0/specifications/rspec-3.11.0.gemspec +2 -2
  89. data/vendor/bundle/ruby/3.2.0/specifications/rspec-core-3.11.0.gemspec +2 -2
  90. data/vendor/bundle/ruby/3.2.0/specifications/rspec-expectations-3.11.0.gemspec +2 -2
  91. data/vendor/bundle/ruby/3.2.0/specifications/rspec-mocks-3.11.1.gemspec +2 -2
  92. data/vendor/bundle/ruby/3.2.0/specifications/rspec-support-3.11.0.gemspec +2 -2
  93. data/vendor/bundle/ruby/3.2.0/specifications/rubocop-0.66.0.gemspec +2 -2
  94. data/vendor/bundle/ruby/3.2.0/specifications/ruby-progressbar-1.11.0.gemspec +2 -2
  95. data/vendor/bundle/ruby/3.2.0/specifications/solid_assert-1.1.0.gemspec +2 -2
  96. data/vendor/bundle/ruby/3.2.0/specifications/stringio-3.0.2.gemspec +2 -2
  97. data/vendor/bundle/ruby/3.2.0/specifications/typhoeus-1.4.1.gemspec +2 -2
  98. data/vendor/bundle/ruby/3.2.0/specifications/unicode-display_width-1.5.0.gemspec +2 -2
  99. metadata +160 -152
@@ -37,6 +37,10 @@ module MuxRuby
37
37
 
38
38
  attr_accessor :view_end
39
39
 
40
+ attr_accessor :viewer_experience_score
41
+
42
+ attr_accessor :watch_time
43
+
40
44
  # Attribute mapping from ruby-style variable name to JSON key.
41
45
  def self.attribute_map
42
46
  {
@@ -50,7 +54,9 @@ module MuxRuby
50
54
  :'error_type_id' => :'error_type_id',
51
55
  :'country_code' => :'country_code',
52
56
  :'view_start' => :'view_start',
53
- :'view_end' => :'view_end'
57
+ :'view_end' => :'view_end',
58
+ :'viewer_experience_score' => :'viewer_experience_score',
59
+ :'watch_time' => :'watch_time'
54
60
  }
55
61
  end
56
62
 
@@ -72,7 +78,9 @@ module MuxRuby
72
78
  :'error_type_id' => :'Integer',
73
79
  :'country_code' => :'String',
74
80
  :'view_start' => :'String',
75
- :'view_end' => :'String'
81
+ :'view_end' => :'String',
82
+ :'viewer_experience_score' => :'Float',
83
+ :'watch_time' => :'Integer'
76
84
  }
77
85
  end
78
86
 
@@ -86,6 +94,8 @@ module MuxRuby
86
94
  :'player_error_code',
87
95
  :'error_type_id',
88
96
  :'country_code',
97
+ :'viewer_experience_score',
98
+ :'watch_time'
89
99
  ])
90
100
  end
91
101
 
@@ -147,6 +157,14 @@ module MuxRuby
147
157
  if attributes.key?(:'view_end')
148
158
  self.view_end = attributes[:'view_end']
149
159
  end
160
+
161
+ if attributes.key?(:'viewer_experience_score')
162
+ self.viewer_experience_score = attributes[:'viewer_experience_score']
163
+ end
164
+
165
+ if attributes.key?(:'watch_time')
166
+ self.watch_time = attributes[:'watch_time']
167
+ end
150
168
  end
151
169
 
152
170
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -177,7 +195,9 @@ module MuxRuby
177
195
  error_type_id == o.error_type_id &&
178
196
  country_code == o.country_code &&
179
197
  view_start == o.view_start &&
180
- view_end == o.view_end
198
+ view_end == o.view_end &&
199
+ viewer_experience_score == o.viewer_experience_score &&
200
+ watch_time == o.watch_time
181
201
  end
182
202
 
183
203
  # @see the `==` method
@@ -189,7 +209,7 @@ module MuxRuby
189
209
  # Calculates hash code according to all attributes.
190
210
  # @return [Integer] Hash code
191
211
  def hash
192
- [id, viewer_os_family, viewer_application_name, video_title, total_row_count, player_error_message, player_error_code, error_type_id, country_code, view_start, view_end].hash
212
+ [id, viewer_os_family, viewer_application_name, video_title, total_row_count, player_error_message, player_error_code, error_type_id, country_code, view_start, view_end, viewer_experience_score, watch_time].hash
193
213
  end
194
214
 
195
215
  # Builds the object from hash
@@ -89,6 +89,9 @@ module MuxRuby
89
89
  # True means this live stream is a test asset. 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 assets are watermarked with the Mux logo, limited to 10 seconds, and deleted after 24 hrs.
90
90
  attr_accessor :test
91
91
 
92
+ # The type of ingest used to create the asset.
93
+ attr_accessor :ingest_type
94
+
92
95
  class EnumAttributeValidator
93
96
  attr_reader :datatype
94
97
  attr_reader :allowable_values
@@ -140,7 +143,8 @@ module MuxRuby
140
143
  :'static_renditions' => :'static_renditions',
141
144
  :'recording_times' => :'recording_times',
142
145
  :'non_standard_input_reasons' => :'non_standard_input_reasons',
143
- :'test' => :'test'
146
+ :'test' => :'test',
147
+ :'ingest_type' => :'ingest_type'
144
148
  }
145
149
  end
146
150
 
@@ -178,7 +182,8 @@ module MuxRuby
178
182
  :'static_renditions' => :'AssetStaticRenditions',
179
183
  :'recording_times' => :'Array<AssetRecordingTimes>',
180
184
  :'non_standard_input_reasons' => :'AssetNonStandardInputReasons',
181
- :'test' => :'Boolean'
185
+ :'test' => :'Boolean',
186
+ :'ingest_type' => :'String'
182
187
  }
183
188
  end
184
189
 
@@ -322,6 +327,10 @@ module MuxRuby
322
327
  if attributes.key?(:'test')
323
328
  self.test = attributes[:'test']
324
329
  end
330
+
331
+ if attributes.key?(:'ingest_type')
332
+ self.ingest_type = attributes[:'ingest_type']
333
+ end
325
334
  end
326
335
 
327
336
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -348,6 +357,8 @@ module MuxRuby
348
357
  return false unless master_access_validator.valid?(@master_access)
349
358
  mp4_support_validator = EnumAttributeValidator.new('String', ["standard", "none"])
350
359
  return false unless mp4_support_validator.valid?(@mp4_support)
360
+ ingest_type_validator = EnumAttributeValidator.new('String', ["on_demand_url", "on_demand_direct_upload", "on_demand_clip", "live_rtmp", "live_srt"])
361
+ return false unless ingest_type_validator.valid?(@ingest_type)
351
362
  true
352
363
  end
353
364
 
@@ -421,6 +432,16 @@ module MuxRuby
421
432
  @mp4_support = mp4_support
422
433
  end
423
434
 
435
+ # Custom attribute writer method checking allowed values (enum).
436
+ # @param [Object] ingest_type Object to be assigned
437
+ def ingest_type=(ingest_type)
438
+ validator = EnumAttributeValidator.new('String', ["on_demand_url", "on_demand_direct_upload", "on_demand_clip", "live_rtmp", "live_srt"])
439
+ unless validator.valid?(ingest_type)
440
+ fail ArgumentError, "invalid value for \"ingest_type\", must be one of #{validator.allowable_values}."
441
+ end
442
+ @ingest_type = ingest_type
443
+ end
444
+
424
445
  # Checks equality by comparing each attribute.
425
446
  # @param [Object] Object to be compared
426
447
  def ==(o)
@@ -452,7 +473,8 @@ module MuxRuby
452
473
  static_renditions == o.static_renditions &&
453
474
  recording_times == o.recording_times &&
454
475
  non_standard_input_reasons == o.non_standard_input_reasons &&
455
- test == o.test
476
+ test == o.test &&
477
+ ingest_type == o.ingest_type
456
478
  end
457
479
 
458
480
  # @see the `==` method
@@ -464,7 +486,7 @@ module MuxRuby
464
486
  # Calculates hash code according to all attributes.
465
487
  # @return [Integer] Hash code
466
488
  def hash
467
- [id, created_at, status, duration, max_stored_resolution, resolution_tier, max_resolution_tier, encoding_tier, max_stored_frame_rate, aspect_ratio, playback_ids, tracks, errors, per_title_encode, upload_id, is_live, passthrough, live_stream_id, master, master_access, mp4_support, source_asset_id, normalize_audio, static_renditions, recording_times, non_standard_input_reasons, test].hash
489
+ [id, created_at, status, duration, max_stored_resolution, resolution_tier, max_resolution_tier, encoding_tier, max_stored_frame_rate, aspect_ratio, playback_ids, tracks, errors, per_title_encode, upload_id, is_live, passthrough, live_stream_id, master, master_access, mp4_support, source_asset_id, normalize_audio, static_renditions, recording_times, non_standard_input_reasons, test, ingest_type].hash
468
490
  end
469
491
 
470
492
  # Builds the object from hash
@@ -115,7 +115,7 @@ module MuxRuby
115
115
  # Check to see if the all the properties in the model are valid
116
116
  # @return true if the model is valid
117
117
  def valid?
118
- language_code_validator = EnumAttributeValidator.new('String', ["en", "en-US"])
118
+ language_code_validator = EnumAttributeValidator.new('String', ["en", "es", "it", "pt", "de", "fr", "pl", "ru", "nl", "ca", "tr", "sv", "uk", "no", "fi", "sk", "el", "cs", "hr", "da", "ro", "bg"])
119
119
  return false unless language_code_validator.valid?(@language_code)
120
120
  true
121
121
  end
@@ -123,7 +123,7 @@ module MuxRuby
123
123
  # Custom attribute writer method checking allowed values (enum).
124
124
  # @param [Object] language_code Object to be assigned
125
125
  def language_code=(language_code)
126
- validator = EnumAttributeValidator.new('String', ["en", "en-US"])
126
+ validator = EnumAttributeValidator.new('String', ["en", "es", "it", "pt", "de", "fr", "pl", "ru", "nl", "ca", "tr", "sv", "uk", "no", "fi", "sk", "el", "cs", "hr", "da", "ro", "bg"])
127
127
  unless validator.valid?(language_code)
128
128
  fail ArgumentError, "invalid value for \"language_code\", must be one of #{validator.allowable_values}."
129
129
  end
@@ -18,10 +18,10 @@ module MuxRuby
18
18
  # Arbitrary user-supplied metadata set by you when creating a simulcast target.
19
19
  attr_accessor :passthrough
20
20
 
21
- # Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to.
21
+ # Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. Only used for RTMP(s) simulcast destinations.
22
22
  attr_accessor :stream_key
23
23
 
24
- # RTMP hostname including application name for the third party live streaming service. Example: `rtmp://live.example.com/app`.
24
+ # The RTMP(s) or SRT endpoint for a simulcast destination. * For RTMP(s) destinations, this should include the application name for the third party live streaming service, for example: `rtmp://live.example.com/app`. * For SRT destinations, this should be a fully formed SRT connection string, for example: `srt://srt-live.example.com:1234?streamid={stream_key}&passphrase={srt_passphrase}`. Note: SRT simulcast targets can only be used when an source is connected over SRT.
25
25
  attr_accessor :url
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -39,6 +39,9 @@ module MuxRuby
39
39
  # The error code
40
40
  attr_accessor :code
41
41
 
42
+ # The string version of the error code
43
+ attr_accessor :player_error_code
44
+
42
45
  # Attribute mapping from ruby-style variable name to JSON key.
43
46
  def self.attribute_map
44
47
  {
@@ -49,7 +52,8 @@ module MuxRuby
49
52
  :'last_seen' => :'last_seen',
50
53
  :'description' => :'description',
51
54
  :'count' => :'count',
52
- :'code' => :'code'
55
+ :'code' => :'code',
56
+ :'player_error_code' => :'player_error_code'
53
57
  }
54
58
  end
55
59
 
@@ -68,7 +72,8 @@ module MuxRuby
68
72
  :'last_seen' => :'String',
69
73
  :'description' => :'String',
70
74
  :'count' => :'Integer',
71
- :'code' => :'Integer'
75
+ :'code' => :'Integer',
76
+ :'player_error_code' => :'String'
72
77
  }
73
78
  end
74
79
 
@@ -78,7 +83,8 @@ module MuxRuby
78
83
  :'notes',
79
84
  :'message',
80
85
  :'description',
81
- :'code'
86
+ :'code',
87
+ :'player_error_code'
82
88
  ])
83
89
  end
84
90
 
@@ -128,6 +134,10 @@ module MuxRuby
128
134
  if attributes.key?(:'code')
129
135
  self.code = attributes[:'code']
130
136
  end
137
+
138
+ if attributes.key?(:'player_error_code')
139
+ self.player_error_code = attributes[:'player_error_code']
140
+ end
131
141
  end
132
142
 
133
143
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -155,7 +165,8 @@ module MuxRuby
155
165
  last_seen == o.last_seen &&
156
166
  description == o.description &&
157
167
  count == o.count &&
158
- code == o.code
168
+ code == o.code &&
169
+ player_error_code == o.player_error_code
159
170
  end
160
171
 
161
172
  # @see the `==` method
@@ -167,7 +178,7 @@ module MuxRuby
167
178
  # Calculates hash code according to all attributes.
168
179
  # @return [Integer] Hash code
169
180
  def hash
170
- [id, percentage, notes, message, last_seen, description, count, code].hash
181
+ [id, percentage, notes, message, last_seen, description, count, code, player_error_code].hash
171
182
  end
172
183
 
173
184
  # Builds the object from hash
@@ -0,0 +1,221 @@
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 GenerateTrackSubtitlesRequest
18
+ # Generate subtitle tracks using automatic speech recognition with this configuration.
19
+ attr_accessor :generated_subtitles
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'generated_subtitles' => :'generated_subtitles'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'generated_subtitles' => :'Array<AssetGeneratedSubtitleSettings>'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::GenerateTrackSubtitlesRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::GenerateTrackSubtitlesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'generated_subtitles')
62
+ if (value = attributes[:'generated_subtitles']).is_a?(Array)
63
+ self.generated_subtitles = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ generated_subtitles == o.generated_subtitles
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [generated_subtitles].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = MuxRuby.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -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 GenerateTrackSubtitlesResponse
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' => :'Track'
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::GenerateTrackSubtitlesResponse` 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::GenerateTrackSubtitlesResponse`. 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
+ 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
+ data == o.data
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
+ [data].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