cloudsmith-api 0.52.79 → 0.52.92

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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +8 -5
  4. data/build.json +1 -1
  5. data/docs/{EntitlmentTokenMetric.md → EntitlementTokenMetric.md} +1 -1
  6. data/docs/MetricsApi.md +81 -6
  7. data/docs/MetricsownerrepopackagesusageActivePackages.md +10 -0
  8. data/docs/PackageUsageMetric.md +11 -0
  9. data/lib/cloudsmith-api.rb +3 -1
  10. data/lib/cloudsmith-api/api/metrics_api.rb +79 -7
  11. data/lib/cloudsmith-api/models/{entitlment_token_metric.rb → entitlement_token_metric.rb} +1 -1
  12. data/lib/cloudsmith-api/models/metricsownerrepopackagesusage_active_packages.rb +209 -0
  13. data/lib/cloudsmith-api/models/package_usage_metric.rb +243 -0
  14. data/lib/cloudsmith-api/version.rb +1 -1
  15. data/spec/api/metrics_api_spec.rb +21 -3
  16. data/spec/models/{entitlment_token_metric_spec.rb → entitlement_token_metric_spec.rb} +6 -6
  17. data/spec/models/metricsownerrepopackagesusage_active_packages_spec.rb +54 -0
  18. data/spec/models/package_usage_metric_spec.rb +60 -0
  19. data/vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.6.gem +0 -0
  20. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.2.17/gem_make.out +1 -1
  21. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out +2 -2
  22. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.3.1/gem_make.out +1 -1
  23. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.13.1/ext/ffi_c/Makefile +3 -3
  24. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.github/FUNDING.yml +0 -0
  25. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.github/workflows/tests.yml +1 -1
  26. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.gitignore +0 -0
  27. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.rubocop.yml +0 -0
  28. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.rubocop_opinionated.yml +1 -18
  29. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.travis.yml +1 -1
  30. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/.yardopts +0 -0
  31. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/2.0-Upgrade.md +0 -0
  32. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/CHANGELOG.md +7 -0
  33. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/Gemfile +1 -1
  34. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/LICENSE.txt +0 -0
  35. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/README.md +0 -0
  36. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/Rakefile +0 -0
  37. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/SECURITY.md +0 -0
  38. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/bin/console +0 -0
  39. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/codecov.yml +0 -2
  40. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/data/list.txt +312 -78
  41. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/lib/public_suffix.rb +0 -0
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/public_suffix.gemspec +0 -0
  48. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/.empty +0 -0
  49. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/acceptance_test.rb +2 -0
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/psl_test.rb +1 -1
  63. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/test_helper.rb +0 -0
  64. data/vendor/bundle/ruby/2.6.0/gems/{public_suffix-4.0.5 → public_suffix-4.0.6}/test/tests.txt +0 -0
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. data/vendor/bundle/ruby/2.6.0/specifications/{public_suffix-4.0.5.gemspec → public_suffix-4.0.6.gemspec} +4 -4
  71. data/vendor/bundle/ruby/2.6.0/specifications/sys-uname-1.2.1.gemspec +1 -1
  72. metadata +152 -144
  73. data/vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.5.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac0c23c48552b5709804cc0ee3ae65c0c7bc5e0ab070613bc543c268cf375648
4
- data.tar.gz: 510b8dfecf90c850d19c12a89e2acfcaeee6d313bb069b987f8cc96b1c9310eb
3
+ metadata.gz: 2a048f69ab288ca3154990f117c59114bc69a8210eb4bc24c9155c2e5591de86
4
+ data.tar.gz: d0d96cab81eb5128277ca6f0e499c4d4d58cfe0ef4f448c47cf78e3beacc02ee
5
5
  SHA512:
6
- metadata.gz: 1b2ab045adb806c82955199fe9b41fdf251a85e02b75a18f191832ec957b507829a20c0edb55e2508b6a23b29b98fbc05d8984da23cfe2bd36b9e47932602f04
7
- data.tar.gz: 60edab0ce0ce1e6070f880fa4e4770fafe3023b3dbc680b16fe72e7209f094eb315f538d2ce31e9aa096eb317f3d8217561181b0c82379f04fa739a4c8ce5bff
6
+ metadata.gz: 5e1b4ec76c4aa5f470231633da34c006b3737ea4066b9b9266a68cf12f6ed38bfc81ee26426acc5f2a19d84a57121ea1397cc3fa42af40c53e770971fc7729e8
7
+ data.tar.gz: f97fd899d05588cb63e9a444ddb58426ff34b497047a4debf794da929d77cc5b9f7041630fddb3cf4a88d8c246fe1947f7fc4787eceea2ca3ba4a04420defc1f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudsmith-api (0.52.79)
4
+ cloudsmith-api (0.52.92)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
@@ -25,7 +25,7 @@ GEM
25
25
  ffi (1.13.1)
26
26
  hashdiff (1.0.1)
27
27
  json (2.3.1)
28
- public_suffix (4.0.5)
28
+ public_suffix (4.0.6)
29
29
  rake (12.0.0)
30
30
  rspec (3.9.0)
31
31
  rspec-core (~> 3.9.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@ The API to the Cloudsmith Service
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: v1
10
- - Package version: 0.52.79
10
+ - Package version: 0.52.92
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [https://help.cloudsmith.io](https://help.cloudsmith.io)
13
13
 
@@ -24,15 +24,15 @@ gem build cloudsmith-api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./cloudsmith-api-0.52.79.gem
27
+ gem install ./cloudsmith-api-0.52.92.gem
28
28
  ```
29
- (for development, run `gem install --dev ./cloudsmith-api-0.52.79.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./cloudsmith-api-0.52.92.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'cloudsmith-api', '~> 0.52.79'
35
+ gem 'cloudsmith-api', '~> 0.52.92'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
123
123
  *CloudsmithApi::FormatsApi* | [**formats_list**](docs/FormatsApi.md#formats_list) | **GET** /formats/ | Get a list of all supported package formats.
124
124
  *CloudsmithApi::FormatsApi* | [**formats_read**](docs/FormatsApi.md#formats_read) | **GET** /formats/{slug}/ | Get a specific supported package format.
125
125
  *CloudsmithApi::MetricsApi* | [**metrics_entitlements_usage_list**](docs/MetricsApi.md#metrics_entitlements_usage_list) | **GET** /metrics/{owner}/{repo}/entitlements/usage/ | View for listing entitlement token usage as a metric.
126
+ *CloudsmithApi::MetricsApi* | [**metrics_packages_usage_list**](docs/MetricsApi.md#metrics_packages_usage_list) | **GET** /metrics/{owner}/{repo}/packages/usage/ | View for listing package usage metrics by user.
126
127
  *CloudsmithApi::NamespacesApi* | [**namespaces_list**](docs/NamespacesApi.md#namespaces_list) | **GET** /namespaces/ | Get a list of all namespaces the user belongs to.
127
128
  *CloudsmithApi::NamespacesApi* | [**namespaces_read**](docs/NamespacesApi.md#namespaces_read) | **GET** /namespaces/{slug}/ | Views for working with namespaces.
128
129
  *CloudsmithApi::OrgsApi* | [**orgs_list**](docs/OrgsApi.md#orgs_list) | **GET** /orgs/ | Get a list of all the organizations you are associated with.
@@ -203,11 +204,11 @@ Class | Method | HTTP request | Description
203
204
  - [CloudsmithApi::ConanPackageUpload](docs/ConanPackageUpload.md)
204
205
  - [CloudsmithApi::Distribution](docs/Distribution.md)
205
206
  - [CloudsmithApi::DistrosVersions](docs/DistrosVersions.md)
207
+ - [CloudsmithApi::EntitlementTokenMetric](docs/EntitlementTokenMetric.md)
206
208
  - [CloudsmithApi::EntitlementsCreate](docs/EntitlementsCreate.md)
207
209
  - [CloudsmithApi::EntitlementsPartialUpdate](docs/EntitlementsPartialUpdate.md)
208
210
  - [CloudsmithApi::EntitlementsRefresh](docs/EntitlementsRefresh.md)
209
211
  - [CloudsmithApi::EntitlementsSync](docs/EntitlementsSync.md)
210
- - [CloudsmithApi::EntitlmentTokenMetric](docs/EntitlmentTokenMetric.md)
211
212
  - [CloudsmithApi::FilesAbort](docs/FilesAbort.md)
212
213
  - [CloudsmithApi::FilesComplete](docs/FilesComplete.md)
213
214
  - [CloudsmithApi::FilesCreate](docs/FilesCreate.md)
@@ -215,6 +216,7 @@ Class | Method | HTTP request | Description
215
216
  - [CloudsmithApi::Format](docs/Format.md)
216
217
  - [CloudsmithApi::FormatsDistributions](docs/FormatsDistributions.md)
217
218
  - [CloudsmithApi::MavenPackageUpload](docs/MavenPackageUpload.md)
219
+ - [CloudsmithApi::MetricsownerrepopackagesusageActivePackages](docs/MetricsownerrepopackagesusageActivePackages.md)
218
220
  - [CloudsmithApi::Namespace](docs/Namespace.md)
219
221
  - [CloudsmithApi::Organization](docs/Organization.md)
220
222
  - [CloudsmithApi::Package](docs/Package.md)
@@ -223,6 +225,7 @@ Class | Method | HTTP request | Description
223
225
  - [CloudsmithApi::PackageFileUpload](docs/PackageFileUpload.md)
224
226
  - [CloudsmithApi::PackageMove](docs/PackageMove.md)
225
227
  - [CloudsmithApi::PackageStatus](docs/PackageStatus.md)
228
+ - [CloudsmithApi::PackageUsageMetric](docs/PackageUsageMetric.md)
226
229
  - [CloudsmithApi::PackagesCopy](docs/PackagesCopy.md)
227
230
  - [CloudsmithApi::PackagesMove](docs/PackagesMove.md)
228
231
  - [CloudsmithApi::PackagesTag](docs/PackagesTag.md)
data/build.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "gemName": "cloudsmith-api",
9
9
  "gemRequiredRubyVersion": ">= 1.9",
10
10
  "gemSummary": "Cloudsmith API",
11
- "gemVersion": "0.52.79",
11
+ "gemVersion": "0.52.92",
12
12
  "hideGenerationTimestamp": true,
13
13
  "moduleName": "CloudsmithApi",
14
14
  "sortParamsByRequiredFlag": true
@@ -1,4 +1,4 @@
1
- # CloudsmithApi::EntitlmentTokenMetric
1
+ # CloudsmithApi::EntitlementTokenMetric
2
2
 
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
@@ -5,10 +5,11 @@ All URIs are relative to *https://api.cloudsmith.io*
5
5
  Method | HTTP request | Description
6
6
  ------------- | ------------- | -------------
7
7
  [**metrics_entitlements_usage_list**](MetricsApi.md#metrics_entitlements_usage_list) | **GET** /metrics/{owner}/{repo}/entitlements/usage/ | View for listing entitlement token usage as a metric.
8
+ [**metrics_packages_usage_list**](MetricsApi.md#metrics_packages_usage_list) | **GET** /metrics/{owner}/{repo}/packages/usage/ | View for listing package usage metrics by user.
8
9
 
9
10
 
10
11
  # **metrics_entitlements_usage_list**
11
- > Array<EntitlmentTokenMetric> metrics_entitlements_usage_list(owner, repo, opts)
12
+ > Array<EntitlementTokenMetric> metrics_entitlements_usage_list(owner, repo, opts)
12
13
 
13
14
  View for listing entitlement token usage as a metric.
14
15
 
@@ -40,8 +41,8 @@ repo = "repo_example" # String |
40
41
  opts = {
41
42
  page: 56, # Integer | A page number within the paginated result set.
42
43
  page_size: 56, # Integer | Number of results to return per page.
43
- finish: 56, # Integer | Filter token usage ending before this timestamp. Defaults to now if not supplied.
44
- start: 56, # Integer | Filter token usage starting from this timestamp (seconds since Jan 01 1970. (UTC)).
44
+ finish: 56, # Integer | Filter token usage ending before this datetime (UTC by default unless otherwise specified). Defaults to now if not supplied.
45
+ start: 56, # Integer | Filter token usage starting from this datetime (UTC by default unless otherwise specified)).
45
46
  tokens: "tokens_example" # String | A comma seperated list of tokens (slug perm) to include in the results.
46
47
  }
47
48
 
@@ -62,13 +63,87 @@ Name | Type | Description | Notes
62
63
  **repo** | **String**| |
63
64
  **page** | **Integer**| A page number within the paginated result set. | [optional]
64
65
  **page_size** | **Integer**| Number of results to return per page. | [optional]
65
- **finish** | **Integer**| Filter token usage ending before this timestamp. Defaults to now if not supplied. | [optional]
66
- **start** | **Integer**| Filter token usage starting from this timestamp (seconds since Jan 01 1970. (UTC)). | [optional]
66
+ **finish** | **Integer**| Filter token usage ending before this datetime (UTC by default unless otherwise specified). Defaults to now if not supplied. | [optional]
67
+ **start** | **Integer**| Filter token usage starting from this datetime (UTC by default unless otherwise specified)). | [optional]
67
68
  **tokens** | **String**| A comma seperated list of tokens (slug perm) to include in the results. | [optional]
68
69
 
69
70
  ### Return type
70
71
 
71
- [**Array<EntitlmentTokenMetric>**](EntitlmentTokenMetric.md)
72
+ [**Array<EntitlementTokenMetric>**](EntitlementTokenMetric.md)
73
+
74
+ ### Authorization
75
+
76
+ [apikey](../README.md#apikey), [csrf_token](../README.md#csrf_token)
77
+
78
+ ### HTTP request headers
79
+
80
+ - **Content-Type**: Not defined
81
+ - **Accept**: Not defined
82
+
83
+
84
+
85
+ # **metrics_packages_usage_list**
86
+ > Array<PackageUsageMetric> metrics_packages_usage_list(owner, repo, opts)
87
+
88
+ View for listing package usage metrics by user.
89
+
90
+ View for listing package usage metrics by user.
91
+
92
+ ### Example
93
+ ```ruby
94
+ # load the gem
95
+ require 'cloudsmith-api'
96
+ # setup authorization
97
+ CloudsmithApi.configure do |config|
98
+ # Configure API key authorization: apikey
99
+ config.api_key['X-Api-Key'] = 'YOUR API KEY'
100
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
101
+ #config.api_key_prefix['X-Api-Key'] = 'Bearer'
102
+
103
+ # Configure API key authorization: csrf_token
104
+ config.api_key['X-CSRFToken'] = 'YOUR API KEY'
105
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
106
+ #config.api_key_prefix['X-CSRFToken'] = 'Bearer'
107
+ end
108
+
109
+ api_instance = CloudsmithApi::MetricsApi.new
110
+
111
+ owner = "owner_example" # String |
112
+
113
+ repo = "repo_example" # String |
114
+
115
+ opts = {
116
+ page: 56, # Integer | A page number within the paginated result set.
117
+ page_size: 56, # Integer | Number of results to return per page.
118
+ finish: 56, # Integer | Filter token usage ending before this datetime (UTC). Defaults to now if not supplied.
119
+ packages: "packages_example", # String | A comma seperated list of packages (slug perm) to include in the results.
120
+ start: 56 # Integer | Filter token usage starting from this datetime (UTC)).
121
+ }
122
+
123
+ begin
124
+ #View for listing package usage metrics by user.
125
+ result = api_instance.metrics_packages_usage_list(owner, repo, opts)
126
+ p result
127
+ rescue CloudsmithApi::ApiError => e
128
+ puts "Exception when calling MetricsApi->metrics_packages_usage_list: #{e}"
129
+ end
130
+ ```
131
+
132
+ ### Parameters
133
+
134
+ Name | Type | Description | Notes
135
+ ------------- | ------------- | ------------- | -------------
136
+ **owner** | **String**| |
137
+ **repo** | **String**| |
138
+ **page** | **Integer**| A page number within the paginated result set. | [optional]
139
+ **page_size** | **Integer**| Number of results to return per page. | [optional]
140
+ **finish** | **Integer**| Filter token usage ending before this datetime (UTC). Defaults to now if not supplied. | [optional]
141
+ **packages** | **String**| A comma seperated list of packages (slug perm) to include in the results. | [optional]
142
+ **start** | **Integer**| Filter token usage starting from this datetime (UTC)). | [optional]
143
+
144
+ ### Return type
145
+
146
+ [**Array<PackageUsageMetric>**](PackageUsageMetric.md)
72
147
 
73
148
  ### Authorization
74
149
 
@@ -0,0 +1,10 @@
1
+ # CloudsmithApi::MetricsownerrepopackagesusageActivePackages
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **name** | **String** | | [optional]
7
+ **slug** | **String** | | [optional]
8
+ **version** | **String** | | [optional]
9
+
10
+
@@ -0,0 +1,11 @@
1
+ # CloudsmithApi::PackageUsageMetric
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **active_packages** | [**Array<MetricsownerrepopackagesusageActivePackages>**](MetricsownerrepopackagesusageActivePackages.md) | |
7
+ **downloads_per_package** | **Object** | |
8
+ **inactive_packages** | [**Array<MetricsownerrepopackagesusageActivePackages>**](MetricsownerrepopackagesusageActivePackages.md) | |
9
+ **totals** | **Object** | |
10
+
11
+
@@ -21,11 +21,11 @@ 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'
27
28
  require 'cloudsmith-api/models/entitlements_sync'
28
- require 'cloudsmith-api/models/entitlment_token_metric'
29
29
  require 'cloudsmith-api/models/files_abort'
30
30
  require 'cloudsmith-api/models/files_complete'
31
31
  require 'cloudsmith-api/models/files_create'
@@ -33,6 +33,7 @@ require 'cloudsmith-api/models/files_validate'
33
33
  require 'cloudsmith-api/models/format'
34
34
  require 'cloudsmith-api/models/formats_distributions'
35
35
  require 'cloudsmith-api/models/maven_package_upload'
36
+ require 'cloudsmith-api/models/metricsownerrepopackagesusage_active_packages'
36
37
  require 'cloudsmith-api/models/namespace'
37
38
  require 'cloudsmith-api/models/organization'
38
39
  require 'cloudsmith-api/models/package'
@@ -41,6 +42,7 @@ require 'cloudsmith-api/models/package_file_parts_upload'
41
42
  require 'cloudsmith-api/models/package_file_upload'
42
43
  require 'cloudsmith-api/models/package_move'
43
44
  require 'cloudsmith-api/models/package_status'
45
+ require 'cloudsmith-api/models/package_usage_metric'
44
46
  require 'cloudsmith-api/models/packages_copy'
45
47
  require 'cloudsmith-api/models/packages_move'
46
48
  require 'cloudsmith-api/models/packages_tag'
@@ -27,10 +27,10 @@ module CloudsmithApi
27
27
  # @param [Hash] opts the optional parameters
28
28
  # @option opts [Integer] :page A page number within the paginated result set.
29
29
  # @option opts [Integer] :page_size Number of results to return per page.
30
- # @option opts [Integer] :finish Filter token usage ending before this timestamp. Defaults to now if not supplied.
31
- # @option opts [Integer] :start Filter token usage starting from this timestamp (seconds since Jan 01 1970. (UTC)).
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
32
  # @option opts [String] :tokens A comma seperated list of tokens (slug perm) to include in the results.
33
- # @return [Array<EntitlmentTokenMetric>]
33
+ # @return [Array<EntitlementTokenMetric>]
34
34
  def metrics_entitlements_usage_list(owner, repo, opts = {})
35
35
  data, _status_code, _headers = metrics_entitlements_usage_list_with_http_info(owner, repo, opts)
36
36
  return data
@@ -43,10 +43,10 @@ module CloudsmithApi
43
43
  # @param [Hash] opts the optional parameters
44
44
  # @option opts [Integer] :page A page number within the paginated result set.
45
45
  # @option opts [Integer] :page_size Number of results to return per page.
46
- # @option opts [Integer] :finish Filter token usage ending before this timestamp. Defaults to now if not supplied.
47
- # @option opts [Integer] :start Filter token usage starting from this timestamp (seconds since Jan 01 1970. (UTC)).
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
48
  # @option opts [String] :tokens A comma seperated list of tokens (slug perm) to include in the results.
49
- # @return [Array<(Array<EntitlmentTokenMetric>, Fixnum, Hash)>] Array<EntitlmentTokenMetric> data, response status code and response headers
49
+ # @return [Array<(Array<EntitlementTokenMetric>, Fixnum, Hash)>] Array<EntitlementTokenMetric> data, response status code and response headers
50
50
  def metrics_entitlements_usage_list_with_http_info(owner, repo, opts = {})
51
51
  if @api_client.config.debugging
52
52
  @api_client.config.logger.debug "Calling API: MetricsApi.metrics_entitlements_usage_list ..."
@@ -85,11 +85,83 @@ module CloudsmithApi
85
85
  :form_params => form_params,
86
86
  :body => post_body,
87
87
  :auth_names => auth_names,
88
- :return_type => 'Array<EntitlmentTokenMetric>')
88
+ :return_type => 'Array<EntitlementTokenMetric>')
89
89
  if @api_client.config.debugging
90
90
  @api_client.config.logger.debug "API called: MetricsApi#metrics_entitlements_usage_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
91
  end
92
92
  return data, status_code, headers
93
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
94
166
  end
95
167
  end
@@ -14,7 +14,7 @@ require 'date'
14
14
 
15
15
  module CloudsmithApi
16
16
 
17
- class EntitlmentTokenMetric
17
+ class EntitlementTokenMetric
18
18
  #
19
19
  attr_accessor :bandwidth_per_token
20
20
 
@@ -0,0 +1,209 @@
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 'date'
14
+
15
+ module CloudsmithApi
16
+
17
+ class MetricsownerrepopackagesusageActivePackages
18
+ #
19
+ attr_accessor :name
20
+
21
+ #
22
+ attr_accessor :slug
23
+
24
+ #
25
+ attr_accessor :version
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'name' => :'name',
32
+ :'slug' => :'slug',
33
+ :'version' => :'version'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'name' => :'String',
41
+ :'slug' => :'String',
42
+ :'version' => :'String'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
+
54
+ if attributes.has_key?(:'name')
55
+ self.name = attributes[:'name']
56
+ end
57
+
58
+ if attributes.has_key?(:'slug')
59
+ self.slug = attributes[:'slug']
60
+ end
61
+
62
+ if attributes.has_key?(:'version')
63
+ self.version = attributes[:'version']
64
+ end
65
+
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properies with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ return invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ name == o.name &&
87
+ slug == o.slug &&
88
+ version == o.version
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [name, slug, version].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = CloudsmithApi.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map{ |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
208
+
209
+ end