mux_ruby 1.9.0 → 2.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +26 -37
  4. data/README.md +36 -13
  5. data/docs/AbridgedVideoView.md +33 -13
  6. data/docs/Asset.md +57 -26
  7. data/docs/AssetErrors.md +15 -4
  8. data/docs/AssetMaster.md +15 -4
  9. data/docs/AssetNonStandardInputReasons.md +29 -11
  10. data/docs/AssetRecordingTimes.md +15 -4
  11. data/docs/AssetResponse.md +13 -3
  12. data/docs/AssetStaticRenditions.md +15 -4
  13. data/docs/AssetStaticRenditionsFiles.md +23 -8
  14. data/docs/AssetsApi.md +387 -160
  15. data/docs/BreakdownValue.md +21 -7
  16. data/docs/CreateAssetRequest.md +27 -10
  17. data/docs/CreateLiveStreamRequest.md +25 -9
  18. data/docs/CreatePlaybackIDRequest.md +13 -3
  19. data/docs/CreatePlaybackIDResponse.md +13 -3
  20. data/docs/CreateSimulcastTargetRequest.md +17 -5
  21. data/docs/CreateTrackRequest.md +25 -9
  22. data/docs/CreateTrackResponse.md +13 -3
  23. data/docs/CreateUploadRequest.md +19 -6
  24. data/docs/DeliveryReport.md +27 -9
  25. data/docs/DeliveryUsageApi.md +40 -22
  26. data/docs/DimensionValue.md +15 -4
  27. data/docs/DimensionsApi.md +72 -34
  28. data/docs/DirectUploadsApi.md +131 -56
  29. data/docs/DisableLiveStreamResponse.md +13 -3
  30. data/docs/EnableLiveStreamResponse.md +13 -3
  31. data/docs/Error.md +27 -10
  32. data/docs/ErrorsApi.md +37 -19
  33. data/docs/ExportsApi.md +32 -13
  34. data/docs/FilterValue.md +15 -4
  35. data/docs/FiltersApi.md +71 -33
  36. data/docs/GetAssetInputInfoResponse.md +13 -3
  37. data/docs/GetAssetOrLiveStreamIdResponse.md +13 -3
  38. data/docs/GetAssetOrLiveStreamIdResponseData.md +17 -5
  39. data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +15 -4
  40. data/docs/GetAssetPlaybackIDResponse.md +13 -3
  41. data/docs/GetMetricTimeseriesDataResponse.md +17 -5
  42. data/docs/GetOverallValuesResponse.md +17 -5
  43. data/docs/GetRealTimeBreakdownResponse.md +17 -5
  44. data/docs/GetRealTimeHistogramTimeseriesResponse.md +19 -6
  45. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +13 -3
  46. data/docs/GetRealTimeTimeseriesResponse.md +17 -5
  47. data/docs/Incident.md +53 -23
  48. data/docs/IncidentBreakdown.md +17 -5
  49. data/docs/IncidentNotification.md +17 -5
  50. data/docs/IncidentNotificationRule.md +21 -7
  51. data/docs/IncidentResponse.md +15 -4
  52. data/docs/IncidentsApi.md +115 -59
  53. data/docs/InputFile.md +15 -4
  54. data/docs/InputInfo.md +15 -4
  55. data/docs/InputSettings.md +31 -12
  56. data/docs/InputSettingsOverlaySettings.md +25 -9
  57. data/docs/InputTrack.md +29 -11
  58. data/docs/Insight.md +23 -8
  59. data/docs/ListAllMetricValuesResponse.md +17 -5
  60. data/docs/ListAssetsResponse.md +13 -3
  61. data/docs/ListBreakdownValuesResponse.md +17 -5
  62. data/docs/ListDeliveryUsageResponse.md +19 -6
  63. data/docs/ListDimensionValuesResponse.md +17 -5
  64. data/docs/ListDimensionsResponse.md +17 -5
  65. data/docs/ListErrorsResponse.md +17 -5
  66. data/docs/ListExportsResponse.md +17 -5
  67. data/docs/ListFilterValuesResponse.md +17 -5
  68. data/docs/ListFiltersResponse.md +17 -5
  69. data/docs/ListFiltersResponseData.md +15 -4
  70. data/docs/ListIncidentsResponse.md +17 -5
  71. data/docs/ListInsightsResponse.md +17 -5
  72. data/docs/ListLiveStreamsResponse.md +13 -3
  73. data/docs/ListRealTimeDimensionsResponse.md +17 -5
  74. data/docs/ListRealTimeDimensionsResponseData.md +15 -4
  75. data/docs/ListRealTimeMetricsResponse.md +17 -5
  76. data/docs/ListRelatedIncidentsResponse.md +17 -5
  77. data/docs/ListSigningKeysResponse.md +13 -3
  78. data/docs/ListUploadsResponse.md +13 -3
  79. data/docs/ListVideoViewsResponse.md +17 -5
  80. data/docs/LiveStream.md +37 -15
  81. data/docs/LiveStreamResponse.md +13 -3
  82. data/docs/LiveStreamsApi.md +418 -170
  83. data/docs/Metric.md +21 -7
  84. data/docs/MetricsApi.md +206 -112
  85. data/docs/NotificationRule.md +17 -5
  86. data/docs/OverallValues.md +19 -6
  87. data/docs/PlaybackID.md +15 -4
  88. data/docs/PlaybackIDApi.md +34 -16
  89. data/docs/PlaybackPolicy.md +10 -2
  90. data/docs/RealTimeApi.md +172 -76
  91. data/docs/RealTimeBreakdownValue.md +21 -7
  92. data/docs/RealTimeHistogramTimeseriesBucket.md +15 -4
  93. data/docs/RealTimeHistogramTimeseriesBucketValues.md +15 -4
  94. data/docs/RealTimeHistogramTimeseriesDatapoint.md +25 -9
  95. data/docs/RealTimeTimeseriesDatapoint.md +17 -5
  96. data/docs/Score.md +23 -8
  97. data/docs/SignalLiveStreamCompleteResponse.md +13 -3
  98. data/docs/SigningKey.md +17 -5
  99. data/docs/SigningKeyResponse.md +13 -3
  100. data/docs/SimulcastTarget.md +21 -7
  101. data/docs/SimulcastTargetResponse.md +13 -3
  102. data/docs/Track.md +37 -15
  103. data/docs/URLSigningKeysApi.md +127 -51
  104. data/docs/UpdateAssetMP4SupportRequest.md +13 -3
  105. data/docs/UpdateAssetMasterAccessRequest.md +13 -3
  106. data/docs/Upload.md +29 -11
  107. data/docs/UploadError.md +15 -4
  108. data/docs/UploadResponse.md +13 -3
  109. data/docs/VideoView.md +235 -114
  110. data/docs/VideoViewEvent.md +19 -6
  111. data/docs/VideoViewResponse.md +15 -4
  112. data/docs/VideoViewsApi.md +76 -39
  113. data/gen/.gitignore +7 -0
  114. data/gen/Makefile +31 -0
  115. data/gen/generator-config.json +11 -0
  116. data/gen/openapitools.json +7 -0
  117. data/gen/package.json +17 -0
  118. data/gen/templates/Gemfile.mustache +11 -0
  119. data/gen/templates/README.mustache +158 -0
  120. data/gen/templates/Rakefile.mustache +10 -0
  121. data/gen/templates/api.mustache +206 -0
  122. data/gen/templates/api_client.mustache +264 -0
  123. data/gen/templates/api_client_faraday_partial.mustache +138 -0
  124. data/gen/templates/api_client_spec.mustache +220 -0
  125. data/gen/templates/api_client_typhoeus_partial.mustache +183 -0
  126. data/gen/templates/api_doc.mustache +118 -0
  127. data/gen/templates/api_error.mustache +67 -0
  128. data/gen/templates/api_info.mustache +12 -0
  129. data/gen/templates/api_test.mustache +47 -0
  130. data/gen/templates/base_object.mustache +120 -0
  131. data/gen/templates/configuration.mustache +349 -0
  132. data/gen/templates/configuration_spec.mustache +34 -0
  133. data/gen/templates/configuration_tls_faraday_partial.mustache +29 -0
  134. data/gen/templates/configuration_tls_typhoeus_partial.mustache +34 -0
  135. data/gen/templates/gem.mustache +40 -0
  136. data/gen/templates/gemspec.mustache +35 -0
  137. data/gen/templates/gitignore.mustache +39 -0
  138. data/gen/templates/model.mustache +26 -0
  139. data/gen/templates/model_doc.mustache +12 -0
  140. data/gen/templates/model_test.mustache +77 -0
  141. data/gen/templates/partial_model_enum_class.mustache +20 -0
  142. data/gen/templates/partial_model_generic.mustache +371 -0
  143. data/gen/templates/partial_model_generic_doc.mustache +28 -0
  144. data/gen/templates/partial_oneof_module.mustache +137 -0
  145. data/gen/templates/partial_oneof_module_doc.mustache +92 -0
  146. data/gen/templates/rspec.mustache +2 -0
  147. data/gen/templates/rubocop.mustache +148 -0
  148. data/gen/templates/spec_helper.mustache +103 -0
  149. data/gen/templates/version.mustache +7 -0
  150. data/gen/yarn.lock +1878 -0
  151. data/lib/mux_ruby.rb +9 -2
  152. data/lib/mux_ruby/api/assets_api.rb +279 -150
  153. data/lib/mux_ruby/api/delivery_usage_api.rb +28 -12
  154. data/lib/mux_ruby/api/dimensions_api.rb +55 -29
  155. data/lib/mux_ruby/api/direct_uploads_api.rb +90 -44
  156. data/lib/mux_ruby/api/errors_api.rb +32 -16
  157. data/lib/mux_ruby/api/exports_api.rb +28 -12
  158. data/lib/mux_ruby/api/filters_api.rb +53 -27
  159. data/lib/mux_ruby/api/incidents_api.rb +88 -46
  160. data/lib/mux_ruby/api/live_streams_api.rb +299 -157
  161. data/lib/mux_ruby/api/metrics_api.rb +175 -104
  162. data/lib/mux_ruby/api/playback_id_api.rb +31 -15
  163. data/lib/mux_ruby/api/real_time_api.rb +139 -77
  164. data/lib/mux_ruby/api/url_signing_keys_api.rb +89 -42
  165. data/lib/mux_ruby/api/video_views_api.rb +56 -29
  166. data/lib/mux_ruby/api_client.rb +94 -79
  167. data/lib/mux_ruby/api_error.rb +35 -7
  168. data/lib/mux_ruby/configuration.rb +50 -14
  169. data/lib/mux_ruby/models/abridged_video_view.rb +58 -24
  170. data/lib/mux_ruby/models/asset.rb +88 -61
  171. data/lib/mux_ruby/models/asset_errors.rb +50 -15
  172. data/lib/mux_ruby/models/asset_master.rb +52 -17
  173. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +70 -35
  174. data/lib/mux_ruby/models/asset_recording_times.rb +50 -16
  175. data/lib/mux_ruby/models/asset_response.rb +48 -14
  176. data/lib/mux_ruby/models/asset_static_renditions.rb +53 -17
  177. data/lib/mux_ruby/models/asset_static_renditions_files.rb +58 -23
  178. data/lib/mux_ruby/models/breakdown_value.rb +52 -18
  179. data/lib/mux_ruby/models/create_asset_request.rb +64 -30
  180. data/lib/mux_ruby/models/create_live_stream_request.rb +57 -22
  181. data/lib/mux_ruby/models/create_playback_id_request.rb +48 -14
  182. data/lib/mux_ruby/models/create_playback_id_response.rb +48 -14
  183. data/lib/mux_ruby/models/create_simulcast_target_request.rb +50 -16
  184. data/lib/mux_ruby/models/create_track_request.rb +59 -25
  185. data/lib/mux_ruby/models/create_track_response.rb +48 -14
  186. data/lib/mux_ruby/models/create_upload_request.rb +52 -18
  187. data/lib/mux_ruby/models/delivery_report.rb +106 -21
  188. data/lib/mux_ruby/models/dimension_value.rb +49 -15
  189. data/lib/mux_ruby/models/disable_live_stream_response.rb +48 -14
  190. data/lib/mux_ruby/models/enable_live_stream_response.rb +48 -14
  191. data/lib/mux_ruby/models/error.rb +63 -21
  192. data/lib/mux_ruby/models/filter_value.rb +49 -15
  193. data/lib/mux_ruby/models/get_asset_input_info_response.rb +48 -14
  194. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +48 -14
  195. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +50 -16
  196. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +51 -17
  197. data/lib/mux_ruby/models/get_asset_playback_id_response.rb +48 -14
  198. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +50 -16
  199. data/lib/mux_ruby/models/get_overall_values_response.rb +50 -16
  200. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +50 -16
  201. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +51 -17
  202. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +48 -14
  203. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +50 -16
  204. data/lib/mux_ruby/models/incident.rb +68 -34
  205. data/lib/mux_ruby/models/incident_breakdown.rb +50 -16
  206. data/lib/mux_ruby/models/incident_notification.rb +50 -16
  207. data/lib/mux_ruby/models/incident_notification_rule.rb +52 -18
  208. data/lib/mux_ruby/models/incident_response.rb +49 -15
  209. data/lib/mux_ruby/models/input_file.rb +49 -15
  210. data/lib/mux_ruby/models/input_info.rb +49 -15
  211. data/lib/mux_ruby/models/input_settings.rb +64 -30
  212. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +58 -24
  213. data/lib/mux_ruby/models/input_track.rb +56 -22
  214. data/lib/mux_ruby/models/insight.rb +53 -19
  215. data/lib/mux_ruby/models/list_all_metric_values_response.rb +50 -16
  216. data/lib/mux_ruby/models/list_assets_response.rb +48 -14
  217. data/lib/mux_ruby/models/list_breakdown_values_response.rb +50 -16
  218. data/lib/mux_ruby/models/list_delivery_usage_response.rb +51 -17
  219. data/lib/mux_ruby/models/list_dimension_values_response.rb +50 -16
  220. data/lib/mux_ruby/models/list_dimensions_response.rb +50 -16
  221. data/lib/mux_ruby/models/list_errors_response.rb +50 -16
  222. data/lib/mux_ruby/models/list_exports_response.rb +50 -16
  223. data/lib/mux_ruby/models/list_filter_values_response.rb +50 -16
  224. data/lib/mux_ruby/models/list_filters_response.rb +50 -16
  225. data/lib/mux_ruby/models/list_filters_response_data.rb +49 -15
  226. data/lib/mux_ruby/models/list_incidents_response.rb +50 -16
  227. data/lib/mux_ruby/models/list_insights_response.rb +50 -16
  228. data/lib/mux_ruby/models/list_live_streams_response.rb +48 -14
  229. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +50 -16
  230. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +49 -15
  231. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +50 -16
  232. data/lib/mux_ruby/models/list_related_incidents_response.rb +50 -16
  233. data/lib/mux_ruby/models/list_signing_keys_response.rb +48 -14
  234. data/lib/mux_ruby/models/list_uploads_response.rb +48 -14
  235. data/lib/mux_ruby/models/list_video_views_response.rb +50 -16
  236. data/lib/mux_ruby/models/live_stream.rb +110 -28
  237. data/lib/mux_ruby/models/live_stream_response.rb +48 -14
  238. data/lib/mux_ruby/models/metric.rb +52 -18
  239. data/lib/mux_ruby/models/notification_rule.rb +50 -16
  240. data/lib/mux_ruby/models/overall_values.rb +51 -17
  241. data/lib/mux_ruby/models/playback_id.rb +49 -15
  242. data/lib/mux_ruby/models/playback_policy.rb +12 -6
  243. data/lib/mux_ruby/models/real_time_breakdown_value.rb +52 -18
  244. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +50 -16
  245. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +49 -15
  246. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +54 -20
  247. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +50 -16
  248. data/lib/mux_ruby/models/score.rb +53 -19
  249. data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +48 -14
  250. data/lib/mux_ruby/models/signing_key.rb +53 -16
  251. data/lib/mux_ruby/models/signing_key_response.rb +48 -14
  252. data/lib/mux_ruby/models/simulcast_target.rb +54 -20
  253. data/lib/mux_ruby/models/simulcast_target_response.rb +48 -14
  254. data/lib/mux_ruby/models/track.rb +67 -33
  255. data/lib/mux_ruby/models/update_asset_master_access_request.rb +50 -16
  256. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +50 -16
  257. data/lib/mux_ruby/models/upload.rb +61 -25
  258. data/lib/mux_ruby/models/upload_error.rb +51 -15
  259. data/lib/mux_ruby/models/upload_response.rb +48 -14
  260. data/lib/mux_ruby/models/video_view.rb +166 -132
  261. data/lib/mux_ruby/models/video_view_event.rb +51 -17
  262. data/lib/mux_ruby/models/video_view_response.rb +49 -15
  263. data/lib/mux_ruby/version.rb +10 -3
  264. data/mux_ruby.gemspec +15 -17
  265. data/spec/api_client_spec.rb +10 -3
  266. data/spec/configuration_spec.rb +9 -2
  267. data/spec/spec_helper.rb +9 -2
  268. metadata +139 -242
@@ -1,9 +1,17 @@
1
1
  =begin
2
- # Mux Ruby - Copyright 2019 Mux Inc.
3
- # NOTE: This file is auto generated. Do not edit this file manually.
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
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
4
11
  =end
5
12
 
6
13
  require 'date'
14
+ require 'time'
7
15
 
8
16
  module MuxRuby
9
17
  # An array of objects that each describe an input file to be used to create the asset. As a shortcut, `input` can also be a string URL for a file when only one input file is used. See `input[].url` for requirements.
@@ -13,10 +21,10 @@ module MuxRuby
13
21
 
14
22
  attr_accessor :overlay_settings
15
23
 
16
- # The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included.
24
+ # The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format.
17
25
  attr_accessor :start_time
18
26
 
19
- # The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included.
27
+ # The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included. This parameter is only applicable for creating clips when `input.url` has `mux://assets/{asset_id}` format.
20
28
  attr_accessor :end_time
21
29
 
22
30
  # This parameter is required for the `text` track type.
@@ -75,6 +83,11 @@ module MuxRuby
75
83
  }
76
84
  end
77
85
 
86
+ # Returns all the JSON keys this model knows about
87
+ def self.acceptable_attributes
88
+ attribute_map.values
89
+ end
90
+
78
91
  # Attribute type mapping.
79
92
  def self.openapi_types
80
93
  {
@@ -86,56 +99,69 @@ module MuxRuby
86
99
  :'text_type' => :'String',
87
100
  :'language_code' => :'String',
88
101
  :'name' => :'String',
89
- :'closed_captions' => :'BOOLEAN',
102
+ :'closed_captions' => :'Boolean',
90
103
  :'passthrough' => :'String'
91
104
  }
92
105
  end
93
106
 
107
+ # List of attributes with nullable: true
108
+ def self.openapi_nullable
109
+ Set.new([
110
+ ])
111
+ end
112
+
94
113
  # Initializes the object
95
114
  # @param [Hash] attributes Model attributes in the form of hash
96
115
  def initialize(attributes = {})
97
- return unless attributes.is_a?(Hash)
116
+ if (!attributes.is_a?(Hash))
117
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::InputSettings` initialize method"
118
+ end
98
119
 
99
- # convert string to symbol for hash key
100
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
120
+ # check to see if the attribute exists and convert string to symbol for hash key
121
+ attributes = attributes.each_with_object({}) { |(k, v), h|
122
+ if (!self.class.attribute_map.key?(k.to_sym))
123
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::InputSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
124
+ end
125
+ h[k.to_sym] = v
126
+ }
101
127
 
102
- if attributes.has_key?(:'url')
128
+ if attributes.key?(:'url')
103
129
  self.url = attributes[:'url']
104
130
  end
105
131
 
106
- if attributes.has_key?(:'overlay_settings')
132
+ if attributes.key?(:'overlay_settings')
107
133
  self.overlay_settings = attributes[:'overlay_settings']
108
134
  end
109
135
 
110
- if attributes.has_key?(:'start_time')
136
+ if attributes.key?(:'start_time')
111
137
  self.start_time = attributes[:'start_time']
112
138
  end
113
139
 
114
- if attributes.has_key?(:'end_time')
140
+ if attributes.key?(:'end_time')
115
141
  self.end_time = attributes[:'end_time']
116
142
  end
117
143
 
118
- if attributes.has_key?(:'type')
144
+ if attributes.key?(:'type')
119
145
  self.type = attributes[:'type']
120
146
  end
121
147
 
122
- if attributes.has_key?(:'text_type')
148
+ if attributes.key?(:'text_type')
123
149
  self.text_type = attributes[:'text_type']
124
150
  end
125
151
 
126
- if attributes.has_key?(:'language_code')
152
+ if attributes.key?(:'language_code')
127
153
  self.language_code = attributes[:'language_code']
128
154
  end
129
155
 
130
- if attributes.has_key?(:'name')
156
+ if attributes.key?(:'name')
131
157
  self.name = attributes[:'name']
132
158
  end
133
159
 
134
- if attributes.has_key?(:'closed_captions')
160
+ if attributes.key?(:'closed_captions')
135
161
  self.closed_captions = attributes[:'closed_captions']
136
162
  end
137
163
 
138
- if attributes.has_key?(:'passthrough')
164
+ if attributes.key?(:'passthrough')
139
165
  self.passthrough = attributes[:'passthrough']
140
166
  end
141
167
  end
@@ -150,9 +176,9 @@ module MuxRuby
150
176
  # Check to see if the all the properties in the model are valid
151
177
  # @return true if the model is valid
152
178
  def valid?
153
- type_validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
179
+ type_validator = EnumAttributeValidator.new('String', ["video", "audio", "text"])
154
180
  return false unless type_validator.valid?(@type)
155
- text_type_validator = EnumAttributeValidator.new('String', ['subtitles'])
181
+ text_type_validator = EnumAttributeValidator.new('String', ["subtitles"])
156
182
  return false unless text_type_validator.valid?(@text_type)
157
183
  true
158
184
  end
@@ -160,7 +186,7 @@ module MuxRuby
160
186
  # Custom attribute writer method checking allowed values (enum).
161
187
  # @param [Object] type Object to be assigned
162
188
  def type=(type)
163
- validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
189
+ validator = EnumAttributeValidator.new('String', ["video", "audio", "text"])
164
190
  unless validator.valid?(type)
165
191
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
166
192
  end
@@ -170,7 +196,7 @@ module MuxRuby
170
196
  # Custom attribute writer method checking allowed values (enum).
171
197
  # @param [Object] text_type Object to be assigned
172
198
  def text_type=(text_type)
173
- validator = EnumAttributeValidator.new('String', ['subtitles'])
199
+ validator = EnumAttributeValidator.new('String', ["subtitles"])
174
200
  unless validator.valid?(text_type)
175
201
  fail ArgumentError, "invalid value for \"text_type\", must be one of #{validator.allowable_values}."
176
202
  end
@@ -201,7 +227,7 @@ module MuxRuby
201
227
  end
202
228
 
203
229
  # Calculates hash code according to all attributes.
204
- # @return [Fixnum] Hash code
230
+ # @return [Integer] Hash code
205
231
  def hash
206
232
  [url, overlay_settings, start_time, end_time, type, text_type, language_code, name, closed_captions, passthrough].hash
207
233
  end
@@ -219,7 +245,9 @@ module MuxRuby
219
245
  def build_from_hash(attributes)
220
246
  return nil unless attributes.is_a?(Hash)
221
247
  self.class.openapi_types.each_pair do |key, type|
222
- if type =~ /\AArray<(.*)>/i
248
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
249
+ self.send("#{key}=", nil)
250
+ elsif type =~ /\AArray<(.*)>/i
223
251
  # check to ensure the input is an array given that the attribute
224
252
  # is documented as an array but the input is not
225
253
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -227,7 +255,7 @@ module MuxRuby
227
255
  end
228
256
  elsif !attributes[self.class.attribute_map[key]].nil?
229
257
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
230
- end # or else data not found in attributes(hash), not an issue as the data can be optional
258
+ end
231
259
  end
232
260
 
233
261
  self
@@ -239,8 +267,8 @@ module MuxRuby
239
267
  # @return [Object] Deserialized data
240
268
  def _deserialize(type, value)
241
269
  case type.to_sym
242
- when :DateTime
243
- DateTime.parse(value)
270
+ when :Time
271
+ Time.parse(value)
244
272
  when :Date
245
273
  Date.parse(value)
246
274
  when :String
@@ -249,7 +277,7 @@ module MuxRuby
249
277
  value.to_i
250
278
  when :Float
251
279
  value.to_f
252
- when :BOOLEAN
280
+ when :Boolean
253
281
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
254
282
  true
255
283
  else
@@ -270,7 +298,9 @@ module MuxRuby
270
298
  end
271
299
  end
272
300
  else # model
273
- MuxRuby.const_get(type).build_from_hash(value)
301
+ # models (e.g. Pet) or oneOf
302
+ klass = MuxRuby.const_get(type)
303
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
274
304
  end
275
305
  end
276
306
 
@@ -292,7 +322,11 @@ module MuxRuby
292
322
  hash = {}
293
323
  self.class.attribute_map.each_pair do |attr, param|
294
324
  value = self.send(attr)
295
- next if value.nil?
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
296
330
  hash[param] = _to_hash(value)
297
331
  end
298
332
  hash
@@ -1,9 +1,17 @@
1
1
  =begin
2
- # Mux Ruby - Copyright 2019 Mux Inc.
3
- # NOTE: This file is auto generated. Do not edit this file manually.
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
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
4
11
  =end
5
12
 
6
13
  require 'date'
14
+ require 'time'
7
15
 
8
16
  module MuxRuby
9
17
  # An object that describes how the image file referenced in url should be placed over the video (i.e. watermarking).
@@ -64,6 +72,11 @@ module MuxRuby
64
72
  }
65
73
  end
66
74
 
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ attribute_map.values
78
+ end
79
+
67
80
  # Attribute type mapping.
68
81
  def self.openapi_types
69
82
  {
@@ -77,39 +90,52 @@ module MuxRuby
77
90
  }
78
91
  end
79
92
 
93
+ # List of attributes with nullable: true
94
+ def self.openapi_nullable
95
+ Set.new([
96
+ ])
97
+ end
98
+
80
99
  # Initializes the object
81
100
  # @param [Hash] attributes Model attributes in the form of hash
82
101
  def initialize(attributes = {})
83
- return unless attributes.is_a?(Hash)
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::InputSettingsOverlaySettings` initialize method"
104
+ end
84
105
 
85
- # convert string to symbol for hash key
86
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!self.class.attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::InputSettingsOverlaySettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
87
113
 
88
- if attributes.has_key?(:'vertical_align')
114
+ if attributes.key?(:'vertical_align')
89
115
  self.vertical_align = attributes[:'vertical_align']
90
116
  end
91
117
 
92
- if attributes.has_key?(:'vertical_margin')
118
+ if attributes.key?(:'vertical_margin')
93
119
  self.vertical_margin = attributes[:'vertical_margin']
94
120
  end
95
121
 
96
- if attributes.has_key?(:'horizontal_align')
122
+ if attributes.key?(:'horizontal_align')
97
123
  self.horizontal_align = attributes[:'horizontal_align']
98
124
  end
99
125
 
100
- if attributes.has_key?(:'horizontal_margin')
126
+ if attributes.key?(:'horizontal_margin')
101
127
  self.horizontal_margin = attributes[:'horizontal_margin']
102
128
  end
103
129
 
104
- if attributes.has_key?(:'width')
130
+ if attributes.key?(:'width')
105
131
  self.width = attributes[:'width']
106
132
  end
107
133
 
108
- if attributes.has_key?(:'height')
134
+ if attributes.key?(:'height')
109
135
  self.height = attributes[:'height']
110
136
  end
111
137
 
112
- if attributes.has_key?(:'opacity')
138
+ if attributes.key?(:'opacity')
113
139
  self.opacity = attributes[:'opacity']
114
140
  end
115
141
  end
@@ -124,9 +150,9 @@ module MuxRuby
124
150
  # Check to see if the all the properties in the model are valid
125
151
  # @return true if the model is valid
126
152
  def valid?
127
- vertical_align_validator = EnumAttributeValidator.new('String', ['top', 'middle', 'bottom'])
153
+ vertical_align_validator = EnumAttributeValidator.new('String', ["top", "middle", "bottom"])
128
154
  return false unless vertical_align_validator.valid?(@vertical_align)
129
- horizontal_align_validator = EnumAttributeValidator.new('String', ['left', 'center', 'right'])
155
+ horizontal_align_validator = EnumAttributeValidator.new('String', ["left", "center", "right"])
130
156
  return false unless horizontal_align_validator.valid?(@horizontal_align)
131
157
  true
132
158
  end
@@ -134,7 +160,7 @@ module MuxRuby
134
160
  # Custom attribute writer method checking allowed values (enum).
135
161
  # @param [Object] vertical_align Object to be assigned
136
162
  def vertical_align=(vertical_align)
137
- validator = EnumAttributeValidator.new('String', ['top', 'middle', 'bottom'])
163
+ validator = EnumAttributeValidator.new('String', ["top", "middle", "bottom"])
138
164
  unless validator.valid?(vertical_align)
139
165
  fail ArgumentError, "invalid value for \"vertical_align\", must be one of #{validator.allowable_values}."
140
166
  end
@@ -144,7 +170,7 @@ module MuxRuby
144
170
  # Custom attribute writer method checking allowed values (enum).
145
171
  # @param [Object] horizontal_align Object to be assigned
146
172
  def horizontal_align=(horizontal_align)
147
- validator = EnumAttributeValidator.new('String', ['left', 'center', 'right'])
173
+ validator = EnumAttributeValidator.new('String', ["left", "center", "right"])
148
174
  unless validator.valid?(horizontal_align)
149
175
  fail ArgumentError, "invalid value for \"horizontal_align\", must be one of #{validator.allowable_values}."
150
176
  end
@@ -172,7 +198,7 @@ module MuxRuby
172
198
  end
173
199
 
174
200
  # Calculates hash code according to all attributes.
175
- # @return [Fixnum] Hash code
201
+ # @return [Integer] Hash code
176
202
  def hash
177
203
  [vertical_align, vertical_margin, horizontal_align, horizontal_margin, width, height, opacity].hash
178
204
  end
@@ -190,7 +216,9 @@ module MuxRuby
190
216
  def build_from_hash(attributes)
191
217
  return nil unless attributes.is_a?(Hash)
192
218
  self.class.openapi_types.each_pair do |key, type|
193
- if type =~ /\AArray<(.*)>/i
219
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
220
+ self.send("#{key}=", nil)
221
+ elsif type =~ /\AArray<(.*)>/i
194
222
  # check to ensure the input is an array given that the attribute
195
223
  # is documented as an array but the input is not
196
224
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -198,7 +226,7 @@ module MuxRuby
198
226
  end
199
227
  elsif !attributes[self.class.attribute_map[key]].nil?
200
228
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
201
- end # or else data not found in attributes(hash), not an issue as the data can be optional
229
+ end
202
230
  end
203
231
 
204
232
  self
@@ -210,8 +238,8 @@ module MuxRuby
210
238
  # @return [Object] Deserialized data
211
239
  def _deserialize(type, value)
212
240
  case type.to_sym
213
- when :DateTime
214
- DateTime.parse(value)
241
+ when :Time
242
+ Time.parse(value)
215
243
  when :Date
216
244
  Date.parse(value)
217
245
  when :String
@@ -220,7 +248,7 @@ module MuxRuby
220
248
  value.to_i
221
249
  when :Float
222
250
  value.to_f
223
- when :BOOLEAN
251
+ when :Boolean
224
252
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
253
  true
226
254
  else
@@ -241,7 +269,9 @@ module MuxRuby
241
269
  end
242
270
  end
243
271
  else # model
244
- MuxRuby.const_get(type).build_from_hash(value)
272
+ # models (e.g. Pet) or oneOf
273
+ klass = MuxRuby.const_get(type)
274
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
275
  end
246
276
  end
247
277
 
@@ -263,7 +293,11 @@ module MuxRuby
263
293
  hash = {}
264
294
  self.class.attribute_map.each_pair do |attr, param|
265
295
  value = self.send(attr)
266
- next if value.nil?
296
+ if value.nil?
297
+ is_nullable = self.class.openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
267
301
  hash[param] = _to_hash(value)
268
302
  end
269
303
  hash
@@ -1,9 +1,17 @@
1
1
  =begin
2
- # Mux Ruby - Copyright 2019 Mux Inc.
3
- # NOTE: This file is auto generated. Do not edit this file manually.
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
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
4
11
  =end
5
12
 
6
13
  require 'date'
14
+ require 'time'
7
15
 
8
16
  module MuxRuby
9
17
  class InputTrack
@@ -40,6 +48,11 @@ module MuxRuby
40
48
  }
41
49
  end
42
50
 
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
43
56
  # Attribute type mapping.
44
57
  def self.openapi_types
45
58
  {
@@ -55,47 +68,60 @@ module MuxRuby
55
68
  }
56
69
  end
57
70
 
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
58
77
  # Initializes the object
59
78
  # @param [Hash] attributes Model attributes in the form of hash
60
79
  def initialize(attributes = {})
61
- return unless attributes.is_a?(Hash)
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::InputTrack` initialize method"
82
+ end
62
83
 
63
- # convert string to symbol for hash key
64
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::InputTrack`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
65
91
 
66
- if attributes.has_key?(:'type')
92
+ if attributes.key?(:'type')
67
93
  self.type = attributes[:'type']
68
94
  end
69
95
 
70
- if attributes.has_key?(:'duration')
96
+ if attributes.key?(:'duration')
71
97
  self.duration = attributes[:'duration']
72
98
  end
73
99
 
74
- if attributes.has_key?(:'encoding')
100
+ if attributes.key?(:'encoding')
75
101
  self.encoding = attributes[:'encoding']
76
102
  end
77
103
 
78
- if attributes.has_key?(:'width')
104
+ if attributes.key?(:'width')
79
105
  self.width = attributes[:'width']
80
106
  end
81
107
 
82
- if attributes.has_key?(:'height')
108
+ if attributes.key?(:'height')
83
109
  self.height = attributes[:'height']
84
110
  end
85
111
 
86
- if attributes.has_key?(:'frame_rate')
112
+ if attributes.key?(:'frame_rate')
87
113
  self.frame_rate = attributes[:'frame_rate']
88
114
  end
89
115
 
90
- if attributes.has_key?(:'sample_rate')
116
+ if attributes.key?(:'sample_rate')
91
117
  self.sample_rate = attributes[:'sample_rate']
92
118
  end
93
119
 
94
- if attributes.has_key?(:'sample_size')
120
+ if attributes.key?(:'sample_size')
95
121
  self.sample_size = attributes[:'sample_size']
96
122
  end
97
123
 
98
- if attributes.has_key?(:'channels')
124
+ if attributes.key?(:'channels')
99
125
  self.channels = attributes[:'channels']
100
126
  end
101
127
  end
@@ -136,7 +162,7 @@ module MuxRuby
136
162
  end
137
163
 
138
164
  # Calculates hash code according to all attributes.
139
- # @return [Fixnum] Hash code
165
+ # @return [Integer] Hash code
140
166
  def hash
141
167
  [type, duration, encoding, width, height, frame_rate, sample_rate, sample_size, channels].hash
142
168
  end
@@ -154,7 +180,9 @@ module MuxRuby
154
180
  def build_from_hash(attributes)
155
181
  return nil unless attributes.is_a?(Hash)
156
182
  self.class.openapi_types.each_pair do |key, type|
157
- if type =~ /\AArray<(.*)>/i
183
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
184
+ self.send("#{key}=", nil)
185
+ elsif type =~ /\AArray<(.*)>/i
158
186
  # check to ensure the input is an array given that the attribute
159
187
  # is documented as an array but the input is not
160
188
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -162,7 +190,7 @@ module MuxRuby
162
190
  end
163
191
  elsif !attributes[self.class.attribute_map[key]].nil?
164
192
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
- end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
166
194
  end
167
195
 
168
196
  self
@@ -174,8 +202,8 @@ module MuxRuby
174
202
  # @return [Object] Deserialized data
175
203
  def _deserialize(type, value)
176
204
  case type.to_sym
177
- when :DateTime
178
- DateTime.parse(value)
205
+ when :Time
206
+ Time.parse(value)
179
207
  when :Date
180
208
  Date.parse(value)
181
209
  when :String
@@ -184,7 +212,7 @@ module MuxRuby
184
212
  value.to_i
185
213
  when :Float
186
214
  value.to_f
187
- when :BOOLEAN
215
+ when :Boolean
188
216
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
217
  true
190
218
  else
@@ -205,7 +233,9 @@ module MuxRuby
205
233
  end
206
234
  end
207
235
  else # model
208
- MuxRuby.const_get(type).build_from_hash(value)
236
+ # models (e.g. Pet) or oneOf
237
+ klass = MuxRuby.const_get(type)
238
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
239
  end
210
240
  end
211
241
 
@@ -227,7 +257,11 @@ module MuxRuby
227
257
  hash = {}
228
258
  self.class.attribute_map.each_pair do |attr, param|
229
259
  value = self.send(attr)
230
- next if value.nil?
260
+ if value.nil?
261
+ is_nullable = self.class.openapi_nullable.include?(attr)
262
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
263
+ end
264
+
231
265
  hash[param] = _to_hash(value)
232
266
  end
233
267
  hash