mux_ruby 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +79 -0
- data/LICENSE +7 -0
- data/README.md +121 -0
- data/Rakefile +10 -0
- data/docs/AbridgedVideoView.md +18 -0
- data/docs/Asset.md +27 -0
- data/docs/AssetErrors.md +9 -0
- data/docs/AssetMaster.md +9 -0
- data/docs/AssetResponse.md +8 -0
- data/docs/AssetStaticRenditions.md +9 -0
- data/docs/AssetStaticRenditionsFiles.md +13 -0
- data/docs/AssetsApi.md +476 -0
- data/docs/BreakdownValue.md +12 -0
- data/docs/CreateAssetRequest.md +13 -0
- data/docs/CreateLiveStreamRequest.md +9 -0
- data/docs/CreatePlaybackIDRequest.md +8 -0
- data/docs/CreatePlaybackIDResponse.md +8 -0
- data/docs/CreateUploadRequest.md +10 -0
- data/docs/DirectUploadsApi.md +214 -0
- data/docs/Error.md +15 -0
- data/docs/ErrorsApi.md +64 -0
- data/docs/ExportsApi.md +56 -0
- data/docs/FilterValue.md +9 -0
- data/docs/FiltersApi.md +118 -0
- data/docs/GetAssetInputInfoResponse.md +8 -0
- data/docs/GetAssetPlaybackIDResponse.md +8 -0
- data/docs/GetMetricTimeseriesDataResponse.md +10 -0
- data/docs/GetOverallValuesResponse.md +10 -0
- data/docs/InputFile.md +9 -0
- data/docs/InputInfo.md +9 -0
- data/docs/InputSettings.md +10 -0
- data/docs/InputSettingsOverlaySettings.md +14 -0
- data/docs/InputTrack.md +18 -0
- data/docs/Insight.md +13 -0
- data/docs/ListAllMetricValuesResponse.md +10 -0
- data/docs/ListAssetsResponse.md +8 -0
- data/docs/ListBreakdownValuesResponse.md +10 -0
- data/docs/ListErrorsResponse.md +10 -0
- data/docs/ListExportsResponse.md +10 -0
- data/docs/ListFilterValuesResponse.md +10 -0
- data/docs/ListFiltersResponse.md +10 -0
- data/docs/ListFiltersResponseData.md +9 -0
- data/docs/ListInsightsResponse.md +10 -0
- data/docs/ListLiveStreamsResponse.md +8 -0
- data/docs/ListSigningKeysResponse.md +8 -0
- data/docs/ListUploadsResponse.md +8 -0
- data/docs/ListVideoViewsResponse.md +10 -0
- data/docs/LiveStream.md +17 -0
- data/docs/LiveStreamResponse.md +8 -0
- data/docs/LiveStreamsApi.md +420 -0
- data/docs/Metric.md +12 -0
- data/docs/MetricsApi.md +322 -0
- data/docs/OverallValues.md +11 -0
- data/docs/PlaybackID.md +9 -0
- data/docs/PlaybackPolicy.md +7 -0
- data/docs/Score.md +13 -0
- data/docs/SignalLiveStreamCompleteResponse.md +8 -0
- data/docs/SigningKey.md +10 -0
- data/docs/SigningKeyResponse.md +8 -0
- data/docs/Track.md +17 -0
- data/docs/URLSigningKeysApi.md +215 -0
- data/docs/UpdateAssetMP4SupportRequest.md +8 -0
- data/docs/Upload.md +15 -0
- data/docs/UploadError.md +9 -0
- data/docs/UploadResponse.md +8 -0
- data/docs/VideoView.md +117 -0
- data/docs/VideoViewEvent.md +11 -0
- data/docs/VideoViewResponse.md +9 -0
- data/docs/VideoViewsApi.md +126 -0
- data/examples/data/exercise-errors.rb +23 -0
- data/examples/data/exercise-exports.rb +22 -0
- data/examples/data/exercise-filters.rb +29 -0
- data/examples/data/exercise-metrics.rb +52 -0
- data/examples/data/exercise-video-views.rb +30 -0
- data/examples/video/create-live-stream.rb +25 -0
- data/examples/video/exercise-assets.rb +95 -0
- data/examples/video/exercise-live-streams.rb +89 -0
- data/examples/video/exercise-signing-keys.rb +46 -0
- data/examples/video/exercise-uploads.rb +49 -0
- data/examples/video/ingest.rb +37 -0
- data/examples/video/list-everything.rb +48 -0
- data/github-ruby-sdk.png +0 -0
- data/lib/mux_ruby/api/assets_api.rb +507 -0
- data/lib/mux_ruby/api/direct_uploads_api.rb +224 -0
- data/lib/mux_ruby/api/errors_api.rb +69 -0
- data/lib/mux_ruby/api/exports_api.rb +63 -0
- data/lib/mux_ruby/api/filters_api.rb +128 -0
- data/lib/mux_ruby/api/live_streams_api.rb +440 -0
- data/lib/mux_ruby/api/metrics_api.rb +393 -0
- data/lib/mux_ruby/api/url_signing_keys_api.rb +219 -0
- data/lib/mux_ruby/api/video_views_api.rb +140 -0
- data/lib/mux_ruby/api_client.rb +400 -0
- data/lib/mux_ruby/api_error.rb +44 -0
- data/lib/mux_ruby/configuration.rb +244 -0
- data/lib/mux_ruby/models/abridged_video_view.rb +274 -0
- data/lib/mux_ruby/models/asset.rb +409 -0
- data/lib/mux_ruby/models/asset_errors.rb +195 -0
- data/lib/mux_ruby/models/asset_master.rb +193 -0
- data/lib/mux_ruby/models/asset_response.rb +184 -0
- data/lib/mux_ruby/models/asset_static_renditions.rb +232 -0
- data/lib/mux_ruby/models/asset_static_renditions_files.rb +279 -0
- data/lib/mux_ruby/models/breakdown_value.rb +220 -0
- data/lib/mux_ruby/models/create_asset_request.rb +267 -0
- data/lib/mux_ruby/models/create_live_stream_request.rb +195 -0
- data/lib/mux_ruby/models/create_playback_id_request.rb +184 -0
- data/lib/mux_ruby/models/create_playback_id_response.rb +184 -0
- data/lib/mux_ruby/models/create_upload_request.rb +235 -0
- data/lib/mux_ruby/models/error.rb +247 -0
- data/lib/mux_ruby/models/filter_value.rb +193 -0
- data/lib/mux_ruby/models/get_asset_input_info_response.rb +186 -0
- data/lib/mux_ruby/models/get_asset_playback_id_response.rb +184 -0
- data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +206 -0
- data/lib/mux_ruby/models/get_overall_values_response.rb +204 -0
- data/lib/mux_ruby/models/input_file.rb +195 -0
- data/lib/mux_ruby/models/input_info.rb +193 -0
- data/lib/mux_ruby/models/input_settings.rb +203 -0
- data/lib/mux_ruby/models/input_settings_overlay_settings.rb +238 -0
- data/lib/mux_ruby/models/input_track.rb +274 -0
- data/lib/mux_ruby/models/insight.rb +229 -0
- data/lib/mux_ruby/models/list_all_metric_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_assets_response.rb +186 -0
- data/lib/mux_ruby/models/list_breakdown_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_errors_response.rb +206 -0
- data/lib/mux_ruby/models/list_exports_response.rb +206 -0
- data/lib/mux_ruby/models/list_filter_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_filters_response.rb +204 -0
- data/lib/mux_ruby/models/list_filters_response_data.rb +197 -0
- data/lib/mux_ruby/models/list_insights_response.rb +206 -0
- data/lib/mux_ruby/models/list_live_streams_response.rb +186 -0
- data/lib/mux_ruby/models/list_signing_keys_response.rb +186 -0
- data/lib/mux_ruby/models/list_uploads_response.rb +186 -0
- data/lib/mux_ruby/models/list_video_views_response.rb +206 -0
- data/lib/mux_ruby/models/live_stream.rb +269 -0
- data/lib/mux_ruby/models/live_stream_response.rb +184 -0
- data/lib/mux_ruby/models/metric.rb +220 -0
- data/lib/mux_ruby/models/overall_values.rb +211 -0
- data/lib/mux_ruby/models/playback_id.rb +193 -0
- data/lib/mux_ruby/models/playback_policy.rb +31 -0
- data/lib/mux_ruby/models/score.rb +231 -0
- data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +184 -0
- data/lib/mux_ruby/models/signing_key.rb +202 -0
- data/lib/mux_ruby/models/signing_key_response.rb +184 -0
- data/lib/mux_ruby/models/track.rb +265 -0
- data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +219 -0
- data/lib/mux_ruby/models/upload.rb +311 -0
- data/lib/mux_ruby/models/upload_error.rb +194 -0
- data/lib/mux_ruby/models/upload_response.rb +184 -0
- data/lib/mux_ruby/models/video_view.rb +1167 -0
- data/lib/mux_ruby/models/video_view_event.rb +211 -0
- data/lib/mux_ruby/models/video_view_response.rb +195 -0
- data/lib/mux_ruby/version.rb +8 -0
- data/lib/mux_ruby.rb +97 -0
- data/mux_ruby.gemspec +38 -0
- data/spec/api/assets_api_spec.rb +136 -0
- data/spec/api/direct_uploads_api_spec.rb +74 -0
- data/spec/api/errors_api_spec.rb +41 -0
- data/spec/api/exports_api_spec.rb +39 -0
- data/spec/api/filters_api_spec.rb +55 -0
- data/spec/api/live_streams_api_spec.rb +122 -0
- data/spec/api/metrics_api_spec.rb +110 -0
- data/spec/api/url_signing_keys_api_spec.rb +76 -0
- data/spec/api/video_views_api_spec.rb +58 -0
- data/spec/api_client_spec.rb +219 -0
- data/spec/configuration_spec.rb +35 -0
- data/spec/models/abridged_video_view_spec.rb +94 -0
- data/spec/models/asset_errors_spec.rb +40 -0
- data/spec/models/asset_master_spec.rb +40 -0
- data/spec/models/asset_response_spec.rb +34 -0
- data/spec/models/asset_spec.rb +156 -0
- data/spec/models/asset_static_renditions_files_spec.rb +72 -0
- data/spec/models/asset_static_renditions_spec.rb +44 -0
- data/spec/models/breakdown_value_spec.rb +58 -0
- data/spec/models/create_asset_request_spec.rb +68 -0
- data/spec/models/create_live_stream_request_spec.rb +40 -0
- data/spec/models/create_playback_id_request_spec.rb +34 -0
- data/spec/models/create_playback_id_response_spec.rb +34 -0
- data/spec/models/create_upload_request_spec.rb +46 -0
- data/spec/models/error_spec.rb +76 -0
- data/spec/models/filter_value_spec.rb +40 -0
- data/spec/models/get_asset_input_info_response_spec.rb +34 -0
- data/spec/models/get_asset_playback_id_response_spec.rb +34 -0
- data/spec/models/get_metric_timeseries_data_response_spec.rb +46 -0
- data/spec/models/get_overall_values_response_spec.rb +46 -0
- data/spec/models/input_file_spec.rb +40 -0
- data/spec/models/input_info_spec.rb +40 -0
- data/spec/models/input_settings_overlay_settings_spec.rb +70 -0
- data/spec/models/input_settings_spec.rb +46 -0
- data/spec/models/input_track_spec.rb +94 -0
- data/spec/models/insight_spec.rb +64 -0
- data/spec/models/list_all_metric_values_response_spec.rb +46 -0
- data/spec/models/list_assets_response_spec.rb +34 -0
- data/spec/models/list_breakdown_values_response_spec.rb +46 -0
- data/spec/models/list_errors_response_spec.rb +46 -0
- data/spec/models/list_exports_response_spec.rb +46 -0
- data/spec/models/list_filter_values_response_spec.rb +46 -0
- data/spec/models/list_filters_response_data_spec.rb +40 -0
- data/spec/models/list_filters_response_spec.rb +46 -0
- data/spec/models/list_insights_response_spec.rb +46 -0
- data/spec/models/list_live_streams_response_spec.rb +34 -0
- data/spec/models/list_signing_keys_response_spec.rb +34 -0
- data/spec/models/list_uploads_response_spec.rb +34 -0
- data/spec/models/list_video_views_response_spec.rb +46 -0
- data/spec/models/live_stream_response_spec.rb +34 -0
- data/spec/models/live_stream_spec.rb +88 -0
- data/spec/models/metric_spec.rb +58 -0
- data/spec/models/overall_values_spec.rb +52 -0
- data/spec/models/playback_id_spec.rb +40 -0
- data/spec/models/playback_policy_spec.rb +28 -0
- data/spec/models/score_spec.rb +64 -0
- data/spec/models/signal_live_stream_complete_response_spec.rb +34 -0
- data/spec/models/signing_key_response_spec.rb +34 -0
- data/spec/models/signing_key_spec.rb +46 -0
- data/spec/models/track_spec.rb +88 -0
- data/spec/models/update_asset_mp4_support_request_spec.rb +38 -0
- data/spec/models/upload_error_spec.rb +40 -0
- data/spec/models/upload_response_spec.rb +34 -0
- data/spec/models/upload_spec.rb +80 -0
- data/spec/models/video_view_event_spec.rb +52 -0
- data/spec/models/video_view_response_spec.rb +40 -0
- data/spec/models/video_view_spec.rb +688 -0
- data/spec/spec_helper.rb +104 -0
- metadata +514 -0
|
@@ -0,0 +1,393 @@
|
|
|
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 MetricsApi
|
|
10
|
+
attr_accessor :api_client
|
|
11
|
+
|
|
12
|
+
def initialize(api_client = ApiClient.default)
|
|
13
|
+
@api_client = api_client
|
|
14
|
+
end
|
|
15
|
+
# Get metric timeseries data
|
|
16
|
+
# Returns timeseries data for a specific metric
|
|
17
|
+
# @param metric_id ID of the Metric
|
|
18
|
+
# @param [Hash] opts the optional parameters
|
|
19
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
20
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
21
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
22
|
+
# @option opts [String] :order_direction Sort order.
|
|
23
|
+
# @option opts [String] :group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe.
|
|
24
|
+
# @return [GetMetricTimeseriesDataResponse]
|
|
25
|
+
def get_metric_timeseries_data(metric_id, opts = {})
|
|
26
|
+
data, _status_code, _headers = get_metric_timeseries_data_with_http_info(metric_id, opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Get metric timeseries data
|
|
31
|
+
# Returns timeseries data for a specific metric
|
|
32
|
+
# @param metric_id ID of the Metric
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
35
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
36
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
37
|
+
# @option opts [String] :order_direction Sort order.
|
|
38
|
+
# @option opts [String] :group_by Time granularity to group results by. If this value is omitted, a default granularity is chosen based on the supplied timeframe.
|
|
39
|
+
# @return [Array<(GetMetricTimeseriesDataResponse, Fixnum, Hash)>] GetMetricTimeseriesDataResponse data, response status code and response headers
|
|
40
|
+
def get_metric_timeseries_data_with_http_info(metric_id, opts = {})
|
|
41
|
+
if @api_client.config.debugging
|
|
42
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_timeseries_data ...'
|
|
43
|
+
end
|
|
44
|
+
# verify the required parameter 'metric_id' is set
|
|
45
|
+
if @api_client.config.client_side_validation && metric_id.nil?
|
|
46
|
+
fail ArgumentError, "Missing the required parameter 'metric_id' when calling MetricsApi.get_metric_timeseries_data"
|
|
47
|
+
end
|
|
48
|
+
# verify enum value
|
|
49
|
+
if @api_client.config.client_side_validation && !['aggregate_startup_time', 'downscale_percentage', 'exits_before_video_start', 'max_downscale_percentage', 'max_upscale_percentage', 'page_load_time', 'playback_failure_percentage', 'playback_failure_score', 'player_startup_time', 'rebuffer_count', 'rebuffer_duration', 'rebuffer_frequency', 'rebuffer_percentage', 'rebuffer_score', 'requests_for_first_preroll', 'seek_latency', 'startup_time_score', 'upscale_percentage', 'video_quality_score', 'video_startup_preroll_load_time', 'video_startup_preroll_request_time', 'video_startup_time', 'viewer_experience_score'].include?(metric_id)
|
|
50
|
+
fail ArgumentError, "invalid value for 'metric_id', must be one of aggregate_startup_time, downscale_percentage, exits_before_video_start, max_downscale_percentage, max_upscale_percentage, page_load_time, playback_failure_percentage, playback_failure_score, player_startup_time, rebuffer_count, rebuffer_duration, rebuffer_frequency, rebuffer_percentage, rebuffer_score, requests_for_first_preroll, seek_latency, startup_time_score, upscale_percentage, video_quality_score, video_startup_preroll_load_time, video_startup_preroll_request_time, video_startup_time, viewer_experience_score"
|
|
51
|
+
end
|
|
52
|
+
if @api_client.config.client_side_validation && opts[:'measurement'] && !['95th', 'median', 'avg'].include?(opts[:'measurement'])
|
|
53
|
+
fail ArgumentError, 'invalid value for "measurement", must be one of 95th, median, avg'
|
|
54
|
+
end
|
|
55
|
+
if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
|
|
56
|
+
fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
|
|
57
|
+
end
|
|
58
|
+
if @api_client.config.client_side_validation && opts[:'group_by'] && !['hour', 'day'].include?(opts[:'group_by'])
|
|
59
|
+
fail ArgumentError, 'invalid value for "group_by", must be one of hour, day'
|
|
60
|
+
end
|
|
61
|
+
# resource path
|
|
62
|
+
local_var_path = '/data/v1/metrics/{METRIC_ID}/timeseries'.sub('{' + 'METRIC_ID' + '}', metric_id.to_s)
|
|
63
|
+
|
|
64
|
+
# query parameters
|
|
65
|
+
query_params = {}
|
|
66
|
+
query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
|
|
67
|
+
query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
|
|
68
|
+
query_params[:'measurement'] = opts[:'measurement'] if !opts[:'measurement'].nil?
|
|
69
|
+
query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil?
|
|
70
|
+
query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].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 => 'GetMetricTimeseriesDataResponse')
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: MetricsApi#get_metric_timeseries_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Get Overall values
|
|
97
|
+
# Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric.
|
|
98
|
+
# @param metric_id ID of the Metric
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
101
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
102
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
103
|
+
# @return [GetOverallValuesResponse]
|
|
104
|
+
def get_overall_values(metric_id, opts = {})
|
|
105
|
+
data, _status_code, _headers = get_overall_values_with_http_info(metric_id, opts)
|
|
106
|
+
data
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Get Overall values
|
|
110
|
+
# Returns the overall value for a specific metric, as well as the total view count, watch time, and the Mux Global metric value for the metric.
|
|
111
|
+
# @param metric_id ID of the Metric
|
|
112
|
+
# @param [Hash] opts the optional parameters
|
|
113
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
114
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
115
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
116
|
+
# @return [Array<(GetOverallValuesResponse, Fixnum, Hash)>] GetOverallValuesResponse data, response status code and response headers
|
|
117
|
+
def get_overall_values_with_http_info(metric_id, opts = {})
|
|
118
|
+
if @api_client.config.debugging
|
|
119
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.get_overall_values ...'
|
|
120
|
+
end
|
|
121
|
+
# verify the required parameter 'metric_id' is set
|
|
122
|
+
if @api_client.config.client_side_validation && metric_id.nil?
|
|
123
|
+
fail ArgumentError, "Missing the required parameter 'metric_id' when calling MetricsApi.get_overall_values"
|
|
124
|
+
end
|
|
125
|
+
# verify enum value
|
|
126
|
+
if @api_client.config.client_side_validation && !['aggregate_startup_time', 'downscale_percentage', 'exits_before_video_start', 'max_downscale_percentage', 'max_upscale_percentage', 'page_load_time', 'playback_failure_percentage', 'playback_failure_score', 'player_startup_time', 'rebuffer_count', 'rebuffer_duration', 'rebuffer_frequency', 'rebuffer_percentage', 'rebuffer_score', 'requests_for_first_preroll', 'seek_latency', 'startup_time_score', 'upscale_percentage', 'video_quality_score', 'video_startup_preroll_load_time', 'video_startup_preroll_request_time', 'video_startup_time', 'viewer_experience_score'].include?(metric_id)
|
|
127
|
+
fail ArgumentError, "invalid value for 'metric_id', must be one of aggregate_startup_time, downscale_percentage, exits_before_video_start, max_downscale_percentage, max_upscale_percentage, page_load_time, playback_failure_percentage, playback_failure_score, player_startup_time, rebuffer_count, rebuffer_duration, rebuffer_frequency, rebuffer_percentage, rebuffer_score, requests_for_first_preroll, seek_latency, startup_time_score, upscale_percentage, video_quality_score, video_startup_preroll_load_time, video_startup_preroll_request_time, video_startup_time, viewer_experience_score"
|
|
128
|
+
end
|
|
129
|
+
if @api_client.config.client_side_validation && opts[:'measurement'] && !['95th', 'median', 'avg'].include?(opts[:'measurement'])
|
|
130
|
+
fail ArgumentError, 'invalid value for "measurement", must be one of 95th, median, avg'
|
|
131
|
+
end
|
|
132
|
+
# resource path
|
|
133
|
+
local_var_path = '/data/v1/metrics/{METRIC_ID}/overall'.sub('{' + 'METRIC_ID' + '}', metric_id.to_s)
|
|
134
|
+
|
|
135
|
+
# query parameters
|
|
136
|
+
query_params = {}
|
|
137
|
+
query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
|
|
138
|
+
query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
|
|
139
|
+
query_params[:'measurement'] = opts[:'measurement'] if !opts[:'measurement'].nil?
|
|
140
|
+
|
|
141
|
+
# header parameters
|
|
142
|
+
header_params = {}
|
|
143
|
+
# HTTP header 'Accept' (if needed)
|
|
144
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
145
|
+
|
|
146
|
+
# form parameters
|
|
147
|
+
form_params = {}
|
|
148
|
+
|
|
149
|
+
# http body (model)
|
|
150
|
+
post_body = nil
|
|
151
|
+
auth_names = ['accessToken']
|
|
152
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
153
|
+
:header_params => header_params,
|
|
154
|
+
:query_params => query_params,
|
|
155
|
+
:form_params => form_params,
|
|
156
|
+
:body => post_body,
|
|
157
|
+
:auth_names => auth_names,
|
|
158
|
+
:return_type => 'GetOverallValuesResponse')
|
|
159
|
+
if @api_client.config.debugging
|
|
160
|
+
@api_client.config.logger.debug "API called: MetricsApi#get_overall_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
161
|
+
end
|
|
162
|
+
return data, status_code, headers
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# List all metric values
|
|
166
|
+
# List all of the values across every breakdown for a specific metric
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
169
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
170
|
+
# @option opts [String] :dimension Dimension the specified value belongs to
|
|
171
|
+
# @option opts [String] :value Value to show all available metrics for
|
|
172
|
+
# @return [ListAllMetricValuesResponse]
|
|
173
|
+
def list_all_metric_values(opts = {})
|
|
174
|
+
data, _status_code, _headers = list_all_metric_values_with_http_info(opts)
|
|
175
|
+
data
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# List all metric values
|
|
179
|
+
# List all of the values across every breakdown for a specific metric
|
|
180
|
+
# @param [Hash] opts the optional parameters
|
|
181
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
182
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
183
|
+
# @option opts [String] :dimension Dimension the specified value belongs to
|
|
184
|
+
# @option opts [String] :value Value to show all available metrics for
|
|
185
|
+
# @return [Array<(ListAllMetricValuesResponse, Fixnum, Hash)>] ListAllMetricValuesResponse data, response status code and response headers
|
|
186
|
+
def list_all_metric_values_with_http_info(opts = {})
|
|
187
|
+
if @api_client.config.debugging
|
|
188
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.list_all_metric_values ...'
|
|
189
|
+
end
|
|
190
|
+
if @api_client.config.client_side_validation && opts[:'dimension'] && !['asn', 'browser', 'browser_version', 'cdn', 'country', 'experiment_name', 'operating_system', 'operating_system_version', 'player_name', 'player_software', 'player_software_version', 'player_version', 'preroll_ad_asset_hostname', 'preroll_ad_tag_hostname', 'preroll_played', 'preroll_requested', 'source_hostname', 'source_type', 'stream_type', 'sub_property_id', 'video_series', 'video_title'].include?(opts[:'dimension'])
|
|
191
|
+
fail ArgumentError, 'invalid value for "dimension", must be one of asn, browser, browser_version, cdn, country, experiment_name, operating_system, operating_system_version, player_name, player_software, player_software_version, player_version, preroll_ad_asset_hostname, preroll_ad_tag_hostname, preroll_played, preroll_requested, source_hostname, source_type, stream_type, sub_property_id, video_series, video_title'
|
|
192
|
+
end
|
|
193
|
+
# resource path
|
|
194
|
+
local_var_path = '/data/v1/metrics/comparison'
|
|
195
|
+
|
|
196
|
+
# query parameters
|
|
197
|
+
query_params = {}
|
|
198
|
+
query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
|
|
199
|
+
query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
|
|
200
|
+
query_params[:'dimension'] = opts[:'dimension'] if !opts[:'dimension'].nil?
|
|
201
|
+
query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil?
|
|
202
|
+
|
|
203
|
+
# header parameters
|
|
204
|
+
header_params = {}
|
|
205
|
+
# HTTP header 'Accept' (if needed)
|
|
206
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
207
|
+
|
|
208
|
+
# form parameters
|
|
209
|
+
form_params = {}
|
|
210
|
+
|
|
211
|
+
# http body (model)
|
|
212
|
+
post_body = nil
|
|
213
|
+
auth_names = ['accessToken']
|
|
214
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
215
|
+
:header_params => header_params,
|
|
216
|
+
:query_params => query_params,
|
|
217
|
+
:form_params => form_params,
|
|
218
|
+
:body => post_body,
|
|
219
|
+
:auth_names => auth_names,
|
|
220
|
+
:return_type => 'ListAllMetricValuesResponse')
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug "API called: MetricsApi#list_all_metric_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
223
|
+
end
|
|
224
|
+
return data, status_code, headers
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# List breakdown values
|
|
228
|
+
# List the breakdown values for a specific metric
|
|
229
|
+
# @param metric_id ID of the Metric
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @option opts [String] :group_by Breakdown value to group the results by
|
|
232
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
233
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
234
|
+
# @option opts [Integer] :limit Number of items to include in the response (default to 25)
|
|
235
|
+
# @option opts [Integer] :page Offset by this many pages, of the size of `limit` (default to 1)
|
|
236
|
+
# @option opts [String] :order_by Value to order the results by
|
|
237
|
+
# @option opts [String] :order_direction Sort order.
|
|
238
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
239
|
+
# @return [ListBreakdownValuesResponse]
|
|
240
|
+
def list_breakdown_values(metric_id, opts = {})
|
|
241
|
+
data, _status_code, _headers = list_breakdown_values_with_http_info(metric_id, opts)
|
|
242
|
+
data
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# List breakdown values
|
|
246
|
+
# List the breakdown values for a specific metric
|
|
247
|
+
# @param metric_id ID of the Metric
|
|
248
|
+
# @param [Hash] opts the optional parameters
|
|
249
|
+
# @option opts [String] :group_by Breakdown value to group the results by
|
|
250
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
251
|
+
# @option opts [Array<String>] :filters Filter key:value pairs. Must be provided as an array query string parameter (e.g. filters[]=operating_system:windows&filters[]=country:US). Possible filter names are the same as returned by the List Filters endpoint.
|
|
252
|
+
# @option opts [Integer] :limit Number of items to include in the response
|
|
253
|
+
# @option opts [Integer] :page Offset by this many pages, of the size of `limit`
|
|
254
|
+
# @option opts [String] :order_by Value to order the results by
|
|
255
|
+
# @option opts [String] :order_direction Sort order.
|
|
256
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
257
|
+
# @return [Array<(ListBreakdownValuesResponse, Fixnum, Hash)>] ListBreakdownValuesResponse data, response status code and response headers
|
|
258
|
+
def list_breakdown_values_with_http_info(metric_id, opts = {})
|
|
259
|
+
if @api_client.config.debugging
|
|
260
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.list_breakdown_values ...'
|
|
261
|
+
end
|
|
262
|
+
# verify the required parameter 'metric_id' is set
|
|
263
|
+
if @api_client.config.client_side_validation && metric_id.nil?
|
|
264
|
+
fail ArgumentError, "Missing the required parameter 'metric_id' when calling MetricsApi.list_breakdown_values"
|
|
265
|
+
end
|
|
266
|
+
# verify enum value
|
|
267
|
+
if @api_client.config.client_side_validation && !['aggregate_startup_time', 'downscale_percentage', 'exits_before_video_start', 'max_downscale_percentage', 'max_upscale_percentage', 'page_load_time', 'playback_failure_percentage', 'playback_failure_score', 'player_startup_time', 'rebuffer_count', 'rebuffer_duration', 'rebuffer_frequency', 'rebuffer_percentage', 'rebuffer_score', 'requests_for_first_preroll', 'seek_latency', 'startup_time_score', 'upscale_percentage', 'video_quality_score', 'video_startup_preroll_load_time', 'video_startup_preroll_request_time', 'video_startup_time', 'viewer_experience_score'].include?(metric_id)
|
|
268
|
+
fail ArgumentError, "invalid value for 'metric_id', must be one of aggregate_startup_time, downscale_percentage, exits_before_video_start, max_downscale_percentage, max_upscale_percentage, page_load_time, playback_failure_percentage, playback_failure_score, player_startup_time, rebuffer_count, rebuffer_duration, rebuffer_frequency, rebuffer_percentage, rebuffer_score, requests_for_first_preroll, seek_latency, startup_time_score, upscale_percentage, video_quality_score, video_startup_preroll_load_time, video_startup_preroll_request_time, video_startup_time, viewer_experience_score"
|
|
269
|
+
end
|
|
270
|
+
if @api_client.config.client_side_validation && opts[:'group_by'] && !['asn', 'browser', 'browser_version', 'cdn', 'country', 'experiment_name', 'operating_system', 'operating_system_version', 'player_name', 'player_software', 'player_software_version', 'player_version', 'preroll_ad_asset_hostname', 'preroll_ad_tag_hostname', 'preroll_played', 'preroll_requested', 'source_hostname', 'source_type', 'stream_type', 'sub_property_id', 'video_series', 'video_title'].include?(opts[:'group_by'])
|
|
271
|
+
fail ArgumentError, 'invalid value for "group_by", must be one of asn, browser, browser_version, cdn, country, experiment_name, operating_system, operating_system_version, player_name, player_software, player_software_version, player_version, preroll_ad_asset_hostname, preroll_ad_tag_hostname, preroll_played, preroll_requested, source_hostname, source_type, stream_type, sub_property_id, video_series, video_title'
|
|
272
|
+
end
|
|
273
|
+
if @api_client.config.client_side_validation && opts[:'measurement'] && !['95th', 'median', 'avg'].include?(opts[:'measurement'])
|
|
274
|
+
fail ArgumentError, 'invalid value for "measurement", must be one of 95th, median, avg'
|
|
275
|
+
end
|
|
276
|
+
if @api_client.config.client_side_validation && opts[:'order_by'] && !['negative_impact', 'value', 'views', 'field'].include?(opts[:'order_by'])
|
|
277
|
+
fail ArgumentError, 'invalid value for "order_by", must be one of negative_impact, value, views, field'
|
|
278
|
+
end
|
|
279
|
+
if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
|
|
280
|
+
fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
|
|
281
|
+
end
|
|
282
|
+
# resource path
|
|
283
|
+
local_var_path = '/data/v1/metrics/{METRIC_ID}/breakdown'.sub('{' + 'METRIC_ID' + '}', metric_id.to_s)
|
|
284
|
+
|
|
285
|
+
# query parameters
|
|
286
|
+
query_params = {}
|
|
287
|
+
query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil?
|
|
288
|
+
query_params[:'measurement'] = opts[:'measurement'] if !opts[:'measurement'].nil?
|
|
289
|
+
query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
|
|
290
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
291
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
292
|
+
query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
|
|
293
|
+
query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil?
|
|
294
|
+
query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
|
|
295
|
+
|
|
296
|
+
# header parameters
|
|
297
|
+
header_params = {}
|
|
298
|
+
# HTTP header 'Accept' (if needed)
|
|
299
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
300
|
+
|
|
301
|
+
# form parameters
|
|
302
|
+
form_params = {}
|
|
303
|
+
|
|
304
|
+
# http body (model)
|
|
305
|
+
post_body = nil
|
|
306
|
+
auth_names = ['accessToken']
|
|
307
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
308
|
+
:header_params => header_params,
|
|
309
|
+
:query_params => query_params,
|
|
310
|
+
:form_params => form_params,
|
|
311
|
+
:body => post_body,
|
|
312
|
+
:auth_names => auth_names,
|
|
313
|
+
:return_type => 'ListBreakdownValuesResponse')
|
|
314
|
+
if @api_client.config.debugging
|
|
315
|
+
@api_client.config.logger.debug "API called: MetricsApi#list_breakdown_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
316
|
+
end
|
|
317
|
+
return data, status_code, headers
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# List Insights
|
|
321
|
+
# Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric.
|
|
322
|
+
# @param metric_id ID of the Metric
|
|
323
|
+
# @param [Hash] opts the optional parameters
|
|
324
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
325
|
+
# @option opts [String] :order_direction Sort order.
|
|
326
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
327
|
+
# @return [ListInsightsResponse]
|
|
328
|
+
def list_insights(metric_id, opts = {})
|
|
329
|
+
data, _status_code, _headers = list_insights_with_http_info(metric_id, opts)
|
|
330
|
+
data
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# List Insights
|
|
334
|
+
# Returns a list of insights for a metric. These are the worst performing values across all breakdowns sorted by how much they negatively impact a specific metric.
|
|
335
|
+
# @param metric_id ID of the Metric
|
|
336
|
+
# @param [Hash] opts the optional parameters
|
|
337
|
+
# @option opts [String] :measurement Measurement for the provided metric. If omitted, the deafult for the metric will be used.
|
|
338
|
+
# @option opts [String] :order_direction Sort order.
|
|
339
|
+
# @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. timeframe[]=1498867200&timeframe[]=1498953600 * duration string e.g. timeframe[]=24:hours or timeframe[]=7:days.
|
|
340
|
+
# @return [Array<(ListInsightsResponse, Fixnum, Hash)>] ListInsightsResponse data, response status code and response headers
|
|
341
|
+
def list_insights_with_http_info(metric_id, opts = {})
|
|
342
|
+
if @api_client.config.debugging
|
|
343
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.list_insights ...'
|
|
344
|
+
end
|
|
345
|
+
# verify the required parameter 'metric_id' is set
|
|
346
|
+
if @api_client.config.client_side_validation && metric_id.nil?
|
|
347
|
+
fail ArgumentError, "Missing the required parameter 'metric_id' when calling MetricsApi.list_insights"
|
|
348
|
+
end
|
|
349
|
+
# verify enum value
|
|
350
|
+
if @api_client.config.client_side_validation && !['aggregate_startup_time', 'downscale_percentage', 'exits_before_video_start', 'max_downscale_percentage', 'max_upscale_percentage', 'page_load_time', 'playback_failure_percentage', 'playback_failure_score', 'player_startup_time', 'rebuffer_count', 'rebuffer_duration', 'rebuffer_frequency', 'rebuffer_percentage', 'rebuffer_score', 'requests_for_first_preroll', 'seek_latency', 'startup_time_score', 'upscale_percentage', 'video_quality_score', 'video_startup_preroll_load_time', 'video_startup_preroll_request_time', 'video_startup_time', 'viewer_experience_score'].include?(metric_id)
|
|
351
|
+
fail ArgumentError, "invalid value for 'metric_id', must be one of aggregate_startup_time, downscale_percentage, exits_before_video_start, max_downscale_percentage, max_upscale_percentage, page_load_time, playback_failure_percentage, playback_failure_score, player_startup_time, rebuffer_count, rebuffer_duration, rebuffer_frequency, rebuffer_percentage, rebuffer_score, requests_for_first_preroll, seek_latency, startup_time_score, upscale_percentage, video_quality_score, video_startup_preroll_load_time, video_startup_preroll_request_time, video_startup_time, viewer_experience_score"
|
|
352
|
+
end
|
|
353
|
+
if @api_client.config.client_side_validation && opts[:'measurement'] && !['95th', 'median', 'avg'].include?(opts[:'measurement'])
|
|
354
|
+
fail ArgumentError, 'invalid value for "measurement", must be one of 95th, median, avg'
|
|
355
|
+
end
|
|
356
|
+
if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
|
|
357
|
+
fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
|
|
358
|
+
end
|
|
359
|
+
# resource path
|
|
360
|
+
local_var_path = '/data/v1/metrics/{METRIC_ID}/insights'.sub('{' + 'METRIC_ID' + '}', metric_id.to_s)
|
|
361
|
+
|
|
362
|
+
# query parameters
|
|
363
|
+
query_params = {}
|
|
364
|
+
query_params[:'measurement'] = opts[:'measurement'] if !opts[:'measurement'].nil?
|
|
365
|
+
query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil?
|
|
366
|
+
query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
|
|
367
|
+
|
|
368
|
+
# header parameters
|
|
369
|
+
header_params = {}
|
|
370
|
+
# HTTP header 'Accept' (if needed)
|
|
371
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
372
|
+
|
|
373
|
+
# form parameters
|
|
374
|
+
form_params = {}
|
|
375
|
+
|
|
376
|
+
# http body (model)
|
|
377
|
+
post_body = nil
|
|
378
|
+
auth_names = ['accessToken']
|
|
379
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
380
|
+
:header_params => header_params,
|
|
381
|
+
:query_params => query_params,
|
|
382
|
+
:form_params => form_params,
|
|
383
|
+
:body => post_body,
|
|
384
|
+
:auth_names => auth_names,
|
|
385
|
+
:return_type => 'ListInsightsResponse')
|
|
386
|
+
if @api_client.config.debugging
|
|
387
|
+
@api_client.config.logger.debug "API called: MetricsApi#list_insights\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
388
|
+
end
|
|
389
|
+
return data, status_code, headers
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
end
|
|
393
|
+
end
|
|
@@ -0,0 +1,219 @@
|
|
|
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 URLSigningKeysApi
|
|
10
|
+
attr_accessor :api_client
|
|
11
|
+
|
|
12
|
+
def initialize(api_client = ApiClient.default)
|
|
13
|
+
@api_client = api_client
|
|
14
|
+
end
|
|
15
|
+
# Create a URL signing key
|
|
16
|
+
# Creates a new signing key pair. When creating a new signing key, the API will generate a 2048-bit RSA key-pair and return the private key and a generated key-id; the public key will be stored at Mux to validate signed tokens.
|
|
17
|
+
# @param [Hash] opts the optional parameters
|
|
18
|
+
# @return [SigningKeyResponse]
|
|
19
|
+
def create_url_signing_key(opts = {})
|
|
20
|
+
data, _status_code, _headers = create_url_signing_key_with_http_info(opts)
|
|
21
|
+
data
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Create a URL signing key
|
|
25
|
+
# Creates a new signing key pair. When creating a new signing key, the API will generate a 2048-bit RSA key-pair and return the private key and a generated key-id; the public key will be stored at Mux to validate signed tokens.
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [Array<(SigningKeyResponse, Fixnum, Hash)>] SigningKeyResponse data, response status code and response headers
|
|
28
|
+
def create_url_signing_key_with_http_info(opts = {})
|
|
29
|
+
if @api_client.config.debugging
|
|
30
|
+
@api_client.config.logger.debug 'Calling API: URLSigningKeysApi.create_url_signing_key ...'
|
|
31
|
+
end
|
|
32
|
+
# resource path
|
|
33
|
+
local_var_path = '/video/v1/signing-keys'
|
|
34
|
+
|
|
35
|
+
# query parameters
|
|
36
|
+
query_params = {}
|
|
37
|
+
|
|
38
|
+
# header parameters
|
|
39
|
+
header_params = {}
|
|
40
|
+
# HTTP header 'Accept' (if needed)
|
|
41
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
42
|
+
|
|
43
|
+
# form parameters
|
|
44
|
+
form_params = {}
|
|
45
|
+
|
|
46
|
+
# http body (model)
|
|
47
|
+
post_body = nil
|
|
48
|
+
auth_names = ['accessToken']
|
|
49
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
50
|
+
:header_params => header_params,
|
|
51
|
+
:query_params => query_params,
|
|
52
|
+
:form_params => form_params,
|
|
53
|
+
:body => post_body,
|
|
54
|
+
:auth_names => auth_names,
|
|
55
|
+
:return_type => 'SigningKeyResponse')
|
|
56
|
+
if @api_client.config.debugging
|
|
57
|
+
@api_client.config.logger.debug "API called: URLSigningKeysApi#create_url_signing_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
58
|
+
end
|
|
59
|
+
return data, status_code, headers
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Delete a URL signing key
|
|
63
|
+
# Deletes an existing signing key. Use with caution, as this will invalidate any existing signatures and no URLs can be signed using the key again.
|
|
64
|
+
# @param signing_key_id The ID of the signing key.
|
|
65
|
+
# @param [Hash] opts the optional parameters
|
|
66
|
+
# @return [nil]
|
|
67
|
+
def delete_url_signing_key(signing_key_id, opts = {})
|
|
68
|
+
delete_url_signing_key_with_http_info(signing_key_id, opts)
|
|
69
|
+
nil
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Delete a URL signing key
|
|
73
|
+
# Deletes an existing signing key. Use with caution, as this will invalidate any existing signatures and no URLs can be signed using the key again.
|
|
74
|
+
# @param signing_key_id The ID of the signing key.
|
|
75
|
+
# @param [Hash] opts the optional parameters
|
|
76
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
|
77
|
+
def delete_url_signing_key_with_http_info(signing_key_id, opts = {})
|
|
78
|
+
if @api_client.config.debugging
|
|
79
|
+
@api_client.config.logger.debug 'Calling API: URLSigningKeysApi.delete_url_signing_key ...'
|
|
80
|
+
end
|
|
81
|
+
# verify the required parameter 'signing_key_id' is set
|
|
82
|
+
if @api_client.config.client_side_validation && signing_key_id.nil?
|
|
83
|
+
fail ArgumentError, "Missing the required parameter 'signing_key_id' when calling URLSigningKeysApi.delete_url_signing_key"
|
|
84
|
+
end
|
|
85
|
+
# resource path
|
|
86
|
+
local_var_path = '/video/v1/signing-keys/{SIGNING_KEY_ID}'.sub('{' + 'SIGNING_KEY_ID' + '}', signing_key_id.to_s)
|
|
87
|
+
|
|
88
|
+
# query parameters
|
|
89
|
+
query_params = {}
|
|
90
|
+
|
|
91
|
+
# header parameters
|
|
92
|
+
header_params = {}
|
|
93
|
+
|
|
94
|
+
# form parameters
|
|
95
|
+
form_params = {}
|
|
96
|
+
|
|
97
|
+
# http body (model)
|
|
98
|
+
post_body = nil
|
|
99
|
+
auth_names = ['accessToken']
|
|
100
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
|
101
|
+
:header_params => header_params,
|
|
102
|
+
:query_params => query_params,
|
|
103
|
+
:form_params => form_params,
|
|
104
|
+
:body => post_body,
|
|
105
|
+
:auth_names => auth_names)
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug "API called: URLSigningKeysApi#delete_url_signing_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
108
|
+
end
|
|
109
|
+
return data, status_code, headers
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Retrieve a URL signing key
|
|
113
|
+
# Retrieves the details of a URL signing key that has previously been created. Supply the unique signing key ID that was returned from your previous request, and Mux will return the corresponding signing key information. **The private key is not returned in this response.**
|
|
114
|
+
# @param signing_key_id The ID of the signing key.
|
|
115
|
+
# @param [Hash] opts the optional parameters
|
|
116
|
+
# @return [SigningKeyResponse]
|
|
117
|
+
def get_url_signing_key(signing_key_id, opts = {})
|
|
118
|
+
data, _status_code, _headers = get_url_signing_key_with_http_info(signing_key_id, opts)
|
|
119
|
+
data
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Retrieve a URL signing key
|
|
123
|
+
# Retrieves the details of a URL signing key that has previously been created. Supply the unique signing key ID that was returned from your previous request, and Mux will return the corresponding signing key information. **The private key is not returned in this response.**
|
|
124
|
+
# @param signing_key_id The ID of the signing key.
|
|
125
|
+
# @param [Hash] opts the optional parameters
|
|
126
|
+
# @return [Array<(SigningKeyResponse, Fixnum, Hash)>] SigningKeyResponse data, response status code and response headers
|
|
127
|
+
def get_url_signing_key_with_http_info(signing_key_id, opts = {})
|
|
128
|
+
if @api_client.config.debugging
|
|
129
|
+
@api_client.config.logger.debug 'Calling API: URLSigningKeysApi.get_url_signing_key ...'
|
|
130
|
+
end
|
|
131
|
+
# verify the required parameter 'signing_key_id' is set
|
|
132
|
+
if @api_client.config.client_side_validation && signing_key_id.nil?
|
|
133
|
+
fail ArgumentError, "Missing the required parameter 'signing_key_id' when calling URLSigningKeysApi.get_url_signing_key"
|
|
134
|
+
end
|
|
135
|
+
# resource path
|
|
136
|
+
local_var_path = '/video/v1/signing-keys/{SIGNING_KEY_ID}'.sub('{' + 'SIGNING_KEY_ID' + '}', signing_key_id.to_s)
|
|
137
|
+
|
|
138
|
+
# query parameters
|
|
139
|
+
query_params = {}
|
|
140
|
+
|
|
141
|
+
# header parameters
|
|
142
|
+
header_params = {}
|
|
143
|
+
# HTTP header 'Accept' (if needed)
|
|
144
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
145
|
+
|
|
146
|
+
# form parameters
|
|
147
|
+
form_params = {}
|
|
148
|
+
|
|
149
|
+
# http body (model)
|
|
150
|
+
post_body = nil
|
|
151
|
+
auth_names = ['accessToken']
|
|
152
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
153
|
+
:header_params => header_params,
|
|
154
|
+
:query_params => query_params,
|
|
155
|
+
:form_params => form_params,
|
|
156
|
+
:body => post_body,
|
|
157
|
+
:auth_names => auth_names,
|
|
158
|
+
:return_type => 'SigningKeyResponse')
|
|
159
|
+
if @api_client.config.debugging
|
|
160
|
+
@api_client.config.logger.debug "API called: URLSigningKeysApi#get_url_signing_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
161
|
+
end
|
|
162
|
+
return data, status_code, headers
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# List URL signing keys
|
|
166
|
+
# Returns a list of URL signing keys.
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @option opts [Integer] :limit Number of items to include in the response (default to 25)
|
|
169
|
+
# @option opts [Integer] :page Offset by this many pages, of the size of `limit` (default to 1)
|
|
170
|
+
# @return [ListSigningKeysResponse]
|
|
171
|
+
def list_url_signing_keys(opts = {})
|
|
172
|
+
data, _status_code, _headers = list_url_signing_keys_with_http_info(opts)
|
|
173
|
+
data
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# List URL signing keys
|
|
177
|
+
# Returns a list of URL signing keys.
|
|
178
|
+
# @param [Hash] opts the optional parameters
|
|
179
|
+
# @option opts [Integer] :limit Number of items to include in the response
|
|
180
|
+
# @option opts [Integer] :page Offset by this many pages, of the size of `limit`
|
|
181
|
+
# @return [Array<(ListSigningKeysResponse, Fixnum, Hash)>] ListSigningKeysResponse data, response status code and response headers
|
|
182
|
+
def list_url_signing_keys_with_http_info(opts = {})
|
|
183
|
+
if @api_client.config.debugging
|
|
184
|
+
@api_client.config.logger.debug 'Calling API: URLSigningKeysApi.list_url_signing_keys ...'
|
|
185
|
+
end
|
|
186
|
+
# resource path
|
|
187
|
+
local_var_path = '/video/v1/signing-keys'
|
|
188
|
+
|
|
189
|
+
# query parameters
|
|
190
|
+
query_params = {}
|
|
191
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
192
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
193
|
+
|
|
194
|
+
# header parameters
|
|
195
|
+
header_params = {}
|
|
196
|
+
# HTTP header 'Accept' (if needed)
|
|
197
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
198
|
+
|
|
199
|
+
# form parameters
|
|
200
|
+
form_params = {}
|
|
201
|
+
|
|
202
|
+
# http body (model)
|
|
203
|
+
post_body = nil
|
|
204
|
+
auth_names = ['accessToken']
|
|
205
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
206
|
+
:header_params => header_params,
|
|
207
|
+
:query_params => query_params,
|
|
208
|
+
:form_params => form_params,
|
|
209
|
+
:body => post_body,
|
|
210
|
+
:auth_names => auth_names,
|
|
211
|
+
:return_type => 'ListSigningKeysResponse')
|
|
212
|
+
if @api_client.config.debugging
|
|
213
|
+
@api_client.config.logger.debug "API called: URLSigningKeysApi#list_url_signing_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
214
|
+
end
|
|
215
|
+
return data, status_code, headers
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
219
|
+
end
|