Class: CloudsmithApi::MetricsApi
- Inherits:
-
Object
- Object
- CloudsmithApi::MetricsApi
- Defined in:
- lib/cloudsmith-api/api/metrics_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ MetricsApi
constructor
A new instance of MetricsApi.
-
#metrics_entitlements_usage_list(owner, repo, opts = {}) ⇒ Array<EntitlmentTokenMetric>
View for listing entitlement token usage as a metric.
-
#metrics_entitlements_usage_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(Array<EntitlmentTokenMetric>, Fixnum, Hash)>
View for listing entitlement token usage as a metric.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ MetricsApi
Returns a new instance of MetricsApi.
19 20 21 |
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#metrics_entitlements_usage_list(owner, repo, opts = {}) ⇒ Array<EntitlmentTokenMetric>
View for listing entitlement token usage as a metric. View for listing entitlement token usage as a metric.
34 35 36 37 |
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 34 def metrics_entitlements_usage_list(owner, repo, opts = {}) data, _status_code, _headers = metrics_entitlements_usage_list_with_http_info(owner, repo, opts) return data end |
#metrics_entitlements_usage_list_with_http_info(owner, repo, opts = {}) ⇒ Array<(Array<EntitlmentTokenMetric>, Fixnum, Hash)>
View for listing entitlement token usage as a metric. View for listing entitlement token usage as a metric.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/cloudsmith-api/api/metrics_api.rb', line 50 def metrics_entitlements_usage_list_with_http_info(owner, repo, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: MetricsApi.metrics_entitlements_usage_list ..." end # verify the required parameter 'owner' is set if @api_client.config.client_side_validation && owner.nil? fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_entitlements_usage_list" end # verify the required parameter 'repo' is set if @api_client.config.client_side_validation && repo.nil? fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_entitlements_usage_list" end # resource path local_var_path = "/metrics/{owner}/{repo}/entitlements/usage/".sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s) # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'finish'] = opts[:'finish'] if !opts[:'finish'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'tokens'] = opts[:'tokens'] if !opts[:'tokens'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['apikey', 'csrf_token'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Array<EntitlmentTokenMetric>') if @api_client.config.debugging @api_client.config.logger.debug "API called: MetricsApi#metrics_entitlements_usage_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |