mux_ruby 1.7.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/docs/DimensionValue.md +9 -0
  4. data/docs/DimensionsApi.md +118 -0
  5. data/docs/FiltersApi.md +2 -2
  6. data/docs/GetRealTimeBreakdownResponse.md +10 -0
  7. data/docs/GetRealTimeHistogramTimeseriesResponse.md +11 -0
  8. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +8 -0
  9. data/docs/GetRealTimeTimeseriesResponse.md +10 -0
  10. data/docs/Incident.md +28 -0
  11. data/docs/IncidentBreakdown.md +10 -0
  12. data/docs/IncidentNotification.md +10 -0
  13. data/docs/IncidentNotificationRule.md +12 -0
  14. data/docs/IncidentResponse.md +9 -0
  15. data/docs/IncidentsApi.md +186 -0
  16. data/docs/ListDimensionValuesResponse.md +10 -0
  17. data/docs/ListDimensionsResponse.md +10 -0
  18. data/docs/ListIncidentsResponse.md +10 -0
  19. data/docs/ListRealTimeDimensionsResponse.md +10 -0
  20. data/docs/ListRealTimeDimensionsResponseData.md +9 -0
  21. data/docs/ListRealTimeMetricsResponse.md +10 -0
  22. data/docs/ListRelatedIncidentsResponse.md +10 -0
  23. data/docs/NotificationRule.md +10 -0
  24. data/docs/RealTimeApi.md +280 -0
  25. data/docs/RealTimeBreakdownValue.md +12 -0
  26. data/docs/RealTimeHistogramTimeseriesBucket.md +9 -0
  27. data/docs/RealTimeHistogramTimeseriesBucketValues.md +9 -0
  28. data/docs/RealTimeHistogramTimeseriesDatapoint.md +14 -0
  29. data/docs/RealTimeTimeseriesDatapoint.md +10 -0
  30. data/examples/data/exercise-dimensions.rb +29 -0
  31. data/examples/data/exercise-incidents.rb +29 -0
  32. data/examples/data/exercise-realtime.rb +60 -0
  33. data/lib/mux_ruby.rb +26 -0
  34. data/lib/mux_ruby/api/dimensions_api.rb +128 -0
  35. data/lib/mux_ruby/api/filters_api.rb +4 -4
  36. data/lib/mux_ruby/api/incidents_api.rb +217 -0
  37. data/lib/mux_ruby/api/real_time_api.rb +311 -0
  38. data/lib/mux_ruby/models/asset.rb +12 -0
  39. data/lib/mux_ruby/models/dimension_value.rb +193 -0
  40. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +206 -0
  41. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +215 -0
  42. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +186 -0
  43. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +206 -0
  44. data/lib/mux_ruby/models/incident.rb +370 -0
  45. data/lib/mux_ruby/models/incident_breakdown.rb +202 -0
  46. data/lib/mux_ruby/models/incident_notification.rb +202 -0
  47. data/lib/mux_ruby/models/incident_notification_rule.rb +222 -0
  48. data/lib/mux_ruby/models/incident_response.rb +195 -0
  49. data/lib/mux_ruby/models/list_dimension_values_response.rb +206 -0
  50. data/lib/mux_ruby/models/list_dimensions_response.rb +204 -0
  51. data/lib/mux_ruby/models/list_incidents_response.rb +206 -0
  52. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +206 -0
  53. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +193 -0
  54. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +206 -0
  55. data/lib/mux_ruby/models/list_related_incidents_response.rb +206 -0
  56. data/lib/mux_ruby/models/notification_rule.rb +202 -0
  57. data/lib/mux_ruby/models/real_time_breakdown_value.rb +220 -0
  58. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +193 -0
  59. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +193 -0
  60. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +240 -0
  61. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +202 -0
  62. data/lib/mux_ruby/version.rb +1 -1
  63. data/spec/api/dimensions_api_spec.rb +55 -0
  64. data/spec/api/filters_api_spec.rb +2 -2
  65. data/spec/api/incidents_api_spec.rb +73 -0
  66. data/spec/api/real_time_api_spec.rb +93 -0
  67. data/spec/models/asset_spec.rb +4 -0
  68. data/spec/models/dimension_value_spec.rb +40 -0
  69. data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
  70. data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
  71. data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
  72. data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
  73. data/spec/models/incident_breakdown_spec.rb +46 -0
  74. data/spec/models/incident_notification_rule_spec.rb +58 -0
  75. data/spec/models/incident_notification_spec.rb +46 -0
  76. data/spec/models/incident_response_spec.rb +40 -0
  77. data/spec/models/incident_spec.rb +154 -0
  78. data/spec/models/list_dimension_values_response_spec.rb +46 -0
  79. data/spec/models/list_dimensions_response_spec.rb +46 -0
  80. data/spec/models/list_incidents_response_spec.rb +46 -0
  81. data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
  82. data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
  83. data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
  84. data/spec/models/list_related_incidents_response_spec.rb +46 -0
  85. data/spec/models/notification_rule_spec.rb +46 -0
  86. data/spec/models/real_time_breakdown_value_spec.rb +58 -0
  87. data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
  88. data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
  89. data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
  90. data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
  91. metadata +171 -64
@@ -0,0 +1,311 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'uri'
7
+
8
+ module MuxRuby
9
+ class RealTimeApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+ # Get Real-Time Breakdown
16
+ # Gets breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score.
17
+ # @param realtime_metric_id ID of the Realtime Metric
18
+ # @param [Hash] opts the optional parameters
19
+ # @option opts [String] :dimension Dimension the specified value belongs to
20
+ # @option opts [Float] :timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp.
21
+ # @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]&#x3D;operating_system:windows&amp;filters[]&#x3D;country:US). Possible filter names are the same as returned by the List Filters endpoint.
22
+ # @option opts [String] :order_by Value to order the results by
23
+ # @option opts [String] :order_direction Sort order.
24
+ # @return [GetRealTimeBreakdownResponse]
25
+ def get_realtime_breakdown(realtime_metric_id, opts = {})
26
+ data, _status_code, _headers = get_realtime_breakdown_with_http_info(realtime_metric_id, opts)
27
+ data
28
+ end
29
+
30
+ # Get Real-Time Breakdown
31
+ # Gets breakdown information for a specific dimension and metric along with the number of concurrent viewers and negative impact score.
32
+ # @param realtime_metric_id ID of the Realtime Metric
33
+ # @param [Hash] opts the optional parameters
34
+ # @option opts [String] :dimension Dimension the specified value belongs to
35
+ # @option opts [Float] :timestamp Timestamp to limit results by. This value must be provided as a unix timestamp. Defaults to the current unix timestamp.
36
+ # @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]&#x3D;operating_system:windows&amp;filters[]&#x3D;country:US). Possible filter names are the same as returned by the List Filters endpoint.
37
+ # @option opts [String] :order_by Value to order the results by
38
+ # @option opts [String] :order_direction Sort order.
39
+ # @return [Array<(GetRealTimeBreakdownResponse, Fixnum, Hash)>] GetRealTimeBreakdownResponse data, response status code and response headers
40
+ def get_realtime_breakdown_with_http_info(realtime_metric_id, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug 'Calling API: RealTimeApi.get_realtime_breakdown ...'
43
+ end
44
+ # verify the required parameter 'realtime_metric_id' is set
45
+ if @api_client.config.client_side_validation && realtime_metric_id.nil?
46
+ fail ArgumentError, "Missing the required parameter 'realtime_metric_id' when calling RealTimeApi.get_realtime_breakdown"
47
+ end
48
+ # verify enum value
49
+ if @api_client.config.client_side_validation && !['current-average-bitrate', 'current-concurrent-viewers', 'current-rebuffering-percentage', 'exits-before-video-start', 'playback-failure-percentage', 'video-startup-time'].include?(realtime_metric_id)
50
+ fail ArgumentError, "invalid value for 'realtime_metric_id', must be one of current-average-bitrate, current-concurrent-viewers, current-rebuffering-percentage, exits-before-video-start, playback-failure-percentage, video-startup-time"
51
+ end
52
+ if @api_client.config.client_side_validation && opts[:'dimension'] && !['asn', 'cdn', 'country', 'operating_system', 'player_name', 'region', 'stream_type', 'sub_property_id', 'video_series', 'video_title'].include?(opts[:'dimension'])
53
+ fail ArgumentError, 'invalid value for "dimension", must be one of asn, cdn, country, operating_system, player_name, region, stream_type, sub_property_id, video_series, video_title'
54
+ end
55
+ if @api_client.config.client_side_validation && opts[:'order_by'] && !['negative_impact', 'value', 'views', 'field'].include?(opts[:'order_by'])
56
+ fail ArgumentError, 'invalid value for "order_by", must be one of negative_impact, value, views, field'
57
+ end
58
+ if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
59
+ fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
60
+ end
61
+ # resource path
62
+ local_var_path = '/data/v1/realtime/metrics/{REALTIME_METRIC_ID}/breakdown'.sub('{' + 'REALTIME_METRIC_ID' + '}', realtime_metric_id.to_s)
63
+
64
+ # query parameters
65
+ query_params = {}
66
+ query_params[:'dimension'] = opts[:'dimension'] if !opts[:'dimension'].nil?
67
+ query_params[:'timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
68
+ query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
69
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
70
+ query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil?
71
+
72
+ # header parameters
73
+ header_params = {}
74
+ # HTTP header 'Accept' (if needed)
75
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
76
+
77
+ # form parameters
78
+ form_params = {}
79
+
80
+ # http body (model)
81
+ post_body = nil
82
+ auth_names = ['accessToken']
83
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
84
+ :header_params => header_params,
85
+ :query_params => query_params,
86
+ :form_params => form_params,
87
+ :body => post_body,
88
+ :auth_names => auth_names,
89
+ :return_type => 'GetRealTimeBreakdownResponse')
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: RealTimeApi#get_realtime_breakdown\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Get Real-Time Histogram Timeseries
97
+ # Gets histogram timeseries information for a specific metric.
98
+ # @param realtime_metric_id ID of the Realtime Metric
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]&#x3D;operating_system:windows&amp;filters[]&#x3D;country:US). Possible filter names are the same as returned by the List Filters endpoint.
101
+ # @return [GetRealTimeHistogramTimeseriesResponse]
102
+ def get_realtime_histogram_timeseries(realtime_metric_id, opts = {})
103
+ data, _status_code, _headers = get_realtime_histogram_timeseries_with_http_info(realtime_metric_id, opts)
104
+ data
105
+ end
106
+
107
+ # Get Real-Time Histogram Timeseries
108
+ # Gets histogram timeseries information for a specific metric.
109
+ # @param realtime_metric_id ID of the Realtime Metric
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]&#x3D;operating_system:windows&amp;filters[]&#x3D;country:US). Possible filter names are the same as returned by the List Filters endpoint.
112
+ # @return [Array<(GetRealTimeHistogramTimeseriesResponse, Fixnum, Hash)>] GetRealTimeHistogramTimeseriesResponse data, response status code and response headers
113
+ def get_realtime_histogram_timeseries_with_http_info(realtime_metric_id, opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug 'Calling API: RealTimeApi.get_realtime_histogram_timeseries ...'
116
+ end
117
+ # verify the required parameter 'realtime_metric_id' is set
118
+ if @api_client.config.client_side_validation && realtime_metric_id.nil?
119
+ fail ArgumentError, "Missing the required parameter 'realtime_metric_id' when calling RealTimeApi.get_realtime_histogram_timeseries"
120
+ end
121
+ # verify enum value
122
+ if @api_client.config.client_side_validation && !['current-average-bitrate', 'current-concurrent-viewers', 'current-rebuffering-percentage', 'exits-before-video-start', 'playback-failure-percentage', 'video-startup-time'].include?(realtime_metric_id)
123
+ fail ArgumentError, "invalid value for 'realtime_metric_id', must be one of current-average-bitrate, current-concurrent-viewers, current-rebuffering-percentage, exits-before-video-start, playback-failure-percentage, video-startup-time"
124
+ end
125
+ # resource path
126
+ local_var_path = '/data/v1/realtime/metrics/{REALTIME_METRIC_ID}/histogram-timeseries'.sub('{' + 'REALTIME_METRIC_ID' + '}', realtime_metric_id.to_s)
127
+
128
+ # query parameters
129
+ query_params = {}
130
+ query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
131
+
132
+ # header parameters
133
+ header_params = {}
134
+ # HTTP header 'Accept' (if needed)
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
136
+
137
+ # form parameters
138
+ form_params = {}
139
+
140
+ # http body (model)
141
+ post_body = nil
142
+ auth_names = ['accessToken']
143
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => 'GetRealTimeHistogramTimeseriesResponse')
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: RealTimeApi#get_realtime_histogram_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+
156
+ # Get Real-Time Timeseries
157
+ # Gets Time series information for a specific metric along with the number of concurrent viewers.
158
+ # @param realtime_metric_id ID of the Realtime Metric
159
+ # @param [Hash] opts the optional parameters
160
+ # @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]&#x3D;operating_system:windows&amp;filters[]&#x3D;country:US). Possible filter names are the same as returned by the List Filters endpoint.
161
+ # @return [GetRealTimeTimeseriesResponse]
162
+ def get_realtime_timeseries(realtime_metric_id, opts = {})
163
+ data, _status_code, _headers = get_realtime_timeseries_with_http_info(realtime_metric_id, opts)
164
+ data
165
+ end
166
+
167
+ # Get Real-Time Timeseries
168
+ # Gets Time series information for a specific metric along with the number of concurrent viewers.
169
+ # @param realtime_metric_id ID of the Realtime Metric
170
+ # @param [Hash] opts the optional parameters
171
+ # @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]&#x3D;operating_system:windows&amp;filters[]&#x3D;country:US). Possible filter names are the same as returned by the List Filters endpoint.
172
+ # @return [Array<(GetRealTimeTimeseriesResponse, Fixnum, Hash)>] GetRealTimeTimeseriesResponse data, response status code and response headers
173
+ def get_realtime_timeseries_with_http_info(realtime_metric_id, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: RealTimeApi.get_realtime_timeseries ...'
176
+ end
177
+ # verify the required parameter 'realtime_metric_id' is set
178
+ if @api_client.config.client_side_validation && realtime_metric_id.nil?
179
+ fail ArgumentError, "Missing the required parameter 'realtime_metric_id' when calling RealTimeApi.get_realtime_timeseries"
180
+ end
181
+ # verify enum value
182
+ if @api_client.config.client_side_validation && !['current-average-bitrate', 'current-concurrent-viewers', 'current-rebuffering-percentage', 'exits-before-video-start', 'playback-failure-percentage', 'video-startup-time'].include?(realtime_metric_id)
183
+ fail ArgumentError, "invalid value for 'realtime_metric_id', must be one of current-average-bitrate, current-concurrent-viewers, current-rebuffering-percentage, exits-before-video-start, playback-failure-percentage, video-startup-time"
184
+ end
185
+ # resource path
186
+ local_var_path = '/data/v1/realtime/metrics/{REALTIME_METRIC_ID}/timeseries'.sub('{' + 'REALTIME_METRIC_ID' + '}', realtime_metric_id.to_s)
187
+
188
+ # query parameters
189
+ query_params = {}
190
+ query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
191
+
192
+ # header parameters
193
+ header_params = {}
194
+ # HTTP header 'Accept' (if needed)
195
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
196
+
197
+ # form parameters
198
+ form_params = {}
199
+
200
+ # http body (model)
201
+ post_body = nil
202
+ auth_names = ['accessToken']
203
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
204
+ :header_params => header_params,
205
+ :query_params => query_params,
206
+ :form_params => form_params,
207
+ :body => post_body,
208
+ :auth_names => auth_names,
209
+ :return_type => 'GetRealTimeTimeseriesResponse')
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: RealTimeApi#get_realtime_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ # List Real-Time Dimensions
217
+ # Lists availiable real-time dimensions
218
+ # @param [Hash] opts the optional parameters
219
+ # @return [ListRealTimeDimensionsResponse]
220
+ def list_realtime_dimensions(opts = {})
221
+ data, _status_code, _headers = list_realtime_dimensions_with_http_info(opts)
222
+ data
223
+ end
224
+
225
+ # List Real-Time Dimensions
226
+ # Lists availiable real-time dimensions
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [Array<(ListRealTimeDimensionsResponse, Fixnum, Hash)>] ListRealTimeDimensionsResponse data, response status code and response headers
229
+ def list_realtime_dimensions_with_http_info(opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: RealTimeApi.list_realtime_dimensions ...'
232
+ end
233
+ # resource path
234
+ local_var_path = '/data/v1/realtime/dimensions'
235
+
236
+ # query parameters
237
+ query_params = {}
238
+
239
+ # header parameters
240
+ header_params = {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
243
+
244
+ # form parameters
245
+ form_params = {}
246
+
247
+ # http body (model)
248
+ post_body = nil
249
+ auth_names = ['accessToken']
250
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
251
+ :header_params => header_params,
252
+ :query_params => query_params,
253
+ :form_params => form_params,
254
+ :body => post_body,
255
+ :auth_names => auth_names,
256
+ :return_type => 'ListRealTimeDimensionsResponse')
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug "API called: RealTimeApi#list_realtime_dimensions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
259
+ end
260
+ return data, status_code, headers
261
+ end
262
+
263
+ # List Real-Time Metrics
264
+ # Lists availiable real-time metrics.
265
+ # @param [Hash] opts the optional parameters
266
+ # @return [ListRealTimeMetricsResponse]
267
+ def list_realtime_metrics(opts = {})
268
+ data, _status_code, _headers = list_realtime_metrics_with_http_info(opts)
269
+ data
270
+ end
271
+
272
+ # List Real-Time Metrics
273
+ # Lists availiable real-time metrics.
274
+ # @param [Hash] opts the optional parameters
275
+ # @return [Array<(ListRealTimeMetricsResponse, Fixnum, Hash)>] ListRealTimeMetricsResponse data, response status code and response headers
276
+ def list_realtime_metrics_with_http_info(opts = {})
277
+ if @api_client.config.debugging
278
+ @api_client.config.logger.debug 'Calling API: RealTimeApi.list_realtime_metrics ...'
279
+ end
280
+ # resource path
281
+ local_var_path = '/data/v1/realtime/metrics'
282
+
283
+ # query parameters
284
+ query_params = {}
285
+
286
+ # header parameters
287
+ header_params = {}
288
+ # HTTP header 'Accept' (if needed)
289
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
290
+
291
+ # form parameters
292
+ form_params = {}
293
+
294
+ # http body (model)
295
+ post_body = nil
296
+ auth_names = ['accessToken']
297
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
298
+ :header_params => header_params,
299
+ :query_params => query_params,
300
+ :form_params => form_params,
301
+ :body => post_body,
302
+ :auth_names => auth_names,
303
+ :return_type => 'ListRealTimeMetricsResponse')
304
+ if @api_client.config.debugging
305
+ @api_client.config.logger.debug "API called: RealTimeApi#list_realtime_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
306
+ end
307
+ return data, status_code, headers
308
+ end
309
+
310
+ end
311
+ end
@@ -257,6 +257,8 @@ module MuxRuby
257
257
  # Check to see if the all the properties in the model are valid
258
258
  # @return true if the model is valid
259
259
  def valid?
260
+ max_stored_resolution_validator = EnumAttributeValidator.new('String', ['Audio only', 'SD', 'HD', 'FHD', 'UHD'])
261
+ return false unless max_stored_resolution_validator.valid?(@max_stored_resolution)
260
262
  master_access_validator = EnumAttributeValidator.new('String', ['temporary', 'none'])
261
263
  return false unless master_access_validator.valid?(@master_access)
262
264
  mp4_support_validator = EnumAttributeValidator.new('String', ['standard', 'none'])
@@ -264,6 +266,16 @@ module MuxRuby
264
266
  true
265
267
  end
266
268
 
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] max_stored_resolution Object to be assigned
271
+ def max_stored_resolution=(max_stored_resolution)
272
+ validator = EnumAttributeValidator.new('String', ['Audio only', 'SD', 'HD', 'FHD', 'UHD'])
273
+ unless validator.valid?(max_stored_resolution)
274
+ fail ArgumentError, 'invalid value for "max_stored_resolution", must be one of #{validator.allowable_values}.'
275
+ end
276
+ @max_stored_resolution = max_stored_resolution
277
+ end
278
+
267
279
  # Custom attribute writer method checking allowed values (enum).
268
280
  # @param [Object] master_access Object to be assigned
269
281
  def master_access=(master_access)
@@ -0,0 +1,193 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'date'
7
+
8
+ module MuxRuby
9
+ class DimensionValue
10
+ attr_accessor :value
11
+
12
+ attr_accessor :total_count
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :'value' => :'value',
18
+ :'total_count' => :'total_count'
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.openapi_types
24
+ {
25
+ :'value' => :'String',
26
+ :'total_count' => :'Integer'
27
+ }
28
+ end
29
+
30
+ # Initializes the object
31
+ # @param [Hash] attributes Model attributes in the form of hash
32
+ def initialize(attributes = {})
33
+ return unless attributes.is_a?(Hash)
34
+
35
+ # convert string to symbol for hash key
36
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
37
+
38
+ if attributes.has_key?(:'value')
39
+ self.value = attributes[:'value']
40
+ end
41
+
42
+ if attributes.has_key?(:'total_count')
43
+ self.total_count = attributes[:'total_count']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ value == o.value &&
66
+ total_count == o.total_count
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [value, total_count].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def self.build_from_hash(attributes)
85
+ new.build_from_hash(attributes)
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.openapi_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param string type Data type
110
+ # @param string value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ MuxRuby.const_get(type).build_from_hash(value)
146
+ end
147
+ end
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # to_body is an alias to to_hash (backward compatibility)
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_body
158
+ to_hash
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ next if value.nil?
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+
191
+ end
192
+
193
+ end