mux_ruby 1.5.1 → 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 (317) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +26 -37
  4. data/README.md +38 -12
  5. data/docs/AbridgedVideoView.md +33 -13
  6. data/docs/Asset.md +57 -23
  7. data/docs/AssetErrors.md +15 -4
  8. data/docs/AssetMaster.md +15 -4
  9. data/docs/AssetNonStandardInputReasons.md +34 -0
  10. data/docs/AssetRecordingTimes.md +20 -0
  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 +391 -160
  15. data/docs/BreakdownValue.md +21 -7
  16. data/docs/CreateAssetRequest.md +27 -10
  17. data/docs/CreateLiveStreamRequest.md +25 -8
  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 +20 -0
  27. data/docs/DimensionsApi.md +156 -0
  28. data/docs/DirectUploadsApi.md +131 -56
  29. data/docs/DisableLiveStreamResponse.md +18 -0
  30. data/docs/EnableLiveStreamResponse.md +18 -0
  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 +73 -35
  36. data/docs/GetAssetInputInfoResponse.md +13 -3
  37. data/docs/GetAssetOrLiveStreamIdResponse.md +18 -0
  38. data/docs/GetAssetOrLiveStreamIdResponseData.md +22 -0
  39. data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +20 -0
  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 +22 -0
  44. data/docs/GetRealTimeHistogramTimeseriesResponse.md +24 -0
  45. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +18 -0
  46. data/docs/GetRealTimeTimeseriesResponse.md +22 -0
  47. data/docs/Incident.md +58 -0
  48. data/docs/IncidentBreakdown.md +22 -0
  49. data/docs/IncidentNotification.md +22 -0
  50. data/docs/IncidentNotificationRule.md +26 -0
  51. data/docs/IncidentResponse.md +20 -0
  52. data/docs/IncidentsApi.md +242 -0
  53. data/docs/InputFile.md +15 -4
  54. data/docs/InputInfo.md +15 -4
  55. data/docs/InputSettings.md +31 -10
  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 +22 -0
  64. data/docs/ListDimensionsResponse.md +22 -0
  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 +22 -0
  71. data/docs/ListInsightsResponse.md +17 -5
  72. data/docs/ListLiveStreamsResponse.md +13 -3
  73. data/docs/ListRealTimeDimensionsResponse.md +22 -0
  74. data/docs/ListRealTimeDimensionsResponseData.md +20 -0
  75. data/docs/ListRealTimeMetricsResponse.md +22 -0
  76. data/docs/ListRelatedIncidentsResponse.md +22 -0
  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 +497 -145
  83. data/docs/Metric.md +21 -7
  84. data/docs/MetricsApi.md +206 -112
  85. data/docs/NotificationRule.md +22 -0
  86. data/docs/OverallValues.md +19 -6
  87. data/docs/PlaybackID.md +15 -4
  88. data/docs/PlaybackIDApi.md +78 -0
  89. data/docs/PlaybackPolicy.md +10 -2
  90. data/docs/RealTimeApi.md +376 -0
  91. data/docs/RealTimeBreakdownValue.md +26 -0
  92. data/docs/RealTimeHistogramTimeseriesBucket.md +20 -0
  93. data/docs/RealTimeHistogramTimeseriesBucketValues.md +20 -0
  94. data/docs/RealTimeHistogramTimeseriesDatapoint.md +30 -0
  95. data/docs/RealTimeTimeseriesDatapoint.md +22 -0
  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 -112
  110. data/docs/VideoViewEvent.md +19 -6
  111. data/docs/VideoViewResponse.md +15 -4
  112. data/docs/VideoViewsApi.md +76 -39
  113. data/examples/data/exercise-dimensions.rb +29 -0
  114. data/examples/data/exercise-incidents.rb +29 -0
  115. data/examples/data/exercise-realtime.rb +60 -0
  116. data/examples/video/exercise-assets.rb +21 -0
  117. data/examples/video/exercise-live-streams.rb +30 -0
  118. data/gen/.gitignore +7 -0
  119. data/gen/Makefile +31 -0
  120. data/gen/generator-config.json +11 -0
  121. data/gen/openapitools.json +7 -0
  122. data/gen/package.json +17 -0
  123. data/gen/templates/Gemfile.mustache +11 -0
  124. data/gen/templates/README.mustache +158 -0
  125. data/gen/templates/Rakefile.mustache +10 -0
  126. data/gen/templates/api.mustache +206 -0
  127. data/gen/templates/api_client.mustache +264 -0
  128. data/gen/templates/api_client_faraday_partial.mustache +138 -0
  129. data/gen/templates/api_client_spec.mustache +220 -0
  130. data/gen/templates/api_client_typhoeus_partial.mustache +183 -0
  131. data/gen/templates/api_doc.mustache +118 -0
  132. data/gen/templates/api_error.mustache +67 -0
  133. data/gen/templates/api_info.mustache +12 -0
  134. data/gen/templates/api_test.mustache +47 -0
  135. data/gen/templates/base_object.mustache +120 -0
  136. data/gen/templates/configuration.mustache +349 -0
  137. data/gen/templates/configuration_spec.mustache +34 -0
  138. data/gen/templates/configuration_tls_faraday_partial.mustache +29 -0
  139. data/gen/templates/configuration_tls_typhoeus_partial.mustache +34 -0
  140. data/gen/templates/gem.mustache +40 -0
  141. data/gen/templates/gemspec.mustache +35 -0
  142. data/gen/templates/gitignore.mustache +39 -0
  143. data/gen/templates/model.mustache +26 -0
  144. data/gen/templates/model_doc.mustache +12 -0
  145. data/gen/templates/model_test.mustache +77 -0
  146. data/gen/templates/partial_model_enum_class.mustache +20 -0
  147. data/gen/templates/partial_model_generic.mustache +371 -0
  148. data/gen/templates/partial_model_generic_doc.mustache +28 -0
  149. data/gen/templates/partial_oneof_module.mustache +137 -0
  150. data/gen/templates/partial_oneof_module_doc.mustache +92 -0
  151. data/gen/templates/rspec.mustache +2 -0
  152. data/gen/templates/rubocop.mustache +148 -0
  153. data/gen/templates/spec_helper.mustache +103 -0
  154. data/gen/templates/version.mustache +7 -0
  155. data/gen/yarn.lock +1878 -0
  156. data/lib/mux_ruby.rb +43 -2
  157. data/lib/mux_ruby/api/assets_api.rb +283 -150
  158. data/lib/mux_ruby/api/delivery_usage_api.rb +28 -12
  159. data/lib/mux_ruby/api/dimensions_api.rb +154 -0
  160. data/lib/mux_ruby/api/direct_uploads_api.rb +90 -44
  161. data/lib/mux_ruby/api/errors_api.rb +32 -16
  162. data/lib/mux_ruby/api/exports_api.rb +28 -12
  163. data/lib/mux_ruby/api/filters_api.rb +57 -31
  164. data/lib/mux_ruby/api/incidents_api.rb +259 -0
  165. data/lib/mux_ruby/api/live_streams_api.rb +381 -133
  166. data/lib/mux_ruby/api/metrics_api.rb +175 -104
  167. data/lib/mux_ruby/api/playback_id_api.rb +85 -0
  168. data/lib/mux_ruby/api/real_time_api.rb +373 -0
  169. data/lib/mux_ruby/api/url_signing_keys_api.rb +89 -42
  170. data/lib/mux_ruby/api/video_views_api.rb +56 -29
  171. data/lib/mux_ruby/api_client.rb +106 -91
  172. data/lib/mux_ruby/api_error.rb +35 -7
  173. data/lib/mux_ruby/configuration.rb +50 -14
  174. data/lib/mux_ruby/models/abridged_video_view.rb +58 -24
  175. data/lib/mux_ruby/models/asset.rb +147 -53
  176. data/lib/mux_ruby/models/asset_errors.rb +52 -15
  177. data/lib/mux_ruby/models/asset_master.rb +85 -15
  178. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +370 -0
  179. data/lib/mux_ruby/models/asset_recording_times.rb +229 -0
  180. data/lib/mux_ruby/models/asset_response.rb +48 -14
  181. data/lib/mux_ruby/models/asset_static_renditions.rb +55 -19
  182. data/lib/mux_ruby/models/asset_static_renditions_files.rb +60 -25
  183. data/lib/mux_ruby/models/breakdown_value.rb +52 -18
  184. data/lib/mux_ruby/models/create_asset_request.rb +70 -30
  185. data/lib/mux_ruby/models/create_live_stream_request.rb +70 -24
  186. data/lib/mux_ruby/models/create_playback_id_request.rb +48 -14
  187. data/lib/mux_ruby/models/create_playback_id_response.rb +48 -14
  188. data/lib/mux_ruby/models/create_simulcast_target_request.rb +50 -16
  189. data/lib/mux_ruby/models/create_track_request.rb +65 -27
  190. data/lib/mux_ruby/models/create_track_response.rb +48 -14
  191. data/lib/mux_ruby/models/create_upload_request.rb +52 -18
  192. data/lib/mux_ruby/models/delivery_report.rb +106 -21
  193. data/lib/mux_ruby/models/dimension_value.rb +227 -0
  194. data/lib/mux_ruby/models/disable_live_stream_response.rb +218 -0
  195. data/lib/mux_ruby/models/enable_live_stream_response.rb +218 -0
  196. data/lib/mux_ruby/models/error.rb +63 -21
  197. data/lib/mux_ruby/models/filter_value.rb +49 -15
  198. data/lib/mux_ruby/models/get_asset_input_info_response.rb +48 -14
  199. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +218 -0
  200. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +237 -0
  201. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +264 -0
  202. data/lib/mux_ruby/models/get_asset_playback_id_response.rb +48 -14
  203. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +50 -16
  204. data/lib/mux_ruby/models/get_overall_values_response.rb +50 -16
  205. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +240 -0
  206. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +249 -0
  207. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +220 -0
  208. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +240 -0
  209. data/lib/mux_ruby/models/incident.rb +404 -0
  210. data/lib/mux_ruby/models/incident_breakdown.rb +236 -0
  211. data/lib/mux_ruby/models/incident_notification.rb +236 -0
  212. data/lib/mux_ruby/models/incident_notification_rule.rb +256 -0
  213. data/lib/mux_ruby/models/incident_response.rb +229 -0
  214. data/lib/mux_ruby/models/input_file.rb +49 -15
  215. data/lib/mux_ruby/models/input_info.rb +49 -15
  216. data/lib/mux_ruby/models/input_settings.rb +91 -30
  217. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +68 -26
  218. data/lib/mux_ruby/models/input_track.rb +56 -22
  219. data/lib/mux_ruby/models/insight.rb +53 -19
  220. data/lib/mux_ruby/models/list_all_metric_values_response.rb +50 -16
  221. data/lib/mux_ruby/models/list_assets_response.rb +48 -14
  222. data/lib/mux_ruby/models/list_breakdown_values_response.rb +50 -16
  223. data/lib/mux_ruby/models/list_delivery_usage_response.rb +51 -17
  224. data/lib/mux_ruby/models/list_dimension_values_response.rb +240 -0
  225. data/lib/mux_ruby/models/list_dimensions_response.rb +238 -0
  226. data/lib/mux_ruby/models/list_errors_response.rb +50 -16
  227. data/lib/mux_ruby/models/list_exports_response.rb +50 -16
  228. data/lib/mux_ruby/models/list_filter_values_response.rb +50 -16
  229. data/lib/mux_ruby/models/list_filters_response.rb +50 -16
  230. data/lib/mux_ruby/models/list_filters_response_data.rb +49 -15
  231. data/lib/mux_ruby/models/list_incidents_response.rb +240 -0
  232. data/lib/mux_ruby/models/list_insights_response.rb +50 -16
  233. data/lib/mux_ruby/models/list_live_streams_response.rb +48 -14
  234. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +240 -0
  235. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +227 -0
  236. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +240 -0
  237. data/lib/mux_ruby/models/list_related_incidents_response.rb +240 -0
  238. data/lib/mux_ruby/models/list_signing_keys_response.rb +48 -14
  239. data/lib/mux_ruby/models/list_uploads_response.rb +48 -14
  240. data/lib/mux_ruby/models/list_video_views_response.rb +50 -16
  241. data/lib/mux_ruby/models/live_stream.rb +111 -29
  242. data/lib/mux_ruby/models/live_stream_response.rb +48 -14
  243. data/lib/mux_ruby/models/metric.rb +52 -18
  244. data/lib/mux_ruby/models/notification_rule.rb +236 -0
  245. data/lib/mux_ruby/models/overall_values.rb +51 -17
  246. data/lib/mux_ruby/models/playback_id.rb +50 -15
  247. data/lib/mux_ruby/models/playback_policy.rb +12 -6
  248. data/lib/mux_ruby/models/real_time_breakdown_value.rb +254 -0
  249. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +227 -0
  250. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +227 -0
  251. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +274 -0
  252. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +236 -0
  253. data/lib/mux_ruby/models/score.rb +53 -19
  254. data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +48 -14
  255. data/lib/mux_ruby/models/signing_key.rb +53 -16
  256. data/lib/mux_ruby/models/signing_key_response.rb +48 -14
  257. data/lib/mux_ruby/models/simulcast_target.rb +55 -21
  258. data/lib/mux_ruby/models/simulcast_target_response.rb +48 -14
  259. data/lib/mux_ruby/models/track.rb +92 -33
  260. data/lib/mux_ruby/models/update_asset_master_access_request.rb +51 -17
  261. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +51 -17
  262. data/lib/mux_ruby/models/upload.rb +62 -26
  263. data/lib/mux_ruby/models/upload_error.rb +51 -15
  264. data/lib/mux_ruby/models/upload_response.rb +48 -14
  265. data/lib/mux_ruby/models/video_view.rb +200 -148
  266. data/lib/mux_ruby/models/video_view_event.rb +51 -17
  267. data/lib/mux_ruby/models/video_view_response.rb +49 -15
  268. data/lib/mux_ruby/version.rb +10 -3
  269. data/mux_ruby.gemspec +15 -15
  270. data/spec/api/assets_api_spec.rb +2 -0
  271. data/spec/api/dimensions_api_spec.rb +55 -0
  272. data/spec/api/filters_api_spec.rb +2 -2
  273. data/spec/api/incidents_api_spec.rb +73 -0
  274. data/spec/api/live_streams_api_spec.rb +24 -0
  275. data/spec/api/playback_id_api_spec.rb +40 -0
  276. data/spec/api/real_time_api_spec.rb +93 -0
  277. data/spec/api_client_spec.rb +10 -3
  278. data/spec/configuration_spec.rb +9 -2
  279. data/spec/models/asset_master_spec.rb +4 -0
  280. data/spec/models/asset_non_standard_input_reasons_spec.rb +98 -0
  281. data/spec/models/asset_recording_times_spec.rb +40 -0
  282. data/spec/models/asset_spec.rb +26 -0
  283. data/spec/models/asset_static_renditions_files_spec.rb +2 -2
  284. data/spec/models/create_live_stream_request_spec.rb +6 -0
  285. data/spec/models/dimension_value_spec.rb +40 -0
  286. data/spec/models/disable_live_stream_response_spec.rb +34 -0
  287. data/spec/models/enable_live_stream_response_spec.rb +34 -0
  288. data/spec/models/get_asset_or_live_stream_id_response_data_object_spec.rb +44 -0
  289. data/spec/models/get_asset_or_live_stream_id_response_data_spec.rb +46 -0
  290. data/spec/models/get_asset_or_live_stream_id_response_spec.rb +34 -0
  291. data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
  292. data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
  293. data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
  294. data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
  295. data/spec/models/incident_breakdown_spec.rb +46 -0
  296. data/spec/models/incident_notification_rule_spec.rb +58 -0
  297. data/spec/models/incident_notification_spec.rb +46 -0
  298. data/spec/models/incident_response_spec.rb +40 -0
  299. data/spec/models/incident_spec.rb +154 -0
  300. data/spec/models/input_settings_spec.rb +12 -0
  301. data/spec/models/list_dimension_values_response_spec.rb +46 -0
  302. data/spec/models/list_dimensions_response_spec.rb +46 -0
  303. data/spec/models/list_incidents_response_spec.rb +46 -0
  304. data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
  305. data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
  306. data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
  307. data/spec/models/list_related_incidents_response_spec.rb +46 -0
  308. data/spec/models/notification_rule_spec.rb +46 -0
  309. data/spec/models/real_time_breakdown_value_spec.rb +58 -0
  310. data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
  311. data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
  312. data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
  313. data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
  314. data/spec/models/track_spec.rb +4 -0
  315. data/spec/models/video_view_spec.rb +12 -0
  316. data/spec/spec_helper.rb +9 -2
  317. metadata +249 -212
@@ -1,15 +1,25 @@
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
  # Only set if an error occurred during asset creation.
10
18
  class UploadError
19
+ # Label for the specific error
11
20
  attr_accessor :type
12
21
 
22
+ # Human readable error message
13
23
  attr_accessor :message
14
24
 
15
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -20,6 +30,11 @@ module MuxRuby
20
30
  }
21
31
  end
22
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
23
38
  # Attribute type mapping.
24
39
  def self.openapi_types
25
40
  {
@@ -28,19 +43,32 @@ module MuxRuby
28
43
  }
29
44
  end
30
45
 
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
31
52
  # Initializes the object
32
53
  # @param [Hash] attributes Model attributes in the form of hash
33
54
  def initialize(attributes = {})
34
- return unless attributes.is_a?(Hash)
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::UploadError` initialize method"
57
+ end
35
58
 
36
- # convert string to symbol for hash key
37
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::UploadError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
38
66
 
39
- if attributes.has_key?(:'type')
67
+ if attributes.key?(:'type')
40
68
  self.type = attributes[:'type']
41
69
  end
42
70
 
43
- if attributes.has_key?(:'message')
71
+ if attributes.key?(:'message')
44
72
  self.message = attributes[:'message']
45
73
  end
46
74
  end
@@ -74,7 +102,7 @@ module MuxRuby
74
102
  end
75
103
 
76
104
  # Calculates hash code according to all attributes.
77
- # @return [Fixnum] Hash code
105
+ # @return [Integer] Hash code
78
106
  def hash
79
107
  [type, message].hash
80
108
  end
@@ -92,7 +120,9 @@ module MuxRuby
92
120
  def build_from_hash(attributes)
93
121
  return nil unless attributes.is_a?(Hash)
94
122
  self.class.openapi_types.each_pair do |key, type|
95
- if type =~ /\AArray<(.*)>/i
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
96
126
  # check to ensure the input is an array given that the attribute
97
127
  # is documented as an array but the input is not
98
128
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -100,7 +130,7 @@ module MuxRuby
100
130
  end
101
131
  elsif !attributes[self.class.attribute_map[key]].nil?
102
132
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
- end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
104
134
  end
105
135
 
106
136
  self
@@ -112,8 +142,8 @@ module MuxRuby
112
142
  # @return [Object] Deserialized data
113
143
  def _deserialize(type, value)
114
144
  case type.to_sym
115
- when :DateTime
116
- DateTime.parse(value)
145
+ when :Time
146
+ Time.parse(value)
117
147
  when :Date
118
148
  Date.parse(value)
119
149
  when :String
@@ -122,7 +152,7 @@ module MuxRuby
122
152
  value.to_i
123
153
  when :Float
124
154
  value.to_f
125
- when :BOOLEAN
155
+ when :Boolean
126
156
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
157
  true
128
158
  else
@@ -143,7 +173,9 @@ module MuxRuby
143
173
  end
144
174
  end
145
175
  else # model
146
- MuxRuby.const_get(type).build_from_hash(value)
176
+ # models (e.g. Pet) or oneOf
177
+ klass = MuxRuby.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
147
179
  end
148
180
  end
149
181
 
@@ -165,7 +197,11 @@ module MuxRuby
165
197
  hash = {}
166
198
  self.class.attribute_map.each_pair do |attr, param|
167
199
  value = self.send(attr)
168
- next if value.nil?
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
169
205
  hash[param] = _to_hash(value)
170
206
  end
171
207
  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 UploadResponse
@@ -16,6 +24,11 @@ module MuxRuby
16
24
  }
17
25
  end
18
26
 
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
19
32
  # Attribute type mapping.
20
33
  def self.openapi_types
21
34
  {
@@ -23,15 +36,28 @@ module MuxRuby
23
36
  }
24
37
  end
25
38
 
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
26
45
  # Initializes the object
27
46
  # @param [Hash] attributes Model attributes in the form of hash
28
47
  def initialize(attributes = {})
29
- return unless attributes.is_a?(Hash)
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::UploadResponse` initialize method"
50
+ end
30
51
 
31
- # convert string to symbol for hash key
32
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
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::UploadResponse`. 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
+ }
33
59
 
34
- if attributes.has_key?(:'data')
60
+ if attributes.key?(:'data')
35
61
  self.data = attributes[:'data']
36
62
  end
37
63
  end
@@ -64,7 +90,7 @@ module MuxRuby
64
90
  end
65
91
 
66
92
  # Calculates hash code according to all attributes.
67
- # @return [Fixnum] Hash code
93
+ # @return [Integer] Hash code
68
94
  def hash
69
95
  [data].hash
70
96
  end
@@ -82,7 +108,9 @@ module MuxRuby
82
108
  def build_from_hash(attributes)
83
109
  return nil unless attributes.is_a?(Hash)
84
110
  self.class.openapi_types.each_pair do |key, type|
85
- if type =~ /\AArray<(.*)>/i
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
86
114
  # check to ensure the input is an array given that the attribute
87
115
  # is documented as an array but the input is not
88
116
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -90,7 +118,7 @@ module MuxRuby
90
118
  end
91
119
  elsif !attributes[self.class.attribute_map[key]].nil?
92
120
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
- end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
94
122
  end
95
123
 
96
124
  self
@@ -102,8 +130,8 @@ module MuxRuby
102
130
  # @return [Object] Deserialized data
103
131
  def _deserialize(type, value)
104
132
  case type.to_sym
105
- when :DateTime
106
- DateTime.parse(value)
133
+ when :Time
134
+ Time.parse(value)
107
135
  when :Date
108
136
  Date.parse(value)
109
137
  when :String
@@ -112,7 +140,7 @@ module MuxRuby
112
140
  value.to_i
113
141
  when :Float
114
142
  value.to_f
115
- when :BOOLEAN
143
+ when :Boolean
116
144
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
145
  true
118
146
  else
@@ -133,7 +161,9 @@ module MuxRuby
133
161
  end
134
162
  end
135
163
  else # model
136
- MuxRuby.const_get(type).build_from_hash(value)
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)
137
167
  end
138
168
  end
139
169
 
@@ -155,7 +185,11 @@ module MuxRuby
155
185
  hash = {}
156
186
  self.class.attribute_map.each_pair do |attr, param|
157
187
  value = self.send(attr)
158
- next if value.nil?
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
+
159
193
  hash[param] = _to_hash(value)
160
194
  end
161
195
  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 VideoView
@@ -223,10 +231,14 @@ module MuxRuby
223
231
 
224
232
  attr_accessor :asn
225
233
 
234
+ attr_accessor :asn_name
235
+
226
236
  attr_accessor :quality_score
227
237
 
228
238
  attr_accessor :player_software_version
229
239
 
240
+ attr_accessor :player_mux_plugin_name
241
+
230
242
  # Attribute mapping from ruby-style variable name to JSON key.
231
243
  def self.attribute_map
232
244
  {
@@ -338,11 +350,18 @@ module MuxRuby
338
350
  :'player_autoplay' => :'player_autoplay',
339
351
  :'player_height' => :'player_height',
340
352
  :'asn' => :'asn',
353
+ :'asn_name' => :'asn_name',
341
354
  :'quality_score' => :'quality_score',
342
- :'player_software_version' => :'player_software_version'
355
+ :'player_software_version' => :'player_software_version',
356
+ :'player_mux_plugin_name' => :'player_mux_plugin_name'
343
357
  }
344
358
  end
345
359
 
360
+ # Returns all the JSON keys this model knows about
361
+ def self.acceptable_attributes
362
+ attribute_map.values
363
+ end
364
+
346
365
  # Attribute type mapping.
347
366
  def self.openapi_types
348
367
  {
@@ -351,37 +370,37 @@ module MuxRuby
351
370
  :'player_source_domain' => :'String',
352
371
  :'region' => :'String',
353
372
  :'viewer_user_agent' => :'String',
354
- :'preroll_requested' => :'BOOLEAN',
373
+ :'preroll_requested' => :'Boolean',
355
374
  :'page_type' => :'String',
356
375
  :'startup_score' => :'String',
357
- :'view_seek_duration' => :'String',
376
+ :'view_seek_duration' => :'Integer',
358
377
  :'country_name' => :'String',
359
378
  :'player_source_height' => :'Integer',
360
379
  :'longitude' => :'String',
361
- :'buffering_count' => :'String',
362
- :'video_duration' => :'String',
380
+ :'buffering_count' => :'Integer',
381
+ :'video_duration' => :'Integer',
363
382
  :'player_source_type' => :'String',
364
383
  :'city' => :'String',
365
384
  :'view_id' => :'String',
366
385
  :'platform_description' => :'String',
367
- :'video_startup_preroll_request_time' => :'String',
386
+ :'video_startup_preroll_request_time' => :'Integer',
368
387
  :'viewer_device_name' => :'String',
369
388
  :'video_series' => :'String',
370
389
  :'viewer_application_name' => :'String',
371
390
  :'updated_at' => :'String',
372
- :'view_total_content_playback_time' => :'String',
391
+ :'view_total_content_playback_time' => :'Integer',
373
392
  :'cdn' => :'String',
374
393
  :'player_instance_id' => :'String',
375
394
  :'video_language' => :'String',
376
395
  :'player_source_width' => :'Integer',
377
396
  :'player_error_message' => :'String',
378
397
  :'player_mux_plugin_version' => :'String',
379
- :'watched' => :'BOOLEAN',
398
+ :'watched' => :'Boolean',
380
399
  :'playback_score' => :'String',
381
400
  :'page_url' => :'String',
382
401
  :'metro' => :'String',
383
- :'view_max_request_latency' => :'String',
384
- :'requests_for_first_preroll' => :'String',
402
+ :'view_max_request_latency' => :'Integer',
403
+ :'requests_for_first_preroll' => :'Integer',
385
404
  :'view_total_downscaling' => :'String',
386
405
  :'latitude' => :'String',
387
406
  :'player_source_host_name' => :'String',
@@ -391,7 +410,7 @@ module MuxRuby
391
410
  :'player_language' => :'String',
392
411
  :'page_load_time' => :'Integer',
393
412
  :'viewer_device_category' => :'String',
394
- :'video_startup_preroll_load_time' => :'String',
413
+ :'video_startup_preroll_load_time' => :'Integer',
395
414
  :'player_version' => :'String',
396
415
  :'watch_time' => :'Integer',
397
416
  :'player_source_stream_type' => :'String',
@@ -400,19 +419,19 @@ module MuxRuby
400
419
  :'rebuffering_score' => :'String',
401
420
  :'experiment_name' => :'String',
402
421
  :'viewer_os_version' => :'String',
403
- :'player_preload' => :'BOOLEAN',
404
- :'buffering_duration' => :'String',
422
+ :'player_preload' => :'Boolean',
423
+ :'buffering_duration' => :'Integer',
405
424
  :'player_view_count' => :'Integer',
406
425
  :'player_software' => :'String',
407
- :'player_load_time' => :'String',
426
+ :'player_load_time' => :'Integer',
408
427
  :'platform_summary' => :'String',
409
428
  :'video_encoding_variant' => :'String',
410
429
  :'player_width' => :'Integer',
411
- :'view_seek_count' => :'String',
430
+ :'view_seek_count' => :'Integer',
412
431
  :'viewer_experience_score' => :'String',
413
432
  :'view_error_id' => :'Integer',
414
433
  :'video_variant_name' => :'String',
415
- :'preroll_played' => :'BOOLEAN',
434
+ :'preroll_played' => :'Boolean',
416
435
  :'viewer_application_engine' => :'String',
417
436
  :'viewer_os_architecture' => :'String',
418
437
  :'player_error_code' => :'String',
@@ -420,18 +439,18 @@ module MuxRuby
420
439
  :'events' => :'Array<VideoViewEvent>',
421
440
  :'player_name' => :'String',
422
441
  :'view_start' => :'String',
423
- :'view_average_request_throughput' => :'String',
442
+ :'view_average_request_throughput' => :'Integer',
424
443
  :'video_producer' => :'String',
425
444
  :'error_type_id' => :'Integer',
426
445
  :'mux_viewer_id' => :'String',
427
446
  :'video_id' => :'String',
428
447
  :'continent_code' => :'String',
429
448
  :'session_id' => :'String',
430
- :'exit_before_video_start' => :'BOOLEAN',
449
+ :'exit_before_video_start' => :'Boolean',
431
450
  :'video_content_type' => :'String',
432
451
  :'viewer_os_family' => :'String',
433
452
  :'player_poster' => :'String',
434
- :'view_average_request_latency' => :'String',
453
+ :'view_average_request_latency' => :'Integer',
435
454
  :'video_variant_id' => :'String',
436
455
  :'player_source_duration' => :'Integer',
437
456
  :'player_source_url' => :'String',
@@ -440,7 +459,7 @@ module MuxRuby
440
459
  :'id' => :'String',
441
460
  :'short_time' => :'String',
442
461
  :'rebuffer_percentage' => :'String',
443
- :'time_to_first_frame' => :'String',
462
+ :'time_to_first_frame' => :'Integer',
444
463
  :'viewer_user_id' => :'String',
445
464
  :'video_stream_type' => :'String',
446
465
  :'player_startup_time' => :'Integer',
@@ -448,466 +467,489 @@ module MuxRuby
448
467
  :'view_max_downscale_percentage' => :'String',
449
468
  :'view_max_upscale_percentage' => :'String',
450
469
  :'country_code' => :'String',
451
- :'used_fullscreen' => :'BOOLEAN',
470
+ :'used_fullscreen' => :'Boolean',
452
471
  :'isp' => :'String',
453
472
  :'property_id' => :'Integer',
454
- :'player_autoplay' => :'BOOLEAN',
473
+ :'player_autoplay' => :'Boolean',
455
474
  :'player_height' => :'Integer',
456
475
  :'asn' => :'Integer',
476
+ :'asn_name' => :'String',
457
477
  :'quality_score' => :'String',
458
- :'player_software_version' => :'String'
478
+ :'player_software_version' => :'String',
479
+ :'player_mux_plugin_name' => :'String'
459
480
  }
460
481
  end
461
482
 
483
+ # List of attributes with nullable: true
484
+ def self.openapi_nullable
485
+ Set.new([
486
+ ])
487
+ end
488
+
462
489
  # Initializes the object
463
490
  # @param [Hash] attributes Model attributes in the form of hash
464
491
  def initialize(attributes = {})
465
- return unless attributes.is_a?(Hash)
492
+ if (!attributes.is_a?(Hash))
493
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::VideoView` initialize method"
494
+ end
466
495
 
467
- # convert string to symbol for hash key
468
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
496
+ # check to see if the attribute exists and convert string to symbol for hash key
497
+ attributes = attributes.each_with_object({}) { |(k, v), h|
498
+ if (!self.class.attribute_map.key?(k.to_sym))
499
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::VideoView`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
500
+ end
501
+ h[k.to_sym] = v
502
+ }
469
503
 
470
- if attributes.has_key?(:'view_total_upscaling')
504
+ if attributes.key?(:'view_total_upscaling')
471
505
  self.view_total_upscaling = attributes[:'view_total_upscaling']
472
506
  end
473
507
 
474
- if attributes.has_key?(:'preroll_ad_asset_hostname')
508
+ if attributes.key?(:'preroll_ad_asset_hostname')
475
509
  self.preroll_ad_asset_hostname = attributes[:'preroll_ad_asset_hostname']
476
510
  end
477
511
 
478
- if attributes.has_key?(:'player_source_domain')
512
+ if attributes.key?(:'player_source_domain')
479
513
  self.player_source_domain = attributes[:'player_source_domain']
480
514
  end
481
515
 
482
- if attributes.has_key?(:'region')
516
+ if attributes.key?(:'region')
483
517
  self.region = attributes[:'region']
484
518
  end
485
519
 
486
- if attributes.has_key?(:'viewer_user_agent')
520
+ if attributes.key?(:'viewer_user_agent')
487
521
  self.viewer_user_agent = attributes[:'viewer_user_agent']
488
522
  end
489
523
 
490
- if attributes.has_key?(:'preroll_requested')
524
+ if attributes.key?(:'preroll_requested')
491
525
  self.preroll_requested = attributes[:'preroll_requested']
492
526
  end
493
527
 
494
- if attributes.has_key?(:'page_type')
528
+ if attributes.key?(:'page_type')
495
529
  self.page_type = attributes[:'page_type']
496
530
  end
497
531
 
498
- if attributes.has_key?(:'startup_score')
532
+ if attributes.key?(:'startup_score')
499
533
  self.startup_score = attributes[:'startup_score']
500
534
  end
501
535
 
502
- if attributes.has_key?(:'view_seek_duration')
536
+ if attributes.key?(:'view_seek_duration')
503
537
  self.view_seek_duration = attributes[:'view_seek_duration']
504
538
  end
505
539
 
506
- if attributes.has_key?(:'country_name')
540
+ if attributes.key?(:'country_name')
507
541
  self.country_name = attributes[:'country_name']
508
542
  end
509
543
 
510
- if attributes.has_key?(:'player_source_height')
544
+ if attributes.key?(:'player_source_height')
511
545
  self.player_source_height = attributes[:'player_source_height']
512
546
  end
513
547
 
514
- if attributes.has_key?(:'longitude')
548
+ if attributes.key?(:'longitude')
515
549
  self.longitude = attributes[:'longitude']
516
550
  end
517
551
 
518
- if attributes.has_key?(:'buffering_count')
552
+ if attributes.key?(:'buffering_count')
519
553
  self.buffering_count = attributes[:'buffering_count']
520
554
  end
521
555
 
522
- if attributes.has_key?(:'video_duration')
556
+ if attributes.key?(:'video_duration')
523
557
  self.video_duration = attributes[:'video_duration']
524
558
  end
525
559
 
526
- if attributes.has_key?(:'player_source_type')
560
+ if attributes.key?(:'player_source_type')
527
561
  self.player_source_type = attributes[:'player_source_type']
528
562
  end
529
563
 
530
- if attributes.has_key?(:'city')
564
+ if attributes.key?(:'city')
531
565
  self.city = attributes[:'city']
532
566
  end
533
567
 
534
- if attributes.has_key?(:'view_id')
568
+ if attributes.key?(:'view_id')
535
569
  self.view_id = attributes[:'view_id']
536
570
  end
537
571
 
538
- if attributes.has_key?(:'platform_description')
572
+ if attributes.key?(:'platform_description')
539
573
  self.platform_description = attributes[:'platform_description']
540
574
  end
541
575
 
542
- if attributes.has_key?(:'video_startup_preroll_request_time')
576
+ if attributes.key?(:'video_startup_preroll_request_time')
543
577
  self.video_startup_preroll_request_time = attributes[:'video_startup_preroll_request_time']
544
578
  end
545
579
 
546
- if attributes.has_key?(:'viewer_device_name')
580
+ if attributes.key?(:'viewer_device_name')
547
581
  self.viewer_device_name = attributes[:'viewer_device_name']
548
582
  end
549
583
 
550
- if attributes.has_key?(:'video_series')
584
+ if attributes.key?(:'video_series')
551
585
  self.video_series = attributes[:'video_series']
552
586
  end
553
587
 
554
- if attributes.has_key?(:'viewer_application_name')
588
+ if attributes.key?(:'viewer_application_name')
555
589
  self.viewer_application_name = attributes[:'viewer_application_name']
556
590
  end
557
591
 
558
- if attributes.has_key?(:'updated_at')
592
+ if attributes.key?(:'updated_at')
559
593
  self.updated_at = attributes[:'updated_at']
560
594
  end
561
595
 
562
- if attributes.has_key?(:'view_total_content_playback_time')
596
+ if attributes.key?(:'view_total_content_playback_time')
563
597
  self.view_total_content_playback_time = attributes[:'view_total_content_playback_time']
564
598
  end
565
599
 
566
- if attributes.has_key?(:'cdn')
600
+ if attributes.key?(:'cdn')
567
601
  self.cdn = attributes[:'cdn']
568
602
  end
569
603
 
570
- if attributes.has_key?(:'player_instance_id')
604
+ if attributes.key?(:'player_instance_id')
571
605
  self.player_instance_id = attributes[:'player_instance_id']
572
606
  end
573
607
 
574
- if attributes.has_key?(:'video_language')
608
+ if attributes.key?(:'video_language')
575
609
  self.video_language = attributes[:'video_language']
576
610
  end
577
611
 
578
- if attributes.has_key?(:'player_source_width')
612
+ if attributes.key?(:'player_source_width')
579
613
  self.player_source_width = attributes[:'player_source_width']
580
614
  end
581
615
 
582
- if attributes.has_key?(:'player_error_message')
616
+ if attributes.key?(:'player_error_message')
583
617
  self.player_error_message = attributes[:'player_error_message']
584
618
  end
585
619
 
586
- if attributes.has_key?(:'player_mux_plugin_version')
620
+ if attributes.key?(:'player_mux_plugin_version')
587
621
  self.player_mux_plugin_version = attributes[:'player_mux_plugin_version']
588
622
  end
589
623
 
590
- if attributes.has_key?(:'watched')
624
+ if attributes.key?(:'watched')
591
625
  self.watched = attributes[:'watched']
592
626
  end
593
627
 
594
- if attributes.has_key?(:'playback_score')
628
+ if attributes.key?(:'playback_score')
595
629
  self.playback_score = attributes[:'playback_score']
596
630
  end
597
631
 
598
- if attributes.has_key?(:'page_url')
632
+ if attributes.key?(:'page_url')
599
633
  self.page_url = attributes[:'page_url']
600
634
  end
601
635
 
602
- if attributes.has_key?(:'metro')
636
+ if attributes.key?(:'metro')
603
637
  self.metro = attributes[:'metro']
604
638
  end
605
639
 
606
- if attributes.has_key?(:'view_max_request_latency')
640
+ if attributes.key?(:'view_max_request_latency')
607
641
  self.view_max_request_latency = attributes[:'view_max_request_latency']
608
642
  end
609
643
 
610
- if attributes.has_key?(:'requests_for_first_preroll')
644
+ if attributes.key?(:'requests_for_first_preroll')
611
645
  self.requests_for_first_preroll = attributes[:'requests_for_first_preroll']
612
646
  end
613
647
 
614
- if attributes.has_key?(:'view_total_downscaling')
648
+ if attributes.key?(:'view_total_downscaling')
615
649
  self.view_total_downscaling = attributes[:'view_total_downscaling']
616
650
  end
617
651
 
618
- if attributes.has_key?(:'latitude')
652
+ if attributes.key?(:'latitude')
619
653
  self.latitude = attributes[:'latitude']
620
654
  end
621
655
 
622
- if attributes.has_key?(:'player_source_host_name')
656
+ if attributes.key?(:'player_source_host_name')
623
657
  self.player_source_host_name = attributes[:'player_source_host_name']
624
658
  end
625
659
 
626
- if attributes.has_key?(:'inserted_at')
660
+ if attributes.key?(:'inserted_at')
627
661
  self.inserted_at = attributes[:'inserted_at']
628
662
  end
629
663
 
630
- if attributes.has_key?(:'view_end')
664
+ if attributes.key?(:'view_end')
631
665
  self.view_end = attributes[:'view_end']
632
666
  end
633
667
 
634
- if attributes.has_key?(:'mux_embed_version')
668
+ if attributes.key?(:'mux_embed_version')
635
669
  self.mux_embed_version = attributes[:'mux_embed_version']
636
670
  end
637
671
 
638
- if attributes.has_key?(:'player_language')
672
+ if attributes.key?(:'player_language')
639
673
  self.player_language = attributes[:'player_language']
640
674
  end
641
675
 
642
- if attributes.has_key?(:'page_load_time')
676
+ if attributes.key?(:'page_load_time')
643
677
  self.page_load_time = attributes[:'page_load_time']
644
678
  end
645
679
 
646
- if attributes.has_key?(:'viewer_device_category')
680
+ if attributes.key?(:'viewer_device_category')
647
681
  self.viewer_device_category = attributes[:'viewer_device_category']
648
682
  end
649
683
 
650
- if attributes.has_key?(:'video_startup_preroll_load_time')
684
+ if attributes.key?(:'video_startup_preroll_load_time')
651
685
  self.video_startup_preroll_load_time = attributes[:'video_startup_preroll_load_time']
652
686
  end
653
687
 
654
- if attributes.has_key?(:'player_version')
688
+ if attributes.key?(:'player_version')
655
689
  self.player_version = attributes[:'player_version']
656
690
  end
657
691
 
658
- if attributes.has_key?(:'watch_time')
692
+ if attributes.key?(:'watch_time')
659
693
  self.watch_time = attributes[:'watch_time']
660
694
  end
661
695
 
662
- if attributes.has_key?(:'player_source_stream_type')
696
+ if attributes.key?(:'player_source_stream_type')
663
697
  self.player_source_stream_type = attributes[:'player_source_stream_type']
664
698
  end
665
699
 
666
- if attributes.has_key?(:'preroll_ad_tag_hostname')
700
+ if attributes.key?(:'preroll_ad_tag_hostname')
667
701
  self.preroll_ad_tag_hostname = attributes[:'preroll_ad_tag_hostname']
668
702
  end
669
703
 
670
- if attributes.has_key?(:'viewer_device_manufacturer')
704
+ if attributes.key?(:'viewer_device_manufacturer')
671
705
  self.viewer_device_manufacturer = attributes[:'viewer_device_manufacturer']
672
706
  end
673
707
 
674
- if attributes.has_key?(:'rebuffering_score')
708
+ if attributes.key?(:'rebuffering_score')
675
709
  self.rebuffering_score = attributes[:'rebuffering_score']
676
710
  end
677
711
 
678
- if attributes.has_key?(:'experiment_name')
712
+ if attributes.key?(:'experiment_name')
679
713
  self.experiment_name = attributes[:'experiment_name']
680
714
  end
681
715
 
682
- if attributes.has_key?(:'viewer_os_version')
716
+ if attributes.key?(:'viewer_os_version')
683
717
  self.viewer_os_version = attributes[:'viewer_os_version']
684
718
  end
685
719
 
686
- if attributes.has_key?(:'player_preload')
720
+ if attributes.key?(:'player_preload')
687
721
  self.player_preload = attributes[:'player_preload']
688
722
  end
689
723
 
690
- if attributes.has_key?(:'buffering_duration')
724
+ if attributes.key?(:'buffering_duration')
691
725
  self.buffering_duration = attributes[:'buffering_duration']
692
726
  end
693
727
 
694
- if attributes.has_key?(:'player_view_count')
728
+ if attributes.key?(:'player_view_count')
695
729
  self.player_view_count = attributes[:'player_view_count']
696
730
  end
697
731
 
698
- if attributes.has_key?(:'player_software')
732
+ if attributes.key?(:'player_software')
699
733
  self.player_software = attributes[:'player_software']
700
734
  end
701
735
 
702
- if attributes.has_key?(:'player_load_time')
736
+ if attributes.key?(:'player_load_time')
703
737
  self.player_load_time = attributes[:'player_load_time']
704
738
  end
705
739
 
706
- if attributes.has_key?(:'platform_summary')
740
+ if attributes.key?(:'platform_summary')
707
741
  self.platform_summary = attributes[:'platform_summary']
708
742
  end
709
743
 
710
- if attributes.has_key?(:'video_encoding_variant')
744
+ if attributes.key?(:'video_encoding_variant')
711
745
  self.video_encoding_variant = attributes[:'video_encoding_variant']
712
746
  end
713
747
 
714
- if attributes.has_key?(:'player_width')
748
+ if attributes.key?(:'player_width')
715
749
  self.player_width = attributes[:'player_width']
716
750
  end
717
751
 
718
- if attributes.has_key?(:'view_seek_count')
752
+ if attributes.key?(:'view_seek_count')
719
753
  self.view_seek_count = attributes[:'view_seek_count']
720
754
  end
721
755
 
722
- if attributes.has_key?(:'viewer_experience_score')
756
+ if attributes.key?(:'viewer_experience_score')
723
757
  self.viewer_experience_score = attributes[:'viewer_experience_score']
724
758
  end
725
759
 
726
- if attributes.has_key?(:'view_error_id')
760
+ if attributes.key?(:'view_error_id')
727
761
  self.view_error_id = attributes[:'view_error_id']
728
762
  end
729
763
 
730
- if attributes.has_key?(:'video_variant_name')
764
+ if attributes.key?(:'video_variant_name')
731
765
  self.video_variant_name = attributes[:'video_variant_name']
732
766
  end
733
767
 
734
- if attributes.has_key?(:'preroll_played')
768
+ if attributes.key?(:'preroll_played')
735
769
  self.preroll_played = attributes[:'preroll_played']
736
770
  end
737
771
 
738
- if attributes.has_key?(:'viewer_application_engine')
772
+ if attributes.key?(:'viewer_application_engine')
739
773
  self.viewer_application_engine = attributes[:'viewer_application_engine']
740
774
  end
741
775
 
742
- if attributes.has_key?(:'viewer_os_architecture')
776
+ if attributes.key?(:'viewer_os_architecture')
743
777
  self.viewer_os_architecture = attributes[:'viewer_os_architecture']
744
778
  end
745
779
 
746
- if attributes.has_key?(:'player_error_code')
780
+ if attributes.key?(:'player_error_code')
747
781
  self.player_error_code = attributes[:'player_error_code']
748
782
  end
749
783
 
750
- if attributes.has_key?(:'buffering_rate')
784
+ if attributes.key?(:'buffering_rate')
751
785
  self.buffering_rate = attributes[:'buffering_rate']
752
786
  end
753
787
 
754
- if attributes.has_key?(:'events')
788
+ if attributes.key?(:'events')
755
789
  if (value = attributes[:'events']).is_a?(Array)
756
790
  self.events = value
757
791
  end
758
792
  end
759
793
 
760
- if attributes.has_key?(:'player_name')
794
+ if attributes.key?(:'player_name')
761
795
  self.player_name = attributes[:'player_name']
762
796
  end
763
797
 
764
- if attributes.has_key?(:'view_start')
798
+ if attributes.key?(:'view_start')
765
799
  self.view_start = attributes[:'view_start']
766
800
  end
767
801
 
768
- if attributes.has_key?(:'view_average_request_throughput')
802
+ if attributes.key?(:'view_average_request_throughput')
769
803
  self.view_average_request_throughput = attributes[:'view_average_request_throughput']
770
804
  end
771
805
 
772
- if attributes.has_key?(:'video_producer')
806
+ if attributes.key?(:'video_producer')
773
807
  self.video_producer = attributes[:'video_producer']
774
808
  end
775
809
 
776
- if attributes.has_key?(:'error_type_id')
810
+ if attributes.key?(:'error_type_id')
777
811
  self.error_type_id = attributes[:'error_type_id']
778
812
  end
779
813
 
780
- if attributes.has_key?(:'mux_viewer_id')
814
+ if attributes.key?(:'mux_viewer_id')
781
815
  self.mux_viewer_id = attributes[:'mux_viewer_id']
782
816
  end
783
817
 
784
- if attributes.has_key?(:'video_id')
818
+ if attributes.key?(:'video_id')
785
819
  self.video_id = attributes[:'video_id']
786
820
  end
787
821
 
788
- if attributes.has_key?(:'continent_code')
822
+ if attributes.key?(:'continent_code')
789
823
  self.continent_code = attributes[:'continent_code']
790
824
  end
791
825
 
792
- if attributes.has_key?(:'session_id')
826
+ if attributes.key?(:'session_id')
793
827
  self.session_id = attributes[:'session_id']
794
828
  end
795
829
 
796
- if attributes.has_key?(:'exit_before_video_start')
830
+ if attributes.key?(:'exit_before_video_start')
797
831
  self.exit_before_video_start = attributes[:'exit_before_video_start']
798
832
  end
799
833
 
800
- if attributes.has_key?(:'video_content_type')
834
+ if attributes.key?(:'video_content_type')
801
835
  self.video_content_type = attributes[:'video_content_type']
802
836
  end
803
837
 
804
- if attributes.has_key?(:'viewer_os_family')
838
+ if attributes.key?(:'viewer_os_family')
805
839
  self.viewer_os_family = attributes[:'viewer_os_family']
806
840
  end
807
841
 
808
- if attributes.has_key?(:'player_poster')
842
+ if attributes.key?(:'player_poster')
809
843
  self.player_poster = attributes[:'player_poster']
810
844
  end
811
845
 
812
- if attributes.has_key?(:'view_average_request_latency')
846
+ if attributes.key?(:'view_average_request_latency')
813
847
  self.view_average_request_latency = attributes[:'view_average_request_latency']
814
848
  end
815
849
 
816
- if attributes.has_key?(:'video_variant_id')
850
+ if attributes.key?(:'video_variant_id')
817
851
  self.video_variant_id = attributes[:'video_variant_id']
818
852
  end
819
853
 
820
- if attributes.has_key?(:'player_source_duration')
854
+ if attributes.key?(:'player_source_duration')
821
855
  self.player_source_duration = attributes[:'player_source_duration']
822
856
  end
823
857
 
824
- if attributes.has_key?(:'player_source_url')
858
+ if attributes.key?(:'player_source_url')
825
859
  self.player_source_url = attributes[:'player_source_url']
826
860
  end
827
861
 
828
- if attributes.has_key?(:'mux_api_version')
862
+ if attributes.key?(:'mux_api_version')
829
863
  self.mux_api_version = attributes[:'mux_api_version']
830
864
  end
831
865
 
832
- if attributes.has_key?(:'video_title')
866
+ if attributes.key?(:'video_title')
833
867
  self.video_title = attributes[:'video_title']
834
868
  end
835
869
 
836
- if attributes.has_key?(:'id')
870
+ if attributes.key?(:'id')
837
871
  self.id = attributes[:'id']
838
872
  end
839
873
 
840
- if attributes.has_key?(:'short_time')
874
+ if attributes.key?(:'short_time')
841
875
  self.short_time = attributes[:'short_time']
842
876
  end
843
877
 
844
- if attributes.has_key?(:'rebuffer_percentage')
878
+ if attributes.key?(:'rebuffer_percentage')
845
879
  self.rebuffer_percentage = attributes[:'rebuffer_percentage']
846
880
  end
847
881
 
848
- if attributes.has_key?(:'time_to_first_frame')
882
+ if attributes.key?(:'time_to_first_frame')
849
883
  self.time_to_first_frame = attributes[:'time_to_first_frame']
850
884
  end
851
885
 
852
- if attributes.has_key?(:'viewer_user_id')
886
+ if attributes.key?(:'viewer_user_id')
853
887
  self.viewer_user_id = attributes[:'viewer_user_id']
854
888
  end
855
889
 
856
- if attributes.has_key?(:'video_stream_type')
890
+ if attributes.key?(:'video_stream_type')
857
891
  self.video_stream_type = attributes[:'video_stream_type']
858
892
  end
859
893
 
860
- if attributes.has_key?(:'player_startup_time')
894
+ if attributes.key?(:'player_startup_time')
861
895
  self.player_startup_time = attributes[:'player_startup_time']
862
896
  end
863
897
 
864
- if attributes.has_key?(:'viewer_application_version')
898
+ if attributes.key?(:'viewer_application_version')
865
899
  self.viewer_application_version = attributes[:'viewer_application_version']
866
900
  end
867
901
 
868
- if attributes.has_key?(:'view_max_downscale_percentage')
902
+ if attributes.key?(:'view_max_downscale_percentage')
869
903
  self.view_max_downscale_percentage = attributes[:'view_max_downscale_percentage']
870
904
  end
871
905
 
872
- if attributes.has_key?(:'view_max_upscale_percentage')
906
+ if attributes.key?(:'view_max_upscale_percentage')
873
907
  self.view_max_upscale_percentage = attributes[:'view_max_upscale_percentage']
874
908
  end
875
909
 
876
- if attributes.has_key?(:'country_code')
910
+ if attributes.key?(:'country_code')
877
911
  self.country_code = attributes[:'country_code']
878
912
  end
879
913
 
880
- if attributes.has_key?(:'used_fullscreen')
914
+ if attributes.key?(:'used_fullscreen')
881
915
  self.used_fullscreen = attributes[:'used_fullscreen']
882
916
  end
883
917
 
884
- if attributes.has_key?(:'isp')
918
+ if attributes.key?(:'isp')
885
919
  self.isp = attributes[:'isp']
886
920
  end
887
921
 
888
- if attributes.has_key?(:'property_id')
922
+ if attributes.key?(:'property_id')
889
923
  self.property_id = attributes[:'property_id']
890
924
  end
891
925
 
892
- if attributes.has_key?(:'player_autoplay')
926
+ if attributes.key?(:'player_autoplay')
893
927
  self.player_autoplay = attributes[:'player_autoplay']
894
928
  end
895
929
 
896
- if attributes.has_key?(:'player_height')
930
+ if attributes.key?(:'player_height')
897
931
  self.player_height = attributes[:'player_height']
898
932
  end
899
933
 
900
- if attributes.has_key?(:'asn')
934
+ if attributes.key?(:'asn')
901
935
  self.asn = attributes[:'asn']
902
936
  end
903
937
 
904
- if attributes.has_key?(:'quality_score')
938
+ if attributes.key?(:'asn_name')
939
+ self.asn_name = attributes[:'asn_name']
940
+ end
941
+
942
+ if attributes.key?(:'quality_score')
905
943
  self.quality_score = attributes[:'quality_score']
906
944
  end
907
945
 
908
- if attributes.has_key?(:'player_software_version')
946
+ if attributes.key?(:'player_software_version')
909
947
  self.player_software_version = attributes[:'player_software_version']
910
948
  end
949
+
950
+ if attributes.key?(:'player_mux_plugin_name')
951
+ self.player_mux_plugin_name = attributes[:'player_mux_plugin_name']
952
+ end
911
953
  end
912
954
 
913
955
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -1036,8 +1078,10 @@ module MuxRuby
1036
1078
  player_autoplay == o.player_autoplay &&
1037
1079
  player_height == o.player_height &&
1038
1080
  asn == o.asn &&
1081
+ asn_name == o.asn_name &&
1039
1082
  quality_score == o.quality_score &&
1040
- player_software_version == o.player_software_version
1083
+ player_software_version == o.player_software_version &&
1084
+ player_mux_plugin_name == o.player_mux_plugin_name
1041
1085
  end
1042
1086
 
1043
1087
  # @see the `==` method
@@ -1047,9 +1091,9 @@ module MuxRuby
1047
1091
  end
1048
1092
 
1049
1093
  # Calculates hash code according to all attributes.
1050
- # @return [Fixnum] Hash code
1094
+ # @return [Integer] Hash code
1051
1095
  def hash
1052
- [view_total_upscaling, preroll_ad_asset_hostname, player_source_domain, region, viewer_user_agent, preroll_requested, page_type, startup_score, view_seek_duration, country_name, player_source_height, longitude, buffering_count, video_duration, player_source_type, city, view_id, platform_description, video_startup_preroll_request_time, viewer_device_name, video_series, viewer_application_name, updated_at, view_total_content_playback_time, cdn, player_instance_id, video_language, player_source_width, player_error_message, player_mux_plugin_version, watched, playback_score, page_url, metro, view_max_request_latency, requests_for_first_preroll, view_total_downscaling, latitude, player_source_host_name, inserted_at, view_end, mux_embed_version, player_language, page_load_time, viewer_device_category, video_startup_preroll_load_time, player_version, watch_time, player_source_stream_type, preroll_ad_tag_hostname, viewer_device_manufacturer, rebuffering_score, experiment_name, viewer_os_version, player_preload, buffering_duration, player_view_count, player_software, player_load_time, platform_summary, video_encoding_variant, player_width, view_seek_count, viewer_experience_score, view_error_id, video_variant_name, preroll_played, viewer_application_engine, viewer_os_architecture, player_error_code, buffering_rate, events, player_name, view_start, view_average_request_throughput, video_producer, error_type_id, mux_viewer_id, video_id, continent_code, session_id, exit_before_video_start, video_content_type, viewer_os_family, player_poster, view_average_request_latency, video_variant_id, player_source_duration, player_source_url, mux_api_version, video_title, id, short_time, rebuffer_percentage, time_to_first_frame, viewer_user_id, video_stream_type, player_startup_time, viewer_application_version, view_max_downscale_percentage, view_max_upscale_percentage, country_code, used_fullscreen, isp, property_id, player_autoplay, player_height, asn, quality_score, player_software_version].hash
1096
+ [view_total_upscaling, preroll_ad_asset_hostname, player_source_domain, region, viewer_user_agent, preroll_requested, page_type, startup_score, view_seek_duration, country_name, player_source_height, longitude, buffering_count, video_duration, player_source_type, city, view_id, platform_description, video_startup_preroll_request_time, viewer_device_name, video_series, viewer_application_name, updated_at, view_total_content_playback_time, cdn, player_instance_id, video_language, player_source_width, player_error_message, player_mux_plugin_version, watched, playback_score, page_url, metro, view_max_request_latency, requests_for_first_preroll, view_total_downscaling, latitude, player_source_host_name, inserted_at, view_end, mux_embed_version, player_language, page_load_time, viewer_device_category, video_startup_preroll_load_time, player_version, watch_time, player_source_stream_type, preroll_ad_tag_hostname, viewer_device_manufacturer, rebuffering_score, experiment_name, viewer_os_version, player_preload, buffering_duration, player_view_count, player_software, player_load_time, platform_summary, video_encoding_variant, player_width, view_seek_count, viewer_experience_score, view_error_id, video_variant_name, preroll_played, viewer_application_engine, viewer_os_architecture, player_error_code, buffering_rate, events, player_name, view_start, view_average_request_throughput, video_producer, error_type_id, mux_viewer_id, video_id, continent_code, session_id, exit_before_video_start, video_content_type, viewer_os_family, player_poster, view_average_request_latency, video_variant_id, player_source_duration, player_source_url, mux_api_version, video_title, id, short_time, rebuffer_percentage, time_to_first_frame, viewer_user_id, video_stream_type, player_startup_time, viewer_application_version, view_max_downscale_percentage, view_max_upscale_percentage, country_code, used_fullscreen, isp, property_id, player_autoplay, player_height, asn, asn_name, quality_score, player_software_version, player_mux_plugin_name].hash
1053
1097
  end
1054
1098
 
1055
1099
  # Builds the object from hash
@@ -1065,7 +1109,9 @@ module MuxRuby
1065
1109
  def build_from_hash(attributes)
1066
1110
  return nil unless attributes.is_a?(Hash)
1067
1111
  self.class.openapi_types.each_pair do |key, type|
1068
- if type =~ /\AArray<(.*)>/i
1112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
1113
+ self.send("#{key}=", nil)
1114
+ elsif type =~ /\AArray<(.*)>/i
1069
1115
  # check to ensure the input is an array given that the attribute
1070
1116
  # is documented as an array but the input is not
1071
1117
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -1073,7 +1119,7 @@ module MuxRuby
1073
1119
  end
1074
1120
  elsif !attributes[self.class.attribute_map[key]].nil?
1075
1121
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1076
- end # or else data not found in attributes(hash), not an issue as the data can be optional
1122
+ end
1077
1123
  end
1078
1124
 
1079
1125
  self
@@ -1085,8 +1131,8 @@ module MuxRuby
1085
1131
  # @return [Object] Deserialized data
1086
1132
  def _deserialize(type, value)
1087
1133
  case type.to_sym
1088
- when :DateTime
1089
- DateTime.parse(value)
1134
+ when :Time
1135
+ Time.parse(value)
1090
1136
  when :Date
1091
1137
  Date.parse(value)
1092
1138
  when :String
@@ -1095,7 +1141,7 @@ module MuxRuby
1095
1141
  value.to_i
1096
1142
  when :Float
1097
1143
  value.to_f
1098
- when :BOOLEAN
1144
+ when :Boolean
1099
1145
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1100
1146
  true
1101
1147
  else
@@ -1116,7 +1162,9 @@ module MuxRuby
1116
1162
  end
1117
1163
  end
1118
1164
  else # model
1119
- MuxRuby.const_get(type).build_from_hash(value)
1165
+ # models (e.g. Pet) or oneOf
1166
+ klass = MuxRuby.const_get(type)
1167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1120
1168
  end
1121
1169
  end
1122
1170
 
@@ -1138,7 +1186,11 @@ module MuxRuby
1138
1186
  hash = {}
1139
1187
  self.class.attribute_map.each_pair do |attr, param|
1140
1188
  value = self.send(attr)
1141
- next if value.nil?
1189
+ if value.nil?
1190
+ is_nullable = self.class.openapi_nullable.include?(attr)
1191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1192
+ end
1193
+
1142
1194
  hash[param] = _to_hash(value)
1143
1195
  end
1144
1196
  hash