mux_ruby 1.4.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +37 -35
  4. data/README.md +6 -1
  5. data/docs/Asset.md +3 -1
  6. data/docs/AssetNonStandardInputReasons.md +16 -0
  7. data/docs/AssetRecordingTimes.md +9 -0
  8. data/docs/CreateAssetRequest.md +1 -1
  9. data/docs/CreateLiveStreamRequest.md +2 -0
  10. data/docs/CreateUploadRequest.md +1 -0
  11. data/docs/DimensionValue.md +9 -0
  12. data/docs/DimensionsApi.md +118 -0
  13. data/docs/DisableLiveStreamResponse.md +8 -0
  14. data/docs/EnableLiveStreamResponse.md +8 -0
  15. data/docs/FiltersApi.md +2 -2
  16. data/docs/GetRealTimeBreakdownResponse.md +10 -0
  17. data/docs/GetRealTimeHistogramTimeseriesResponse.md +11 -0
  18. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +8 -0
  19. data/docs/GetRealTimeTimeseriesResponse.md +10 -0
  20. data/docs/Incident.md +28 -0
  21. data/docs/IncidentBreakdown.md +10 -0
  22. data/docs/IncidentNotification.md +10 -0
  23. data/docs/IncidentNotificationRule.md +12 -0
  24. data/docs/IncidentResponse.md +9 -0
  25. data/docs/IncidentsApi.md +186 -0
  26. data/docs/ListDimensionValuesResponse.md +10 -0
  27. data/docs/ListDimensionsResponse.md +10 -0
  28. data/docs/ListIncidentsResponse.md +10 -0
  29. data/docs/ListRealTimeDimensionsResponse.md +10 -0
  30. data/docs/ListRealTimeDimensionsResponseData.md +9 -0
  31. data/docs/ListRealTimeMetricsResponse.md +10 -0
  32. data/docs/ListRelatedIncidentsResponse.md +10 -0
  33. data/docs/LiveStream.md +2 -1
  34. data/docs/LiveStreamsApi.md +104 -0
  35. data/docs/NotificationRule.md +10 -0
  36. data/docs/RealTimeApi.md +280 -0
  37. data/docs/RealTimeBreakdownValue.md +12 -0
  38. data/docs/RealTimeHistogramTimeseriesBucket.md +9 -0
  39. data/docs/RealTimeHistogramTimeseriesBucketValues.md +9 -0
  40. data/docs/RealTimeHistogramTimeseriesDatapoint.md +14 -0
  41. data/docs/RealTimeTimeseriesDatapoint.md +10 -0
  42. data/docs/Upload.md +1 -0
  43. data/docs/VideoView.md +16 -14
  44. data/examples/data/exercise-dimensions.rb +29 -0
  45. data/examples/data/exercise-errors.rb +1 -1
  46. data/examples/data/exercise-incidents.rb +29 -0
  47. data/examples/data/exercise-realtime.rb +60 -0
  48. data/examples/video/exercise-live-streams.rb +22 -0
  49. data/lib/mux_ruby.rb +30 -0
  50. data/lib/mux_ruby/api/dimensions_api.rb +128 -0
  51. data/lib/mux_ruby/api/filters_api.rb +4 -4
  52. data/lib/mux_ruby/api/incidents_api.rb +217 -0
  53. data/lib/mux_ruby/api/live_streams_api.rb +106 -0
  54. data/lib/mux_ruby/api/real_time_api.rb +311 -0
  55. data/lib/mux_ruby/api_client.rb +1 -1
  56. data/lib/mux_ruby/configuration.rb +1 -4
  57. data/lib/mux_ruby/models/asset.rb +46 -13
  58. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +335 -0
  59. data/lib/mux_ruby/models/asset_recording_times.rb +195 -0
  60. data/lib/mux_ruby/models/asset_static_renditions_files.rb +4 -4
  61. data/lib/mux_ruby/models/create_asset_request.rb +13 -13
  62. data/lib/mux_ruby/models/create_live_stream_request.rb +24 -4
  63. data/lib/mux_ruby/models/create_upload_request.rb +13 -4
  64. data/lib/mux_ruby/models/dimension_value.rb +193 -0
  65. data/lib/mux_ruby/models/disable_live_stream_response.rb +184 -0
  66. data/lib/mux_ruby/models/enable_live_stream_response.rb +184 -0
  67. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +206 -0
  68. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +215 -0
  69. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +186 -0
  70. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +206 -0
  71. data/lib/mux_ruby/models/incident.rb +370 -0
  72. data/lib/mux_ruby/models/incident_breakdown.rb +202 -0
  73. data/lib/mux_ruby/models/incident_notification.rb +202 -0
  74. data/lib/mux_ruby/models/incident_notification_rule.rb +222 -0
  75. data/lib/mux_ruby/models/incident_response.rb +195 -0
  76. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +46 -0
  77. data/lib/mux_ruby/models/list_dimension_values_response.rb +206 -0
  78. data/lib/mux_ruby/models/list_dimensions_response.rb +204 -0
  79. data/lib/mux_ruby/models/list_incidents_response.rb +206 -0
  80. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +206 -0
  81. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +193 -0
  82. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +206 -0
  83. data/lib/mux_ruby/models/list_related_incidents_response.rb +206 -0
  84. data/lib/mux_ruby/models/live_stream.rb +14 -5
  85. data/lib/mux_ruby/models/notification_rule.rb +202 -0
  86. data/lib/mux_ruby/models/real_time_breakdown_value.rb +220 -0
  87. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +193 -0
  88. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +193 -0
  89. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +240 -0
  90. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +202 -0
  91. data/lib/mux_ruby/models/upload.rb +13 -4
  92. data/lib/mux_ruby/models/video_view.rb +36 -18
  93. data/lib/mux_ruby/version.rb +1 -1
  94. data/spec/api/dimensions_api_spec.rb +55 -0
  95. data/spec/api/filters_api_spec.rb +2 -2
  96. data/spec/api/incidents_api_spec.rb +73 -0
  97. data/spec/api/live_streams_api_spec.rb +24 -0
  98. data/spec/api/real_time_api_spec.rb +93 -0
  99. data/spec/models/asset_non_standard_input_reasons_spec.rb +98 -0
  100. data/spec/models/asset_recording_times_spec.rb +40 -0
  101. data/spec/models/asset_spec.rb +22 -6
  102. data/spec/models/asset_static_renditions_files_spec.rb +2 -2
  103. data/spec/models/create_asset_request_spec.rb +6 -6
  104. data/spec/models/create_live_stream_request_spec.rb +12 -0
  105. data/spec/models/create_upload_request_spec.rb +6 -0
  106. data/spec/models/dimension_value_spec.rb +40 -0
  107. data/spec/models/disable_live_stream_response_spec.rb +34 -0
  108. data/spec/models/enable_live_stream_response_spec.rb +34 -0
  109. data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
  110. data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
  111. data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
  112. data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
  113. data/spec/models/incident_breakdown_spec.rb +46 -0
  114. data/spec/models/incident_notification_rule_spec.rb +58 -0
  115. data/spec/models/incident_notification_spec.rb +46 -0
  116. data/spec/models/incident_response_spec.rb +40 -0
  117. data/spec/models/incident_spec.rb +154 -0
  118. data/spec/models/input_settings_overlay_settings_spec.rb +8 -0
  119. data/spec/models/list_dimension_values_response_spec.rb +46 -0
  120. data/spec/models/list_dimensions_response_spec.rb +46 -0
  121. data/spec/models/list_incidents_response_spec.rb +46 -0
  122. data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
  123. data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
  124. data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
  125. data/spec/models/list_related_incidents_response_spec.rb +46 -0
  126. data/spec/models/live_stream_spec.rb +6 -0
  127. data/spec/models/notification_rule_spec.rb +46 -0
  128. data/spec/models/real_time_breakdown_value_spec.rb +58 -0
  129. data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
  130. data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
  131. data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
  132. data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
  133. data/spec/models/upload_spec.rb +6 -0
  134. data/spec/models/video_view_spec.rb +12 -0
  135. data/test.sh +28 -0
  136. metadata +181 -58
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mux_ruby'
4
+ require 'solid_assert'
5
+
6
+ SolidAssert.enable_assertions
7
+
8
+ # Authentication Setup
9
+ openapi = MuxRuby.configure do |config|
10
+ config.username = ENV['MUX_TOKEN_ID']
11
+ config.password = ENV['MUX_TOKEN_SECRET']
12
+ end
13
+
14
+ # API Client Initialization
15
+ dimensions_api = MuxRuby::DimensionsApi.new
16
+
17
+ # ========== list-dimensions ==========
18
+ dimensions = dimensions_api.list_dimensions()
19
+ assert dimensions != nil
20
+ assert dimensions.data != nil
21
+ assert dimensions.data.basic != nil
22
+ assert dimensions.data.advanced != nil
23
+ puts "list-dimensions OK ✅"
24
+
25
+ # ========== list-dimension-values ==========
26
+ dimension_values = dimensions_api.list_dimension_values("browser", {:timeframe => ['7:days']})
27
+ assert dimension_values != nil
28
+ assert dimension_values.data != nil
29
+ puts "list-dimension-values OK ✅"
@@ -15,7 +15,7 @@ end
15
15
  errors_api = MuxRuby::ErrorsApi.new
16
16
 
17
17
  # ========== list-errors ==========
18
- errors = errors_api.list_errors(:filters => ['browser:Chrome'], :timeframe => ['7:days'])
18
+ errors = errors_api.list_errors(:filters => ['browser:Safari'], :timeframe => ['7:days'])
19
19
  assert errors != nil
20
20
  assert errors.data != nil
21
21
  assert errors.data.length > 0
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mux_ruby'
4
+ require 'solid_assert'
5
+
6
+ SolidAssert.enable_assertions
7
+
8
+ # Authentication Setup
9
+ openapi = MuxRuby.configure do |config|
10
+ config.username = ENV['MUX_TOKEN_ID']
11
+ config.password = ENV['MUX_TOKEN_SECRET']
12
+ end
13
+
14
+ # API Client Initialization
15
+ incidents_api = MuxRuby::IncidentsApi.new
16
+
17
+ # Test coverage here is poor due to not knowning if the account we're testing against has any incidents.
18
+
19
+ # ========== list-incidents ==========
20
+ incidents = incidents_api.list_incidents
21
+ assert incidents != nil
22
+ assert incidents.data != nil
23
+ puts "list-incidents OK ✅"
24
+
25
+ # ========== get-incident ==========
26
+ puts "get-incident SKIP ⚠️"
27
+
28
+ # ========== list-related-incidents ==========
29
+ puts "list-related-incidents SKIP ⚠️"
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mux_ruby'
4
+ require 'solid_assert'
5
+
6
+ SolidAssert.enable_assertions
7
+
8
+ # Authentication Setup
9
+ openapi = MuxRuby.configure do |config|
10
+ config.username = ENV['MUX_TOKEN_ID']
11
+ config.password = ENV['MUX_TOKEN_SECRET']
12
+ end
13
+
14
+ # API Client Initialization
15
+ rt_api = MuxRuby::RealTimeApi.new
16
+
17
+ # Test coverage here isn't fantastic due to not knowning if the account we're testing against has
18
+ # any real-time data. The behaviour has been manually verified against real-world data.
19
+
20
+ # ========== list-realtime-dimensions ==========
21
+ dimensions = rt_api.list_realtime_dimensions
22
+ assert dimensions != nil
23
+ assert dimensions.data != nil
24
+ assert dimensions.data.length > 0
25
+ assert dimensions.data.first.name != ''
26
+ assert dimensions.data.first.display_name != ''
27
+ puts "list-realtime-dimensions OK ✅"
28
+
29
+ # ========== list-realtime-metrics ==========
30
+ metrics = rt_api.list_realtime_metrics
31
+ assert metrics != nil
32
+ assert metrics.data != nil
33
+ assert metrics.data.length > 0
34
+ assert metrics.data.first.name != ''
35
+ assert metrics.data.first.display_name != ''
36
+ puts "list-realtime-metrics OK ✅"
37
+
38
+ # ========== get-realtime-breakdown ==========
39
+ breakdown = rt_api.get_realtime_breakdown('current-rebuffering-percentage', {:dimension => 'asn'})
40
+ assert breakdown != nil
41
+ assert breakdown.data != nil
42
+ puts "get-realtime-breakdown OK ✅"
43
+
44
+ # ========== get-realtime-histogram-timeseries ==========
45
+ histogram_timeseries = rt_api.get_realtime_histogram_timeseries('video-startup-time')
46
+ assert histogram_timeseries != nil
47
+ assert histogram_timeseries.meta != nil
48
+ assert histogram_timeseries.meta.buckets != nil
49
+ assert histogram_timeseries.meta.buckets.length > 0
50
+ assert histogram_timeseries.data != nil
51
+ assert histogram_timeseries.data.length > 0
52
+ puts "get-realtime-histogram-timeseries OK ✅"
53
+
54
+ # ========== get-realtime-timeseries ==========
55
+ timeseries = rt_api.get_realtime_timeseries('current-rebuffering-percentage')
56
+ assert timeseries != nil
57
+ assert timeseries.data != nil
58
+ assert timeseries.data.length > 0
59
+ assert timeseries.data.first.date != ''
60
+ puts "get-realtime-timeseries OK ✅"
@@ -104,6 +104,28 @@ rescue MuxRuby::ApiError => e
104
104
  end
105
105
  puts "signal-live-stream-complete OK ✅"
106
106
 
107
+ # ========== disable-live-stream ==========
108
+ begin
109
+ live_api.disable_live_stream(stream.data.id)
110
+ disabled_live_stream = live_api.get_live_stream(stream.data.id)
111
+ assert disabled_live_stream.data.status == 'disabled'
112
+ rescue MuxRuby::ApiError => e
113
+ puts "Should not have errored when disabling stream"
114
+ exit 1
115
+ end
116
+ puts "disable-live-stream OK ✅"
117
+
118
+ # ========== enable-live-stream ==========
119
+ begin
120
+ live_api.enable_live_stream(stream.data.id)
121
+ enabled_live_stream = live_api.get_live_stream(stream.data.id)
122
+ assert enabled_live_stream.data.status == 'idle'
123
+ rescue MuxRuby::ApiError => e
124
+ puts "Should not have errored when enabling stream"
125
+ exit 1
126
+ end
127
+ puts "enable-live-stream OK ✅"
128
+
107
129
  # ========== delete-live-stream ==========
108
130
  live_api.delete_live_stream(stream.data.id)
109
131
  begin
@@ -14,6 +14,8 @@ require 'mux_ruby/models/abridged_video_view'
14
14
  require 'mux_ruby/models/asset'
15
15
  require 'mux_ruby/models/asset_errors'
16
16
  require 'mux_ruby/models/asset_master'
17
+ require 'mux_ruby/models/asset_non_standard_input_reasons'
18
+ require 'mux_ruby/models/asset_recording_times'
17
19
  require 'mux_ruby/models/asset_response'
18
20
  require 'mux_ruby/models/asset_static_renditions'
19
21
  require 'mux_ruby/models/asset_static_renditions_files'
@@ -27,12 +29,24 @@ require 'mux_ruby/models/create_track_request'
27
29
  require 'mux_ruby/models/create_track_response'
28
30
  require 'mux_ruby/models/create_upload_request'
29
31
  require 'mux_ruby/models/delivery_report'
32
+ require 'mux_ruby/models/dimension_value'
33
+ require 'mux_ruby/models/disable_live_stream_response'
34
+ require 'mux_ruby/models/enable_live_stream_response'
30
35
  require 'mux_ruby/models/error'
31
36
  require 'mux_ruby/models/filter_value'
32
37
  require 'mux_ruby/models/get_asset_input_info_response'
33
38
  require 'mux_ruby/models/get_asset_playback_id_response'
34
39
  require 'mux_ruby/models/get_metric_timeseries_data_response'
35
40
  require 'mux_ruby/models/get_overall_values_response'
41
+ require 'mux_ruby/models/get_real_time_breakdown_response'
42
+ require 'mux_ruby/models/get_real_time_histogram_timeseries_response'
43
+ require 'mux_ruby/models/get_real_time_histogram_timeseries_response_meta'
44
+ require 'mux_ruby/models/get_real_time_timeseries_response'
45
+ require 'mux_ruby/models/incident'
46
+ require 'mux_ruby/models/incident_breakdown'
47
+ require 'mux_ruby/models/incident_notification'
48
+ require 'mux_ruby/models/incident_notification_rule'
49
+ require 'mux_ruby/models/incident_response'
36
50
  require 'mux_ruby/models/input_file'
37
51
  require 'mux_ruby/models/input_info'
38
52
  require 'mux_ruby/models/input_settings'
@@ -43,22 +57,35 @@ require 'mux_ruby/models/list_all_metric_values_response'
43
57
  require 'mux_ruby/models/list_assets_response'
44
58
  require 'mux_ruby/models/list_breakdown_values_response'
45
59
  require 'mux_ruby/models/list_delivery_usage_response'
60
+ require 'mux_ruby/models/list_dimension_values_response'
61
+ require 'mux_ruby/models/list_dimensions_response'
46
62
  require 'mux_ruby/models/list_errors_response'
47
63
  require 'mux_ruby/models/list_exports_response'
48
64
  require 'mux_ruby/models/list_filter_values_response'
49
65
  require 'mux_ruby/models/list_filters_response'
50
66
  require 'mux_ruby/models/list_filters_response_data'
67
+ require 'mux_ruby/models/list_incidents_response'
51
68
  require 'mux_ruby/models/list_insights_response'
52
69
  require 'mux_ruby/models/list_live_streams_response'
70
+ require 'mux_ruby/models/list_real_time_dimensions_response'
71
+ require 'mux_ruby/models/list_real_time_dimensions_response_data'
72
+ require 'mux_ruby/models/list_real_time_metrics_response'
73
+ require 'mux_ruby/models/list_related_incidents_response'
53
74
  require 'mux_ruby/models/list_signing_keys_response'
54
75
  require 'mux_ruby/models/list_uploads_response'
55
76
  require 'mux_ruby/models/list_video_views_response'
56
77
  require 'mux_ruby/models/live_stream'
57
78
  require 'mux_ruby/models/live_stream_response'
58
79
  require 'mux_ruby/models/metric'
80
+ require 'mux_ruby/models/notification_rule'
59
81
  require 'mux_ruby/models/overall_values'
60
82
  require 'mux_ruby/models/playback_id'
61
83
  require 'mux_ruby/models/playback_policy'
84
+ require 'mux_ruby/models/real_time_breakdown_value'
85
+ require 'mux_ruby/models/real_time_histogram_timeseries_bucket'
86
+ require 'mux_ruby/models/real_time_histogram_timeseries_bucket_values'
87
+ require 'mux_ruby/models/real_time_histogram_timeseries_datapoint'
88
+ require 'mux_ruby/models/real_time_timeseries_datapoint'
62
89
  require 'mux_ruby/models/score'
63
90
  require 'mux_ruby/models/signal_live_stream_complete_response'
64
91
  require 'mux_ruby/models/signing_key'
@@ -78,12 +105,15 @@ require 'mux_ruby/models/video_view_response'
78
105
  # APIs
79
106
  require 'mux_ruby/api/assets_api'
80
107
  require 'mux_ruby/api/delivery_usage_api'
108
+ require 'mux_ruby/api/dimensions_api'
81
109
  require 'mux_ruby/api/direct_uploads_api'
82
110
  require 'mux_ruby/api/errors_api'
83
111
  require 'mux_ruby/api/exports_api'
84
112
  require 'mux_ruby/api/filters_api'
113
+ require 'mux_ruby/api/incidents_api'
85
114
  require 'mux_ruby/api/live_streams_api'
86
115
  require 'mux_ruby/api/metrics_api'
116
+ require 'mux_ruby/api/real_time_api'
87
117
  require 'mux_ruby/api/url_signing_keys_api'
88
118
  require 'mux_ruby/api/video_views_api'
89
119
 
@@ -0,0 +1,128 @@
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 DimensionsApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+ # Lists the values for a specific dimension
16
+ # Lists the values for a dimension along with a total count of related views. Note: This API replaces the list-filter-values API call.
17
+ # @param dimension_id ID of the Dimension
18
+ # @param [Hash] opts the optional parameters
19
+ # @option opts [Integer] :limit Number of items to include in the response (default to 25)
20
+ # @option opts [Integer] :page Offset by this many pages, of the size of `limit` (default to 1)
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 [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]&#x3D;). Accepted formats are... * array of epoch timestamps e.g. timeframe[]&#x3D;1498867200&amp;timeframe[]&#x3D;1498953600 * duration string e.g. timeframe[]&#x3D;24:hours or timeframe[]&#x3D;7:days.
23
+ # @return [ListDimensionValuesResponse]
24
+ def list_dimension_values(dimension_id, opts = {})
25
+ data, _status_code, _headers = list_dimension_values_with_http_info(dimension_id, opts)
26
+ data
27
+ end
28
+
29
+ # Lists the values for a specific dimension
30
+ # Lists the values for a dimension along with a total count of related views. Note: This API replaces the list-filter-values API call.
31
+ # @param dimension_id ID of the Dimension
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [Integer] :limit Number of items to include in the response
34
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60;
35
+ # @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.
36
+ # @option opts [Array<String>] :timeframe Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]&#x3D;). Accepted formats are... * array of epoch timestamps e.g. timeframe[]&#x3D;1498867200&amp;timeframe[]&#x3D;1498953600 * duration string e.g. timeframe[]&#x3D;24:hours or timeframe[]&#x3D;7:days.
37
+ # @return [Array<(ListDimensionValuesResponse, Fixnum, Hash)>] ListDimensionValuesResponse data, response status code and response headers
38
+ def list_dimension_values_with_http_info(dimension_id, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug 'Calling API: DimensionsApi.list_dimension_values ...'
41
+ end
42
+ # verify the required parameter 'dimension_id' is set
43
+ if @api_client.config.client_side_validation && dimension_id.nil?
44
+ fail ArgumentError, "Missing the required parameter 'dimension_id' when calling DimensionsApi.list_dimension_values"
45
+ end
46
+ # resource path
47
+ local_var_path = '/data/v1/dimensions/{DIMENSION_ID}'.sub('{' + 'DIMENSION_ID' + '}', dimension_id.to_s)
48
+
49
+ # query parameters
50
+ query_params = {}
51
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
52
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
53
+ query_params[:'filters[]'] = @api_client.build_collection_param(opts[:'filters'], :multi) if !opts[:'filters'].nil?
54
+ query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
55
+
56
+ # header parameters
57
+ header_params = {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
60
+
61
+ # form parameters
62
+ form_params = {}
63
+
64
+ # http body (model)
65
+ post_body = nil
66
+ auth_names = ['accessToken']
67
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => 'ListDimensionValuesResponse')
74
+ if @api_client.config.debugging
75
+ @api_client.config.logger.debug "API called: DimensionsApi#list_dimension_values\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
76
+ end
77
+ return data, status_code, headers
78
+ end
79
+
80
+ # List Dimensions
81
+ # List all available dimensions. Note: This API replaces the list-filters API call.
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [ListDimensionsResponse]
84
+ def list_dimensions(opts = {})
85
+ data, _status_code, _headers = list_dimensions_with_http_info(opts)
86
+ data
87
+ end
88
+
89
+ # List Dimensions
90
+ # List all available dimensions. Note: This API replaces the list-filters API call.
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [Array<(ListDimensionsResponse, Fixnum, Hash)>] ListDimensionsResponse data, response status code and response headers
93
+ def list_dimensions_with_http_info(opts = {})
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug 'Calling API: DimensionsApi.list_dimensions ...'
96
+ end
97
+ # resource path
98
+ local_var_path = '/data/v1/dimensions'
99
+
100
+ # query parameters
101
+ query_params = {}
102
+
103
+ # header parameters
104
+ header_params = {}
105
+ # HTTP header 'Accept' (if needed)
106
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
107
+
108
+ # form parameters
109
+ form_params = {}
110
+
111
+ # http body (model)
112
+ post_body = nil
113
+ auth_names = ['accessToken']
114
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
115
+ :header_params => header_params,
116
+ :query_params => query_params,
117
+ :form_params => form_params,
118
+ :body => post_body,
119
+ :auth_names => auth_names,
120
+ :return_type => 'ListDimensionsResponse')
121
+ if @api_client.config.debugging
122
+ @api_client.config.logger.debug "API called: DimensionsApi#list_dimensions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
123
+ end
124
+ return data, status_code, headers
125
+ end
126
+
127
+ end
128
+ end
@@ -13,7 +13,7 @@ module MuxRuby
13
13
  @api_client = api_client
14
14
  end
15
15
  # Lists values for a specific filter
16
- # Lists the values for a filter along with a total count of related views
16
+ # Deprecated: The API has been replaced by the list-dimension-values API call. Lists the values for a filter along with a total count of related views.
17
17
  # @param filter_id ID of the Filter
18
18
  # @param [Hash] opts the optional parameters
19
19
  # @option opts [Integer] :limit Number of items to include in the response (default to 25)
@@ -27,7 +27,7 @@ module MuxRuby
27
27
  end
28
28
 
29
29
  # Lists values for a specific filter
30
- # Lists the values for a filter along with a total count of related views
30
+ # Deprecated: The API has been replaced by the list-dimension-values API call. Lists the values for a filter along with a total count of related views.
31
31
  # @param filter_id ID of the Filter
32
32
  # @param [Hash] opts the optional parameters
33
33
  # @option opts [Integer] :limit Number of items to include in the response
@@ -78,7 +78,7 @@ module MuxRuby
78
78
  end
79
79
 
80
80
  # List Filters
81
- # Lists all the filters broken out into basic and advanced
81
+ # Deprecated: The API has been replaced by the list-dimensions API call. Lists all the filters broken out into basic and advanced.
82
82
  # @param [Hash] opts the optional parameters
83
83
  # @return [ListFiltersResponse]
84
84
  def list_filters(opts = {})
@@ -87,7 +87,7 @@ module MuxRuby
87
87
  end
88
88
 
89
89
  # List Filters
90
- # Lists all the filters broken out into basic and advanced
90
+ # Deprecated: The API has been replaced by the list-dimensions API call. Lists all the filters broken out into basic and advanced.
91
91
  # @param [Hash] opts the optional parameters
92
92
  # @return [Array<(ListFiltersResponse, Fixnum, Hash)>] ListFiltersResponse data, response status code and response headers
93
93
  def list_filters_with_http_info(opts = {})
@@ -0,0 +1,217 @@
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 IncidentsApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+ # Get an Incident
16
+ # Returns the details of an incident
17
+ # @param incident_id ID of the Incident
18
+ # @param [Hash] opts the optional parameters
19
+ # @return [IncidentResponse]
20
+ def get_incident(incident_id, opts = {})
21
+ data, _status_code, _headers = get_incident_with_http_info(incident_id, opts)
22
+ data
23
+ end
24
+
25
+ # Get an Incident
26
+ # Returns the details of an incident
27
+ # @param incident_id ID of the Incident
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [Array<(IncidentResponse, Fixnum, Hash)>] IncidentResponse data, response status code and response headers
30
+ def get_incident_with_http_info(incident_id, opts = {})
31
+ if @api_client.config.debugging
32
+ @api_client.config.logger.debug 'Calling API: IncidentsApi.get_incident ...'
33
+ end
34
+ # verify the required parameter 'incident_id' is set
35
+ if @api_client.config.client_side_validation && incident_id.nil?
36
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsApi.get_incident"
37
+ end
38
+ # resource path
39
+ local_var_path = '/data/v1/incidents/{INCIDENT_ID}'.sub('{' + 'INCIDENT_ID' + '}', incident_id.to_s)
40
+
41
+ # query parameters
42
+ query_params = {}
43
+
44
+ # header parameters
45
+ header_params = {}
46
+ # HTTP header 'Accept' (if needed)
47
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
48
+
49
+ # form parameters
50
+ form_params = {}
51
+
52
+ # http body (model)
53
+ post_body = nil
54
+ auth_names = ['accessToken']
55
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
56
+ :header_params => header_params,
57
+ :query_params => query_params,
58
+ :form_params => form_params,
59
+ :body => post_body,
60
+ :auth_names => auth_names,
61
+ :return_type => 'IncidentResponse')
62
+ if @api_client.config.debugging
63
+ @api_client.config.logger.debug "API called: IncidentsApi#get_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
64
+ end
65
+ return data, status_code, headers
66
+ end
67
+
68
+ # List Incidents
69
+ # Returns a list of incidents
70
+ # @param [Hash] opts the optional parameters
71
+ # @option opts [Integer] :limit Number of items to include in the response (default to 25)
72
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60; (default to 1)
73
+ # @option opts [String] :order_by Value to order the results by
74
+ # @option opts [String] :order_direction Sort order.
75
+ # @option opts [String] :status Status to filter incidents by
76
+ # @option opts [String] :severity Severity to filter incidents by
77
+ # @return [ListIncidentsResponse]
78
+ def list_incidents(opts = {})
79
+ data, _status_code, _headers = list_incidents_with_http_info(opts)
80
+ data
81
+ end
82
+
83
+ # List Incidents
84
+ # Returns a list of incidents
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [Integer] :limit Number of items to include in the response
87
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60;
88
+ # @option opts [String] :order_by Value to order the results by
89
+ # @option opts [String] :order_direction Sort order.
90
+ # @option opts [String] :status Status to filter incidents by
91
+ # @option opts [String] :severity Severity to filter incidents by
92
+ # @return [Array<(ListIncidentsResponse, Fixnum, Hash)>] ListIncidentsResponse data, response status code and response headers
93
+ def list_incidents_with_http_info(opts = {})
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug 'Calling API: IncidentsApi.list_incidents ...'
96
+ end
97
+ if @api_client.config.client_side_validation && opts[:'order_by'] && !['negative_impact', 'value', 'views', 'field'].include?(opts[:'order_by'])
98
+ fail ArgumentError, 'invalid value for "order_by", must be one of negative_impact, value, views, field'
99
+ end
100
+ if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
101
+ fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
102
+ end
103
+ if @api_client.config.client_side_validation && opts[:'status'] && !['open', 'closed', 'expired'].include?(opts[:'status'])
104
+ fail ArgumentError, 'invalid value for "status", must be one of open, closed, expired'
105
+ end
106
+ if @api_client.config.client_side_validation && opts[:'severity'] && !['warning', 'alert'].include?(opts[:'severity'])
107
+ fail ArgumentError, 'invalid value for "severity", must be one of warning, alert'
108
+ end
109
+ # resource path
110
+ local_var_path = '/data/v1/incidents'
111
+
112
+ # query parameters
113
+ query_params = {}
114
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
115
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
116
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
117
+ query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].nil?
118
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
119
+ query_params[:'severity'] = opts[:'severity'] if !opts[:'severity'].nil?
120
+
121
+ # header parameters
122
+ header_params = {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
125
+
126
+ # form parameters
127
+ form_params = {}
128
+
129
+ # http body (model)
130
+ post_body = nil
131
+ auth_names = ['accessToken']
132
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => 'ListIncidentsResponse')
139
+ if @api_client.config.debugging
140
+ @api_client.config.logger.debug "API called: IncidentsApi#list_incidents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
141
+ end
142
+ return data, status_code, headers
143
+ end
144
+
145
+ # List Related Incidents
146
+ # Returns all the incidents that seem related to a specific incident
147
+ # @param incident_id ID of the Incident
148
+ # @param [Hash] opts the optional parameters
149
+ # @option opts [Integer] :limit Number of items to include in the response (default to 25)
150
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60; (default to 1)
151
+ # @option opts [String] :order_by Value to order the results by
152
+ # @option opts [String] :order_direction Sort order.
153
+ # @return [ListRelatedIncidentsResponse]
154
+ def list_related_incidents(incident_id, opts = {})
155
+ data, _status_code, _headers = list_related_incidents_with_http_info(incident_id, opts)
156
+ data
157
+ end
158
+
159
+ # List Related Incidents
160
+ # Returns all the incidents that seem related to a specific incident
161
+ # @param incident_id ID of the Incident
162
+ # @param [Hash] opts the optional parameters
163
+ # @option opts [Integer] :limit Number of items to include in the response
164
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60;
165
+ # @option opts [String] :order_by Value to order the results by
166
+ # @option opts [String] :order_direction Sort order.
167
+ # @return [Array<(ListRelatedIncidentsResponse, Fixnum, Hash)>] ListRelatedIncidentsResponse data, response status code and response headers
168
+ def list_related_incidents_with_http_info(incident_id, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: IncidentsApi.list_related_incidents ...'
171
+ end
172
+ # verify the required parameter 'incident_id' is set
173
+ if @api_client.config.client_side_validation && incident_id.nil?
174
+ fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsApi.list_related_incidents"
175
+ end
176
+ if @api_client.config.client_side_validation && opts[:'order_by'] && !['negative_impact', 'value', 'views', 'field'].include?(opts[:'order_by'])
177
+ fail ArgumentError, 'invalid value for "order_by", must be one of negative_impact, value, views, field'
178
+ end
179
+ if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
180
+ fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
181
+ end
182
+ # resource path
183
+ local_var_path = '/data/v1/incidents/{INCIDENT_ID}/related'.sub('{' + 'INCIDENT_ID' + '}', incident_id.to_s)
184
+
185
+ # query parameters
186
+ query_params = {}
187
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
188
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
189
+ query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
190
+ query_params[:'order_direction'] = opts[:'order_direction'] if !opts[:'order_direction'].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 => 'ListRelatedIncidentsResponse')
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: IncidentsApi#list_related_incidents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ end
217
+ end