cloudsmith-api 0.52.0 → 0.53.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +16 -4
  4. data/build.json +1 -1
  5. data/docs/EntitlementTokenMetric.md +9 -0
  6. data/docs/MetricsApi.md +158 -0
  7. data/docs/MetricsownerrepopackagesusageActivePackages.md +10 -0
  8. data/docs/PackageUsageMetric.md +11 -0
  9. data/docs/PackagesCopy.md +1 -0
  10. data/docs/Quota.md +8 -0
  11. data/docs/QuotaApi.md +272 -0
  12. data/docs/QuotaHistory.md +8 -0
  13. data/docs/QuotaownerhistoryHistory.md +13 -0
  14. data/docs/RepositoryToken.md +3 -0
  15. data/docs/RepositoryTokenRefresh.md +3 -0
  16. data/docs/RepositoryTokenSyncTokens.md +3 -0
  17. data/lib/cloudsmith-api.rb +8 -0
  18. data/lib/cloudsmith-api/api/metrics_api.rb +167 -0
  19. data/lib/cloudsmith-api/api/quota_api.rb +251 -0
  20. data/lib/cloudsmith-api/models/entitlement_token_metric.rb +209 -0
  21. data/lib/cloudsmith-api/models/metricsownerrepopackagesusage_active_packages.rb +209 -0
  22. data/lib/cloudsmith-api/models/package_usage_metric.rb +243 -0
  23. data/lib/cloudsmith-api/models/packages_copy.rb +14 -4
  24. data/lib/cloudsmith-api/models/quota.rb +194 -0
  25. data/lib/cloudsmith-api/models/quota_history.rb +196 -0
  26. data/lib/cloudsmith-api/models/quotaownerhistory_history.rb +239 -0
  27. data/lib/cloudsmith-api/models/repository_token.rb +31 -1
  28. data/lib/cloudsmith-api/models/repository_token_refresh.rb +31 -1
  29. data/lib/cloudsmith-api/models/repository_token_sync_tokens.rb +31 -1
  30. data/lib/cloudsmith-api/version.rb +1 -1
  31. data/spec/api/metrics_api_spec.rb +71 -0
  32. data/spec/api/quota_api_spec.rb +91 -0
  33. data/spec/models/entitlement_token_metric_spec.rb +48 -0
  34. data/spec/models/metricsownerrepopackagesusage_active_packages_spec.rb +54 -0
  35. data/spec/models/package_usage_metric_spec.rb +60 -0
  36. data/spec/models/packages_copy_spec.rb +6 -0
  37. data/spec/models/quota_history_spec.rb +42 -0
  38. data/spec/models/quota_spec.rb +42 -0
  39. data/spec/models/quotaownerhistory_history_spec.rb +72 -0
  40. data/spec/models/repository_token_refresh_spec.rb +18 -0
  41. data/spec/models/repository_token_spec.rb +18 -0
  42. data/spec/models/repository_token_sync_tokens_spec.rb +18 -0
  43. data/vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.6.gem +0 -0
  44. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.2.17/gem_make.out +1 -1
  45. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out +2 -2
  46. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.1/gem_make.out +1 -1
  47. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/ext/ffi_c/Makefile +3 -3
  48. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.github/FUNDING.yml +0 -0
  49. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.github/workflows/tests.yml +1 -1
  50. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.gitignore +0 -0
  51. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.rubocop.yml +0 -0
  52. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.rubocop_opinionated.yml +1 -18
  53. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.travis.yml +1 -1
  54. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.yardopts +0 -0
  55. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/2.0-Upgrade.md +0 -0
  56. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/CHANGELOG.md +7 -0
  57. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/Gemfile +1 -1
  58. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/LICENSE.txt +0 -0
  59. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/README.md +0 -0
  60. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/Rakefile +0 -0
  61. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/SECURITY.md +0 -0
  62. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/bin/console +0 -0
  63. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/codecov.yml +0 -2
  64. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/data/list.txt +312 -78
  65. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix.rb +0 -0
  66. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/domain.rb +0 -0
  67. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/errors.rb +0 -0
  68. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/list.rb +0 -0
  69. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/rule.rb +0 -0
  70. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix/version.rb +1 -1
  71. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/public_suffix.gemspec +0 -0
  72. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/.empty +0 -0
  73. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/acceptance_test.rb +2 -0
  74. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_find.rb +0 -0
  75. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_find_all.rb +0 -0
  76. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_names.rb +0 -0
  77. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_select.rb +0 -0
  78. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_select_incremental.rb +0 -0
  79. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/benchmarks/bm_valid.rb +0 -0
  80. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/domain_profiler.rb +0 -0
  81. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/find_profiler.rb +0 -0
  82. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/find_profiler_jp.rb +0 -0
  83. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/initialization_profiler.rb +0 -0
  84. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/list_profsize.rb +0 -0
  85. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/profilers/object_binsize.rb +0 -0
  86. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/psl_test.rb +1 -1
  87. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/test_helper.rb +0 -0
  88. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/tests.txt +0 -0
  89. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/domain_test.rb +0 -0
  90. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/errors_test.rb +0 -0
  91. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/list_test.rb +0 -0
  92. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/public_suffix_test.rb +0 -0
  93. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/unit/rule_test.rb +0 -0
  94. data/vendor/bundle/ruby/2.6.0/specifications/{public_suffix-4.0.5.gemspec → public_suffix-4.0.6.gemspec} +4 -4
  95. data/vendor/bundle/ruby/2.6.0/specifications/sys-uname-1.2.1.gemspec +1 -1
  96. metadata +166 -134
  97. data/vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.5.gem +0 -0
@@ -0,0 +1,8 @@
1
+ # CloudsmithApi::QuotaHistory
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **history** | [**Array<QuotaownerhistoryHistory>**](QuotaownerhistoryHistory.md) | |
7
+
8
+
@@ -0,0 +1,13 @@
1
+ # CloudsmithApi::QuotaownerhistoryHistory
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **days** | **Integer** | | [optional]
7
+ **display** | **Object** | | [optional]
8
+ **_end** | **String** | | [optional]
9
+ **plan** | **String** | | [optional]
10
+ **raw** | **Object** | | [optional]
11
+ **start** | **String** | | [optional]
12
+
13
+
@@ -3,10 +3,12 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **clients** | **Integer** | | [optional]
6
7
  **created_at** | **String** | The datetime the token was updated at. | [optional]
7
8
  **created_by** | **String** | | [optional]
8
9
  **created_by_url** | **String** | | [optional]
9
10
  **default** | **BOOLEAN** | If selected this is the default token for this repository. | [optional]
11
+ **downloads** | **Integer** | | [optional]
10
12
  **has_limits** | **BOOLEAN** | | [optional]
11
13
  **identifier** | **Integer** | | [optional]
12
14
  **is_active** | **BOOLEAN** | If enabled, the token will allow downloads based on configured restrictions (if any). | [optional]
@@ -26,6 +28,7 @@ Name | Type | Description | Notes
26
28
  **updated_at** | **String** | The datetime the token was updated at. | [optional]
27
29
  **updated_by** | **String** | | [optional]
28
30
  **updated_by_url** | **String** | | [optional]
31
+ **usage** | **String** | | [optional]
29
32
  **user** | **String** | | [optional]
30
33
  **user_url** | **String** | | [optional]
31
34
 
@@ -3,10 +3,12 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **clients** | **Integer** | | [optional]
6
7
  **created_at** | **String** | The datetime the token was updated at. | [optional]
7
8
  **created_by** | **String** | | [optional]
8
9
  **created_by_url** | **String** | | [optional]
9
10
  **default** | **BOOLEAN** | If selected this is the default token for this repository. | [optional]
11
+ **downloads** | **Integer** | | [optional]
10
12
  **has_limits** | **BOOLEAN** | | [optional]
11
13
  **identifier** | **Integer** | | [optional]
12
14
  **is_active** | **BOOLEAN** | If enabled, the token will allow downloads based on configured restrictions (if any). | [optional]
@@ -26,6 +28,7 @@ Name | Type | Description | Notes
26
28
  **updated_at** | **String** | The datetime the token was updated at. | [optional]
27
29
  **updated_by** | **String** | | [optional]
28
30
  **updated_by_url** | **String** | | [optional]
31
+ **usage** | **String** | | [optional]
29
32
  **user** | **String** | | [optional]
30
33
  **user_url** | **String** | | [optional]
31
34
 
@@ -3,10 +3,12 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **clients** | **Integer** | | [optional]
6
7
  **created_at** | **String** | The datetime the token was updated at. | [optional]
7
8
  **created_by** | **String** | | [optional]
8
9
  **created_by_url** | **String** | | [optional]
9
10
  **default** | **BOOLEAN** | If selected this is the default token for this repository. | [optional]
11
+ **downloads** | **Integer** | | [optional]
10
12
  **has_limits** | **BOOLEAN** | | [optional]
11
13
  **identifier** | **Integer** | | [optional]
12
14
  **is_active** | **BOOLEAN** | If enabled, the token will allow downloads based on configured restrictions (if any). | [optional]
@@ -26,6 +28,7 @@ Name | Type | Description | Notes
26
28
  **updated_at** | **String** | The datetime the token was updated at. | [optional]
27
29
  **updated_by** | **String** | | [optional]
28
30
  **updated_by_url** | **String** | | [optional]
31
+ **usage** | **String** | | [optional]
29
32
  **user** | **String** | | [optional]
30
33
  **user_url** | **String** | | [optional]
31
34
 
@@ -21,6 +21,7 @@ require 'cloudsmith-api/models/alpine_package_upload'
21
21
  require 'cloudsmith-api/models/conan_package_upload'
22
22
  require 'cloudsmith-api/models/distribution'
23
23
  require 'cloudsmith-api/models/distros_versions'
24
+ require 'cloudsmith-api/models/entitlement_token_metric'
24
25
  require 'cloudsmith-api/models/entitlements_create'
25
26
  require 'cloudsmith-api/models/entitlements_partial_update'
26
27
  require 'cloudsmith-api/models/entitlements_refresh'
@@ -32,6 +33,7 @@ require 'cloudsmith-api/models/files_validate'
32
33
  require 'cloudsmith-api/models/format'
33
34
  require 'cloudsmith-api/models/formats_distributions'
34
35
  require 'cloudsmith-api/models/maven_package_upload'
36
+ require 'cloudsmith-api/models/metricsownerrepopackagesusage_active_packages'
35
37
  require 'cloudsmith-api/models/namespace'
36
38
  require 'cloudsmith-api/models/organization'
37
39
  require 'cloudsmith-api/models/package'
@@ -40,6 +42,7 @@ require 'cloudsmith-api/models/package_file_parts_upload'
40
42
  require 'cloudsmith-api/models/package_file_upload'
41
43
  require 'cloudsmith-api/models/package_move'
42
44
  require 'cloudsmith-api/models/package_status'
45
+ require 'cloudsmith-api/models/package_usage_metric'
43
46
  require 'cloudsmith-api/models/packages_copy'
44
47
  require 'cloudsmith-api/models/packages_move'
45
48
  require 'cloudsmith-api/models/packages_tag'
@@ -87,6 +90,9 @@ require 'cloudsmith-api/models/packages_validateupload_terraform'
87
90
  require 'cloudsmith-api/models/packages_validateupload_vagrant'
88
91
  require 'cloudsmith-api/models/packagesownerrepo_architectures'
89
92
  require 'cloudsmith-api/models/packagesownerrepo_files'
93
+ require 'cloudsmith-api/models/quota'
94
+ require 'cloudsmith-api/models/quota_history'
95
+ require 'cloudsmith-api/models/quotaownerhistory_history'
90
96
  require 'cloudsmith-api/models/raw_package_upload'
91
97
  require 'cloudsmith-api/models/repos_create'
92
98
  require 'cloudsmith-api/models/repos_gpg_keys'
@@ -116,9 +122,11 @@ require 'cloudsmith-api/api/distros_api'
116
122
  require 'cloudsmith-api/api/entitlements_api'
117
123
  require 'cloudsmith-api/api/files_api'
118
124
  require 'cloudsmith-api/api/formats_api'
125
+ require 'cloudsmith-api/api/metrics_api'
119
126
  require 'cloudsmith-api/api/namespaces_api'
120
127
  require 'cloudsmith-api/api/orgs_api'
121
128
  require 'cloudsmith-api/api/packages_api'
129
+ require 'cloudsmith-api/api/quota_api'
122
130
  require 'cloudsmith-api/api/rates_api'
123
131
  require 'cloudsmith-api/api/repos_api'
124
132
  require 'cloudsmith-api/api/status_api'
@@ -0,0 +1,167 @@
1
+ =begin
2
+ #Cloudsmith API
3
+
4
+ #The API to the Cloudsmith Service
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudsmith.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudsmithApi
16
+ class MetricsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # View for listing entitlement token usage as a metric.
24
+ # View for listing entitlement token usage as a metric.
25
+ # @param owner
26
+ # @param repo
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [Integer] :page A page number within the paginated result set.
29
+ # @option opts [Integer] :page_size Number of results to return per page.
30
+ # @option opts [Integer] :finish Filter token usage ending before this datetime (UTC by default unless otherwise specified). Defaults to now if not supplied.
31
+ # @option opts [Integer] :start Filter token usage starting from this datetime (UTC by default unless otherwise specified)).
32
+ # @option opts [String] :tokens A comma seperated list of tokens (slug perm) to include in the results.
33
+ # @return [Array<EntitlementTokenMetric>]
34
+ def metrics_entitlements_usage_list(owner, repo, opts = {})
35
+ data, _status_code, _headers = metrics_entitlements_usage_list_with_http_info(owner, repo, opts)
36
+ return data
37
+ end
38
+
39
+ # View for listing entitlement token usage as a metric.
40
+ # View for listing entitlement token usage as a metric.
41
+ # @param owner
42
+ # @param repo
43
+ # @param [Hash] opts the optional parameters
44
+ # @option opts [Integer] :page A page number within the paginated result set.
45
+ # @option opts [Integer] :page_size Number of results to return per page.
46
+ # @option opts [Integer] :finish Filter token usage ending before this datetime (UTC by default unless otherwise specified). Defaults to now if not supplied.
47
+ # @option opts [Integer] :start Filter token usage starting from this datetime (UTC by default unless otherwise specified)).
48
+ # @option opts [String] :tokens A comma seperated list of tokens (slug perm) to include in the results.
49
+ # @return [Array<(Array<EntitlementTokenMetric>, Fixnum, Hash)>] Array<EntitlementTokenMetric> data, response status code and response headers
50
+ def metrics_entitlements_usage_list_with_http_info(owner, repo, opts = {})
51
+ if @api_client.config.debugging
52
+ @api_client.config.logger.debug "Calling API: MetricsApi.metrics_entitlements_usage_list ..."
53
+ end
54
+ # verify the required parameter 'owner' is set
55
+ if @api_client.config.client_side_validation && owner.nil?
56
+ fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_entitlements_usage_list"
57
+ end
58
+ # verify the required parameter 'repo' is set
59
+ if @api_client.config.client_side_validation && repo.nil?
60
+ fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_entitlements_usage_list"
61
+ end
62
+ # resource path
63
+ local_var_path = "/metrics/{owner}/{repo}/entitlements/usage/".sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s)
64
+
65
+ # query parameters
66
+ query_params = {}
67
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
68
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
69
+ query_params[:'finish'] = opts[:'finish'] if !opts[:'finish'].nil?
70
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
71
+ query_params[:'tokens'] = opts[:'tokens'] if !opts[:'tokens'].nil?
72
+
73
+ # header parameters
74
+ header_params = {}
75
+
76
+ # form parameters
77
+ form_params = {}
78
+
79
+ # http body (model)
80
+ post_body = nil
81
+ auth_names = ['apikey', 'csrf_token']
82
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
83
+ :header_params => header_params,
84
+ :query_params => query_params,
85
+ :form_params => form_params,
86
+ :body => post_body,
87
+ :auth_names => auth_names,
88
+ :return_type => 'Array<EntitlementTokenMetric>')
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: MetricsApi#metrics_entitlements_usage_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # View for listing package usage metrics by user.
96
+ # View for listing package usage metrics by user.
97
+ # @param owner
98
+ # @param repo
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [Integer] :page A page number within the paginated result set.
101
+ # @option opts [Integer] :page_size Number of results to return per page.
102
+ # @option opts [Integer] :finish Filter token usage ending before this datetime (UTC). Defaults to now if not supplied.
103
+ # @option opts [String] :packages A comma seperated list of packages (slug perm) to include in the results.
104
+ # @option opts [Integer] :start Filter token usage starting from this datetime (UTC)).
105
+ # @return [Array<PackageUsageMetric>]
106
+ def metrics_packages_usage_list(owner, repo, opts = {})
107
+ data, _status_code, _headers = metrics_packages_usage_list_with_http_info(owner, repo, opts)
108
+ return data
109
+ end
110
+
111
+ # View for listing package usage metrics by user.
112
+ # View for listing package usage metrics by user.
113
+ # @param owner
114
+ # @param repo
115
+ # @param [Hash] opts the optional parameters
116
+ # @option opts [Integer] :page A page number within the paginated result set.
117
+ # @option opts [Integer] :page_size Number of results to return per page.
118
+ # @option opts [Integer] :finish Filter token usage ending before this datetime (UTC). Defaults to now if not supplied.
119
+ # @option opts [String] :packages A comma seperated list of packages (slug perm) to include in the results.
120
+ # @option opts [Integer] :start Filter token usage starting from this datetime (UTC)).
121
+ # @return [Array<(Array<PackageUsageMetric>, Fixnum, Hash)>] Array<PackageUsageMetric> data, response status code and response headers
122
+ def metrics_packages_usage_list_with_http_info(owner, repo, opts = {})
123
+ if @api_client.config.debugging
124
+ @api_client.config.logger.debug "Calling API: MetricsApi.metrics_packages_usage_list ..."
125
+ end
126
+ # verify the required parameter 'owner' is set
127
+ if @api_client.config.client_side_validation && owner.nil?
128
+ fail ArgumentError, "Missing the required parameter 'owner' when calling MetricsApi.metrics_packages_usage_list"
129
+ end
130
+ # verify the required parameter 'repo' is set
131
+ if @api_client.config.client_side_validation && repo.nil?
132
+ fail ArgumentError, "Missing the required parameter 'repo' when calling MetricsApi.metrics_packages_usage_list"
133
+ end
134
+ # resource path
135
+ local_var_path = "/metrics/{owner}/{repo}/packages/usage/".sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'repo' + '}', repo.to_s)
136
+
137
+ # query parameters
138
+ query_params = {}
139
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
140
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
141
+ query_params[:'finish'] = opts[:'finish'] if !opts[:'finish'].nil?
142
+ query_params[:'packages'] = opts[:'packages'] if !opts[:'packages'].nil?
143
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
144
+
145
+ # header parameters
146
+ header_params = {}
147
+
148
+ # form parameters
149
+ form_params = {}
150
+
151
+ # http body (model)
152
+ post_body = nil
153
+ auth_names = ['apikey', 'csrf_token']
154
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => 'Array<PackageUsageMetric>')
161
+ if @api_client.config.debugging
162
+ @api_client.config.logger.debug "API called: MetricsApi#metrics_packages_usage_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
163
+ end
164
+ return data, status_code, headers
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,251 @@
1
+ =begin
2
+ #Cloudsmith API
3
+
4
+ #The API to the Cloudsmith Service
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudsmith.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module CloudsmithApi
16
+ class QuotaApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Quota history for a given namespace.
24
+ # Quota history for a given namespace.
25
+ # @param owner
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Integer] :page A page number within the paginated result set.
28
+ # @option opts [Integer] :page_size Number of results to return per page.
29
+ # @return [Array<QuotaHistory>]
30
+ def quota_history_list(owner, opts = {})
31
+ data, _status_code, _headers = quota_history_list_with_http_info(owner, opts)
32
+ return data
33
+ end
34
+
35
+ # Quota history for a given namespace.
36
+ # Quota history for a given namespace.
37
+ # @param owner
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [Integer] :page A page number within the paginated result set.
40
+ # @option opts [Integer] :page_size Number of results to return per page.
41
+ # @return [Array<(Array<QuotaHistory>, Fixnum, Hash)>] Array<QuotaHistory> data, response status code and response headers
42
+ def quota_history_list_with_http_info(owner, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug "Calling API: QuotaApi.quota_history_list ..."
45
+ end
46
+ # verify the required parameter 'owner' is set
47
+ if @api_client.config.client_side_validation && owner.nil?
48
+ fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_history_list"
49
+ end
50
+ # resource path
51
+ local_var_path = "/quota/{owner}/history/".sub('{' + 'owner' + '}', owner.to_s)
52
+
53
+ # query parameters
54
+ query_params = {}
55
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
56
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
57
+
58
+ # header parameters
59
+ header_params = {}
60
+
61
+ # form parameters
62
+ form_params = {}
63
+
64
+ # http body (model)
65
+ post_body = nil
66
+ auth_names = ['apikey', 'csrf_token']
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 => 'Array<QuotaHistory>')
74
+ if @api_client.config.debugging
75
+ @api_client.config.logger.debug "API called: QuotaApi#quota_history_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
76
+ end
77
+ return data, status_code, headers
78
+ end
79
+
80
+ # Quota usage for a given namespace.
81
+ # Quota usage for a given namespace.
82
+ # @param owner
83
+ # @param [Hash] opts the optional parameters
84
+ # @option opts [Integer] :page A page number within the paginated result set.
85
+ # @option opts [Integer] :page_size Number of results to return per page.
86
+ # @return [Array<Quota>]
87
+ def quota_list(owner, opts = {})
88
+ data, _status_code, _headers = quota_list_with_http_info(owner, opts)
89
+ return data
90
+ end
91
+
92
+ # Quota usage for a given namespace.
93
+ # Quota usage for a given namespace.
94
+ # @param owner
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [Integer] :page A page number within the paginated result set.
97
+ # @option opts [Integer] :page_size Number of results to return per page.
98
+ # @return [Array<(Array<Quota>, Fixnum, Hash)>] Array<Quota> data, response status code and response headers
99
+ def quota_list_with_http_info(owner, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "Calling API: QuotaApi.quota_list ..."
102
+ end
103
+ # verify the required parameter 'owner' is set
104
+ if @api_client.config.client_side_validation && owner.nil?
105
+ fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_list"
106
+ end
107
+ # resource path
108
+ local_var_path = "/quota/{owner}/".sub('{' + 'owner' + '}', owner.to_s)
109
+
110
+ # query parameters
111
+ query_params = {}
112
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
113
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
114
+
115
+ # header parameters
116
+ header_params = {}
117
+
118
+ # form parameters
119
+ form_params = {}
120
+
121
+ # http body (model)
122
+ post_body = nil
123
+ auth_names = ['apikey', 'csrf_token']
124
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
125
+ :header_params => header_params,
126
+ :query_params => query_params,
127
+ :form_params => form_params,
128
+ :body => post_body,
129
+ :auth_names => auth_names,
130
+ :return_type => 'Array<Quota>')
131
+ if @api_client.config.debugging
132
+ @api_client.config.logger.debug "API called: QuotaApi#quota_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
133
+ end
134
+ return data, status_code, headers
135
+ end
136
+
137
+ # Open-source Quota history for a given namespace.
138
+ # Open-source Quota history for a given namespace.
139
+ # @param owner
140
+ # @param [Hash] opts the optional parameters
141
+ # @option opts [Integer] :page A page number within the paginated result set.
142
+ # @option opts [Integer] :page_size Number of results to return per page.
143
+ # @return [Array<QuotaHistory>]
144
+ def quota_oss_history_list(owner, opts = {})
145
+ data, _status_code, _headers = quota_oss_history_list_with_http_info(owner, opts)
146
+ return data
147
+ end
148
+
149
+ # Open-source Quota history for a given namespace.
150
+ # Open-source Quota history for a given namespace.
151
+ # @param owner
152
+ # @param [Hash] opts the optional parameters
153
+ # @option opts [Integer] :page A page number within the paginated result set.
154
+ # @option opts [Integer] :page_size Number of results to return per page.
155
+ # @return [Array<(Array<QuotaHistory>, Fixnum, Hash)>] Array<QuotaHistory> data, response status code and response headers
156
+ def quota_oss_history_list_with_http_info(owner, opts = {})
157
+ if @api_client.config.debugging
158
+ @api_client.config.logger.debug "Calling API: QuotaApi.quota_oss_history_list ..."
159
+ end
160
+ # verify the required parameter 'owner' is set
161
+ if @api_client.config.client_side_validation && owner.nil?
162
+ fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_oss_history_list"
163
+ end
164
+ # resource path
165
+ local_var_path = "/quota/{owner}/oss/history/".sub('{' + 'owner' + '}', owner.to_s)
166
+
167
+ # query parameters
168
+ query_params = {}
169
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
170
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
171
+
172
+ # header parameters
173
+ header_params = {}
174
+
175
+ # form parameters
176
+ form_params = {}
177
+
178
+ # http body (model)
179
+ post_body = nil
180
+ auth_names = ['apikey', 'csrf_token']
181
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
182
+ :header_params => header_params,
183
+ :query_params => query_params,
184
+ :form_params => form_params,
185
+ :body => post_body,
186
+ :auth_names => auth_names,
187
+ :return_type => 'Array<QuotaHistory>')
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: QuotaApi#quota_oss_history_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ return data, status_code, headers
192
+ end
193
+
194
+ # Open-source Quota usage for a given namespace.
195
+ # Open-source Quota usage for a given namespace.
196
+ # @param owner
197
+ # @param [Hash] opts the optional parameters
198
+ # @option opts [Integer] :page A page number within the paginated result set.
199
+ # @option opts [Integer] :page_size Number of results to return per page.
200
+ # @return [Array<Quota>]
201
+ def quota_oss_list(owner, opts = {})
202
+ data, _status_code, _headers = quota_oss_list_with_http_info(owner, opts)
203
+ return data
204
+ end
205
+
206
+ # Open-source Quota usage for a given namespace.
207
+ # Open-source Quota usage for a given namespace.
208
+ # @param owner
209
+ # @param [Hash] opts the optional parameters
210
+ # @option opts [Integer] :page A page number within the paginated result set.
211
+ # @option opts [Integer] :page_size Number of results to return per page.
212
+ # @return [Array<(Array<Quota>, Fixnum, Hash)>] Array<Quota> data, response status code and response headers
213
+ def quota_oss_list_with_http_info(owner, opts = {})
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug "Calling API: QuotaApi.quota_oss_list ..."
216
+ end
217
+ # verify the required parameter 'owner' is set
218
+ if @api_client.config.client_side_validation && owner.nil?
219
+ fail ArgumentError, "Missing the required parameter 'owner' when calling QuotaApi.quota_oss_list"
220
+ end
221
+ # resource path
222
+ local_var_path = "/quota/{owner}/oss/".sub('{' + 'owner' + '}', owner.to_s)
223
+
224
+ # query parameters
225
+ query_params = {}
226
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
227
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
228
+
229
+ # header parameters
230
+ header_params = {}
231
+
232
+ # form parameters
233
+ form_params = {}
234
+
235
+ # http body (model)
236
+ post_body = nil
237
+ auth_names = ['apikey', 'csrf_token']
238
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
239
+ :header_params => header_params,
240
+ :query_params => query_params,
241
+ :form_params => form_params,
242
+ :body => post_body,
243
+ :auth_names => auth_names,
244
+ :return_type => 'Array<Quota>')
245
+ if @api_client.config.debugging
246
+ @api_client.config.logger.debug "API called: QuotaApi#quota_oss_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
247
+ end
248
+ return data, status_code, headers
249
+ end
250
+ end
251
+ end