From 0fb74fd6490210c84d89df6323785827b606bce9 Mon Sep 17 00:00:00 2001 From: cloudsmith-bot Date: Tue, 20 Oct 2026 06:19:03 +0000 Subject: [PATCH 1/2] feat: update bindings to v2.0.39 (API v1.1451.1) --- bindings/java/src/README.md | 16 +- bindings/java/src/build.gradle | 2 +- bindings/java/src/build.json | 2 +- bindings/java/src/build.sbt | 2 +- .../java/src/docs/OrganizationApiKeyRule.md | 2 +- bindings/java/src/docs/ReposApi.md | 395 ++++++++ bindings/java/src/docs/Service.md | 2 +- bindings/java/src/docs/SkillsUpstream.md | 73 ++ .../java/src/docs/SkillsUpstreamRequest.md | 50 + .../src/docs/SkillsUpstreamRequestPatch.md | 50 + .../java/src/docs/SkillsUpstreamSelection.md | 12 + bindings/java/src/pom.xml | 7 +- .../java/io/cloudsmith/api/ApiClient.java | 2 +- .../java/io/cloudsmith/api/apis/ReposApi.java | 913 +++++++++++++++++ .../api/models/OrganizationApiKeyRule.java | 4 +- .../io/cloudsmith/api/models/Service.java | 4 +- .../api/models/SkillsPackageUpload.java | 2 +- .../models/SkillsPackageUploadRequest.java | 2 +- .../cloudsmith/api/models/SkillsUpstream.java | 806 +++++++++++++++ .../api/models/SkillsUpstreamRequest.java | 582 +++++++++++ .../models/SkillsUpstreamRequestPatch.java | 580 +++++++++++ .../api/models/SkillsUpstreamSelection.java | 148 +++ .../io/cloudsmith/api/apis/ReposApiTest.java | 114 +++ bindings/python/src/README.md | 12 +- bindings/python/src/build.json | 2 +- .../python/src/cloudsmith_api/__init__.py | 4 + .../src/cloudsmith_api/api/repos_api.py | 694 +++++++++++++ .../python/src/cloudsmith_api/api_client.py | 2 +- .../src/cloudsmith_api/configuration.py | 2 +- .../src/cloudsmith_api/models/__init__.py | 4 + .../models/organization_api_key_rule.py | 4 +- .../src/cloudsmith_api/models/service.py | 4 +- .../models/skills_package_upload.py | 8 +- .../models/skills_package_upload_request.py | 8 +- .../cloudsmith_api/models/skills_upstream.py | 935 ++++++++++++++++++ .../models/skills_upstream_request.py | 592 +++++++++++ .../models/skills_upstream_request_patch.py | 590 +++++++++++ .../models/skills_upstream_selection.py | 209 ++++ .../python/src/docs/OrganizationApiKeyRule.md | 2 +- bindings/python/src/docs/ReposApi.md | 383 +++++++ bindings/python/src/docs/Service.md | 2 +- bindings/python/src/docs/SkillsUpstream.md | 36 + .../python/src/docs/SkillsUpstreamRequest.md | 24 + .../src/docs/SkillsUpstreamRequestPatch.md | 24 + .../src/docs/SkillsUpstreamSelection.md | 12 + bindings/python/src/setup.py | 2 +- bindings/python/src/test/test_repos_api.py | 42 + .../python/src/test/test_skills_upstream.py | 40 + .../src/test/test_skills_upstream_request.py | 40 + .../test_skills_upstream_request_patch.py | 40 + .../test/test_skills_upstream_selection.py | 40 + bindings/ruby/src/README.md | 18 +- bindings/ruby/src/build.json | 2 +- .../ruby/src/docs/OrganizationApiKeyRule.md | 2 +- bindings/ruby/src/docs/ReposApi.md | 401 ++++++++ bindings/ruby/src/docs/Service.md | 2 +- bindings/ruby/src/docs/SkillsUpstream.md | 34 + .../ruby/src/docs/SkillsUpstreamRequest.md | 22 + .../src/docs/SkillsUpstreamRequestPatch.md | 22 + .../ruby/src/docs/SkillsUpstreamSelection.md | 10 + bindings/ruby/src/lib/cloudsmith-api.rb | 4 + .../src/lib/cloudsmith-api/api/repos_api.rb | 395 ++++++++ .../models/organization_api_key_rule.rb | 2 +- .../src/lib/cloudsmith-api/models/service.rb | 2 +- .../cloudsmith-api/models/skills_upstream.rb | 532 ++++++++++ .../models/skills_upstream_request.rb | 401 ++++++++ .../models/skills_upstream_request_patch.rb | 391 ++++++++ .../models/skills_upstream_selection.rb | 220 +++++ .../ruby/src/lib/cloudsmith-api/version.rb | 2 +- bindings/ruby/src/spec/api/repos_api_spec.rb | 87 ++ .../skills_upstream_request_patch_spec.rb | 137 +++ .../models/skills_upstream_request_spec.rb | 137 +++ .../models/skills_upstream_selection_spec.rb | 53 + .../src/spec/models/skills_upstream_spec.rb | 213 ++++ scripts/common.sh | 2 +- 75 files changed, 10569 insertions(+), 49 deletions(-) create mode 100644 bindings/java/src/docs/SkillsUpstream.md create mode 100644 bindings/java/src/docs/SkillsUpstreamRequest.md create mode 100644 bindings/java/src/docs/SkillsUpstreamRequestPatch.md create mode 100644 bindings/java/src/docs/SkillsUpstreamSelection.md create mode 100644 bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstream.java create mode 100644 bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequest.java create mode 100644 bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequestPatch.java create mode 100644 bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamSelection.java create mode 100644 bindings/python/src/cloudsmith_api/models/skills_upstream.py create mode 100644 bindings/python/src/cloudsmith_api/models/skills_upstream_request.py create mode 100644 bindings/python/src/cloudsmith_api/models/skills_upstream_request_patch.py create mode 100644 bindings/python/src/cloudsmith_api/models/skills_upstream_selection.py create mode 100644 bindings/python/src/docs/SkillsUpstream.md create mode 100644 bindings/python/src/docs/SkillsUpstreamRequest.md create mode 100644 bindings/python/src/docs/SkillsUpstreamRequestPatch.md create mode 100644 bindings/python/src/docs/SkillsUpstreamSelection.md create mode 100644 bindings/python/src/test/test_skills_upstream.py create mode 100644 bindings/python/src/test/test_skills_upstream_request.py create mode 100644 bindings/python/src/test/test_skills_upstream_request_patch.py create mode 100644 bindings/python/src/test/test_skills_upstream_selection.py create mode 100644 bindings/ruby/src/docs/SkillsUpstream.md create mode 100644 bindings/ruby/src/docs/SkillsUpstreamRequest.md create mode 100644 bindings/ruby/src/docs/SkillsUpstreamRequestPatch.md create mode 100644 bindings/ruby/src/docs/SkillsUpstreamSelection.md create mode 100644 bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream.rb create mode 100644 bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request.rb create mode 100644 bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request_patch.rb create mode 100644 bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_selection.rb create mode 100644 bindings/ruby/src/spec/models/skills_upstream_request_patch_spec.rb create mode 100644 bindings/ruby/src/spec/models/skills_upstream_request_spec.rb create mode 100644 bindings/ruby/src/spec/models/skills_upstream_selection_spec.rb create mode 100644 bindings/ruby/src/spec/models/skills_upstream_spec.rb diff --git a/bindings/java/src/README.md b/bindings/java/src/README.md index 19d28f99a..0bc91633d 100644 --- a/bindings/java/src/README.md +++ b/bindings/java/src/README.md @@ -40,7 +40,7 @@ Add this dependency to your project's POM: io.cloudsmith.api cloudsmith-api - 2.0.38 + 2.0.39 compile ``` @@ -50,7 +50,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "io.cloudsmith.api:cloudsmith-api:2.0.38" +compile "io.cloudsmith.api:cloudsmith-api:2.0.39" ``` ### Others @@ -63,7 +63,7 @@ mvn clean package Then manually install the following JARs: -* `target/cloudsmith-api-2.0.38.jar` +* `target/cloudsmith-api-2.0.39.jar` * `target/lib/*.jar` ## Getting Started @@ -470,6 +470,12 @@ Class | Method | HTTP request | Description *ReposApi* | [**reposUpstreamRubyPartialUpdate**](docs/ReposApi.md#reposUpstreamRubyPartialUpdate) | **PATCH** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Partially update a Ruby upstream config for this repository. *ReposApi* | [**reposUpstreamRubyRead**](docs/ReposApi.md#reposUpstreamRubyRead) | **GET** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Retrieve a Ruby upstream config for this repository. *ReposApi* | [**reposUpstreamRubyUpdate**](docs/ReposApi.md#reposUpstreamRubyUpdate) | **PUT** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Update a Ruby upstream config for this repository. +*ReposApi* | [**reposUpstreamSkillsCreate**](docs/ReposApi.md#reposUpstreamSkillsCreate) | **POST** /repos/{owner}/{identifier}/upstream/skills/ | Create an AI Skills upstream config for this repository. +*ReposApi* | [**reposUpstreamSkillsDelete**](docs/ReposApi.md#reposUpstreamSkillsDelete) | **DELETE** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Delete an AI Skills upstream config for this repository. +*ReposApi* | [**reposUpstreamSkillsList**](docs/ReposApi.md#reposUpstreamSkillsList) | **GET** /repos/{owner}/{identifier}/upstream/skills/ | List AI Skills upstream configs for this repository. +*ReposApi* | [**reposUpstreamSkillsPartialUpdate**](docs/ReposApi.md#reposUpstreamSkillsPartialUpdate) | **PATCH** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Partially update an AI Skills upstream config for this repository. +*ReposApi* | [**reposUpstreamSkillsRead**](docs/ReposApi.md#reposUpstreamSkillsRead) | **GET** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Retrieve an AI Skills upstream config for this repository. +*ReposApi* | [**reposUpstreamSkillsUpdate**](docs/ReposApi.md#reposUpstreamSkillsUpdate) | **PUT** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Update an AI Skills upstream config for this repository. *ReposApi* | [**reposUpstreamSwiftCreate**](docs/ReposApi.md#reposUpstreamSwiftCreate) | **POST** /repos/{owner}/{identifier}/upstream/swift/ | Create a Swift upstream config for this repository. *ReposApi* | [**reposUpstreamSwiftDelete**](docs/ReposApi.md#reposUpstreamSwiftDelete) | **DELETE** /repos/{owner}/{identifier}/upstream/swift/{slug_perm}/ | Delete a Swift upstream config for this repository. *ReposApi* | [**reposUpstreamSwiftList**](docs/ReposApi.md#reposUpstreamSwiftList) | **GET** /repos/{owner}/{identifier}/upstream/swift/ | List Swift upstream configs for this repository. @@ -793,6 +799,10 @@ Class | Method | HTTP request | Description - [ServiceTeams](docs/ServiceTeams.md) - [SkillsPackageUpload](docs/SkillsPackageUpload.md) - [SkillsPackageUploadRequest](docs/SkillsPackageUploadRequest.md) + - [SkillsUpstream](docs/SkillsUpstream.md) + - [SkillsUpstreamRequest](docs/SkillsUpstreamRequest.md) + - [SkillsUpstreamRequestPatch](docs/SkillsUpstreamRequestPatch.md) + - [SkillsUpstreamSelection](docs/SkillsUpstreamSelection.md) - [StatusBasic](docs/StatusBasic.md) - [StorageAllocatedLimit](docs/StorageAllocatedLimit.md) - [StorageAllocatedLimitRaw](docs/StorageAllocatedLimitRaw.md) diff --git a/bindings/java/src/build.gradle b/bindings/java/src/build.gradle index 774d15f7f..607d2c6be 100644 --- a/bindings/java/src/build.gradle +++ b/bindings/java/src/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'io.cloudsmith.api' -version = '2.0.38' +version = '2.0.39' buildscript { repositories { diff --git a/bindings/java/src/build.json b/bindings/java/src/build.json index 5cc618ae8..0eaee336d 100644 --- a/bindings/java/src/build.json +++ b/bindings/java/src/build.json @@ -3,7 +3,7 @@ "apiPackage": "io.cloudsmith.api.apis", "artifactId": "cloudsmith-api", "artifactUrl": "https://api.cloudsmith.io/?format=openapi", - "artifactVersion": "2.0.38", + "artifactVersion": "2.0.39", "artifactDescription": "Cloudsmith API", "dateLibrary": "java8", "developerName": "Cloudsmith Ltd", diff --git a/bindings/java/src/build.sbt b/bindings/java/src/build.sbt index 70c21f180..cd391719a 100644 --- a/bindings/java/src/build.sbt +++ b/bindings/java/src/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "io.cloudsmith.api", name := "cloudsmith-api", - version := "2.0.38", + version := "2.0.39", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/bindings/java/src/docs/OrganizationApiKeyRule.md b/bindings/java/src/docs/OrganizationApiKeyRule.md index 7b3b9c1a9..b5ed458c7 100644 --- a/bindings/java/src/docs/OrganizationApiKeyRule.md +++ b/bindings/java/src/docs/OrganizationApiKeyRule.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **maxAgeHours** | **java.math.BigInteger** | The maximum permitted age of an API key for use in the organization. API keys older than this will no longer have access until they are refreshed. To disable the rule unset this value. | [optional] **ruleType** | [**RuleTypeEnum**](#RuleTypeEnum) | Specify which account types this rule applies to: all accounts (deprecated — prefer separate service/user rules), service accounts only, or user accounts only. | **slug** | **String** | Human-readable identifier for the rule type. Automatically generated based on the rule type. | [optional] -**slugPerm** | **String** | An auto-generated id that uniquely identifies the API key policy. | [optional] +**slugPerm** | **String** | An auto-generated id that uniquely identifies the rule. | [optional] **updatedAt** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] diff --git a/bindings/java/src/docs/ReposApi.md b/bindings/java/src/docs/ReposApi.md index 4cae6161a..6c09af9d1 100644 --- a/bindings/java/src/docs/ReposApi.md +++ b/bindings/java/src/docs/ReposApi.md @@ -160,6 +160,12 @@ Method | HTTP request | Description [**reposUpstreamRubyPartialUpdate**](ReposApi.md#reposUpstreamRubyPartialUpdate) | **PATCH** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Partially update a Ruby upstream config for this repository. [**reposUpstreamRubyRead**](ReposApi.md#reposUpstreamRubyRead) | **GET** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Retrieve a Ruby upstream config for this repository. [**reposUpstreamRubyUpdate**](ReposApi.md#reposUpstreamRubyUpdate) | **PUT** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Update a Ruby upstream config for this repository. +[**reposUpstreamSkillsCreate**](ReposApi.md#reposUpstreamSkillsCreate) | **POST** /repos/{owner}/{identifier}/upstream/skills/ | Create an AI Skills upstream config for this repository. +[**reposUpstreamSkillsDelete**](ReposApi.md#reposUpstreamSkillsDelete) | **DELETE** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Delete an AI Skills upstream config for this repository. +[**reposUpstreamSkillsList**](ReposApi.md#reposUpstreamSkillsList) | **GET** /repos/{owner}/{identifier}/upstream/skills/ | List AI Skills upstream configs for this repository. +[**reposUpstreamSkillsPartialUpdate**](ReposApi.md#reposUpstreamSkillsPartialUpdate) | **PATCH** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Partially update an AI Skills upstream config for this repository. +[**reposUpstreamSkillsRead**](ReposApi.md#reposUpstreamSkillsRead) | **GET** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Retrieve an AI Skills upstream config for this repository. +[**reposUpstreamSkillsUpdate**](ReposApi.md#reposUpstreamSkillsUpdate) | **PUT** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Update an AI Skills upstream config for this repository. [**reposUpstreamSwiftCreate**](ReposApi.md#reposUpstreamSwiftCreate) | **POST** /repos/{owner}/{identifier}/upstream/swift/ | Create a Swift upstream config for this repository. [**reposUpstreamSwiftDelete**](ReposApi.md#reposUpstreamSwiftDelete) | **DELETE** /repos/{owner}/{identifier}/upstream/swift/{slug_perm}/ | Delete a Swift upstream config for this repository. [**reposUpstreamSwiftList**](ReposApi.md#reposUpstreamSwiftList) | **GET** /repos/{owner}/{identifier}/upstream/swift/ | List Swift upstream configs for this repository. @@ -10227,6 +10233,395 @@ Name | Type | Description | Notes [apikey](../README.md#apikey), [basic](../README.md#basic) +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **reposUpstreamSkillsCreate** +> SkillsUpstream reposUpstreamSkillsCreate(owner, identifier, data) + +Create an AI Skills upstream config for this repository. + +Create an AI Skills upstream config for this repository. + +### Example +```java +// Import classes: +//import io.cloudsmith.api.ApiClient; +//import io.cloudsmith.api.ApiException; +//import io.cloudsmith.api.Configuration; +//import io.cloudsmith.api.auth.*; +//import io.cloudsmith.api.apis.ReposApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: apikey +ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey"); +apikey.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apikey.setApiKeyPrefix("Token"); + +// Configure HTTP basic authorization: basic +HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic"); +basic.setUsername("YOUR USERNAME"); +basic.setPassword("YOUR PASSWORD"); + +ReposApi apiInstance = new ReposApi(); +String owner = "owner_example"; // String | +String identifier = "identifier_example"; // String | +SkillsUpstreamRequest data = new SkillsUpstreamRequest(); // SkillsUpstreamRequest | +try { + SkillsUpstream result = apiInstance.reposUpstreamSkillsCreate(owner, identifier, data); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ReposApi#reposUpstreamSkillsCreate"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **data** | [**SkillsUpstreamRequest**](SkillsUpstreamRequest.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **reposUpstreamSkillsDelete** +> reposUpstreamSkillsDelete(owner, identifier, slugPerm) + +Delete an AI Skills upstream config for this repository. + +Delete an AI Skills upstream config for this repository. + +### Example +```java +// Import classes: +//import io.cloudsmith.api.ApiClient; +//import io.cloudsmith.api.ApiException; +//import io.cloudsmith.api.Configuration; +//import io.cloudsmith.api.auth.*; +//import io.cloudsmith.api.apis.ReposApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: apikey +ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey"); +apikey.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apikey.setApiKeyPrefix("Token"); + +// Configure HTTP basic authorization: basic +HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic"); +basic.setUsername("YOUR USERNAME"); +basic.setPassword("YOUR PASSWORD"); + +ReposApi apiInstance = new ReposApi(); +String owner = "owner_example"; // String | +String identifier = "identifier_example"; // String | +String slugPerm = "slugPerm_example"; // String | +try { + apiInstance.reposUpstreamSkillsDelete(owner, identifier, slugPerm); +} catch (ApiException e) { + System.err.println("Exception when calling ReposApi#reposUpstreamSkillsDelete"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slugPerm** | **String**| | + +### Return type + +null (empty response body) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **reposUpstreamSkillsList** +> List<SkillsUpstream> reposUpstreamSkillsList(owner, identifier, page, pageSize) + +List AI Skills upstream configs for this repository. + +List AI Skills upstream configs for this repository. + +### Example +```java +// Import classes: +//import io.cloudsmith.api.ApiClient; +//import io.cloudsmith.api.ApiException; +//import io.cloudsmith.api.Configuration; +//import io.cloudsmith.api.auth.*; +//import io.cloudsmith.api.apis.ReposApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: apikey +ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey"); +apikey.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apikey.setApiKeyPrefix("Token"); + +// Configure HTTP basic authorization: basic +HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic"); +basic.setUsername("YOUR USERNAME"); +basic.setPassword("YOUR PASSWORD"); + +ReposApi apiInstance = new ReposApi(); +String owner = "owner_example"; // String | +String identifier = "identifier_example"; // String | +java.math.BigInteger page = new java.math.BigInteger(); // java.math.BigInteger | A page number within the paginated result set. +java.math.BigInteger pageSize = new java.math.BigInteger(); // java.math.BigInteger | Number of results to return per page. +try { + List result = apiInstance.reposUpstreamSkillsList(owner, identifier, page, pageSize); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ReposApi#reposUpstreamSkillsList"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **page** | **java.math.BigInteger**| A page number within the paginated result set. | [optional] + **pageSize** | **java.math.BigInteger**| Number of results to return per page. | [optional] + +### Return type + +[**List<SkillsUpstream>**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **reposUpstreamSkillsPartialUpdate** +> SkillsUpstream reposUpstreamSkillsPartialUpdate(owner, identifier, slugPerm, data) + +Partially update an AI Skills upstream config for this repository. + +Partially update an AI Skills upstream config for this repository. + +### Example +```java +// Import classes: +//import io.cloudsmith.api.ApiClient; +//import io.cloudsmith.api.ApiException; +//import io.cloudsmith.api.Configuration; +//import io.cloudsmith.api.auth.*; +//import io.cloudsmith.api.apis.ReposApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: apikey +ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey"); +apikey.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apikey.setApiKeyPrefix("Token"); + +// Configure HTTP basic authorization: basic +HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic"); +basic.setUsername("YOUR USERNAME"); +basic.setPassword("YOUR PASSWORD"); + +ReposApi apiInstance = new ReposApi(); +String owner = "owner_example"; // String | +String identifier = "identifier_example"; // String | +String slugPerm = "slugPerm_example"; // String | +SkillsUpstreamRequestPatch data = new SkillsUpstreamRequestPatch(); // SkillsUpstreamRequestPatch | +try { + SkillsUpstream result = apiInstance.reposUpstreamSkillsPartialUpdate(owner, identifier, slugPerm, data); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ReposApi#reposUpstreamSkillsPartialUpdate"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slugPerm** | **String**| | + **data** | [**SkillsUpstreamRequestPatch**](SkillsUpstreamRequestPatch.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **reposUpstreamSkillsRead** +> SkillsUpstream reposUpstreamSkillsRead(owner, identifier, slugPerm) + +Retrieve an AI Skills upstream config for this repository. + +Retrieve an AI Skills upstream config for this repository. + +### Example +```java +// Import classes: +//import io.cloudsmith.api.ApiClient; +//import io.cloudsmith.api.ApiException; +//import io.cloudsmith.api.Configuration; +//import io.cloudsmith.api.auth.*; +//import io.cloudsmith.api.apis.ReposApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: apikey +ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey"); +apikey.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apikey.setApiKeyPrefix("Token"); + +// Configure HTTP basic authorization: basic +HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic"); +basic.setUsername("YOUR USERNAME"); +basic.setPassword("YOUR PASSWORD"); + +ReposApi apiInstance = new ReposApi(); +String owner = "owner_example"; // String | +String identifier = "identifier_example"; // String | +String slugPerm = "slugPerm_example"; // String | +try { + SkillsUpstream result = apiInstance.reposUpstreamSkillsRead(owner, identifier, slugPerm); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ReposApi#reposUpstreamSkillsRead"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slugPerm** | **String**| | + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **reposUpstreamSkillsUpdate** +> SkillsUpstream reposUpstreamSkillsUpdate(owner, identifier, slugPerm, data) + +Update an AI Skills upstream config for this repository. + +Update an AI Skills upstream config for this repository. + +### Example +```java +// Import classes: +//import io.cloudsmith.api.ApiClient; +//import io.cloudsmith.api.ApiException; +//import io.cloudsmith.api.Configuration; +//import io.cloudsmith.api.auth.*; +//import io.cloudsmith.api.apis.ReposApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: apikey +ApiKeyAuth apikey = (ApiKeyAuth) defaultClient.getAuthentication("apikey"); +apikey.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apikey.setApiKeyPrefix("Token"); + +// Configure HTTP basic authorization: basic +HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic"); +basic.setUsername("YOUR USERNAME"); +basic.setPassword("YOUR PASSWORD"); + +ReposApi apiInstance = new ReposApi(); +String owner = "owner_example"; // String | +String identifier = "identifier_example"; // String | +String slugPerm = "slugPerm_example"; // String | +SkillsUpstreamRequest data = new SkillsUpstreamRequest(); // SkillsUpstreamRequest | +try { + SkillsUpstream result = apiInstance.reposUpstreamSkillsUpdate(owner, identifier, slugPerm, data); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ReposApi#reposUpstreamSkillsUpdate"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slugPerm** | **String**| | + **data** | [**SkillsUpstreamRequest**](SkillsUpstreamRequest.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + ### HTTP request headers - **Content-Type**: application/json diff --git a/bindings/java/src/docs/Service.md b/bindings/java/src/docs/Service.md index 51e051871..8dbf347e7 100644 --- a/bindings/java/src/docs/Service.md +++ b/bindings/java/src/docs/Service.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **createdByUrl** | **String** | | [optional] **description** | **String** | The description of the service | [optional] **key** | **String** | The API key of the service | [optional] -**keyExpiresAt** | [**OffsetDateTime**](OffsetDateTime.md) | The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. | [optional] +**keyExpiresAt** | [**OffsetDateTime**](OffsetDateTime.md) | The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. | [optional] **name** | **String** | The name of the service | **role** | [**RoleEnum**](#RoleEnum) | The role of the service. | [optional] **slug** | **String** | The slug of the service | [optional] diff --git a/bindings/java/src/docs/SkillsUpstream.md b/bindings/java/src/docs/SkillsUpstream.md new file mode 100644 index 000000000..98beb5545 --- /dev/null +++ b/bindings/java/src/docs/SkillsUpstream.md @@ -0,0 +1,73 @@ + +# SkillsUpstream + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authMode** | [**AuthModeEnum**](#AuthModeEnum) | The authentication mode to use when accessing this upstream. | [optional] +**authSecret** | **String** | Secret to provide with requests to upstream. | [optional] +**authUsername** | **String** | Username to provide with requests to upstream. | [optional] +**available** | **Boolean** | Whether the upstream is available for use. | [optional] +**canReindex** | **Boolean** | Whether the upstream can be reindexed. | [optional] +**contents** | [**ContentsEnum**](#ContentsEnum) | The package types to serve from the upstream: skills, plugins, or both. | [optional] +**createdAt** | [**OffsetDateTime**](OffsetDateTime.md) | The datetime the upstream source was created. | [optional] +**disableReason** | [**DisableReasonEnum**](#DisableReasonEnum) | | [optional] +**disableReasonText** | **String** | Human-readable explanation of why this upstream is disabled | [optional] +**extraHeader1** | **String** | The key for extra header #1 to send to upstream. | [optional] +**extraHeader2** | **String** | The key for extra header #2 to send to upstream. | [optional] +**extraValue1** | **String** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extraValue2** | **String** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**hasFailedSignatureVerification** | **Boolean** | Whether the upstream has failed signature verification. | [optional] +**indexPackageCount** | **java.math.BigInteger** | The number of packages available in this upstream source | [optional] +**indexStatus** | **String** | The current indexing status of this upstream source | [optional] +**isActive** | **Boolean** | Whether or not this upstream is active and ready for requests. | [optional] +**lastIndexed** | **String** | The last time this upstream source was indexed | [optional] +**mode** | [**ModeEnum**](#ModeEnum) | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] +**name** | **String** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | +**pendingValidation** | **Boolean** | When true, this upstream source is pending validation. | [optional] +**priority** | **java.math.BigInteger** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**List<SkillsUpstreamSelection>**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**slugPerm** | **String** | | [optional] +**updatedAt** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**upstreamUrl** | **String** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | +**verifySsl** | **Boolean** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + + + +## Enum: AuthModeEnum +Name | Value +---- | ----- +NONE | "None" +TOKEN | "Token" + + + +## Enum: ContentsEnum +Name | Value +---- | ----- +SKILLS | "Skills" +PLUGINS | "Plugins" +SKILLS_AND_PLUGINS | "Skills and plugins" + + + +## Enum: DisableReasonEnum +Name | Value +---- | ----- +N_A | "N/A" +UPSTREAM_POINTS_TO_ITS_OWN_REPOSITORY | "Upstream points to its own repository" +MISSING_UPSTREAM_SOURCE | "Missing upstream source" +RSA_KEY_DID_NOT_VERIFY_THE_UPSTREAM_S_APKINDEX_SIGNATURE | "RSA key did not verify the upstream's APKINDEX signature" +UPSTREAM_WAS_DISABLED_BY_REQUEST_OF_USER | "Upstream was disabled by request of user" + + + +## Enum: ModeEnum +Name | Value +---- | ----- +PROXY_ONLY | "Proxy Only" +CACHE_AND_PROXY | "Cache and Proxy" +CACHE_ONLY | "Cache Only" + + + diff --git a/bindings/java/src/docs/SkillsUpstreamRequest.md b/bindings/java/src/docs/SkillsUpstreamRequest.md new file mode 100644 index 000000000..74b17f9a4 --- /dev/null +++ b/bindings/java/src/docs/SkillsUpstreamRequest.md @@ -0,0 +1,50 @@ + +# SkillsUpstreamRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authMode** | [**AuthModeEnum**](#AuthModeEnum) | The authentication mode to use when accessing this upstream. | [optional] +**authSecret** | **String** | Secret to provide with requests to upstream. | [optional] +**authUsername** | **String** | Username to provide with requests to upstream. | [optional] +**contents** | [**ContentsEnum**](#ContentsEnum) | The package types to serve from the upstream: skills, plugins, or both. | [optional] +**extraHeader1** | **String** | The key for extra header #1 to send to upstream. | [optional] +**extraHeader2** | **String** | The key for extra header #2 to send to upstream. | [optional] +**extraValue1** | **String** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extraValue2** | **String** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**isActive** | **Boolean** | Whether or not this upstream is active and ready for requests. | [optional] +**mode** | [**ModeEnum**](#ModeEnum) | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] +**name** | **String** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | +**priority** | **java.math.BigInteger** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**List<SkillsUpstreamSelection>**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**upstreamUrl** | **String** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | +**verifySsl** | **Boolean** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + + + +## Enum: AuthModeEnum +Name | Value +---- | ----- +NONE | "None" +TOKEN | "Token" + + + +## Enum: ContentsEnum +Name | Value +---- | ----- +SKILLS | "Skills" +PLUGINS | "Plugins" +SKILLS_AND_PLUGINS | "Skills and plugins" + + + +## Enum: ModeEnum +Name | Value +---- | ----- +PROXY_ONLY | "Proxy Only" +CACHE_AND_PROXY | "Cache and Proxy" +CACHE_ONLY | "Cache Only" + + + diff --git a/bindings/java/src/docs/SkillsUpstreamRequestPatch.md b/bindings/java/src/docs/SkillsUpstreamRequestPatch.md new file mode 100644 index 000000000..b78ba116c --- /dev/null +++ b/bindings/java/src/docs/SkillsUpstreamRequestPatch.md @@ -0,0 +1,50 @@ + +# SkillsUpstreamRequestPatch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**authMode** | [**AuthModeEnum**](#AuthModeEnum) | The authentication mode to use when accessing this upstream. | [optional] +**authSecret** | **String** | Secret to provide with requests to upstream. | [optional] +**authUsername** | **String** | Username to provide with requests to upstream. | [optional] +**contents** | [**ContentsEnum**](#ContentsEnum) | The package types to serve from the upstream: skills, plugins, or both. | [optional] +**extraHeader1** | **String** | The key for extra header #1 to send to upstream. | [optional] +**extraHeader2** | **String** | The key for extra header #2 to send to upstream. | [optional] +**extraValue1** | **String** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extraValue2** | **String** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**isActive** | **Boolean** | Whether or not this upstream is active and ready for requests. | [optional] +**mode** | [**ModeEnum**](#ModeEnum) | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] +**name** | **String** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | [optional] +**priority** | **java.math.BigInteger** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**List<SkillsUpstreamSelection>**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**upstreamUrl** | **String** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | [optional] +**verifySsl** | **Boolean** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + + + +## Enum: AuthModeEnum +Name | Value +---- | ----- +NONE | "None" +TOKEN | "Token" + + + +## Enum: ContentsEnum +Name | Value +---- | ----- +SKILLS | "Skills" +PLUGINS | "Plugins" +SKILLS_AND_PLUGINS | "Skills and plugins" + + + +## Enum: ModeEnum +Name | Value +---- | ----- +PROXY_ONLY | "Proxy Only" +CACHE_AND_PROXY | "Cache and Proxy" +CACHE_ONLY | "Cache Only" + + + diff --git a/bindings/java/src/docs/SkillsUpstreamSelection.md b/bindings/java/src/docs/SkillsUpstreamSelection.md new file mode 100644 index 000000000..81d82a47d --- /dev/null +++ b/bindings/java/src/docs/SkillsUpstreamSelection.md @@ -0,0 +1,12 @@ + +# SkillsUpstreamSelection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The skill's ClawHub slug. | +**publisher** | **String** | The ClawHub owner handle that publishes the skill. | +**version** | **String** | The exact semantic version of the release. | + + + diff --git a/bindings/java/src/pom.xml b/bindings/java/src/pom.xml index 2cee4f000..2c63ef5bc 100644 --- a/bindings/java/src/pom.xml +++ b/bindings/java/src/pom.xml @@ -6,7 +6,7 @@ jar cloudsmith-api - 2.0.38 + 2.0.39 https://api.cloudsmith.io/?format=openapi Cloudsmith API @@ -37,7 +37,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M1 + 3.6.3 enforce-maven @@ -93,7 +93,6 @@ - jar test-jar @@ -138,7 +137,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.12.0 attach-javadocs diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/ApiClient.java b/bindings/java/src/src/main/java/io/cloudsmith/api/ApiClient.java index dbc9e646a..79a28372f 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/ApiClient.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/ApiClient.java @@ -87,7 +87,7 @@ public ApiClient() { json = new JSON(); // Set default User-Agent. - setUserAgent("Swagger-Codegen/2.0.38/java"); + setUserAgent("Swagger-Codegen/2.0.39/java"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/ReposApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/ReposApi.java index 0d1f0c6c1..e715146b8 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/ReposApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/ReposApi.java @@ -128,6 +128,9 @@ import io.cloudsmith.api.models.RubyUpstream; import io.cloudsmith.api.models.RubyUpstreamRequest; import io.cloudsmith.api.models.RubyUpstreamRequestPatch; +import io.cloudsmith.api.models.SkillsUpstream; +import io.cloudsmith.api.models.SkillsUpstreamRequest; +import io.cloudsmith.api.models.SkillsUpstreamRequestPatch; import io.cloudsmith.api.models.SwiftUpstream; import io.cloudsmith.api.models.SwiftUpstreamRequest; import io.cloudsmith.api.models.SwiftUpstreamRequestPatch; @@ -23683,6 +23686,916 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** + * Build call for reposUpstreamSkillsCreate + * @param owner (required) + * @param identifier (required) + * @param data (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsCreateCall(String owner, String identifier, SkillsUpstreamRequest data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = data; + + // create path and map variables + String localVarPath = "/repos/{owner}/{identifier}/upstream/skills/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "apikey", "basic" }; + if (headers != null) { + localVarHeaderParams.putAll(headers); + } + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call reposUpstreamSkillsCreateValidateBeforeCall(String owner, String identifier, SkillsUpstreamRequest data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, identifier, data }; + Method method = this.getClass().getMethod("reposUpstreamSkillsCreateWithHttpInfo", String.class, String.class, SkillsUpstreamRequest.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = reposUpstreamSkillsCreateCall(owner, identifier, data, progressListener, progressRequestListener); + return call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + } + + /** + * Create an AI Skills upstream config for this repository. + * Create an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param data (optional) + * @return SkillsUpstream + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SkillsUpstream reposUpstreamSkillsCreate(String owner, String identifier, SkillsUpstreamRequest data) throws ApiException { + ApiResponse resp = reposUpstreamSkillsCreateWithHttpInfo(owner, identifier, data); + return resp.getData(); + } + + /** + * Create an AI Skills upstream config for this repository. + * Create an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param data (optional) + * @return ApiResponse<SkillsUpstream> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse reposUpstreamSkillsCreateWithHttpInfo( @NotNull String owner, @NotNull String identifier, SkillsUpstreamRequest data) throws ApiException { + com.squareup.okhttp.Call call = reposUpstreamSkillsCreateValidateBeforeCall(owner, identifier, data, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Create an AI Skills upstream config for this repository. (asynchronously) + * Create an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param data (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsCreateAsync(String owner, String identifier, SkillsUpstreamRequest data, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = reposUpstreamSkillsCreateValidateBeforeCall(owner, identifier, data, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for reposUpstreamSkillsDelete + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsDeleteCall(String owner, String identifier, String slugPerm, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())) + .replaceAll("\\{" + "slug_perm" + "\\}", apiClient.escapeString(slugPerm.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "apikey", "basic" }; + if (headers != null) { + localVarHeaderParams.putAll(headers); + } + return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call reposUpstreamSkillsDeleteValidateBeforeCall(String owner, String identifier, String slugPerm, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, identifier, slugPerm }; + Method method = this.getClass().getMethod("reposUpstreamSkillsDeleteWithHttpInfo", String.class, String.class, String.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = reposUpstreamSkillsDeleteCall(owner, identifier, slugPerm, progressListener, progressRequestListener); + return call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + } + + /** + * Delete an AI Skills upstream config for this repository. + * Delete an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void reposUpstreamSkillsDelete(String owner, String identifier, String slugPerm) throws ApiException { + reposUpstreamSkillsDeleteWithHttpInfo(owner, identifier, slugPerm); + } + + /** + * Delete an AI Skills upstream config for this repository. + * Delete an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse reposUpstreamSkillsDeleteWithHttpInfo( @NotNull String owner, @NotNull String identifier, @NotNull String slugPerm) throws ApiException { + com.squareup.okhttp.Call call = reposUpstreamSkillsDeleteValidateBeforeCall(owner, identifier, slugPerm, null, null); + return apiClient.execute(call); + } + + /** + * Delete an AI Skills upstream config for this repository. (asynchronously) + * Delete an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsDeleteAsync(String owner, String identifier, String slugPerm, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = reposUpstreamSkillsDeleteValidateBeforeCall(owner, identifier, slugPerm, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for reposUpstreamSkillsList + * @param owner (required) + * @param identifier (required) + * @param page A page number within the paginated result set. (optional) + * @param pageSize Number of results to return per page. (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsListCall(String owner, String identifier, java.math.BigInteger page, java.math.BigInteger pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repos/{owner}/{identifier}/upstream/skills/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (page != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page", page)); + if (pageSize != null) + localVarQueryParams.addAll(apiClient.parameterToPair("page_size", pageSize)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "apikey", "basic" }; + if (headers != null) { + localVarHeaderParams.putAll(headers); + } + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call reposUpstreamSkillsListValidateBeforeCall(String owner, String identifier, java.math.BigInteger page, java.math.BigInteger pageSize, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, identifier, page, pageSize }; + Method method = this.getClass().getMethod("reposUpstreamSkillsListWithHttpInfo", String.class, String.class, java.math.BigInteger.class, java.math.BigInteger.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = reposUpstreamSkillsListCall(owner, identifier, page, pageSize, progressListener, progressRequestListener); + return call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + } + + /** + * List AI Skills upstream configs for this repository. + * List AI Skills upstream configs for this repository. + * @param owner (required) + * @param identifier (required) + * @param page A page number within the paginated result set. (optional) + * @param pageSize Number of results to return per page. (optional) + * @return List<SkillsUpstream> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public List reposUpstreamSkillsList(String owner, String identifier, java.math.BigInteger page, java.math.BigInteger pageSize) throws ApiException { + ApiResponse> resp = reposUpstreamSkillsListWithHttpInfo(owner, identifier, page, pageSize); + return resp.getData(); + } + + /** + * List AI Skills upstream configs for this repository. + * List AI Skills upstream configs for this repository. + * @param owner (required) + * @param identifier (required) + * @param page A page number within the paginated result set. (optional) + * @param pageSize Number of results to return per page. (optional) + * @return ApiResponse<List<SkillsUpstream>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse> reposUpstreamSkillsListWithHttpInfo( @NotNull String owner, @NotNull String identifier, java.math.BigInteger page, java.math.BigInteger pageSize) throws ApiException { + com.squareup.okhttp.Call call = reposUpstreamSkillsListValidateBeforeCall(owner, identifier, page, pageSize, null, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * List AI Skills upstream configs for this repository. (asynchronously) + * List AI Skills upstream configs for this repository. + * @param owner (required) + * @param identifier (required) + * @param page A page number within the paginated result set. (optional) + * @param pageSize Number of results to return per page. (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsListAsync(String owner, String identifier, java.math.BigInteger page, java.math.BigInteger pageSize, final ApiCallback> callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = reposUpstreamSkillsListValidateBeforeCall(owner, identifier, page, pageSize, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken>(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for reposUpstreamSkillsPartialUpdate + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsPartialUpdateCall(String owner, String identifier, String slugPerm, SkillsUpstreamRequestPatch data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = data; + + // create path and map variables + String localVarPath = "/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())) + .replaceAll("\\{" + "slug_perm" + "\\}", apiClient.escapeString(slugPerm.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "apikey", "basic" }; + if (headers != null) { + localVarHeaderParams.putAll(headers); + } + return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call reposUpstreamSkillsPartialUpdateValidateBeforeCall(String owner, String identifier, String slugPerm, SkillsUpstreamRequestPatch data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, identifier, slugPerm, data }; + Method method = this.getClass().getMethod("reposUpstreamSkillsPartialUpdateWithHttpInfo", String.class, String.class, String.class, SkillsUpstreamRequestPatch.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = reposUpstreamSkillsPartialUpdateCall(owner, identifier, slugPerm, data, progressListener, progressRequestListener); + return call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + } + + /** + * Partially update an AI Skills upstream config for this repository. + * Partially update an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @return SkillsUpstream + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SkillsUpstream reposUpstreamSkillsPartialUpdate(String owner, String identifier, String slugPerm, SkillsUpstreamRequestPatch data) throws ApiException { + ApiResponse resp = reposUpstreamSkillsPartialUpdateWithHttpInfo(owner, identifier, slugPerm, data); + return resp.getData(); + } + + /** + * Partially update an AI Skills upstream config for this repository. + * Partially update an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @return ApiResponse<SkillsUpstream> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse reposUpstreamSkillsPartialUpdateWithHttpInfo( @NotNull String owner, @NotNull String identifier, @NotNull String slugPerm, SkillsUpstreamRequestPatch data) throws ApiException { + com.squareup.okhttp.Call call = reposUpstreamSkillsPartialUpdateValidateBeforeCall(owner, identifier, slugPerm, data, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Partially update an AI Skills upstream config for this repository. (asynchronously) + * Partially update an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsPartialUpdateAsync(String owner, String identifier, String slugPerm, SkillsUpstreamRequestPatch data, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = reposUpstreamSkillsPartialUpdateValidateBeforeCall(owner, identifier, slugPerm, data, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for reposUpstreamSkillsRead + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsReadCall(String owner, String identifier, String slugPerm, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())) + .replaceAll("\\{" + "slug_perm" + "\\}", apiClient.escapeString(slugPerm.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "apikey", "basic" }; + if (headers != null) { + localVarHeaderParams.putAll(headers); + } + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call reposUpstreamSkillsReadValidateBeforeCall(String owner, String identifier, String slugPerm, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, identifier, slugPerm }; + Method method = this.getClass().getMethod("reposUpstreamSkillsReadWithHttpInfo", String.class, String.class, String.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = reposUpstreamSkillsReadCall(owner, identifier, slugPerm, progressListener, progressRequestListener); + return call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + } + + /** + * Retrieve an AI Skills upstream config for this repository. + * Retrieve an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @return SkillsUpstream + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SkillsUpstream reposUpstreamSkillsRead(String owner, String identifier, String slugPerm) throws ApiException { + ApiResponse resp = reposUpstreamSkillsReadWithHttpInfo(owner, identifier, slugPerm); + return resp.getData(); + } + + /** + * Retrieve an AI Skills upstream config for this repository. + * Retrieve an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @return ApiResponse<SkillsUpstream> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse reposUpstreamSkillsReadWithHttpInfo( @NotNull String owner, @NotNull String identifier, @NotNull String slugPerm) throws ApiException { + com.squareup.okhttp.Call call = reposUpstreamSkillsReadValidateBeforeCall(owner, identifier, slugPerm, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Retrieve an AI Skills upstream config for this repository. (asynchronously) + * Retrieve an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsReadAsync(String owner, String identifier, String slugPerm, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = reposUpstreamSkillsReadValidateBeforeCall(owner, identifier, slugPerm, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for reposUpstreamSkillsUpdate + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsUpdateCall(String owner, String identifier, String slugPerm, SkillsUpstreamRequest data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = data; + + // create path and map variables + String localVarPath = "/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.toString())) + .replaceAll("\\{" + "identifier" + "\\}", apiClient.escapeString(identifier.toString())) + .replaceAll("\\{" + "slug_perm" + "\\}", apiClient.escapeString(slugPerm.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "apikey", "basic" }; + if (headers != null) { + localVarHeaderParams.putAll(headers); + } + return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call reposUpstreamSkillsUpdateValidateBeforeCall(String owner, String identifier, String slugPerm, SkillsUpstreamRequest data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, identifier, slugPerm, data }; + Method method = this.getClass().getMethod("reposUpstreamSkillsUpdateWithHttpInfo", String.class, String.class, String.class, SkillsUpstreamRequest.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = reposUpstreamSkillsUpdateCall(owner, identifier, slugPerm, data, progressListener, progressRequestListener); + return call; + + } else { + throw new BeanValidationException((Set) violations); + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } catch (SecurityException e) { + e.printStackTrace(); + throw new ApiException(e.getMessage()); + } + + } + + /** + * Update an AI Skills upstream config for this repository. + * Update an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @return SkillsUpstream + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public SkillsUpstream reposUpstreamSkillsUpdate(String owner, String identifier, String slugPerm, SkillsUpstreamRequest data) throws ApiException { + ApiResponse resp = reposUpstreamSkillsUpdateWithHttpInfo(owner, identifier, slugPerm, data); + return resp.getData(); + } + + /** + * Update an AI Skills upstream config for this repository. + * Update an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @return ApiResponse<SkillsUpstream> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse reposUpstreamSkillsUpdateWithHttpInfo( @NotNull String owner, @NotNull String identifier, @NotNull String slugPerm, SkillsUpstreamRequest data) throws ApiException { + com.squareup.okhttp.Call call = reposUpstreamSkillsUpdateValidateBeforeCall(owner, identifier, slugPerm, data, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Update an AI Skills upstream config for this repository. (asynchronously) + * Update an AI Skills upstream config for this repository. + * @param owner (required) + * @param identifier (required) + * @param slugPerm (required) + * @param data (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call reposUpstreamSkillsUpdateAsync(String owner, String identifier, String slugPerm, SkillsUpstreamRequest data, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = reposUpstreamSkillsUpdateValidateBeforeCall(owner, identifier, slugPerm, data, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } /** * Build call for reposUpstreamSwiftCreate * @param owner (required) diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/OrganizationApiKeyRule.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/OrganizationApiKeyRule.java index e6f50e8b4..5f66e6ec4 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/models/OrganizationApiKeyRule.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/OrganizationApiKeyRule.java @@ -216,10 +216,10 @@ public String getSlug() { } /** - * An auto-generated id that uniquely identifies the API key policy. + * An auto-generated id that uniquely identifies the rule. * @return slugPerm **/ - @Pattern(regexp="^[-a-zA-Z0-9_]+$") @Size(min=1) @ApiModelProperty(value = "An auto-generated id that uniquely identifies the API key policy.") + @Pattern(regexp="^[-a-zA-Z0-9_]+$") @Size(min=1) @ApiModelProperty(value = "An auto-generated id that uniquely identifies the rule.") public String getSlugPerm() { return slugPerm; } diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/Service.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/Service.java index 055589b02..de5ffdc1b 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/models/Service.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/Service.java @@ -171,11 +171,11 @@ public String getKey() { } /** - * The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. + * The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. * @return keyExpiresAt **/ @Valid - @ApiModelProperty(value = "The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy.") + @ApiModelProperty(value = "The time at which the API key will expire. This will only be populated if the Organization has an active API key rule.") public OffsetDateTime getKeyExpiresAt() { return keyExpiresAt; } diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUpload.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUpload.java index 2586ea6b5..389337be8 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUpload.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUpload.java @@ -771,7 +771,7 @@ public SkillsPackageUpload name(String name) { * @return name **/ @NotNull - @Pattern(regexp="\\A[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(min=1,max=64) @ApiModelProperty(required = true, value = "") + @Pattern(regexp="^[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(min=1,max=128) @ApiModelProperty(required = true, value = "") public String getName() { return name; } diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUploadRequest.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUploadRequest.java index c3e0a8707..861960ffd 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUploadRequest.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsPackageUploadRequest.java @@ -59,7 +59,7 @@ public SkillsPackageUploadRequest name(String name) { * @return name **/ @NotNull - @Pattern(regexp="\\A[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(min=1,max=64) @ApiModelProperty(required = true, value = "") + @Pattern(regexp="^[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(min=1,max=128) @ApiModelProperty(required = true, value = "") public String getName() { return name; } diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstream.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstream.java new file mode 100644 index 000000000..c14475de2 --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstream.java @@ -0,0 +1,806 @@ +/* + * Cloudsmith API (v1) + * The API to the Cloudsmith Service + * + * OpenAPI spec version: v1 + * Contact: support@cloudsmith.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.cloudsmith.api.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.cloudsmith.api.models.SkillsUpstreamSelection; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * SkillsUpstream + */ + +public class SkillsUpstream implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * The authentication mode to use when accessing this upstream. + */ + @JsonAdapter(AuthModeEnum.Adapter.class) + public enum AuthModeEnum { + NONE("None"), + + TOKEN("Token"); + + private String value; + + AuthModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthModeEnum fromValue(String text) { + for (AuthModeEnum b : AuthModeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthModeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("auth_mode") + private AuthModeEnum authMode = AuthModeEnum.NONE; + + @SerializedName("auth_secret") + private String authSecret = null; + + @SerializedName("auth_username") + private String authUsername = null; + + @SerializedName("available") + private Boolean available = null; + + @SerializedName("can_reindex") + private Boolean canReindex = null; + + /** + * The package types to serve from the upstream: skills, plugins, or both. + */ + @JsonAdapter(ContentsEnum.Adapter.class) + public enum ContentsEnum { + SKILLS("Skills"), + + PLUGINS("Plugins"), + + SKILLS_AND_PLUGINS("Skills and plugins"); + + private String value; + + ContentsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ContentsEnum fromValue(String text) { + for (ContentsEnum b : ContentsEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ContentsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ContentsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ContentsEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("contents") + private ContentsEnum contents = ContentsEnum.SKILLS; + + @SerializedName("created_at") + private OffsetDateTime createdAt = null; + + /** + * Gets or Sets disableReason + */ + @JsonAdapter(DisableReasonEnum.Adapter.class) + public enum DisableReasonEnum { + N_A("N/A"), + + UPSTREAM_POINTS_TO_ITS_OWN_REPOSITORY("Upstream points to its own repository"), + + MISSING_UPSTREAM_SOURCE("Missing upstream source"), + + RSA_KEY_DID_NOT_VERIFY_THE_UPSTREAM_S_APKINDEX_SIGNATURE("RSA key did not verify the upstream's APKINDEX signature"), + + UPSTREAM_WAS_DISABLED_BY_REQUEST_OF_USER("Upstream was disabled by request of user"); + + private String value; + + DisableReasonEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DisableReasonEnum fromValue(String text) { + for (DisableReasonEnum b : DisableReasonEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final DisableReasonEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DisableReasonEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DisableReasonEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("disable_reason") + private DisableReasonEnum disableReason = DisableReasonEnum.N_A; + + @SerializedName("disable_reason_text") + private String disableReasonText = null; + + @SerializedName("extra_header_1") + private String extraHeader1 = null; + + @SerializedName("extra_header_2") + private String extraHeader2 = null; + + @SerializedName("extra_value_1") + private String extraValue1 = null; + + @SerializedName("extra_value_2") + private String extraValue2 = null; + + @SerializedName("has_failed_signature_verification") + private Boolean hasFailedSignatureVerification = null; + + @SerializedName("index_package_count") + private java.math.BigInteger indexPackageCount = null; + + @SerializedName("index_status") + private String indexStatus = null; + + @SerializedName("is_active") + private Boolean isActive = null; + + @SerializedName("last_indexed") + private String lastIndexed = null; + + /** + * The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + */ + @JsonAdapter(ModeEnum.Adapter.class) + public enum ModeEnum { + PROXY_ONLY("Proxy Only"), + + CACHE_AND_PROXY("Cache and Proxy"), + + CACHE_ONLY("Cache Only"); + + private String value; + + ModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModeEnum fromValue(String text) { + for (ModeEnum b : ModeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("mode") + private ModeEnum mode = ModeEnum.PROXY_ONLY; + + @SerializedName("name") + private String name = null; + + @SerializedName("pending_validation") + private Boolean pendingValidation = null; + + @SerializedName("priority") + private java.math.BigInteger priority = null; + + @SerializedName("selections") + private List selections = null; + + @SerializedName("slug_perm") + private String slugPerm = null; + + @SerializedName("updated_at") + private OffsetDateTime updatedAt = null; + + @SerializedName("upstream_url") + private String upstreamUrl = null; + + @SerializedName("verify_ssl") + private Boolean verifySsl = null; + + public SkillsUpstream authMode(AuthModeEnum authMode) { + this.authMode = authMode; + return this; + } + + /** + * The authentication mode to use when accessing this upstream. + * @return authMode + **/ + @ApiModelProperty(value = "The authentication mode to use when accessing this upstream. ") + public AuthModeEnum getAuthMode() { + return authMode; + } + + public void setAuthMode(AuthModeEnum authMode) { + this.authMode = authMode; + } + + public SkillsUpstream authSecret(String authSecret) { + this.authSecret = authSecret; + return this; + } + + /** + * Secret to provide with requests to upstream. + * @return authSecret + **/ + @Size(max=4096) @ApiModelProperty(value = "Secret to provide with requests to upstream.") + public String getAuthSecret() { + return authSecret; + } + + public void setAuthSecret(String authSecret) { + this.authSecret = authSecret; + } + + public SkillsUpstream authUsername(String authUsername) { + this.authUsername = authUsername; + return this; + } + + /** + * Username to provide with requests to upstream. + * @return authUsername + **/ + @Size(max=64) @ApiModelProperty(value = "Username to provide with requests to upstream.") + public String getAuthUsername() { + return authUsername; + } + + public void setAuthUsername(String authUsername) { + this.authUsername = authUsername; + } + + /** + * Whether the upstream is available for use. + * @return available + **/ + @ApiModelProperty(value = "Whether the upstream is available for use.") + public Boolean isAvailable() { + return available; + } + + /** + * Whether the upstream can be reindexed. + * @return canReindex + **/ + @ApiModelProperty(value = "Whether the upstream can be reindexed.") + public Boolean isCanReindex() { + return canReindex; + } + + public SkillsUpstream contents(ContentsEnum contents) { + this.contents = contents; + return this; + } + + /** + * The package types to serve from the upstream: skills, plugins, or both. + * @return contents + **/ + @ApiModelProperty(value = "The package types to serve from the upstream: skills, plugins, or both.") + public ContentsEnum getContents() { + return contents; + } + + public void setContents(ContentsEnum contents) { + this.contents = contents; + } + + /** + * The datetime the upstream source was created. + * @return createdAt + **/ + @Valid + @ApiModelProperty(value = "The datetime the upstream source was created.") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Get disableReason + * @return disableReason + **/ + @ApiModelProperty(value = "") + public DisableReasonEnum getDisableReason() { + return disableReason; + } + + /** + * Human-readable explanation of why this upstream is disabled + * @return disableReasonText + **/ + @ApiModelProperty(value = "Human-readable explanation of why this upstream is disabled") + public String getDisableReasonText() { + return disableReasonText; + } + + public SkillsUpstream extraHeader1(String extraHeader1) { + this.extraHeader1 = extraHeader1; + return this; + } + + /** + * The key for extra header #1 to send to upstream. + * @return extraHeader1 + **/ + @Pattern(regexp="^[-\\w]+$") @Size(max=64) @ApiModelProperty(value = "The key for extra header #1 to send to upstream.") + public String getExtraHeader1() { + return extraHeader1; + } + + public void setExtraHeader1(String extraHeader1) { + this.extraHeader1 = extraHeader1; + } + + public SkillsUpstream extraHeader2(String extraHeader2) { + this.extraHeader2 = extraHeader2; + return this; + } + + /** + * The key for extra header #2 to send to upstream. + * @return extraHeader2 + **/ + @Pattern(regexp="^[-\\w]+$") @Size(max=64) @ApiModelProperty(value = "The key for extra header #2 to send to upstream.") + public String getExtraHeader2() { + return extraHeader2; + } + + public void setExtraHeader2(String extraHeader2) { + this.extraHeader2 = extraHeader2; + } + + public SkillsUpstream extraValue1(String extraValue1) { + this.extraValue1 = extraValue1; + return this; + } + + /** + * The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + * @return extraValue1 + **/ + @Pattern(regexp="^[^\\n\\r]+$") @Size(max=128) @ApiModelProperty(value = "The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.") + public String getExtraValue1() { + return extraValue1; + } + + public void setExtraValue1(String extraValue1) { + this.extraValue1 = extraValue1; + } + + public SkillsUpstream extraValue2(String extraValue2) { + this.extraValue2 = extraValue2; + return this; + } + + /** + * The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + * @return extraValue2 + **/ + @Pattern(regexp="^[^\\n\\r]+$") @Size(max=128) @ApiModelProperty(value = "The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.") + public String getExtraValue2() { + return extraValue2; + } + + public void setExtraValue2(String extraValue2) { + this.extraValue2 = extraValue2; + } + + /** + * Whether the upstream has failed signature verification. + * @return hasFailedSignatureVerification + **/ + @ApiModelProperty(value = "Whether the upstream has failed signature verification.") + public Boolean isHasFailedSignatureVerification() { + return hasFailedSignatureVerification; + } + + /** + * The number of packages available in this upstream source + * @return indexPackageCount + **/ + @ApiModelProperty(value = "The number of packages available in this upstream source") + public java.math.BigInteger getIndexPackageCount() { + return indexPackageCount; + } + + /** + * The current indexing status of this upstream source + * @return indexStatus + **/ + @ApiModelProperty(value = "The current indexing status of this upstream source") + public String getIndexStatus() { + return indexStatus; + } + + public SkillsUpstream isActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether or not this upstream is active and ready for requests. + * @return isActive + **/ + @ApiModelProperty(value = "Whether or not this upstream is active and ready for requests.") + public Boolean isIsActive() { + return isActive; + } + + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + /** + * The last time this upstream source was indexed + * @return lastIndexed + **/ + @ApiModelProperty(value = "The last time this upstream source was indexed") + public String getLastIndexed() { + return lastIndexed; + } + + public SkillsUpstream mode(ModeEnum mode) { + this.mode = mode; + return this; + } + + /** + * The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + * @return mode + **/ + @ApiModelProperty(value = "The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.") + public ModeEnum getMode() { + return mode; + } + + public void setMode(ModeEnum mode) { + this.mode = mode; + } + + public SkillsUpstream name(String name) { + this.name = name; + return this; + } + + /** + * A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + * @return name + **/ + @NotNull + @Pattern(regexp="^\\w[\\w \\-'\\./()]+$") @Size(min=1,max=64) @ApiModelProperty(required = true, value = "A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * When true, this upstream source is pending validation. + * @return pendingValidation + **/ + @ApiModelProperty(value = "When true, this upstream source is pending validation.") + public Boolean isPendingValidation() { + return pendingValidation; + } + + public SkillsUpstream priority(java.math.BigInteger priority) { + this.priority = priority; + return this; + } + + /** + * Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + * minimum: 1 + * maximum: 32767 + * @return priority + **/ + @Min(1L) @Max(32767L) @ApiModelProperty(value = "Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.") + public java.math.BigInteger getPriority() { + return priority; + } + + public void setPriority(java.math.BigInteger priority) { + this.priority = priority; + } + + public SkillsUpstream selections(List selections) { + this.selections = selections; + return this; + } + + public SkillsUpstream addSelectionsItem(SkillsUpstreamSelection selectionsItem) { + if (this.selections == null) { + this.selections = new ArrayList<>(); + } + this.selections.add(selectionsItem); + return this; + } + + /** + * Exact ClawHub releases to cache. + * @return selections + **/ + @Valid + @Size(max=100) @ApiModelProperty(value = "Exact ClawHub releases to cache.") + public List getSelections() { + return selections; + } + + public void setSelections(List selections) { + this.selections = selections; + } + + /** + * Get slugPerm + * @return slugPerm + **/ + @Pattern(regexp="^[-a-zA-Z0-9_]+$") @Size(min=1) @ApiModelProperty(value = "") + public String getSlugPerm() { + return slugPerm; + } + + /** + * Get updatedAt + * @return updatedAt + **/ + @Valid + @ApiModelProperty(value = "") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public SkillsUpstream upstreamUrl(String upstreamUrl) { + this.upstreamUrl = upstreamUrl; + return this; + } + + /** + * The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + * @return upstreamUrl + **/ + @NotNull + @Size(min=1,max=200) @ApiModelProperty(required = true, value = "The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. ") + public String getUpstreamUrl() { + return upstreamUrl; + } + + public void setUpstreamUrl(String upstreamUrl) { + this.upstreamUrl = upstreamUrl; + } + + public SkillsUpstream verifySsl(Boolean verifySsl) { + this.verifySsl = verifySsl; + return this; + } + + /** + * If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + * @return verifySsl + **/ + @ApiModelProperty(value = "If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.") + public Boolean isVerifySsl() { + return verifySsl; + } + + public void setVerifySsl(Boolean verifySsl) { + this.verifySsl = verifySsl; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SkillsUpstream skillsUpstream = (SkillsUpstream) o; + return Objects.equals(this.authMode, skillsUpstream.authMode) && + Objects.equals(this.authSecret, skillsUpstream.authSecret) && + Objects.equals(this.authUsername, skillsUpstream.authUsername) && + Objects.equals(this.available, skillsUpstream.available) && + Objects.equals(this.canReindex, skillsUpstream.canReindex) && + Objects.equals(this.contents, skillsUpstream.contents) && + Objects.equals(this.createdAt, skillsUpstream.createdAt) && + Objects.equals(this.disableReason, skillsUpstream.disableReason) && + Objects.equals(this.disableReasonText, skillsUpstream.disableReasonText) && + Objects.equals(this.extraHeader1, skillsUpstream.extraHeader1) && + Objects.equals(this.extraHeader2, skillsUpstream.extraHeader2) && + Objects.equals(this.extraValue1, skillsUpstream.extraValue1) && + Objects.equals(this.extraValue2, skillsUpstream.extraValue2) && + Objects.equals(this.hasFailedSignatureVerification, skillsUpstream.hasFailedSignatureVerification) && + Objects.equals(this.indexPackageCount, skillsUpstream.indexPackageCount) && + Objects.equals(this.indexStatus, skillsUpstream.indexStatus) && + Objects.equals(this.isActive, skillsUpstream.isActive) && + Objects.equals(this.lastIndexed, skillsUpstream.lastIndexed) && + Objects.equals(this.mode, skillsUpstream.mode) && + Objects.equals(this.name, skillsUpstream.name) && + Objects.equals(this.pendingValidation, skillsUpstream.pendingValidation) && + Objects.equals(this.priority, skillsUpstream.priority) && + Objects.equals(this.selections, skillsUpstream.selections) && + Objects.equals(this.slugPerm, skillsUpstream.slugPerm) && + Objects.equals(this.updatedAt, skillsUpstream.updatedAt) && + Objects.equals(this.upstreamUrl, skillsUpstream.upstreamUrl) && + Objects.equals(this.verifySsl, skillsUpstream.verifySsl); + } + + @Override + public int hashCode() { + return Objects.hash(authMode, authSecret, authUsername, available, canReindex, contents, createdAt, disableReason, disableReasonText, extraHeader1, extraHeader2, extraValue1, extraValue2, hasFailedSignatureVerification, indexPackageCount, indexStatus, isActive, lastIndexed, mode, name, pendingValidation, priority, selections, slugPerm, updatedAt, upstreamUrl, verifySsl); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SkillsUpstream {\n"); + + sb.append(" authMode: ").append(toIndentedString(authMode)).append("\n"); + sb.append(" authSecret: ").append(toIndentedString(authSecret)).append("\n"); + sb.append(" authUsername: ").append(toIndentedString(authUsername)).append("\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append(" canReindex: ").append(toIndentedString(canReindex)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" disableReason: ").append(toIndentedString(disableReason)).append("\n"); + sb.append(" disableReasonText: ").append(toIndentedString(disableReasonText)).append("\n"); + sb.append(" extraHeader1: ").append(toIndentedString(extraHeader1)).append("\n"); + sb.append(" extraHeader2: ").append(toIndentedString(extraHeader2)).append("\n"); + sb.append(" extraValue1: ").append(toIndentedString(extraValue1)).append("\n"); + sb.append(" extraValue2: ").append(toIndentedString(extraValue2)).append("\n"); + sb.append(" hasFailedSignatureVerification: ").append(toIndentedString(hasFailedSignatureVerification)).append("\n"); + sb.append(" indexPackageCount: ").append(toIndentedString(indexPackageCount)).append("\n"); + sb.append(" indexStatus: ").append(toIndentedString(indexStatus)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" lastIndexed: ").append(toIndentedString(lastIndexed)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" pendingValidation: ").append(toIndentedString(pendingValidation)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" selections: ").append(toIndentedString(selections)).append("\n"); + sb.append(" slugPerm: ").append(toIndentedString(slugPerm)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" upstreamUrl: ").append(toIndentedString(upstreamUrl)).append("\n"); + sb.append(" verifySsl: ").append(toIndentedString(verifySsl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequest.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequest.java new file mode 100644 index 000000000..a9d4865ef --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequest.java @@ -0,0 +1,582 @@ +/* + * Cloudsmith API (v1) + * The API to the Cloudsmith Service + * + * OpenAPI spec version: v1 + * Contact: support@cloudsmith.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.cloudsmith.api.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.cloudsmith.api.models.SkillsUpstreamSelection; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * SkillsUpstreamRequest + */ + +public class SkillsUpstreamRequest implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * The authentication mode to use when accessing this upstream. + */ + @JsonAdapter(AuthModeEnum.Adapter.class) + public enum AuthModeEnum { + NONE("None"), + + TOKEN("Token"); + + private String value; + + AuthModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthModeEnum fromValue(String text) { + for (AuthModeEnum b : AuthModeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthModeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("auth_mode") + private AuthModeEnum authMode = AuthModeEnum.NONE; + + @SerializedName("auth_secret") + private String authSecret = null; + + @SerializedName("auth_username") + private String authUsername = null; + + /** + * The package types to serve from the upstream: skills, plugins, or both. + */ + @JsonAdapter(ContentsEnum.Adapter.class) + public enum ContentsEnum { + SKILLS("Skills"), + + PLUGINS("Plugins"), + + SKILLS_AND_PLUGINS("Skills and plugins"); + + private String value; + + ContentsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ContentsEnum fromValue(String text) { + for (ContentsEnum b : ContentsEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ContentsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ContentsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ContentsEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("contents") + private ContentsEnum contents = ContentsEnum.SKILLS; + + @SerializedName("extra_header_1") + private String extraHeader1 = null; + + @SerializedName("extra_header_2") + private String extraHeader2 = null; + + @SerializedName("extra_value_1") + private String extraValue1 = null; + + @SerializedName("extra_value_2") + private String extraValue2 = null; + + @SerializedName("is_active") + private Boolean isActive = null; + + /** + * The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + */ + @JsonAdapter(ModeEnum.Adapter.class) + public enum ModeEnum { + PROXY_ONLY("Proxy Only"), + + CACHE_AND_PROXY("Cache and Proxy"), + + CACHE_ONLY("Cache Only"); + + private String value; + + ModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModeEnum fromValue(String text) { + for (ModeEnum b : ModeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("mode") + private ModeEnum mode = ModeEnum.PROXY_ONLY; + + @SerializedName("name") + private String name = null; + + @SerializedName("priority") + private java.math.BigInteger priority = null; + + @SerializedName("selections") + private List selections = null; + + @SerializedName("upstream_url") + private String upstreamUrl = null; + + @SerializedName("verify_ssl") + private Boolean verifySsl = null; + + public SkillsUpstreamRequest authMode(AuthModeEnum authMode) { + this.authMode = authMode; + return this; + } + + /** + * The authentication mode to use when accessing this upstream. + * @return authMode + **/ + @ApiModelProperty(value = "The authentication mode to use when accessing this upstream. ") + public AuthModeEnum getAuthMode() { + return authMode; + } + + public void setAuthMode(AuthModeEnum authMode) { + this.authMode = authMode; + } + + public SkillsUpstreamRequest authSecret(String authSecret) { + this.authSecret = authSecret; + return this; + } + + /** + * Secret to provide with requests to upstream. + * @return authSecret + **/ + @Size(max=4096) @ApiModelProperty(value = "Secret to provide with requests to upstream.") + public String getAuthSecret() { + return authSecret; + } + + public void setAuthSecret(String authSecret) { + this.authSecret = authSecret; + } + + public SkillsUpstreamRequest authUsername(String authUsername) { + this.authUsername = authUsername; + return this; + } + + /** + * Username to provide with requests to upstream. + * @return authUsername + **/ + @Size(max=64) @ApiModelProperty(value = "Username to provide with requests to upstream.") + public String getAuthUsername() { + return authUsername; + } + + public void setAuthUsername(String authUsername) { + this.authUsername = authUsername; + } + + public SkillsUpstreamRequest contents(ContentsEnum contents) { + this.contents = contents; + return this; + } + + /** + * The package types to serve from the upstream: skills, plugins, or both. + * @return contents + **/ + @ApiModelProperty(value = "The package types to serve from the upstream: skills, plugins, or both.") + public ContentsEnum getContents() { + return contents; + } + + public void setContents(ContentsEnum contents) { + this.contents = contents; + } + + public SkillsUpstreamRequest extraHeader1(String extraHeader1) { + this.extraHeader1 = extraHeader1; + return this; + } + + /** + * The key for extra header #1 to send to upstream. + * @return extraHeader1 + **/ + @Pattern(regexp="^[-\\w]+$") @Size(max=64) @ApiModelProperty(value = "The key for extra header #1 to send to upstream.") + public String getExtraHeader1() { + return extraHeader1; + } + + public void setExtraHeader1(String extraHeader1) { + this.extraHeader1 = extraHeader1; + } + + public SkillsUpstreamRequest extraHeader2(String extraHeader2) { + this.extraHeader2 = extraHeader2; + return this; + } + + /** + * The key for extra header #2 to send to upstream. + * @return extraHeader2 + **/ + @Pattern(regexp="^[-\\w]+$") @Size(max=64) @ApiModelProperty(value = "The key for extra header #2 to send to upstream.") + public String getExtraHeader2() { + return extraHeader2; + } + + public void setExtraHeader2(String extraHeader2) { + this.extraHeader2 = extraHeader2; + } + + public SkillsUpstreamRequest extraValue1(String extraValue1) { + this.extraValue1 = extraValue1; + return this; + } + + /** + * The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + * @return extraValue1 + **/ + @Pattern(regexp="^[^\\n\\r]+$") @Size(max=128) @ApiModelProperty(value = "The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.") + public String getExtraValue1() { + return extraValue1; + } + + public void setExtraValue1(String extraValue1) { + this.extraValue1 = extraValue1; + } + + public SkillsUpstreamRequest extraValue2(String extraValue2) { + this.extraValue2 = extraValue2; + return this; + } + + /** + * The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + * @return extraValue2 + **/ + @Pattern(regexp="^[^\\n\\r]+$") @Size(max=128) @ApiModelProperty(value = "The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.") + public String getExtraValue2() { + return extraValue2; + } + + public void setExtraValue2(String extraValue2) { + this.extraValue2 = extraValue2; + } + + public SkillsUpstreamRequest isActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether or not this upstream is active and ready for requests. + * @return isActive + **/ + @ApiModelProperty(value = "Whether or not this upstream is active and ready for requests.") + public Boolean isIsActive() { + return isActive; + } + + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public SkillsUpstreamRequest mode(ModeEnum mode) { + this.mode = mode; + return this; + } + + /** + * The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + * @return mode + **/ + @ApiModelProperty(value = "The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.") + public ModeEnum getMode() { + return mode; + } + + public void setMode(ModeEnum mode) { + this.mode = mode; + } + + public SkillsUpstreamRequest name(String name) { + this.name = name; + return this; + } + + /** + * A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + * @return name + **/ + @NotNull + @Pattern(regexp="^\\w[\\w \\-'\\./()]+$") @Size(min=1,max=64) @ApiModelProperty(required = true, value = "A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SkillsUpstreamRequest priority(java.math.BigInteger priority) { + this.priority = priority; + return this; + } + + /** + * Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + * minimum: 1 + * maximum: 32767 + * @return priority + **/ + @Min(1L) @Max(32767L) @ApiModelProperty(value = "Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.") + public java.math.BigInteger getPriority() { + return priority; + } + + public void setPriority(java.math.BigInteger priority) { + this.priority = priority; + } + + public SkillsUpstreamRequest selections(List selections) { + this.selections = selections; + return this; + } + + public SkillsUpstreamRequest addSelectionsItem(SkillsUpstreamSelection selectionsItem) { + if (this.selections == null) { + this.selections = new ArrayList<>(); + } + this.selections.add(selectionsItem); + return this; + } + + /** + * Exact ClawHub releases to cache. + * @return selections + **/ + @Valid + @Size(max=100) @ApiModelProperty(value = "Exact ClawHub releases to cache.") + public List getSelections() { + return selections; + } + + public void setSelections(List selections) { + this.selections = selections; + } + + public SkillsUpstreamRequest upstreamUrl(String upstreamUrl) { + this.upstreamUrl = upstreamUrl; + return this; + } + + /** + * The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + * @return upstreamUrl + **/ + @NotNull + @Size(min=1,max=200) @ApiModelProperty(required = true, value = "The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. ") + public String getUpstreamUrl() { + return upstreamUrl; + } + + public void setUpstreamUrl(String upstreamUrl) { + this.upstreamUrl = upstreamUrl; + } + + public SkillsUpstreamRequest verifySsl(Boolean verifySsl) { + this.verifySsl = verifySsl; + return this; + } + + /** + * If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + * @return verifySsl + **/ + @ApiModelProperty(value = "If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.") + public Boolean isVerifySsl() { + return verifySsl; + } + + public void setVerifySsl(Boolean verifySsl) { + this.verifySsl = verifySsl; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SkillsUpstreamRequest skillsUpstreamRequest = (SkillsUpstreamRequest) o; + return Objects.equals(this.authMode, skillsUpstreamRequest.authMode) && + Objects.equals(this.authSecret, skillsUpstreamRequest.authSecret) && + Objects.equals(this.authUsername, skillsUpstreamRequest.authUsername) && + Objects.equals(this.contents, skillsUpstreamRequest.contents) && + Objects.equals(this.extraHeader1, skillsUpstreamRequest.extraHeader1) && + Objects.equals(this.extraHeader2, skillsUpstreamRequest.extraHeader2) && + Objects.equals(this.extraValue1, skillsUpstreamRequest.extraValue1) && + Objects.equals(this.extraValue2, skillsUpstreamRequest.extraValue2) && + Objects.equals(this.isActive, skillsUpstreamRequest.isActive) && + Objects.equals(this.mode, skillsUpstreamRequest.mode) && + Objects.equals(this.name, skillsUpstreamRequest.name) && + Objects.equals(this.priority, skillsUpstreamRequest.priority) && + Objects.equals(this.selections, skillsUpstreamRequest.selections) && + Objects.equals(this.upstreamUrl, skillsUpstreamRequest.upstreamUrl) && + Objects.equals(this.verifySsl, skillsUpstreamRequest.verifySsl); + } + + @Override + public int hashCode() { + return Objects.hash(authMode, authSecret, authUsername, contents, extraHeader1, extraHeader2, extraValue1, extraValue2, isActive, mode, name, priority, selections, upstreamUrl, verifySsl); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SkillsUpstreamRequest {\n"); + + sb.append(" authMode: ").append(toIndentedString(authMode)).append("\n"); + sb.append(" authSecret: ").append(toIndentedString(authSecret)).append("\n"); + sb.append(" authUsername: ").append(toIndentedString(authUsername)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" extraHeader1: ").append(toIndentedString(extraHeader1)).append("\n"); + sb.append(" extraHeader2: ").append(toIndentedString(extraHeader2)).append("\n"); + sb.append(" extraValue1: ").append(toIndentedString(extraValue1)).append("\n"); + sb.append(" extraValue2: ").append(toIndentedString(extraValue2)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" selections: ").append(toIndentedString(selections)).append("\n"); + sb.append(" upstreamUrl: ").append(toIndentedString(upstreamUrl)).append("\n"); + sb.append(" verifySsl: ").append(toIndentedString(verifySsl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequestPatch.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequestPatch.java new file mode 100644 index 000000000..a831ee827 --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamRequestPatch.java @@ -0,0 +1,580 @@ +/* + * Cloudsmith API (v1) + * The API to the Cloudsmith Service + * + * OpenAPI spec version: v1 + * Contact: support@cloudsmith.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.cloudsmith.api.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.cloudsmith.api.models.SkillsUpstreamSelection; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * SkillsUpstreamRequestPatch + */ + +public class SkillsUpstreamRequestPatch implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * The authentication mode to use when accessing this upstream. + */ + @JsonAdapter(AuthModeEnum.Adapter.class) + public enum AuthModeEnum { + NONE("None"), + + TOKEN("Token"); + + private String value; + + AuthModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthModeEnum fromValue(String text) { + for (AuthModeEnum b : AuthModeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final AuthModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthModeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("auth_mode") + private AuthModeEnum authMode = AuthModeEnum.NONE; + + @SerializedName("auth_secret") + private String authSecret = null; + + @SerializedName("auth_username") + private String authUsername = null; + + /** + * The package types to serve from the upstream: skills, plugins, or both. + */ + @JsonAdapter(ContentsEnum.Adapter.class) + public enum ContentsEnum { + SKILLS("Skills"), + + PLUGINS("Plugins"), + + SKILLS_AND_PLUGINS("Skills and plugins"); + + private String value; + + ContentsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ContentsEnum fromValue(String text) { + for (ContentsEnum b : ContentsEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ContentsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ContentsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ContentsEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("contents") + private ContentsEnum contents = ContentsEnum.SKILLS; + + @SerializedName("extra_header_1") + private String extraHeader1 = null; + + @SerializedName("extra_header_2") + private String extraHeader2 = null; + + @SerializedName("extra_value_1") + private String extraValue1 = null; + + @SerializedName("extra_value_2") + private String extraValue2 = null; + + @SerializedName("is_active") + private Boolean isActive = null; + + /** + * The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + */ + @JsonAdapter(ModeEnum.Adapter.class) + public enum ModeEnum { + PROXY_ONLY("Proxy Only"), + + CACHE_AND_PROXY("Cache and Proxy"), + + CACHE_ONLY("Cache Only"); + + private String value; + + ModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModeEnum fromValue(String text) { + for (ModeEnum b : ModeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("mode") + private ModeEnum mode = ModeEnum.PROXY_ONLY; + + @SerializedName("name") + private String name = null; + + @SerializedName("priority") + private java.math.BigInteger priority = null; + + @SerializedName("selections") + private List selections = null; + + @SerializedName("upstream_url") + private String upstreamUrl = null; + + @SerializedName("verify_ssl") + private Boolean verifySsl = null; + + public SkillsUpstreamRequestPatch authMode(AuthModeEnum authMode) { + this.authMode = authMode; + return this; + } + + /** + * The authentication mode to use when accessing this upstream. + * @return authMode + **/ + @ApiModelProperty(value = "The authentication mode to use when accessing this upstream. ") + public AuthModeEnum getAuthMode() { + return authMode; + } + + public void setAuthMode(AuthModeEnum authMode) { + this.authMode = authMode; + } + + public SkillsUpstreamRequestPatch authSecret(String authSecret) { + this.authSecret = authSecret; + return this; + } + + /** + * Secret to provide with requests to upstream. + * @return authSecret + **/ + @Size(max=4096) @ApiModelProperty(value = "Secret to provide with requests to upstream.") + public String getAuthSecret() { + return authSecret; + } + + public void setAuthSecret(String authSecret) { + this.authSecret = authSecret; + } + + public SkillsUpstreamRequestPatch authUsername(String authUsername) { + this.authUsername = authUsername; + return this; + } + + /** + * Username to provide with requests to upstream. + * @return authUsername + **/ + @Size(max=64) @ApiModelProperty(value = "Username to provide with requests to upstream.") + public String getAuthUsername() { + return authUsername; + } + + public void setAuthUsername(String authUsername) { + this.authUsername = authUsername; + } + + public SkillsUpstreamRequestPatch contents(ContentsEnum contents) { + this.contents = contents; + return this; + } + + /** + * The package types to serve from the upstream: skills, plugins, or both. + * @return contents + **/ + @ApiModelProperty(value = "The package types to serve from the upstream: skills, plugins, or both.") + public ContentsEnum getContents() { + return contents; + } + + public void setContents(ContentsEnum contents) { + this.contents = contents; + } + + public SkillsUpstreamRequestPatch extraHeader1(String extraHeader1) { + this.extraHeader1 = extraHeader1; + return this; + } + + /** + * The key for extra header #1 to send to upstream. + * @return extraHeader1 + **/ + @Pattern(regexp="^[-\\w]+$") @Size(max=64) @ApiModelProperty(value = "The key for extra header #1 to send to upstream.") + public String getExtraHeader1() { + return extraHeader1; + } + + public void setExtraHeader1(String extraHeader1) { + this.extraHeader1 = extraHeader1; + } + + public SkillsUpstreamRequestPatch extraHeader2(String extraHeader2) { + this.extraHeader2 = extraHeader2; + return this; + } + + /** + * The key for extra header #2 to send to upstream. + * @return extraHeader2 + **/ + @Pattern(regexp="^[-\\w]+$") @Size(max=64) @ApiModelProperty(value = "The key for extra header #2 to send to upstream.") + public String getExtraHeader2() { + return extraHeader2; + } + + public void setExtraHeader2(String extraHeader2) { + this.extraHeader2 = extraHeader2; + } + + public SkillsUpstreamRequestPatch extraValue1(String extraValue1) { + this.extraValue1 = extraValue1; + return this; + } + + /** + * The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + * @return extraValue1 + **/ + @Pattern(regexp="^[^\\n\\r]+$") @Size(max=128) @ApiModelProperty(value = "The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.") + public String getExtraValue1() { + return extraValue1; + } + + public void setExtraValue1(String extraValue1) { + this.extraValue1 = extraValue1; + } + + public SkillsUpstreamRequestPatch extraValue2(String extraValue2) { + this.extraValue2 = extraValue2; + return this; + } + + /** + * The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + * @return extraValue2 + **/ + @Pattern(regexp="^[^\\n\\r]+$") @Size(max=128) @ApiModelProperty(value = "The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.") + public String getExtraValue2() { + return extraValue2; + } + + public void setExtraValue2(String extraValue2) { + this.extraValue2 = extraValue2; + } + + public SkillsUpstreamRequestPatch isActive(Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether or not this upstream is active and ready for requests. + * @return isActive + **/ + @ApiModelProperty(value = "Whether or not this upstream is active and ready for requests.") + public Boolean isIsActive() { + return isActive; + } + + public void setIsActive(Boolean isActive) { + this.isActive = isActive; + } + + public SkillsUpstreamRequestPatch mode(ModeEnum mode) { + this.mode = mode; + return this; + } + + /** + * The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + * @return mode + **/ + @ApiModelProperty(value = "The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.") + public ModeEnum getMode() { + return mode; + } + + public void setMode(ModeEnum mode) { + this.mode = mode; + } + + public SkillsUpstreamRequestPatch name(String name) { + this.name = name; + return this; + } + + /** + * A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + * @return name + **/ + @Pattern(regexp="^\\w[\\w \\-'\\./()]+$") @Size(min=1,max=64) @ApiModelProperty(value = "A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SkillsUpstreamRequestPatch priority(java.math.BigInteger priority) { + this.priority = priority; + return this; + } + + /** + * Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + * minimum: 1 + * maximum: 32767 + * @return priority + **/ + @Min(1L) @Max(32767L) @ApiModelProperty(value = "Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.") + public java.math.BigInteger getPriority() { + return priority; + } + + public void setPriority(java.math.BigInteger priority) { + this.priority = priority; + } + + public SkillsUpstreamRequestPatch selections(List selections) { + this.selections = selections; + return this; + } + + public SkillsUpstreamRequestPatch addSelectionsItem(SkillsUpstreamSelection selectionsItem) { + if (this.selections == null) { + this.selections = new ArrayList<>(); + } + this.selections.add(selectionsItem); + return this; + } + + /** + * Exact ClawHub releases to cache. + * @return selections + **/ + @Valid + @Size(max=100) @ApiModelProperty(value = "Exact ClawHub releases to cache.") + public List getSelections() { + return selections; + } + + public void setSelections(List selections) { + this.selections = selections; + } + + public SkillsUpstreamRequestPatch upstreamUrl(String upstreamUrl) { + this.upstreamUrl = upstreamUrl; + return this; + } + + /** + * The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + * @return upstreamUrl + **/ + @Size(min=1,max=200) @ApiModelProperty(value = "The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. ") + public String getUpstreamUrl() { + return upstreamUrl; + } + + public void setUpstreamUrl(String upstreamUrl) { + this.upstreamUrl = upstreamUrl; + } + + public SkillsUpstreamRequestPatch verifySsl(Boolean verifySsl) { + this.verifySsl = verifySsl; + return this; + } + + /** + * If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + * @return verifySsl + **/ + @ApiModelProperty(value = "If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.") + public Boolean isVerifySsl() { + return verifySsl; + } + + public void setVerifySsl(Boolean verifySsl) { + this.verifySsl = verifySsl; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SkillsUpstreamRequestPatch skillsUpstreamRequestPatch = (SkillsUpstreamRequestPatch) o; + return Objects.equals(this.authMode, skillsUpstreamRequestPatch.authMode) && + Objects.equals(this.authSecret, skillsUpstreamRequestPatch.authSecret) && + Objects.equals(this.authUsername, skillsUpstreamRequestPatch.authUsername) && + Objects.equals(this.contents, skillsUpstreamRequestPatch.contents) && + Objects.equals(this.extraHeader1, skillsUpstreamRequestPatch.extraHeader1) && + Objects.equals(this.extraHeader2, skillsUpstreamRequestPatch.extraHeader2) && + Objects.equals(this.extraValue1, skillsUpstreamRequestPatch.extraValue1) && + Objects.equals(this.extraValue2, skillsUpstreamRequestPatch.extraValue2) && + Objects.equals(this.isActive, skillsUpstreamRequestPatch.isActive) && + Objects.equals(this.mode, skillsUpstreamRequestPatch.mode) && + Objects.equals(this.name, skillsUpstreamRequestPatch.name) && + Objects.equals(this.priority, skillsUpstreamRequestPatch.priority) && + Objects.equals(this.selections, skillsUpstreamRequestPatch.selections) && + Objects.equals(this.upstreamUrl, skillsUpstreamRequestPatch.upstreamUrl) && + Objects.equals(this.verifySsl, skillsUpstreamRequestPatch.verifySsl); + } + + @Override + public int hashCode() { + return Objects.hash(authMode, authSecret, authUsername, contents, extraHeader1, extraHeader2, extraValue1, extraValue2, isActive, mode, name, priority, selections, upstreamUrl, verifySsl); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SkillsUpstreamRequestPatch {\n"); + + sb.append(" authMode: ").append(toIndentedString(authMode)).append("\n"); + sb.append(" authSecret: ").append(toIndentedString(authSecret)).append("\n"); + sb.append(" authUsername: ").append(toIndentedString(authUsername)).append("\n"); + sb.append(" contents: ").append(toIndentedString(contents)).append("\n"); + sb.append(" extraHeader1: ").append(toIndentedString(extraHeader1)).append("\n"); + sb.append(" extraHeader2: ").append(toIndentedString(extraHeader2)).append("\n"); + sb.append(" extraValue1: ").append(toIndentedString(extraValue1)).append("\n"); + sb.append(" extraValue2: ").append(toIndentedString(extraValue2)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" selections: ").append(toIndentedString(selections)).append("\n"); + sb.append(" upstreamUrl: ").append(toIndentedString(upstreamUrl)).append("\n"); + sb.append(" verifySsl: ").append(toIndentedString(verifySsl)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamSelection.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamSelection.java new file mode 100644 index 000000000..1e80ddce0 --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/SkillsUpstreamSelection.java @@ -0,0 +1,148 @@ +/* + * Cloudsmith API (v1) + * The API to the Cloudsmith Service + * + * OpenAPI spec version: v1 + * Contact: support@cloudsmith.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.cloudsmith.api.models; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * SkillsUpstreamSelection + */ + +public class SkillsUpstreamSelection implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("name") + private String name = null; + + @SerializedName("publisher") + private String publisher = null; + + @SerializedName("version") + private String version = null; + + public SkillsUpstreamSelection name(String name) { + this.name = name; + return this; + } + + /** + * The skill's ClawHub slug. + * @return name + **/ + @NotNull + @Pattern(regexp="^[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(min=1,max=128) @ApiModelProperty(required = true, value = "The skill's ClawHub slug.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SkillsUpstreamSelection publisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * The ClawHub owner handle that publishes the skill. + * @return publisher + **/ + @NotNull + @Pattern(regexp="^[a-z0-9]+(?:-[a-z0-9]+)*$") @Size(min=1,max=128) @ApiModelProperty(required = true, value = "The ClawHub owner handle that publishes the skill.") + public String getPublisher() { + return publisher; + } + + public void setPublisher(String publisher) { + this.publisher = publisher; + } + + public SkillsUpstreamSelection version(String version) { + this.version = version; + return this; + } + + /** + * The exact semantic version of the release. + * @return version + **/ + @NotNull + @Size(min=1,max=255) @ApiModelProperty(required = true, value = "The exact semantic version of the release.") + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SkillsUpstreamSelection skillsUpstreamSelection = (SkillsUpstreamSelection) o; + return Objects.equals(this.name, skillsUpstreamSelection.name) && + Objects.equals(this.publisher, skillsUpstreamSelection.publisher) && + Objects.equals(this.version, skillsUpstreamSelection.version); + } + + @Override + public int hashCode() { + return Objects.hash(name, publisher, version); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SkillsUpstreamSelection {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/bindings/java/src/src/test/java/io/cloudsmith/api/apis/ReposApiTest.java b/bindings/java/src/src/test/java/io/cloudsmith/api/apis/ReposApiTest.java index cf68d6b0c..40454c97d 100644 --- a/bindings/java/src/src/test/java/io/cloudsmith/api/apis/ReposApiTest.java +++ b/bindings/java/src/src/test/java/io/cloudsmith/api/apis/ReposApiTest.java @@ -105,6 +105,9 @@ import io.cloudsmith.api.models.RubyUpstream; import io.cloudsmith.api.models.RubyUpstreamRequest; import io.cloudsmith.api.models.RubyUpstreamRequestPatch; +import io.cloudsmith.api.models.SkillsUpstream; +import io.cloudsmith.api.models.SkillsUpstreamRequest; +import io.cloudsmith.api.models.SkillsUpstreamRequestPatch; import io.cloudsmith.api.models.SwiftUpstream; import io.cloudsmith.api.models.SwiftUpstreamRequest; import io.cloudsmith.api.models.SwiftUpstreamRequestPatch; @@ -2986,6 +2989,117 @@ public void reposUpstreamRubyUpdateTest() throws Exception { // TODO: test validations } + /** + * Create an AI Skills upstream config for this repository. + * + * Create an AI Skills upstream config for this repository. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void reposUpstreamSkillsCreateTest() throws Exception { + String owner = null; + String identifier = null; + SkillsUpstreamRequest data = null; + SkillsUpstream response = api.reposUpstreamSkillsCreate(owner, identifier, data); + + // TODO: test validations + } + + /** + * Delete an AI Skills upstream config for this repository. + * + * Delete an AI Skills upstream config for this repository. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void reposUpstreamSkillsDeleteTest() throws Exception { + String owner = null; + String identifier = null; + String slugPerm = null; + api.reposUpstreamSkillsDelete(owner, identifier, slugPerm); + + // TODO: test validations + } + + /** + * List AI Skills upstream configs for this repository. + * + * List AI Skills upstream configs for this repository. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void reposUpstreamSkillsListTest() throws Exception { + String owner = null; + String identifier = null; + java.math.BigInteger page = null; + java.math.BigInteger pageSize = null; + List response = api.reposUpstreamSkillsList(owner, identifier, page, pageSize); + + // TODO: test validations + } + + /** + * Partially update an AI Skills upstream config for this repository. + * + * Partially update an AI Skills upstream config for this repository. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void reposUpstreamSkillsPartialUpdateTest() throws Exception { + String owner = null; + String identifier = null; + String slugPerm = null; + SkillsUpstreamRequestPatch data = null; + SkillsUpstream response = api.reposUpstreamSkillsPartialUpdate(owner, identifier, slugPerm, data); + + // TODO: test validations + } + + /** + * Retrieve an AI Skills upstream config for this repository. + * + * Retrieve an AI Skills upstream config for this repository. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void reposUpstreamSkillsReadTest() throws Exception { + String owner = null; + String identifier = null; + String slugPerm = null; + SkillsUpstream response = api.reposUpstreamSkillsRead(owner, identifier, slugPerm); + + // TODO: test validations + } + + /** + * Update an AI Skills upstream config for this repository. + * + * Update an AI Skills upstream config for this repository. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void reposUpstreamSkillsUpdateTest() throws Exception { + String owner = null; + String identifier = null; + String slugPerm = null; + SkillsUpstreamRequest data = null; + SkillsUpstream response = api.reposUpstreamSkillsUpdate(owner, identifier, slugPerm, data); + + // TODO: test validations + } + /** * Create a Swift upstream config for this repository. * diff --git a/bindings/python/src/README.md b/bindings/python/src/README.md index 62264a307..b03bf9090 100644 --- a/bindings/python/src/README.md +++ b/bindings/python/src/README.md @@ -4,7 +4,7 @@ The API to the Cloudsmith Service This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: v1 -- Package version: 2.0.38 +- Package version: 2.0.39 - Build package: io.swagger.codegen.languages.PythonClientCodegen For more information, please visit [https://help.cloudsmith.io](https://help.cloudsmith.io) @@ -435,6 +435,12 @@ Class | Method | HTTP request | Description *ReposApi* | [**repos_upstream_ruby_partial_update**](docs/ReposApi.md#repos_upstream_ruby_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Partially update a Ruby upstream config for this repository. *ReposApi* | [**repos_upstream_ruby_read**](docs/ReposApi.md#repos_upstream_ruby_read) | **GET** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Retrieve a Ruby upstream config for this repository. *ReposApi* | [**repos_upstream_ruby_update**](docs/ReposApi.md#repos_upstream_ruby_update) | **PUT** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Update a Ruby upstream config for this repository. +*ReposApi* | [**repos_upstream_skills_create**](docs/ReposApi.md#repos_upstream_skills_create) | **POST** /repos/{owner}/{identifier}/upstream/skills/ | Create an AI Skills upstream config for this repository. +*ReposApi* | [**repos_upstream_skills_delete**](docs/ReposApi.md#repos_upstream_skills_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Delete an AI Skills upstream config for this repository. +*ReposApi* | [**repos_upstream_skills_list**](docs/ReposApi.md#repos_upstream_skills_list) | **GET** /repos/{owner}/{identifier}/upstream/skills/ | List AI Skills upstream configs for this repository. +*ReposApi* | [**repos_upstream_skills_partial_update**](docs/ReposApi.md#repos_upstream_skills_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Partially update an AI Skills upstream config for this repository. +*ReposApi* | [**repos_upstream_skills_read**](docs/ReposApi.md#repos_upstream_skills_read) | **GET** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Retrieve an AI Skills upstream config for this repository. +*ReposApi* | [**repos_upstream_skills_update**](docs/ReposApi.md#repos_upstream_skills_update) | **PUT** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Update an AI Skills upstream config for this repository. *ReposApi* | [**repos_upstream_swift_create**](docs/ReposApi.md#repos_upstream_swift_create) | **POST** /repos/{owner}/{identifier}/upstream/swift/ | Create a Swift upstream config for this repository. *ReposApi* | [**repos_upstream_swift_delete**](docs/ReposApi.md#repos_upstream_swift_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/swift/{slug_perm}/ | Delete a Swift upstream config for this repository. *ReposApi* | [**repos_upstream_swift_list**](docs/ReposApi.md#repos_upstream_swift_list) | **GET** /repos/{owner}/{identifier}/upstream/swift/ | List Swift upstream configs for this repository. @@ -758,6 +764,10 @@ Class | Method | HTTP request | Description - [ServiceTeams](docs/ServiceTeams.md) - [SkillsPackageUpload](docs/SkillsPackageUpload.md) - [SkillsPackageUploadRequest](docs/SkillsPackageUploadRequest.md) + - [SkillsUpstream](docs/SkillsUpstream.md) + - [SkillsUpstreamRequest](docs/SkillsUpstreamRequest.md) + - [SkillsUpstreamRequestPatch](docs/SkillsUpstreamRequestPatch.md) + - [SkillsUpstreamSelection](docs/SkillsUpstreamSelection.md) - [StatusBasic](docs/StatusBasic.md) - [StorageAllocatedLimit](docs/StorageAllocatedLimit.md) - [StorageAllocatedLimitRaw](docs/StorageAllocatedLimitRaw.md) diff --git a/bindings/python/src/build.json b/bindings/python/src/build.json index b88362047..60f13bc5b 100644 --- a/bindings/python/src/build.json +++ b/bindings/python/src/build.json @@ -2,7 +2,7 @@ "hideGenerationTimestamp": true, "packageName": "cloudsmith_api", "projectName": "cloudsmith_api", - "packageVersion": "2.0.38", + "packageVersion": "2.0.39", "packageUrl": "https://api.cloudsmith.io/?format=openapi", "sortParamsByRequiredFlag": true } diff --git a/bindings/python/src/cloudsmith_api/__init__.py b/bindings/python/src/cloudsmith_api/__init__.py index b606f0cbb..db90ae905 100644 --- a/bindings/python/src/cloudsmith_api/__init__.py +++ b/bindings/python/src/cloudsmith_api/__init__.py @@ -336,6 +336,10 @@ from cloudsmith_api.models.service_teams import ServiceTeams from cloudsmith_api.models.skills_package_upload import SkillsPackageUpload from cloudsmith_api.models.skills_package_upload_request import SkillsPackageUploadRequest +from cloudsmith_api.models.skills_upstream import SkillsUpstream +from cloudsmith_api.models.skills_upstream_request import SkillsUpstreamRequest +from cloudsmith_api.models.skills_upstream_request_patch import SkillsUpstreamRequestPatch +from cloudsmith_api.models.skills_upstream_selection import SkillsUpstreamSelection from cloudsmith_api.models.status_basic import StatusBasic from cloudsmith_api.models.storage_allocated_limit import StorageAllocatedLimit from cloudsmith_api.models.storage_allocated_limit_raw import StorageAllocatedLimitRaw diff --git a/bindings/python/src/cloudsmith_api/api/repos_api.py b/bindings/python/src/cloudsmith_api/api/repos_api.py index 62951e006..53b017abc 100644 --- a/bindings/python/src/cloudsmith_api/api/repos_api.py +++ b/bindings/python/src/cloudsmith_api/api/repos_api.py @@ -17885,6 +17885,700 @@ def repos_upstream_ruby_update_with_http_info(self, owner, identifier, slug_perm _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def repos_upstream_skills_create(self, owner, identifier, **kwargs): # noqa: E501 + """Create an AI Skills upstream config for this repository. # noqa: E501 + + Create an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_create(owner, identifier, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param SkillsUpstreamRequest data: + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.repos_upstream_skills_create_with_http_info(owner, identifier, **kwargs) # noqa: E501 + else: + (data) = self.repos_upstream_skills_create_with_http_info(owner, identifier, **kwargs) # noqa: E501 + return data + + def repos_upstream_skills_create_with_http_info(self, owner, identifier, **kwargs): # noqa: E501 + """Create an AI Skills upstream config for this repository. # noqa: E501 + + Create an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_create_with_http_info(owner, identifier, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param SkillsUpstreamRequest data: + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', 'identifier', 'data'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method repos_upstream_skills_create" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in params or + params['owner'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `owner` when calling `repos_upstream_skills_create`") # noqa: E501 + # verify the required parameter 'identifier' is set + if self.api_client.client_side_validation and ('identifier' not in params or + params['identifier'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `identifier` when calling `repos_upstream_skills_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # noqa: E501 + if 'identifier' in params: + path_params['identifier'] = params['identifier'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'data' in params: + body_params = params['data'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apikey', 'basic'] # noqa: E501 + + return self.api_client.call_api( + '/repos/{owner}/{identifier}/upstream/skills/', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SkillsUpstream', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def repos_upstream_skills_delete(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Delete an AI Skills upstream config for this repository. # noqa: E501 + + Delete an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_delete(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.repos_upstream_skills_delete_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + else: + (data) = self.repos_upstream_skills_delete_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + return data + + def repos_upstream_skills_delete_with_http_info(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Delete an AI Skills upstream config for this repository. # noqa: E501 + + Delete an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_delete_with_http_info(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', 'identifier', 'slug_perm'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method repos_upstream_skills_delete" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in params or + params['owner'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `owner` when calling `repos_upstream_skills_delete`") # noqa: E501 + # verify the required parameter 'identifier' is set + if self.api_client.client_side_validation and ('identifier' not in params or + params['identifier'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `identifier` when calling `repos_upstream_skills_delete`") # noqa: E501 + # verify the required parameter 'slug_perm' is set + if self.api_client.client_side_validation and ('slug_perm' not in params or + params['slug_perm'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `slug_perm` when calling `repos_upstream_skills_delete`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # noqa: E501 + if 'identifier' in params: + path_params['identifier'] = params['identifier'] # noqa: E501 + if 'slug_perm' in params: + path_params['slug_perm'] = params['slug_perm'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apikey', 'basic'] # noqa: E501 + + return self.api_client.call_api( + '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def repos_upstream_skills_list(self, owner, identifier, **kwargs): # noqa: E501 + """List AI Skills upstream configs for this repository. # noqa: E501 + + List AI Skills upstream configs for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_list(owner, identifier, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param int page: A page number within the paginated result set. + :param int page_size: Number of results to return per page. + :return: list[SkillsUpstream] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.repos_upstream_skills_list_with_http_info(owner, identifier, **kwargs) # noqa: E501 + else: + (data) = self.repos_upstream_skills_list_with_http_info(owner, identifier, **kwargs) # noqa: E501 + return data + + def repos_upstream_skills_list_with_http_info(self, owner, identifier, **kwargs): # noqa: E501 + """List AI Skills upstream configs for this repository. # noqa: E501 + + List AI Skills upstream configs for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_list_with_http_info(owner, identifier, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param int page: A page number within the paginated result set. + :param int page_size: Number of results to return per page. + :return: list[SkillsUpstream] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', 'identifier', 'page', 'page_size'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method repos_upstream_skills_list" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in params or + params['owner'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `owner` when calling `repos_upstream_skills_list`") # noqa: E501 + # verify the required parameter 'identifier' is set + if self.api_client.client_side_validation and ('identifier' not in params or + params['identifier'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `identifier` when calling `repos_upstream_skills_list`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # noqa: E501 + if 'identifier' in params: + path_params['identifier'] = params['identifier'] # noqa: E501 + + query_params = [] + if 'page' in params: + query_params.append(('page', params['page'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('page_size', params['page_size'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apikey', 'basic'] # noqa: E501 + + return self.api_client.call_api( + '/repos/{owner}/{identifier}/upstream/skills/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SkillsUpstream]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def repos_upstream_skills_partial_update(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Partially update an AI Skills upstream config for this repository. # noqa: E501 + + Partially update an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_partial_update(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :param SkillsUpstreamRequestPatch data: + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.repos_upstream_skills_partial_update_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + else: + (data) = self.repos_upstream_skills_partial_update_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + return data + + def repos_upstream_skills_partial_update_with_http_info(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Partially update an AI Skills upstream config for this repository. # noqa: E501 + + Partially update an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_partial_update_with_http_info(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :param SkillsUpstreamRequestPatch data: + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', 'identifier', 'slug_perm', 'data'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method repos_upstream_skills_partial_update" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in params or + params['owner'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `owner` when calling `repos_upstream_skills_partial_update`") # noqa: E501 + # verify the required parameter 'identifier' is set + if self.api_client.client_side_validation and ('identifier' not in params or + params['identifier'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `identifier` when calling `repos_upstream_skills_partial_update`") # noqa: E501 + # verify the required parameter 'slug_perm' is set + if self.api_client.client_side_validation and ('slug_perm' not in params or + params['slug_perm'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `slug_perm` when calling `repos_upstream_skills_partial_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # noqa: E501 + if 'identifier' in params: + path_params['identifier'] = params['identifier'] # noqa: E501 + if 'slug_perm' in params: + path_params['slug_perm'] = params['slug_perm'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'data' in params: + body_params = params['data'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apikey', 'basic'] # noqa: E501 + + return self.api_client.call_api( + '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/', 'PATCH', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SkillsUpstream', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def repos_upstream_skills_read(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Retrieve an AI Skills upstream config for this repository. # noqa: E501 + + Retrieve an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_read(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.repos_upstream_skills_read_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + else: + (data) = self.repos_upstream_skills_read_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + return data + + def repos_upstream_skills_read_with_http_info(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Retrieve an AI Skills upstream config for this repository. # noqa: E501 + + Retrieve an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_read_with_http_info(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', 'identifier', 'slug_perm'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method repos_upstream_skills_read" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in params or + params['owner'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `owner` when calling `repos_upstream_skills_read`") # noqa: E501 + # verify the required parameter 'identifier' is set + if self.api_client.client_side_validation and ('identifier' not in params or + params['identifier'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `identifier` when calling `repos_upstream_skills_read`") # noqa: E501 + # verify the required parameter 'slug_perm' is set + if self.api_client.client_side_validation and ('slug_perm' not in params or + params['slug_perm'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `slug_perm` when calling `repos_upstream_skills_read`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # noqa: E501 + if 'identifier' in params: + path_params['identifier'] = params['identifier'] # noqa: E501 + if 'slug_perm' in params: + path_params['slug_perm'] = params['slug_perm'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apikey', 'basic'] # noqa: E501 + + return self.api_client.call_api( + '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SkillsUpstream', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def repos_upstream_skills_update(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Update an AI Skills upstream config for this repository. # noqa: E501 + + Update an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_update(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :param SkillsUpstreamRequest data: + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.repos_upstream_skills_update_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + else: + (data) = self.repos_upstream_skills_update_with_http_info(owner, identifier, slug_perm, **kwargs) # noqa: E501 + return data + + def repos_upstream_skills_update_with_http_info(self, owner, identifier, slug_perm, **kwargs): # noqa: E501 + """Update an AI Skills upstream config for this repository. # noqa: E501 + + Update an AI Skills upstream config for this repository. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.repos_upstream_skills_update_with_http_info(owner, identifier, slug_perm, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param str identifier: (required) + :param str slug_perm: (required) + :param SkillsUpstreamRequest data: + :return: SkillsUpstream + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', 'identifier', 'slug_perm', 'data'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method repos_upstream_skills_update" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'owner' is set + if self.api_client.client_side_validation and ('owner' not in params or + params['owner'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `owner` when calling `repos_upstream_skills_update`") # noqa: E501 + # verify the required parameter 'identifier' is set + if self.api_client.client_side_validation and ('identifier' not in params or + params['identifier'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `identifier` when calling `repos_upstream_skills_update`") # noqa: E501 + # verify the required parameter 'slug_perm' is set + if self.api_client.client_side_validation and ('slug_perm' not in params or + params['slug_perm'] is None): # noqa: E501 + raise ValueError("Missing the required parameter `slug_perm` when calling `repos_upstream_skills_update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # noqa: E501 + if 'identifier' in params: + path_params['identifier'] = params['identifier'] # noqa: E501 + if 'slug_perm' in params: + path_params['slug_perm'] = params['slug_perm'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'data' in params: + body_params = params['data'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apikey', 'basic'] # noqa: E501 + + return self.api_client.call_api( + '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SkillsUpstream', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def repos_upstream_swift_create(self, owner, identifier, **kwargs): # noqa: E501 """Create a Swift upstream config for this repository. # noqa: E501 diff --git a/bindings/python/src/cloudsmith_api/api_client.py b/bindings/python/src/cloudsmith_api/api_client.py index 1aea74fe7..7e2869e0f 100644 --- a/bindings/python/src/cloudsmith_api/api_client.py +++ b/bindings/python/src/cloudsmith_api/api_client.py @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/2.0.38/python' + self.user_agent = 'Swagger-Codegen/2.0.39/python' self.client_side_validation = configuration.client_side_validation def __del__(self): diff --git a/bindings/python/src/cloudsmith_api/configuration.py b/bindings/python/src/cloudsmith_api/configuration.py index 41f00d6d8..d414ed5d6 100644 --- a/bindings/python/src/cloudsmith_api/configuration.py +++ b/bindings/python/src/cloudsmith_api/configuration.py @@ -249,5 +249,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1\n"\ - "SDK Package Version: 2.0.38".\ + "SDK Package Version: 2.0.39".\ format(env=sys.platform, pyversion=sys.version) diff --git a/bindings/python/src/cloudsmith_api/models/__init__.py b/bindings/python/src/cloudsmith_api/models/__init__.py index 46a197d6a..5fd779b2d 100644 --- a/bindings/python/src/cloudsmith_api/models/__init__.py +++ b/bindings/python/src/cloudsmith_api/models/__init__.py @@ -307,6 +307,10 @@ from cloudsmith_api.models.service_teams import ServiceTeams from cloudsmith_api.models.skills_package_upload import SkillsPackageUpload from cloudsmith_api.models.skills_package_upload_request import SkillsPackageUploadRequest +from cloudsmith_api.models.skills_upstream import SkillsUpstream +from cloudsmith_api.models.skills_upstream_request import SkillsUpstreamRequest +from cloudsmith_api.models.skills_upstream_request_patch import SkillsUpstreamRequestPatch +from cloudsmith_api.models.skills_upstream_selection import SkillsUpstreamSelection from cloudsmith_api.models.status_basic import StatusBasic from cloudsmith_api.models.storage_allocated_limit import StorageAllocatedLimit from cloudsmith_api.models.storage_allocated_limit_raw import StorageAllocatedLimitRaw diff --git a/bindings/python/src/cloudsmith_api/models/organization_api_key_rule.py b/bindings/python/src/cloudsmith_api/models/organization_api_key_rule.py index b55c178d6..30755ef42 100644 --- a/bindings/python/src/cloudsmith_api/models/organization_api_key_rule.py +++ b/bindings/python/src/cloudsmith_api/models/organization_api_key_rule.py @@ -275,7 +275,7 @@ def slug(self, slug): def slug_perm(self): """Gets the slug_perm of this OrganizationApiKeyRule. - An auto-generated id that uniquely identifies the API key policy. + An auto-generated id that uniquely identifies the rule. :return: The slug_perm of this OrganizationApiKeyRule. :rtype: str @@ -286,7 +286,7 @@ def slug_perm(self): def slug_perm(self, slug_perm): """Sets the slug_perm of this OrganizationApiKeyRule. - An auto-generated id that uniquely identifies the API key policy. + An auto-generated id that uniquely identifies the rule. :param slug_perm: The slug_perm of this OrganizationApiKeyRule. :type: str diff --git a/bindings/python/src/cloudsmith_api/models/service.py b/bindings/python/src/cloudsmith_api/models/service.py index 43f889882..13eb39c02 100644 --- a/bindings/python/src/cloudsmith_api/models/service.py +++ b/bindings/python/src/cloudsmith_api/models/service.py @@ -218,7 +218,7 @@ def key(self, key): def key_expires_at(self): """Gets the key_expires_at of this Service. - The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. + The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. :return: The key_expires_at of this Service. :rtype: datetime @@ -229,7 +229,7 @@ def key_expires_at(self): def key_expires_at(self, key_expires_at): """Sets the key_expires_at of this Service. - The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. + The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. :param key_expires_at: The key_expires_at of this Service. :type: datetime diff --git a/bindings/python/src/cloudsmith_api/models/skills_package_upload.py b/bindings/python/src/cloudsmith_api/models/skills_package_upload.py index e5f77b809..57652b995 100644 --- a/bindings/python/src/cloudsmith_api/models/skills_package_upload.py +++ b/bindings/python/src/cloudsmith_api/models/skills_package_upload.py @@ -1403,14 +1403,14 @@ def name(self, name): if self._configuration.client_side_validation and name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 if (self._configuration.client_side_validation and - name is not None and len(name) > 64): - raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + name is not None and len(name) > 128): + raise ValueError("Invalid value for `name`, length must be less than or equal to `128`") # noqa: E501 if (self._configuration.client_side_validation and name is not None and len(name) < 1): raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501 if (self._configuration.client_side_validation and - name is not None and not re.search('\\A[a-z0-9]+(?:-[a-z0-9]+)*$', name)): # noqa: E501 - raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/\\A[a-z0-9]+(?:-[a-z0-9]+)*$/`") # noqa: E501 + name is not None and not re.search('^[a-z0-9]+(?:-[a-z0-9]+)*$', name)): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^[a-z0-9]+(?:-[a-z0-9]+)*$/`") # noqa: E501 self._name = name diff --git a/bindings/python/src/cloudsmith_api/models/skills_package_upload_request.py b/bindings/python/src/cloudsmith_api/models/skills_package_upload_request.py index 9ef0211ea..3b0f75f11 100644 --- a/bindings/python/src/cloudsmith_api/models/skills_package_upload_request.py +++ b/bindings/python/src/cloudsmith_api/models/skills_package_upload_request.py @@ -90,14 +90,14 @@ def name(self, name): if self._configuration.client_side_validation and name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 if (self._configuration.client_side_validation and - name is not None and len(name) > 64): - raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + name is not None and len(name) > 128): + raise ValueError("Invalid value for `name`, length must be less than or equal to `128`") # noqa: E501 if (self._configuration.client_side_validation and name is not None and len(name) < 1): raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501 if (self._configuration.client_side_validation and - name is not None and not re.search('\\A[a-z0-9]+(?:-[a-z0-9]+)*$', name)): # noqa: E501 - raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/\\A[a-z0-9]+(?:-[a-z0-9]+)*$/`") # noqa: E501 + name is not None and not re.search('^[a-z0-9]+(?:-[a-z0-9]+)*$', name)): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^[a-z0-9]+(?:-[a-z0-9]+)*$/`") # noqa: E501 self._name = name diff --git a/bindings/python/src/cloudsmith_api/models/skills_upstream.py b/bindings/python/src/cloudsmith_api/models/skills_upstream.py new file mode 100644 index 000000000..5ec01b5bd --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/skills_upstream.py @@ -0,0 +1,935 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from cloudsmith_api.configuration import Configuration + + +class SkillsUpstream(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'auth_mode': 'str', + 'auth_secret': 'str', + 'auth_username': 'str', + 'available': 'bool', + 'can_reindex': 'bool', + 'contents': 'str', + 'created_at': 'datetime', + 'disable_reason': 'str', + 'disable_reason_text': 'str', + 'extra_header_1': 'str', + 'extra_header_2': 'str', + 'extra_value_1': 'str', + 'extra_value_2': 'str', + 'has_failed_signature_verification': 'bool', + 'index_package_count': 'int', + 'index_status': 'str', + 'is_active': 'bool', + 'last_indexed': 'str', + 'mode': 'str', + 'name': 'str', + 'pending_validation': 'bool', + 'priority': 'int', + 'selections': 'list[SkillsUpstreamSelection]', + 'slug_perm': 'str', + 'updated_at': 'datetime', + 'upstream_url': 'str', + 'verify_ssl': 'bool' + } + + attribute_map = { + 'auth_mode': 'auth_mode', + 'auth_secret': 'auth_secret', + 'auth_username': 'auth_username', + 'available': 'available', + 'can_reindex': 'can_reindex', + 'contents': 'contents', + 'created_at': 'created_at', + 'disable_reason': 'disable_reason', + 'disable_reason_text': 'disable_reason_text', + 'extra_header_1': 'extra_header_1', + 'extra_header_2': 'extra_header_2', + 'extra_value_1': 'extra_value_1', + 'extra_value_2': 'extra_value_2', + 'has_failed_signature_verification': 'has_failed_signature_verification', + 'index_package_count': 'index_package_count', + 'index_status': 'index_status', + 'is_active': 'is_active', + 'last_indexed': 'last_indexed', + 'mode': 'mode', + 'name': 'name', + 'pending_validation': 'pending_validation', + 'priority': 'priority', + 'selections': 'selections', + 'slug_perm': 'slug_perm', + 'updated_at': 'updated_at', + 'upstream_url': 'upstream_url', + 'verify_ssl': 'verify_ssl' + } + + def __init__(self, auth_mode='None', auth_secret=None, auth_username=None, available=None, can_reindex=None, contents='Skills', created_at=None, disable_reason='N/A', disable_reason_text=None, extra_header_1=None, extra_header_2=None, extra_value_1=None, extra_value_2=None, has_failed_signature_verification=None, index_package_count=None, index_status=None, is_active=None, last_indexed=None, mode='Proxy Only', name=None, pending_validation=None, priority=None, selections=None, slug_perm=None, updated_at=None, upstream_url=None, verify_ssl=None, _configuration=None): # noqa: E501 + """SkillsUpstream - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._auth_mode = None + self._auth_secret = None + self._auth_username = None + self._available = None + self._can_reindex = None + self._contents = None + self._created_at = None + self._disable_reason = None + self._disable_reason_text = None + self._extra_header_1 = None + self._extra_header_2 = None + self._extra_value_1 = None + self._extra_value_2 = None + self._has_failed_signature_verification = None + self._index_package_count = None + self._index_status = None + self._is_active = None + self._last_indexed = None + self._mode = None + self._name = None + self._pending_validation = None + self._priority = None + self._selections = None + self._slug_perm = None + self._updated_at = None + self._upstream_url = None + self._verify_ssl = None + self.discriminator = None + + if auth_mode is not None: + self.auth_mode = auth_mode + if auth_secret is not None: + self.auth_secret = auth_secret + if auth_username is not None: + self.auth_username = auth_username + if available is not None: + self.available = available + if can_reindex is not None: + self.can_reindex = can_reindex + if contents is not None: + self.contents = contents + if created_at is not None: + self.created_at = created_at + if disable_reason is not None: + self.disable_reason = disable_reason + if disable_reason_text is not None: + self.disable_reason_text = disable_reason_text + if extra_header_1 is not None: + self.extra_header_1 = extra_header_1 + if extra_header_2 is not None: + self.extra_header_2 = extra_header_2 + if extra_value_1 is not None: + self.extra_value_1 = extra_value_1 + if extra_value_2 is not None: + self.extra_value_2 = extra_value_2 + if has_failed_signature_verification is not None: + self.has_failed_signature_verification = has_failed_signature_verification + if index_package_count is not None: + self.index_package_count = index_package_count + if index_status is not None: + self.index_status = index_status + if is_active is not None: + self.is_active = is_active + if last_indexed is not None: + self.last_indexed = last_indexed + if mode is not None: + self.mode = mode + self.name = name + if pending_validation is not None: + self.pending_validation = pending_validation + if priority is not None: + self.priority = priority + if selections is not None: + self.selections = selections + if slug_perm is not None: + self.slug_perm = slug_perm + if updated_at is not None: + self.updated_at = updated_at + self.upstream_url = upstream_url + if verify_ssl is not None: + self.verify_ssl = verify_ssl + + @property + def auth_mode(self): + """Gets the auth_mode of this SkillsUpstream. + + The authentication mode to use when accessing this upstream. + + :return: The auth_mode of this SkillsUpstream. + :rtype: str + """ + return self._auth_mode + + @auth_mode.setter + def auth_mode(self, auth_mode): + """Sets the auth_mode of this SkillsUpstream. + + The authentication mode to use when accessing this upstream. + + :param auth_mode: The auth_mode of this SkillsUpstream. + :type: str + """ + allowed_values = ["None", "Token"] # noqa: E501 + if (self._configuration.client_side_validation and + auth_mode not in allowed_values): + raise ValueError( + "Invalid value for `auth_mode` ({0}), must be one of {1}" # noqa: E501 + .format(auth_mode, allowed_values) + ) + + self._auth_mode = auth_mode + + @property + def auth_secret(self): + """Gets the auth_secret of this SkillsUpstream. + + Secret to provide with requests to upstream. + + :return: The auth_secret of this SkillsUpstream. + :rtype: str + """ + return self._auth_secret + + @auth_secret.setter + def auth_secret(self, auth_secret): + """Sets the auth_secret of this SkillsUpstream. + + Secret to provide with requests to upstream. + + :param auth_secret: The auth_secret of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + auth_secret is not None and len(auth_secret) > 4096): + raise ValueError("Invalid value for `auth_secret`, length must be less than or equal to `4096`") # noqa: E501 + + self._auth_secret = auth_secret + + @property + def auth_username(self): + """Gets the auth_username of this SkillsUpstream. + + Username to provide with requests to upstream. + + :return: The auth_username of this SkillsUpstream. + :rtype: str + """ + return self._auth_username + + @auth_username.setter + def auth_username(self, auth_username): + """Sets the auth_username of this SkillsUpstream. + + Username to provide with requests to upstream. + + :param auth_username: The auth_username of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + auth_username is not None and len(auth_username) > 64): + raise ValueError("Invalid value for `auth_username`, length must be less than or equal to `64`") # noqa: E501 + + self._auth_username = auth_username + + @property + def available(self): + """Gets the available of this SkillsUpstream. + + Whether the upstream is available for use. + + :return: The available of this SkillsUpstream. + :rtype: bool + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this SkillsUpstream. + + Whether the upstream is available for use. + + :param available: The available of this SkillsUpstream. + :type: bool + """ + + self._available = available + + @property + def can_reindex(self): + """Gets the can_reindex of this SkillsUpstream. + + Whether the upstream can be reindexed. + + :return: The can_reindex of this SkillsUpstream. + :rtype: bool + """ + return self._can_reindex + + @can_reindex.setter + def can_reindex(self, can_reindex): + """Sets the can_reindex of this SkillsUpstream. + + Whether the upstream can be reindexed. + + :param can_reindex: The can_reindex of this SkillsUpstream. + :type: bool + """ + + self._can_reindex = can_reindex + + @property + def contents(self): + """Gets the contents of this SkillsUpstream. + + The package types to serve from the upstream: skills, plugins, or both. + + :return: The contents of this SkillsUpstream. + :rtype: str + """ + return self._contents + + @contents.setter + def contents(self, contents): + """Sets the contents of this SkillsUpstream. + + The package types to serve from the upstream: skills, plugins, or both. + + :param contents: The contents of this SkillsUpstream. + :type: str + """ + allowed_values = ["Skills", "Plugins", "Skills and plugins"] # noqa: E501 + if (self._configuration.client_side_validation and + contents not in allowed_values): + raise ValueError( + "Invalid value for `contents` ({0}), must be one of {1}" # noqa: E501 + .format(contents, allowed_values) + ) + + self._contents = contents + + @property + def created_at(self): + """Gets the created_at of this SkillsUpstream. + + The datetime the upstream source was created. + + :return: The created_at of this SkillsUpstream. + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this SkillsUpstream. + + The datetime the upstream source was created. + + :param created_at: The created_at of this SkillsUpstream. + :type: datetime + """ + + self._created_at = created_at + + @property + def disable_reason(self): + """Gets the disable_reason of this SkillsUpstream. + + + :return: The disable_reason of this SkillsUpstream. + :rtype: str + """ + return self._disable_reason + + @disable_reason.setter + def disable_reason(self, disable_reason): + """Sets the disable_reason of this SkillsUpstream. + + + :param disable_reason: The disable_reason of this SkillsUpstream. + :type: str + """ + allowed_values = ["N/A", "Upstream points to its own repository", "Missing upstream source", "RSA key did not verify the upstream's APKINDEX signature", "Upstream was disabled by request of user"] # noqa: E501 + if (self._configuration.client_side_validation and + disable_reason not in allowed_values): + raise ValueError( + "Invalid value for `disable_reason` ({0}), must be one of {1}" # noqa: E501 + .format(disable_reason, allowed_values) + ) + + self._disable_reason = disable_reason + + @property + def disable_reason_text(self): + """Gets the disable_reason_text of this SkillsUpstream. + + Human-readable explanation of why this upstream is disabled + + :return: The disable_reason_text of this SkillsUpstream. + :rtype: str + """ + return self._disable_reason_text + + @disable_reason_text.setter + def disable_reason_text(self, disable_reason_text): + """Sets the disable_reason_text of this SkillsUpstream. + + Human-readable explanation of why this upstream is disabled + + :param disable_reason_text: The disable_reason_text of this SkillsUpstream. + :type: str + """ + + self._disable_reason_text = disable_reason_text + + @property + def extra_header_1(self): + """Gets the extra_header_1 of this SkillsUpstream. + + The key for extra header #1 to send to upstream. + + :return: The extra_header_1 of this SkillsUpstream. + :rtype: str + """ + return self._extra_header_1 + + @extra_header_1.setter + def extra_header_1(self, extra_header_1): + """Sets the extra_header_1 of this SkillsUpstream. + + The key for extra header #1 to send to upstream. + + :param extra_header_1: The extra_header_1 of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + extra_header_1 is not None and len(extra_header_1) > 64): + raise ValueError("Invalid value for `extra_header_1`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_header_1 is not None and not re.search('^[-\\w]+$', extra_header_1)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_header_1`, must be a follow pattern or equal to `/^[-\\w]+$/`") # noqa: E501 + + self._extra_header_1 = extra_header_1 + + @property + def extra_header_2(self): + """Gets the extra_header_2 of this SkillsUpstream. + + The key for extra header #2 to send to upstream. + + :return: The extra_header_2 of this SkillsUpstream. + :rtype: str + """ + return self._extra_header_2 + + @extra_header_2.setter + def extra_header_2(self, extra_header_2): + """Sets the extra_header_2 of this SkillsUpstream. + + The key for extra header #2 to send to upstream. + + :param extra_header_2: The extra_header_2 of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + extra_header_2 is not None and len(extra_header_2) > 64): + raise ValueError("Invalid value for `extra_header_2`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_header_2 is not None and not re.search('^[-\\w]+$', extra_header_2)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_header_2`, must be a follow pattern or equal to `/^[-\\w]+$/`") # noqa: E501 + + self._extra_header_2 = extra_header_2 + + @property + def extra_value_1(self): + """Gets the extra_value_1 of this SkillsUpstream. + + The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :return: The extra_value_1 of this SkillsUpstream. + :rtype: str + """ + return self._extra_value_1 + + @extra_value_1.setter + def extra_value_1(self, extra_value_1): + """Sets the extra_value_1 of this SkillsUpstream. + + The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :param extra_value_1: The extra_value_1 of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + extra_value_1 is not None and len(extra_value_1) > 128): + raise ValueError("Invalid value for `extra_value_1`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_value_1 is not None and not re.search('^[^\\n\\r]+$', extra_value_1)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_value_1`, must be a follow pattern or equal to `/^[^\\n\\r]+$/`") # noqa: E501 + + self._extra_value_1 = extra_value_1 + + @property + def extra_value_2(self): + """Gets the extra_value_2 of this SkillsUpstream. + + The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :return: The extra_value_2 of this SkillsUpstream. + :rtype: str + """ + return self._extra_value_2 + + @extra_value_2.setter + def extra_value_2(self, extra_value_2): + """Sets the extra_value_2 of this SkillsUpstream. + + The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :param extra_value_2: The extra_value_2 of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + extra_value_2 is not None and len(extra_value_2) > 128): + raise ValueError("Invalid value for `extra_value_2`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_value_2 is not None and not re.search('^[^\\n\\r]+$', extra_value_2)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_value_2`, must be a follow pattern or equal to `/^[^\\n\\r]+$/`") # noqa: E501 + + self._extra_value_2 = extra_value_2 + + @property + def has_failed_signature_verification(self): + """Gets the has_failed_signature_verification of this SkillsUpstream. + + Whether the upstream has failed signature verification. + + :return: The has_failed_signature_verification of this SkillsUpstream. + :rtype: bool + """ + return self._has_failed_signature_verification + + @has_failed_signature_verification.setter + def has_failed_signature_verification(self, has_failed_signature_verification): + """Sets the has_failed_signature_verification of this SkillsUpstream. + + Whether the upstream has failed signature verification. + + :param has_failed_signature_verification: The has_failed_signature_verification of this SkillsUpstream. + :type: bool + """ + + self._has_failed_signature_verification = has_failed_signature_verification + + @property + def index_package_count(self): + """Gets the index_package_count of this SkillsUpstream. + + The number of packages available in this upstream source + + :return: The index_package_count of this SkillsUpstream. + :rtype: int + """ + return self._index_package_count + + @index_package_count.setter + def index_package_count(self, index_package_count): + """Sets the index_package_count of this SkillsUpstream. + + The number of packages available in this upstream source + + :param index_package_count: The index_package_count of this SkillsUpstream. + :type: int + """ + + self._index_package_count = index_package_count + + @property + def index_status(self): + """Gets the index_status of this SkillsUpstream. + + The current indexing status of this upstream source + + :return: The index_status of this SkillsUpstream. + :rtype: str + """ + return self._index_status + + @index_status.setter + def index_status(self, index_status): + """Sets the index_status of this SkillsUpstream. + + The current indexing status of this upstream source + + :param index_status: The index_status of this SkillsUpstream. + :type: str + """ + + self._index_status = index_status + + @property + def is_active(self): + """Gets the is_active of this SkillsUpstream. + + Whether or not this upstream is active and ready for requests. + + :return: The is_active of this SkillsUpstream. + :rtype: bool + """ + return self._is_active + + @is_active.setter + def is_active(self, is_active): + """Sets the is_active of this SkillsUpstream. + + Whether or not this upstream is active and ready for requests. + + :param is_active: The is_active of this SkillsUpstream. + :type: bool + """ + + self._is_active = is_active + + @property + def last_indexed(self): + """Gets the last_indexed of this SkillsUpstream. + + The last time this upstream source was indexed + + :return: The last_indexed of this SkillsUpstream. + :rtype: str + """ + return self._last_indexed + + @last_indexed.setter + def last_indexed(self, last_indexed): + """Sets the last_indexed of this SkillsUpstream. + + The last time this upstream source was indexed + + :param last_indexed: The last_indexed of this SkillsUpstream. + :type: str + """ + + self._last_indexed = last_indexed + + @property + def mode(self): + """Gets the mode of this SkillsUpstream. + + The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + + :return: The mode of this SkillsUpstream. + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this SkillsUpstream. + + The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + + :param mode: The mode of this SkillsUpstream. + :type: str + """ + allowed_values = ["Proxy Only", "Cache and Proxy", "Cache Only"] # noqa: E501 + if (self._configuration.client_side_validation and + mode not in allowed_values): + raise ValueError( + "Invalid value for `mode` ({0}), must be one of {1}" # noqa: E501 + .format(mode, allowed_values) + ) + + self._mode = mode + + @property + def name(self): + """Gets the name of this SkillsUpstream. + + A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + + :return: The name of this SkillsUpstream. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SkillsUpstream. + + A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + + :param name: The name of this SkillsUpstream. + :type: str + """ + if self._configuration.client_side_validation and name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) > 64): + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) < 1): + raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and not re.search('^\\w[\\w \\-\'\\.\\/()]+$', name)): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^\\w[\\w \\-'\\.\/()]+$/`") # noqa: E501 + + self._name = name + + @property + def pending_validation(self): + """Gets the pending_validation of this SkillsUpstream. + + When true, this upstream source is pending validation. + + :return: The pending_validation of this SkillsUpstream. + :rtype: bool + """ + return self._pending_validation + + @pending_validation.setter + def pending_validation(self, pending_validation): + """Sets the pending_validation of this SkillsUpstream. + + When true, this upstream source is pending validation. + + :param pending_validation: The pending_validation of this SkillsUpstream. + :type: bool + """ + + self._pending_validation = pending_validation + + @property + def priority(self): + """Gets the priority of this SkillsUpstream. + + Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + + :return: The priority of this SkillsUpstream. + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this SkillsUpstream. + + Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + + :param priority: The priority of this SkillsUpstream. + :type: int + """ + if (self._configuration.client_side_validation and + priority is not None and priority > 32767): # noqa: E501 + raise ValueError("Invalid value for `priority`, must be a value less than or equal to `32767`") # noqa: E501 + if (self._configuration.client_side_validation and + priority is not None and priority < 1): # noqa: E501 + raise ValueError("Invalid value for `priority`, must be a value greater than or equal to `1`") # noqa: E501 + + self._priority = priority + + @property + def selections(self): + """Gets the selections of this SkillsUpstream. + + Exact ClawHub releases to cache. + + :return: The selections of this SkillsUpstream. + :rtype: list[SkillsUpstreamSelection] + """ + return self._selections + + @selections.setter + def selections(self, selections): + """Sets the selections of this SkillsUpstream. + + Exact ClawHub releases to cache. + + :param selections: The selections of this SkillsUpstream. + :type: list[SkillsUpstreamSelection] + """ + + self._selections = selections + + @property + def slug_perm(self): + """Gets the slug_perm of this SkillsUpstream. + + + :return: The slug_perm of this SkillsUpstream. + :rtype: str + """ + return self._slug_perm + + @slug_perm.setter + def slug_perm(self, slug_perm): + """Sets the slug_perm of this SkillsUpstream. + + + :param slug_perm: The slug_perm of this SkillsUpstream. + :type: str + """ + if (self._configuration.client_side_validation and + slug_perm is not None and len(slug_perm) < 1): + raise ValueError("Invalid value for `slug_perm`, length must be greater than or equal to `1`") # noqa: E501 + if (self._configuration.client_side_validation and + slug_perm is not None and not re.search('^[-a-zA-Z0-9_]+$', slug_perm)): # noqa: E501 + raise ValueError(r"Invalid value for `slug_perm`, must be a follow pattern or equal to `/^[-a-zA-Z0-9_]+$/`") # noqa: E501 + + self._slug_perm = slug_perm + + @property + def updated_at(self): + """Gets the updated_at of this SkillsUpstream. + + + :return: The updated_at of this SkillsUpstream. + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this SkillsUpstream. + + + :param updated_at: The updated_at of this SkillsUpstream. + :type: datetime + """ + + self._updated_at = updated_at + + @property + def upstream_url(self): + """Gets the upstream_url of this SkillsUpstream. + + The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + + :return: The upstream_url of this SkillsUpstream. + :rtype: str + """ + return self._upstream_url + + @upstream_url.setter + def upstream_url(self, upstream_url): + """Sets the upstream_url of this SkillsUpstream. + + The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + + :param upstream_url: The upstream_url of this SkillsUpstream. + :type: str + """ + if self._configuration.client_side_validation and upstream_url is None: + raise ValueError("Invalid value for `upstream_url`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + upstream_url is not None and len(upstream_url) > 200): + raise ValueError("Invalid value for `upstream_url`, length must be less than or equal to `200`") # noqa: E501 + if (self._configuration.client_side_validation and + upstream_url is not None and len(upstream_url) < 1): + raise ValueError("Invalid value for `upstream_url`, length must be greater than or equal to `1`") # noqa: E501 + + self._upstream_url = upstream_url + + @property + def verify_ssl(self): + """Gets the verify_ssl of this SkillsUpstream. + + If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + + :return: The verify_ssl of this SkillsUpstream. + :rtype: bool + """ + return self._verify_ssl + + @verify_ssl.setter + def verify_ssl(self, verify_ssl): + """Sets the verify_ssl of this SkillsUpstream. + + If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + + :param verify_ssl: The verify_ssl of this SkillsUpstream. + :type: bool + """ + + self._verify_ssl = verify_ssl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SkillsUpstream, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SkillsUpstream): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SkillsUpstream): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/cloudsmith_api/models/skills_upstream_request.py b/bindings/python/src/cloudsmith_api/models/skills_upstream_request.py new file mode 100644 index 000000000..4bf7956f2 --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/skills_upstream_request.py @@ -0,0 +1,592 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from cloudsmith_api.configuration import Configuration + + +class SkillsUpstreamRequest(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'auth_mode': 'str', + 'auth_secret': 'str', + 'auth_username': 'str', + 'contents': 'str', + 'extra_header_1': 'str', + 'extra_header_2': 'str', + 'extra_value_1': 'str', + 'extra_value_2': 'str', + 'is_active': 'bool', + 'mode': 'str', + 'name': 'str', + 'priority': 'int', + 'selections': 'list[SkillsUpstreamSelection]', + 'upstream_url': 'str', + 'verify_ssl': 'bool' + } + + attribute_map = { + 'auth_mode': 'auth_mode', + 'auth_secret': 'auth_secret', + 'auth_username': 'auth_username', + 'contents': 'contents', + 'extra_header_1': 'extra_header_1', + 'extra_header_2': 'extra_header_2', + 'extra_value_1': 'extra_value_1', + 'extra_value_2': 'extra_value_2', + 'is_active': 'is_active', + 'mode': 'mode', + 'name': 'name', + 'priority': 'priority', + 'selections': 'selections', + 'upstream_url': 'upstream_url', + 'verify_ssl': 'verify_ssl' + } + + def __init__(self, auth_mode='None', auth_secret=None, auth_username=None, contents='Skills', extra_header_1=None, extra_header_2=None, extra_value_1=None, extra_value_2=None, is_active=None, mode='Proxy Only', name=None, priority=None, selections=None, upstream_url=None, verify_ssl=None, _configuration=None): # noqa: E501 + """SkillsUpstreamRequest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._auth_mode = None + self._auth_secret = None + self._auth_username = None + self._contents = None + self._extra_header_1 = None + self._extra_header_2 = None + self._extra_value_1 = None + self._extra_value_2 = None + self._is_active = None + self._mode = None + self._name = None + self._priority = None + self._selections = None + self._upstream_url = None + self._verify_ssl = None + self.discriminator = None + + if auth_mode is not None: + self.auth_mode = auth_mode + if auth_secret is not None: + self.auth_secret = auth_secret + if auth_username is not None: + self.auth_username = auth_username + if contents is not None: + self.contents = contents + if extra_header_1 is not None: + self.extra_header_1 = extra_header_1 + if extra_header_2 is not None: + self.extra_header_2 = extra_header_2 + if extra_value_1 is not None: + self.extra_value_1 = extra_value_1 + if extra_value_2 is not None: + self.extra_value_2 = extra_value_2 + if is_active is not None: + self.is_active = is_active + if mode is not None: + self.mode = mode + self.name = name + if priority is not None: + self.priority = priority + if selections is not None: + self.selections = selections + self.upstream_url = upstream_url + if verify_ssl is not None: + self.verify_ssl = verify_ssl + + @property + def auth_mode(self): + """Gets the auth_mode of this SkillsUpstreamRequest. + + The authentication mode to use when accessing this upstream. + + :return: The auth_mode of this SkillsUpstreamRequest. + :rtype: str + """ + return self._auth_mode + + @auth_mode.setter + def auth_mode(self, auth_mode): + """Sets the auth_mode of this SkillsUpstreamRequest. + + The authentication mode to use when accessing this upstream. + + :param auth_mode: The auth_mode of this SkillsUpstreamRequest. + :type: str + """ + allowed_values = ["None", "Token"] # noqa: E501 + if (self._configuration.client_side_validation and + auth_mode not in allowed_values): + raise ValueError( + "Invalid value for `auth_mode` ({0}), must be one of {1}" # noqa: E501 + .format(auth_mode, allowed_values) + ) + + self._auth_mode = auth_mode + + @property + def auth_secret(self): + """Gets the auth_secret of this SkillsUpstreamRequest. + + Secret to provide with requests to upstream. + + :return: The auth_secret of this SkillsUpstreamRequest. + :rtype: str + """ + return self._auth_secret + + @auth_secret.setter + def auth_secret(self, auth_secret): + """Sets the auth_secret of this SkillsUpstreamRequest. + + Secret to provide with requests to upstream. + + :param auth_secret: The auth_secret of this SkillsUpstreamRequest. + :type: str + """ + if (self._configuration.client_side_validation and + auth_secret is not None and len(auth_secret) > 4096): + raise ValueError("Invalid value for `auth_secret`, length must be less than or equal to `4096`") # noqa: E501 + + self._auth_secret = auth_secret + + @property + def auth_username(self): + """Gets the auth_username of this SkillsUpstreamRequest. + + Username to provide with requests to upstream. + + :return: The auth_username of this SkillsUpstreamRequest. + :rtype: str + """ + return self._auth_username + + @auth_username.setter + def auth_username(self, auth_username): + """Sets the auth_username of this SkillsUpstreamRequest. + + Username to provide with requests to upstream. + + :param auth_username: The auth_username of this SkillsUpstreamRequest. + :type: str + """ + if (self._configuration.client_side_validation and + auth_username is not None and len(auth_username) > 64): + raise ValueError("Invalid value for `auth_username`, length must be less than or equal to `64`") # noqa: E501 + + self._auth_username = auth_username + + @property + def contents(self): + """Gets the contents of this SkillsUpstreamRequest. + + The package types to serve from the upstream: skills, plugins, or both. + + :return: The contents of this SkillsUpstreamRequest. + :rtype: str + """ + return self._contents + + @contents.setter + def contents(self, contents): + """Sets the contents of this SkillsUpstreamRequest. + + The package types to serve from the upstream: skills, plugins, or both. + + :param contents: The contents of this SkillsUpstreamRequest. + :type: str + """ + allowed_values = ["Skills", "Plugins", "Skills and plugins"] # noqa: E501 + if (self._configuration.client_side_validation and + contents not in allowed_values): + raise ValueError( + "Invalid value for `contents` ({0}), must be one of {1}" # noqa: E501 + .format(contents, allowed_values) + ) + + self._contents = contents + + @property + def extra_header_1(self): + """Gets the extra_header_1 of this SkillsUpstreamRequest. + + The key for extra header #1 to send to upstream. + + :return: The extra_header_1 of this SkillsUpstreamRequest. + :rtype: str + """ + return self._extra_header_1 + + @extra_header_1.setter + def extra_header_1(self, extra_header_1): + """Sets the extra_header_1 of this SkillsUpstreamRequest. + + The key for extra header #1 to send to upstream. + + :param extra_header_1: The extra_header_1 of this SkillsUpstreamRequest. + :type: str + """ + if (self._configuration.client_side_validation and + extra_header_1 is not None and len(extra_header_1) > 64): + raise ValueError("Invalid value for `extra_header_1`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_header_1 is not None and not re.search('^[-\\w]+$', extra_header_1)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_header_1`, must be a follow pattern or equal to `/^[-\\w]+$/`") # noqa: E501 + + self._extra_header_1 = extra_header_1 + + @property + def extra_header_2(self): + """Gets the extra_header_2 of this SkillsUpstreamRequest. + + The key for extra header #2 to send to upstream. + + :return: The extra_header_2 of this SkillsUpstreamRequest. + :rtype: str + """ + return self._extra_header_2 + + @extra_header_2.setter + def extra_header_2(self, extra_header_2): + """Sets the extra_header_2 of this SkillsUpstreamRequest. + + The key for extra header #2 to send to upstream. + + :param extra_header_2: The extra_header_2 of this SkillsUpstreamRequest. + :type: str + """ + if (self._configuration.client_side_validation and + extra_header_2 is not None and len(extra_header_2) > 64): + raise ValueError("Invalid value for `extra_header_2`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_header_2 is not None and not re.search('^[-\\w]+$', extra_header_2)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_header_2`, must be a follow pattern or equal to `/^[-\\w]+$/`") # noqa: E501 + + self._extra_header_2 = extra_header_2 + + @property + def extra_value_1(self): + """Gets the extra_value_1 of this SkillsUpstreamRequest. + + The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :return: The extra_value_1 of this SkillsUpstreamRequest. + :rtype: str + """ + return self._extra_value_1 + + @extra_value_1.setter + def extra_value_1(self, extra_value_1): + """Sets the extra_value_1 of this SkillsUpstreamRequest. + + The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :param extra_value_1: The extra_value_1 of this SkillsUpstreamRequest. + :type: str + """ + if (self._configuration.client_side_validation and + extra_value_1 is not None and len(extra_value_1) > 128): + raise ValueError("Invalid value for `extra_value_1`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_value_1 is not None and not re.search('^[^\\n\\r]+$', extra_value_1)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_value_1`, must be a follow pattern or equal to `/^[^\\n\\r]+$/`") # noqa: E501 + + self._extra_value_1 = extra_value_1 + + @property + def extra_value_2(self): + """Gets the extra_value_2 of this SkillsUpstreamRequest. + + The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :return: The extra_value_2 of this SkillsUpstreamRequest. + :rtype: str + """ + return self._extra_value_2 + + @extra_value_2.setter + def extra_value_2(self, extra_value_2): + """Sets the extra_value_2 of this SkillsUpstreamRequest. + + The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :param extra_value_2: The extra_value_2 of this SkillsUpstreamRequest. + :type: str + """ + if (self._configuration.client_side_validation and + extra_value_2 is not None and len(extra_value_2) > 128): + raise ValueError("Invalid value for `extra_value_2`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_value_2 is not None and not re.search('^[^\\n\\r]+$', extra_value_2)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_value_2`, must be a follow pattern or equal to `/^[^\\n\\r]+$/`") # noqa: E501 + + self._extra_value_2 = extra_value_2 + + @property + def is_active(self): + """Gets the is_active of this SkillsUpstreamRequest. + + Whether or not this upstream is active and ready for requests. + + :return: The is_active of this SkillsUpstreamRequest. + :rtype: bool + """ + return self._is_active + + @is_active.setter + def is_active(self, is_active): + """Sets the is_active of this SkillsUpstreamRequest. + + Whether or not this upstream is active and ready for requests. + + :param is_active: The is_active of this SkillsUpstreamRequest. + :type: bool + """ + + self._is_active = is_active + + @property + def mode(self): + """Gets the mode of this SkillsUpstreamRequest. + + The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + + :return: The mode of this SkillsUpstreamRequest. + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this SkillsUpstreamRequest. + + The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + + :param mode: The mode of this SkillsUpstreamRequest. + :type: str + """ + allowed_values = ["Proxy Only", "Cache and Proxy", "Cache Only"] # noqa: E501 + if (self._configuration.client_side_validation and + mode not in allowed_values): + raise ValueError( + "Invalid value for `mode` ({0}), must be one of {1}" # noqa: E501 + .format(mode, allowed_values) + ) + + self._mode = mode + + @property + def name(self): + """Gets the name of this SkillsUpstreamRequest. + + A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + + :return: The name of this SkillsUpstreamRequest. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SkillsUpstreamRequest. + + A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + + :param name: The name of this SkillsUpstreamRequest. + :type: str + """ + if self._configuration.client_side_validation and name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) > 64): + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) < 1): + raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and not re.search('^\\w[\\w \\-\'\\.\\/()]+$', name)): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^\\w[\\w \\-'\\.\/()]+$/`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this SkillsUpstreamRequest. + + Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + + :return: The priority of this SkillsUpstreamRequest. + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this SkillsUpstreamRequest. + + Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + + :param priority: The priority of this SkillsUpstreamRequest. + :type: int + """ + if (self._configuration.client_side_validation and + priority is not None and priority > 32767): # noqa: E501 + raise ValueError("Invalid value for `priority`, must be a value less than or equal to `32767`") # noqa: E501 + if (self._configuration.client_side_validation and + priority is not None and priority < 1): # noqa: E501 + raise ValueError("Invalid value for `priority`, must be a value greater than or equal to `1`") # noqa: E501 + + self._priority = priority + + @property + def selections(self): + """Gets the selections of this SkillsUpstreamRequest. + + Exact ClawHub releases to cache. + + :return: The selections of this SkillsUpstreamRequest. + :rtype: list[SkillsUpstreamSelection] + """ + return self._selections + + @selections.setter + def selections(self, selections): + """Sets the selections of this SkillsUpstreamRequest. + + Exact ClawHub releases to cache. + + :param selections: The selections of this SkillsUpstreamRequest. + :type: list[SkillsUpstreamSelection] + """ + + self._selections = selections + + @property + def upstream_url(self): + """Gets the upstream_url of this SkillsUpstreamRequest. + + The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + + :return: The upstream_url of this SkillsUpstreamRequest. + :rtype: str + """ + return self._upstream_url + + @upstream_url.setter + def upstream_url(self, upstream_url): + """Sets the upstream_url of this SkillsUpstreamRequest. + + The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + + :param upstream_url: The upstream_url of this SkillsUpstreamRequest. + :type: str + """ + if self._configuration.client_side_validation and upstream_url is None: + raise ValueError("Invalid value for `upstream_url`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + upstream_url is not None and len(upstream_url) > 200): + raise ValueError("Invalid value for `upstream_url`, length must be less than or equal to `200`") # noqa: E501 + if (self._configuration.client_side_validation and + upstream_url is not None and len(upstream_url) < 1): + raise ValueError("Invalid value for `upstream_url`, length must be greater than or equal to `1`") # noqa: E501 + + self._upstream_url = upstream_url + + @property + def verify_ssl(self): + """Gets the verify_ssl of this SkillsUpstreamRequest. + + If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + + :return: The verify_ssl of this SkillsUpstreamRequest. + :rtype: bool + """ + return self._verify_ssl + + @verify_ssl.setter + def verify_ssl(self, verify_ssl): + """Sets the verify_ssl of this SkillsUpstreamRequest. + + If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + + :param verify_ssl: The verify_ssl of this SkillsUpstreamRequest. + :type: bool + """ + + self._verify_ssl = verify_ssl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SkillsUpstreamRequest, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SkillsUpstreamRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SkillsUpstreamRequest): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/cloudsmith_api/models/skills_upstream_request_patch.py b/bindings/python/src/cloudsmith_api/models/skills_upstream_request_patch.py new file mode 100644 index 000000000..ffbace2aa --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/skills_upstream_request_patch.py @@ -0,0 +1,590 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from cloudsmith_api.configuration import Configuration + + +class SkillsUpstreamRequestPatch(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'auth_mode': 'str', + 'auth_secret': 'str', + 'auth_username': 'str', + 'contents': 'str', + 'extra_header_1': 'str', + 'extra_header_2': 'str', + 'extra_value_1': 'str', + 'extra_value_2': 'str', + 'is_active': 'bool', + 'mode': 'str', + 'name': 'str', + 'priority': 'int', + 'selections': 'list[SkillsUpstreamSelection]', + 'upstream_url': 'str', + 'verify_ssl': 'bool' + } + + attribute_map = { + 'auth_mode': 'auth_mode', + 'auth_secret': 'auth_secret', + 'auth_username': 'auth_username', + 'contents': 'contents', + 'extra_header_1': 'extra_header_1', + 'extra_header_2': 'extra_header_2', + 'extra_value_1': 'extra_value_1', + 'extra_value_2': 'extra_value_2', + 'is_active': 'is_active', + 'mode': 'mode', + 'name': 'name', + 'priority': 'priority', + 'selections': 'selections', + 'upstream_url': 'upstream_url', + 'verify_ssl': 'verify_ssl' + } + + def __init__(self, auth_mode='None', auth_secret=None, auth_username=None, contents='Skills', extra_header_1=None, extra_header_2=None, extra_value_1=None, extra_value_2=None, is_active=None, mode='Proxy Only', name=None, priority=None, selections=None, upstream_url=None, verify_ssl=None, _configuration=None): # noqa: E501 + """SkillsUpstreamRequestPatch - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._auth_mode = None + self._auth_secret = None + self._auth_username = None + self._contents = None + self._extra_header_1 = None + self._extra_header_2 = None + self._extra_value_1 = None + self._extra_value_2 = None + self._is_active = None + self._mode = None + self._name = None + self._priority = None + self._selections = None + self._upstream_url = None + self._verify_ssl = None + self.discriminator = None + + if auth_mode is not None: + self.auth_mode = auth_mode + if auth_secret is not None: + self.auth_secret = auth_secret + if auth_username is not None: + self.auth_username = auth_username + if contents is not None: + self.contents = contents + if extra_header_1 is not None: + self.extra_header_1 = extra_header_1 + if extra_header_2 is not None: + self.extra_header_2 = extra_header_2 + if extra_value_1 is not None: + self.extra_value_1 = extra_value_1 + if extra_value_2 is not None: + self.extra_value_2 = extra_value_2 + if is_active is not None: + self.is_active = is_active + if mode is not None: + self.mode = mode + if name is not None: + self.name = name + if priority is not None: + self.priority = priority + if selections is not None: + self.selections = selections + if upstream_url is not None: + self.upstream_url = upstream_url + if verify_ssl is not None: + self.verify_ssl = verify_ssl + + @property + def auth_mode(self): + """Gets the auth_mode of this SkillsUpstreamRequestPatch. + + The authentication mode to use when accessing this upstream. + + :return: The auth_mode of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._auth_mode + + @auth_mode.setter + def auth_mode(self, auth_mode): + """Sets the auth_mode of this SkillsUpstreamRequestPatch. + + The authentication mode to use when accessing this upstream. + + :param auth_mode: The auth_mode of this SkillsUpstreamRequestPatch. + :type: str + """ + allowed_values = ["None", "Token"] # noqa: E501 + if (self._configuration.client_side_validation and + auth_mode not in allowed_values): + raise ValueError( + "Invalid value for `auth_mode` ({0}), must be one of {1}" # noqa: E501 + .format(auth_mode, allowed_values) + ) + + self._auth_mode = auth_mode + + @property + def auth_secret(self): + """Gets the auth_secret of this SkillsUpstreamRequestPatch. + + Secret to provide with requests to upstream. + + :return: The auth_secret of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._auth_secret + + @auth_secret.setter + def auth_secret(self, auth_secret): + """Sets the auth_secret of this SkillsUpstreamRequestPatch. + + Secret to provide with requests to upstream. + + :param auth_secret: The auth_secret of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + auth_secret is not None and len(auth_secret) > 4096): + raise ValueError("Invalid value for `auth_secret`, length must be less than or equal to `4096`") # noqa: E501 + + self._auth_secret = auth_secret + + @property + def auth_username(self): + """Gets the auth_username of this SkillsUpstreamRequestPatch. + + Username to provide with requests to upstream. + + :return: The auth_username of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._auth_username + + @auth_username.setter + def auth_username(self, auth_username): + """Sets the auth_username of this SkillsUpstreamRequestPatch. + + Username to provide with requests to upstream. + + :param auth_username: The auth_username of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + auth_username is not None and len(auth_username) > 64): + raise ValueError("Invalid value for `auth_username`, length must be less than or equal to `64`") # noqa: E501 + + self._auth_username = auth_username + + @property + def contents(self): + """Gets the contents of this SkillsUpstreamRequestPatch. + + The package types to serve from the upstream: skills, plugins, or both. + + :return: The contents of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._contents + + @contents.setter + def contents(self, contents): + """Sets the contents of this SkillsUpstreamRequestPatch. + + The package types to serve from the upstream: skills, plugins, or both. + + :param contents: The contents of this SkillsUpstreamRequestPatch. + :type: str + """ + allowed_values = ["Skills", "Plugins", "Skills and plugins"] # noqa: E501 + if (self._configuration.client_side_validation and + contents not in allowed_values): + raise ValueError( + "Invalid value for `contents` ({0}), must be one of {1}" # noqa: E501 + .format(contents, allowed_values) + ) + + self._contents = contents + + @property + def extra_header_1(self): + """Gets the extra_header_1 of this SkillsUpstreamRequestPatch. + + The key for extra header #1 to send to upstream. + + :return: The extra_header_1 of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._extra_header_1 + + @extra_header_1.setter + def extra_header_1(self, extra_header_1): + """Sets the extra_header_1 of this SkillsUpstreamRequestPatch. + + The key for extra header #1 to send to upstream. + + :param extra_header_1: The extra_header_1 of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + extra_header_1 is not None and len(extra_header_1) > 64): + raise ValueError("Invalid value for `extra_header_1`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_header_1 is not None and not re.search('^[-\\w]+$', extra_header_1)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_header_1`, must be a follow pattern or equal to `/^[-\\w]+$/`") # noqa: E501 + + self._extra_header_1 = extra_header_1 + + @property + def extra_header_2(self): + """Gets the extra_header_2 of this SkillsUpstreamRequestPatch. + + The key for extra header #2 to send to upstream. + + :return: The extra_header_2 of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._extra_header_2 + + @extra_header_2.setter + def extra_header_2(self, extra_header_2): + """Sets the extra_header_2 of this SkillsUpstreamRequestPatch. + + The key for extra header #2 to send to upstream. + + :param extra_header_2: The extra_header_2 of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + extra_header_2 is not None and len(extra_header_2) > 64): + raise ValueError("Invalid value for `extra_header_2`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_header_2 is not None and not re.search('^[-\\w]+$', extra_header_2)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_header_2`, must be a follow pattern or equal to `/^[-\\w]+$/`") # noqa: E501 + + self._extra_header_2 = extra_header_2 + + @property + def extra_value_1(self): + """Gets the extra_value_1 of this SkillsUpstreamRequestPatch. + + The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :return: The extra_value_1 of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._extra_value_1 + + @extra_value_1.setter + def extra_value_1(self, extra_value_1): + """Sets the extra_value_1 of this SkillsUpstreamRequestPatch. + + The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :param extra_value_1: The extra_value_1 of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + extra_value_1 is not None and len(extra_value_1) > 128): + raise ValueError("Invalid value for `extra_value_1`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_value_1 is not None and not re.search('^[^\\n\\r]+$', extra_value_1)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_value_1`, must be a follow pattern or equal to `/^[^\\n\\r]+$/`") # noqa: E501 + + self._extra_value_1 = extra_value_1 + + @property + def extra_value_2(self): + """Gets the extra_value_2 of this SkillsUpstreamRequestPatch. + + The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :return: The extra_value_2 of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._extra_value_2 + + @extra_value_2.setter + def extra_value_2(self, extra_value_2): + """Sets the extra_value_2 of this SkillsUpstreamRequestPatch. + + The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + + :param extra_value_2: The extra_value_2 of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + extra_value_2 is not None and len(extra_value_2) > 128): + raise ValueError("Invalid value for `extra_value_2`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + extra_value_2 is not None and not re.search('^[^\\n\\r]+$', extra_value_2)): # noqa: E501 + raise ValueError(r"Invalid value for `extra_value_2`, must be a follow pattern or equal to `/^[^\\n\\r]+$/`") # noqa: E501 + + self._extra_value_2 = extra_value_2 + + @property + def is_active(self): + """Gets the is_active of this SkillsUpstreamRequestPatch. + + Whether or not this upstream is active and ready for requests. + + :return: The is_active of this SkillsUpstreamRequestPatch. + :rtype: bool + """ + return self._is_active + + @is_active.setter + def is_active(self, is_active): + """Sets the is_active of this SkillsUpstreamRequestPatch. + + Whether or not this upstream is active and ready for requests. + + :param is_active: The is_active of this SkillsUpstreamRequestPatch. + :type: bool + """ + + self._is_active = is_active + + @property + def mode(self): + """Gets the mode of this SkillsUpstreamRequestPatch. + + The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + + :return: The mode of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this SkillsUpstreamRequestPatch. + + The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + + :param mode: The mode of this SkillsUpstreamRequestPatch. + :type: str + """ + allowed_values = ["Proxy Only", "Cache and Proxy", "Cache Only"] # noqa: E501 + if (self._configuration.client_side_validation and + mode not in allowed_values): + raise ValueError( + "Invalid value for `mode` ({0}), must be one of {1}" # noqa: E501 + .format(mode, allowed_values) + ) + + self._mode = mode + + @property + def name(self): + """Gets the name of this SkillsUpstreamRequestPatch. + + A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + + :return: The name of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SkillsUpstreamRequestPatch. + + A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + + :param name: The name of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + name is not None and len(name) > 64): + raise ValueError("Invalid value for `name`, length must be less than or equal to `64`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) < 1): + raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and not re.search('^\\w[\\w \\-\'\\.\\/()]+$', name)): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^\\w[\\w \\-'\\.\/()]+$/`") # noqa: E501 + + self._name = name + + @property + def priority(self): + """Gets the priority of this SkillsUpstreamRequestPatch. + + Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + + :return: The priority of this SkillsUpstreamRequestPatch. + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this SkillsUpstreamRequestPatch. + + Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + + :param priority: The priority of this SkillsUpstreamRequestPatch. + :type: int + """ + if (self._configuration.client_side_validation and + priority is not None and priority > 32767): # noqa: E501 + raise ValueError("Invalid value for `priority`, must be a value less than or equal to `32767`") # noqa: E501 + if (self._configuration.client_side_validation and + priority is not None and priority < 1): # noqa: E501 + raise ValueError("Invalid value for `priority`, must be a value greater than or equal to `1`") # noqa: E501 + + self._priority = priority + + @property + def selections(self): + """Gets the selections of this SkillsUpstreamRequestPatch. + + Exact ClawHub releases to cache. + + :return: The selections of this SkillsUpstreamRequestPatch. + :rtype: list[SkillsUpstreamSelection] + """ + return self._selections + + @selections.setter + def selections(self, selections): + """Sets the selections of this SkillsUpstreamRequestPatch. + + Exact ClawHub releases to cache. + + :param selections: The selections of this SkillsUpstreamRequestPatch. + :type: list[SkillsUpstreamSelection] + """ + + self._selections = selections + + @property + def upstream_url(self): + """Gets the upstream_url of this SkillsUpstreamRequestPatch. + + The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + + :return: The upstream_url of this SkillsUpstreamRequestPatch. + :rtype: str + """ + return self._upstream_url + + @upstream_url.setter + def upstream_url(self, upstream_url): + """Sets the upstream_url of this SkillsUpstreamRequestPatch. + + The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + + :param upstream_url: The upstream_url of this SkillsUpstreamRequestPatch. + :type: str + """ + if (self._configuration.client_side_validation and + upstream_url is not None and len(upstream_url) > 200): + raise ValueError("Invalid value for `upstream_url`, length must be less than or equal to `200`") # noqa: E501 + if (self._configuration.client_side_validation and + upstream_url is not None and len(upstream_url) < 1): + raise ValueError("Invalid value for `upstream_url`, length must be greater than or equal to `1`") # noqa: E501 + + self._upstream_url = upstream_url + + @property + def verify_ssl(self): + """Gets the verify_ssl of this SkillsUpstreamRequestPatch. + + If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + + :return: The verify_ssl of this SkillsUpstreamRequestPatch. + :rtype: bool + """ + return self._verify_ssl + + @verify_ssl.setter + def verify_ssl(self, verify_ssl): + """Sets the verify_ssl of this SkillsUpstreamRequestPatch. + + If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + + :param verify_ssl: The verify_ssl of this SkillsUpstreamRequestPatch. + :type: bool + """ + + self._verify_ssl = verify_ssl + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SkillsUpstreamRequestPatch, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SkillsUpstreamRequestPatch): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SkillsUpstreamRequestPatch): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/cloudsmith_api/models/skills_upstream_selection.py b/bindings/python/src/cloudsmith_api/models/skills_upstream_selection.py new file mode 100644 index 000000000..181666171 --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/skills_upstream_selection.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from cloudsmith_api.configuration import Configuration + + +class SkillsUpstreamSelection(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'publisher': 'str', + 'version': 'str' + } + + attribute_map = { + 'name': 'name', + 'publisher': 'publisher', + 'version': 'version' + } + + def __init__(self, name=None, publisher=None, version=None, _configuration=None): # noqa: E501 + """SkillsUpstreamSelection - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._name = None + self._publisher = None + self._version = None + self.discriminator = None + + self.name = name + self.publisher = publisher + self.version = version + + @property + def name(self): + """Gets the name of this SkillsUpstreamSelection. + + The skill's ClawHub slug. + + :return: The name of this SkillsUpstreamSelection. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SkillsUpstreamSelection. + + The skill's ClawHub slug. + + :param name: The name of this SkillsUpstreamSelection. + :type: str + """ + if self._configuration.client_side_validation and name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) > 128): + raise ValueError("Invalid value for `name`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and len(name) < 1): + raise ValueError("Invalid value for `name`, length must be greater than or equal to `1`") # noqa: E501 + if (self._configuration.client_side_validation and + name is not None and not re.search('^[a-z0-9]+(?:-[a-z0-9]+)*$', name)): # noqa: E501 + raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^[a-z0-9]+(?:-[a-z0-9]+)*$/`") # noqa: E501 + + self._name = name + + @property + def publisher(self): + """Gets the publisher of this SkillsUpstreamSelection. + + The ClawHub owner handle that publishes the skill. + + :return: The publisher of this SkillsUpstreamSelection. + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this SkillsUpstreamSelection. + + The ClawHub owner handle that publishes the skill. + + :param publisher: The publisher of this SkillsUpstreamSelection. + :type: str + """ + if self._configuration.client_side_validation and publisher is None: + raise ValueError("Invalid value for `publisher`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + publisher is not None and len(publisher) > 128): + raise ValueError("Invalid value for `publisher`, length must be less than or equal to `128`") # noqa: E501 + if (self._configuration.client_side_validation and + publisher is not None and len(publisher) < 1): + raise ValueError("Invalid value for `publisher`, length must be greater than or equal to `1`") # noqa: E501 + if (self._configuration.client_side_validation and + publisher is not None and not re.search('^[a-z0-9]+(?:-[a-z0-9]+)*$', publisher)): # noqa: E501 + raise ValueError(r"Invalid value for `publisher`, must be a follow pattern or equal to `/^[a-z0-9]+(?:-[a-z0-9]+)*$/`") # noqa: E501 + + self._publisher = publisher + + @property + def version(self): + """Gets the version of this SkillsUpstreamSelection. + + The exact semantic version of the release. + + :return: The version of this SkillsUpstreamSelection. + :rtype: str + """ + return self._version + + @version.setter + def version(self, version): + """Sets the version of this SkillsUpstreamSelection. + + The exact semantic version of the release. + + :param version: The version of this SkillsUpstreamSelection. + :type: str + """ + if self._configuration.client_side_validation and version is None: + raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + version is not None and len(version) > 255): + raise ValueError("Invalid value for `version`, length must be less than or equal to `255`") # noqa: E501 + if (self._configuration.client_side_validation and + version is not None and len(version) < 1): + raise ValueError("Invalid value for `version`, length must be greater than or equal to `1`") # noqa: E501 + + self._version = version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SkillsUpstreamSelection, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SkillsUpstreamSelection): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SkillsUpstreamSelection): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/docs/OrganizationApiKeyRule.md b/bindings/python/src/docs/OrganizationApiKeyRule.md index f75a7f84e..42a843c74 100644 --- a/bindings/python/src/docs/OrganizationApiKeyRule.md +++ b/bindings/python/src/docs/OrganizationApiKeyRule.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **max_age_hours** | **int** | The maximum permitted age of an API key for use in the organization. API keys older than this will no longer have access until they are refreshed. To disable the rule unset this value. | [optional] **rule_type** | **str** | Specify which account types this rule applies to: all accounts (deprecated — prefer separate service/user rules), service accounts only, or user accounts only. | **slug** | **str** | Human-readable identifier for the rule type. Automatically generated based on the rule type. | [optional] -**slug_perm** | **str** | An auto-generated id that uniquely identifies the API key policy. | [optional] +**slug_perm** | **str** | An auto-generated id that uniquely identifies the rule. | [optional] **updated_at** | **datetime** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/bindings/python/src/docs/ReposApi.md b/bindings/python/src/docs/ReposApi.md index fbc4bd632..486aed9fc 100644 --- a/bindings/python/src/docs/ReposApi.md +++ b/bindings/python/src/docs/ReposApi.md @@ -160,6 +160,12 @@ Method | HTTP request | Description [**repos_upstream_ruby_partial_update**](ReposApi.md#repos_upstream_ruby_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Partially update a Ruby upstream config for this repository. [**repos_upstream_ruby_read**](ReposApi.md#repos_upstream_ruby_read) | **GET** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Retrieve a Ruby upstream config for this repository. [**repos_upstream_ruby_update**](ReposApi.md#repos_upstream_ruby_update) | **PUT** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Update a Ruby upstream config for this repository. +[**repos_upstream_skills_create**](ReposApi.md#repos_upstream_skills_create) | **POST** /repos/{owner}/{identifier}/upstream/skills/ | Create an AI Skills upstream config for this repository. +[**repos_upstream_skills_delete**](ReposApi.md#repos_upstream_skills_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Delete an AI Skills upstream config for this repository. +[**repos_upstream_skills_list**](ReposApi.md#repos_upstream_skills_list) | **GET** /repos/{owner}/{identifier}/upstream/skills/ | List AI Skills upstream configs for this repository. +[**repos_upstream_skills_partial_update**](ReposApi.md#repos_upstream_skills_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Partially update an AI Skills upstream config for this repository. +[**repos_upstream_skills_read**](ReposApi.md#repos_upstream_skills_read) | **GET** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Retrieve an AI Skills upstream config for this repository. +[**repos_upstream_skills_update**](ReposApi.md#repos_upstream_skills_update) | **PUT** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Update an AI Skills upstream config for this repository. [**repos_upstream_swift_create**](ReposApi.md#repos_upstream_swift_create) | **POST** /repos/{owner}/{identifier}/upstream/swift/ | Create a Swift upstream config for this repository. [**repos_upstream_swift_delete**](ReposApi.md#repos_upstream_swift_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/swift/{slug_perm}/ | Delete a Swift upstream config for this repository. [**repos_upstream_swift_list**](ReposApi.md#repos_upstream_swift_list) | **GET** /repos/{owner}/{identifier}/upstream/swift/ | List Swift upstream configs for this repository. @@ -9919,6 +9925,383 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **repos_upstream_skills_create** +> SkillsUpstream repos_upstream_skills_create(owner, identifier, data=data) + +Create an AI Skills upstream config for this repository. + +Create an AI Skills upstream config for this repository. + +### Example +```python +from __future__ import print_function +import time +import cloudsmith_api +from cloudsmith_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: apikey +configuration = cloudsmith_api.Configuration() +configuration.api_key['X-Api-Key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Api-Key'] = 'Bearer' +# Configure HTTP basic authorization: basic +configuration = cloudsmith_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = cloudsmith_api.ReposApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +identifier = 'identifier_example' # str | +data = cloudsmith_api.SkillsUpstreamRequest() # SkillsUpstreamRequest | (optional) + +try: + # Create an AI Skills upstream config for this repository. + api_response = api_instance.repos_upstream_skills_create(owner, identifier, data=data) + pprint(api_response) +except ApiException as e: + print("Exception when calling ReposApi->repos_upstream_skills_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **identifier** | **str**| | + **data** | [**SkillsUpstreamRequest**](SkillsUpstreamRequest.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repos_upstream_skills_delete** +> repos_upstream_skills_delete(owner, identifier, slug_perm) + +Delete an AI Skills upstream config for this repository. + +Delete an AI Skills upstream config for this repository. + +### Example +```python +from __future__ import print_function +import time +import cloudsmith_api +from cloudsmith_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: apikey +configuration = cloudsmith_api.Configuration() +configuration.api_key['X-Api-Key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Api-Key'] = 'Bearer' +# Configure HTTP basic authorization: basic +configuration = cloudsmith_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = cloudsmith_api.ReposApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +identifier = 'identifier_example' # str | +slug_perm = 'slug_perm_example' # str | + +try: + # Delete an AI Skills upstream config for this repository. + api_instance.repos_upstream_skills_delete(owner, identifier, slug_perm) +except ApiException as e: + print("Exception when calling ReposApi->repos_upstream_skills_delete: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **identifier** | **str**| | + **slug_perm** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repos_upstream_skills_list** +> list[SkillsUpstream] repos_upstream_skills_list(owner, identifier, page=page, page_size=page_size) + +List AI Skills upstream configs for this repository. + +List AI Skills upstream configs for this repository. + +### Example +```python +from __future__ import print_function +import time +import cloudsmith_api +from cloudsmith_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: apikey +configuration = cloudsmith_api.Configuration() +configuration.api_key['X-Api-Key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Api-Key'] = 'Bearer' +# Configure HTTP basic authorization: basic +configuration = cloudsmith_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = cloudsmith_api.ReposApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +identifier = 'identifier_example' # str | +page = 56 # int | A page number within the paginated result set. (optional) +page_size = 56 # int | Number of results to return per page. (optional) + +try: + # List AI Skills upstream configs for this repository. + api_response = api_instance.repos_upstream_skills_list(owner, identifier, page=page, page_size=page_size) + pprint(api_response) +except ApiException as e: + print("Exception when calling ReposApi->repos_upstream_skills_list: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **identifier** | **str**| | + **page** | **int**| A page number within the paginated result set. | [optional] + **page_size** | **int**| Number of results to return per page. | [optional] + +### Return type + +[**list[SkillsUpstream]**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repos_upstream_skills_partial_update** +> SkillsUpstream repos_upstream_skills_partial_update(owner, identifier, slug_perm, data=data) + +Partially update an AI Skills upstream config for this repository. + +Partially update an AI Skills upstream config for this repository. + +### Example +```python +from __future__ import print_function +import time +import cloudsmith_api +from cloudsmith_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: apikey +configuration = cloudsmith_api.Configuration() +configuration.api_key['X-Api-Key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Api-Key'] = 'Bearer' +# Configure HTTP basic authorization: basic +configuration = cloudsmith_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = cloudsmith_api.ReposApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +identifier = 'identifier_example' # str | +slug_perm = 'slug_perm_example' # str | +data = cloudsmith_api.SkillsUpstreamRequestPatch() # SkillsUpstreamRequestPatch | (optional) + +try: + # Partially update an AI Skills upstream config for this repository. + api_response = api_instance.repos_upstream_skills_partial_update(owner, identifier, slug_perm, data=data) + pprint(api_response) +except ApiException as e: + print("Exception when calling ReposApi->repos_upstream_skills_partial_update: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **identifier** | **str**| | + **slug_perm** | **str**| | + **data** | [**SkillsUpstreamRequestPatch**](SkillsUpstreamRequestPatch.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repos_upstream_skills_read** +> SkillsUpstream repos_upstream_skills_read(owner, identifier, slug_perm) + +Retrieve an AI Skills upstream config for this repository. + +Retrieve an AI Skills upstream config for this repository. + +### Example +```python +from __future__ import print_function +import time +import cloudsmith_api +from cloudsmith_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: apikey +configuration = cloudsmith_api.Configuration() +configuration.api_key['X-Api-Key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Api-Key'] = 'Bearer' +# Configure HTTP basic authorization: basic +configuration = cloudsmith_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = cloudsmith_api.ReposApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +identifier = 'identifier_example' # str | +slug_perm = 'slug_perm_example' # str | + +try: + # Retrieve an AI Skills upstream config for this repository. + api_response = api_instance.repos_upstream_skills_read(owner, identifier, slug_perm) + pprint(api_response) +except ApiException as e: + print("Exception when calling ReposApi->repos_upstream_skills_read: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **identifier** | **str**| | + **slug_perm** | **str**| | + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **repos_upstream_skills_update** +> SkillsUpstream repos_upstream_skills_update(owner, identifier, slug_perm, data=data) + +Update an AI Skills upstream config for this repository. + +Update an AI Skills upstream config for this repository. + +### Example +```python +from __future__ import print_function +import time +import cloudsmith_api +from cloudsmith_api.rest import ApiException +from pprint import pprint + +# Configure API key authorization: apikey +configuration = cloudsmith_api.Configuration() +configuration.api_key['X-Api-Key'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Api-Key'] = 'Bearer' +# Configure HTTP basic authorization: basic +configuration = cloudsmith_api.Configuration() +configuration.username = 'YOUR_USERNAME' +configuration.password = 'YOUR_PASSWORD' + +# create an instance of the API class +api_instance = cloudsmith_api.ReposApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +identifier = 'identifier_example' # str | +slug_perm = 'slug_perm_example' # str | +data = cloudsmith_api.SkillsUpstreamRequest() # SkillsUpstreamRequest | (optional) + +try: + # Update an AI Skills upstream config for this repository. + api_response = api_instance.repos_upstream_skills_update(owner, identifier, slug_perm, data=data) + pprint(api_response) +except ApiException as e: + print("Exception when calling ReposApi->repos_upstream_skills_update: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **identifier** | **str**| | + **slug_perm** | **str**| | + **data** | [**SkillsUpstreamRequest**](SkillsUpstreamRequest.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **repos_upstream_swift_create** > SwiftUpstream repos_upstream_swift_create(owner, identifier, data=data) diff --git a/bindings/python/src/docs/Service.md b/bindings/python/src/docs/Service.md index 369bc2bf4..bbf62cbbc 100644 --- a/bindings/python/src/docs/Service.md +++ b/bindings/python/src/docs/Service.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **created_by_url** | **str** | | [optional] **description** | **str** | The description of the service | [optional] **key** | **str** | The API key of the service | [optional] -**key_expires_at** | **datetime** | The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. | [optional] +**key_expires_at** | **datetime** | The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. | [optional] **name** | **str** | The name of the service | **role** | **str** | The role of the service. | [optional] [default to 'Member'] **slug** | **str** | The slug of the service | [optional] diff --git a/bindings/python/src/docs/SkillsUpstream.md b/bindings/python/src/docs/SkillsUpstream.md new file mode 100644 index 000000000..8bccce1d4 --- /dev/null +++ b/bindings/python/src/docs/SkillsUpstream.md @@ -0,0 +1,36 @@ +# SkillsUpstream + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **str** | The authentication mode to use when accessing this upstream. | [optional] [default to 'None'] +**auth_secret** | **str** | Secret to provide with requests to upstream. | [optional] +**auth_username** | **str** | Username to provide with requests to upstream. | [optional] +**available** | **bool** | Whether the upstream is available for use. | [optional] +**can_reindex** | **bool** | Whether the upstream can be reindexed. | [optional] +**contents** | **str** | The package types to serve from the upstream: skills, plugins, or both. | [optional] [default to 'Skills'] +**created_at** | **datetime** | The datetime the upstream source was created. | [optional] +**disable_reason** | **str** | | [optional] [default to 'N/A'] +**disable_reason_text** | **str** | Human-readable explanation of why this upstream is disabled | [optional] +**extra_header_1** | **str** | The key for extra header #1 to send to upstream. | [optional] +**extra_header_2** | **str** | The key for extra header #2 to send to upstream. | [optional] +**extra_value_1** | **str** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extra_value_2** | **str** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**has_failed_signature_verification** | **bool** | Whether the upstream has failed signature verification. | [optional] +**index_package_count** | **int** | The number of packages available in this upstream source | [optional] +**index_status** | **str** | The current indexing status of this upstream source | [optional] +**is_active** | **bool** | Whether or not this upstream is active and ready for requests. | [optional] +**last_indexed** | **str** | The last time this upstream source was indexed | [optional] +**mode** | **str** | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] [default to 'Proxy Only'] +**name** | **str** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | +**pending_validation** | **bool** | When true, this upstream source is pending validation. | [optional] +**priority** | **int** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**list[SkillsUpstreamSelection]**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**slug_perm** | **str** | | [optional] +**updated_at** | **datetime** | | [optional] +**upstream_url** | **str** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | +**verify_ssl** | **bool** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bindings/python/src/docs/SkillsUpstreamRequest.md b/bindings/python/src/docs/SkillsUpstreamRequest.md new file mode 100644 index 000000000..9148fcc9b --- /dev/null +++ b/bindings/python/src/docs/SkillsUpstreamRequest.md @@ -0,0 +1,24 @@ +# SkillsUpstreamRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **str** | The authentication mode to use when accessing this upstream. | [optional] [default to 'None'] +**auth_secret** | **str** | Secret to provide with requests to upstream. | [optional] +**auth_username** | **str** | Username to provide with requests to upstream. | [optional] +**contents** | **str** | The package types to serve from the upstream: skills, plugins, or both. | [optional] [default to 'Skills'] +**extra_header_1** | **str** | The key for extra header #1 to send to upstream. | [optional] +**extra_header_2** | **str** | The key for extra header #2 to send to upstream. | [optional] +**extra_value_1** | **str** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extra_value_2** | **str** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**is_active** | **bool** | Whether or not this upstream is active and ready for requests. | [optional] +**mode** | **str** | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] [default to 'Proxy Only'] +**name** | **str** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | +**priority** | **int** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**list[SkillsUpstreamSelection]**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**upstream_url** | **str** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | +**verify_ssl** | **bool** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bindings/python/src/docs/SkillsUpstreamRequestPatch.md b/bindings/python/src/docs/SkillsUpstreamRequestPatch.md new file mode 100644 index 000000000..5c266d3be --- /dev/null +++ b/bindings/python/src/docs/SkillsUpstreamRequestPatch.md @@ -0,0 +1,24 @@ +# SkillsUpstreamRequestPatch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **str** | The authentication mode to use when accessing this upstream. | [optional] [default to 'None'] +**auth_secret** | **str** | Secret to provide with requests to upstream. | [optional] +**auth_username** | **str** | Username to provide with requests to upstream. | [optional] +**contents** | **str** | The package types to serve from the upstream: skills, plugins, or both. | [optional] [default to 'Skills'] +**extra_header_1** | **str** | The key for extra header #1 to send to upstream. | [optional] +**extra_header_2** | **str** | The key for extra header #2 to send to upstream. | [optional] +**extra_value_1** | **str** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extra_value_2** | **str** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**is_active** | **bool** | Whether or not this upstream is active and ready for requests. | [optional] +**mode** | **str** | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] [default to 'Proxy Only'] +**name** | **str** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | [optional] +**priority** | **int** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**list[SkillsUpstreamSelection]**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**upstream_url** | **str** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | [optional] +**verify_ssl** | **bool** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bindings/python/src/docs/SkillsUpstreamSelection.md b/bindings/python/src/docs/SkillsUpstreamSelection.md new file mode 100644 index 000000000..494a9aa4f --- /dev/null +++ b/bindings/python/src/docs/SkillsUpstreamSelection.md @@ -0,0 +1,12 @@ +# SkillsUpstreamSelection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The skill's ClawHub slug. | +**publisher** | **str** | The ClawHub owner handle that publishes the skill. | +**version** | **str** | The exact semantic version of the release. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/bindings/python/src/setup.py b/bindings/python/src/setup.py index 8cb6bc105..7b20e0c2c 100644 --- a/bindings/python/src/setup.py +++ b/bindings/python/src/setup.py @@ -14,7 +14,7 @@ from setuptools import find_packages, setup # noqa: H301 NAME = "cloudsmith_api" -VERSION = "2.0.38" +VERSION = "2.0.39" # To install the library, run the following # # python setup.py install diff --git a/bindings/python/src/test/test_repos_api.py b/bindings/python/src/test/test_repos_api.py index 257658053..fce91c3d5 100644 --- a/bindings/python/src/test/test_repos_api.py +++ b/bindings/python/src/test/test_repos_api.py @@ -1120,6 +1120,48 @@ def test_repos_upstream_ruby_update(self): """ pass + def test_repos_upstream_skills_create(self): + """Test case for repos_upstream_skills_create + + Create an AI Skills upstream config for this repository. # noqa: E501 + """ + pass + + def test_repos_upstream_skills_delete(self): + """Test case for repos_upstream_skills_delete + + Delete an AI Skills upstream config for this repository. # noqa: E501 + """ + pass + + def test_repos_upstream_skills_list(self): + """Test case for repos_upstream_skills_list + + List AI Skills upstream configs for this repository. # noqa: E501 + """ + pass + + def test_repos_upstream_skills_partial_update(self): + """Test case for repos_upstream_skills_partial_update + + Partially update an AI Skills upstream config for this repository. # noqa: E501 + """ + pass + + def test_repos_upstream_skills_read(self): + """Test case for repos_upstream_skills_read + + Retrieve an AI Skills upstream config for this repository. # noqa: E501 + """ + pass + + def test_repos_upstream_skills_update(self): + """Test case for repos_upstream_skills_update + + Update an AI Skills upstream config for this repository. # noqa: E501 + """ + pass + def test_repos_upstream_swift_create(self): """Test case for repos_upstream_swift_create diff --git a/bindings/python/src/test/test_skills_upstream.py b/bindings/python/src/test/test_skills_upstream.py new file mode 100644 index 000000000..1c0448a62 --- /dev/null +++ b/bindings/python/src/test/test_skills_upstream.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import cloudsmith_api +from cloudsmith_api.models.skills_upstream import SkillsUpstream # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestSkillsUpstream(unittest.TestCase): + """SkillsUpstream unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSkillsUpstream(self): + """Test SkillsUpstream""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.skills_upstream.SkillsUpstream() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/python/src/test/test_skills_upstream_request.py b/bindings/python/src/test/test_skills_upstream_request.py new file mode 100644 index 000000000..aa6e3db3c --- /dev/null +++ b/bindings/python/src/test/test_skills_upstream_request.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import cloudsmith_api +from cloudsmith_api.models.skills_upstream_request import SkillsUpstreamRequest # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestSkillsUpstreamRequest(unittest.TestCase): + """SkillsUpstreamRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSkillsUpstreamRequest(self): + """Test SkillsUpstreamRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.skills_upstream_request.SkillsUpstreamRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/python/src/test/test_skills_upstream_request_patch.py b/bindings/python/src/test/test_skills_upstream_request_patch.py new file mode 100644 index 000000000..7bf33153c --- /dev/null +++ b/bindings/python/src/test/test_skills_upstream_request_patch.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import cloudsmith_api +from cloudsmith_api.models.skills_upstream_request_patch import SkillsUpstreamRequestPatch # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestSkillsUpstreamRequestPatch(unittest.TestCase): + """SkillsUpstreamRequestPatch unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSkillsUpstreamRequestPatch(self): + """Test SkillsUpstreamRequestPatch""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.skills_upstream_request_patch.SkillsUpstreamRequestPatch() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/python/src/test/test_skills_upstream_selection.py b/bindings/python/src/test/test_skills_upstream_selection.py new file mode 100644 index 000000000..c0cb9c6b7 --- /dev/null +++ b/bindings/python/src/test/test_skills_upstream_selection.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Cloudsmith API (v1) + + The API to the Cloudsmith Service # noqa: E501 + + OpenAPI spec version: v1 + Contact: support@cloudsmith.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import cloudsmith_api +from cloudsmith_api.models.skills_upstream_selection import SkillsUpstreamSelection # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestSkillsUpstreamSelection(unittest.TestCase): + """SkillsUpstreamSelection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSkillsUpstreamSelection(self): + """Test SkillsUpstreamSelection""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.skills_upstream_selection.SkillsUpstreamSelection() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/ruby/src/README.md b/bindings/ruby/src/README.md index f55901325..75977e5f9 100644 --- a/bindings/ruby/src/README.md +++ b/bindings/ruby/src/README.md @@ -7,7 +7,7 @@ The API to the Cloudsmith Service This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: v1 -- Package version: 2.0.38 +- Package version: 2.0.39 - Build package: io.swagger.codegen.languages.RubyClientCodegen For more information, please visit [https://help.cloudsmith.io](https://help.cloudsmith.io) @@ -24,15 +24,15 @@ gem build cloudsmith-api.gemspec Then either install the gem locally: ```shell -gem install ./cloudsmith-api-2.0.38.gem +gem install ./cloudsmith-api-2.0.39.gem ``` -(for development, run `gem install --dev ./cloudsmith-api-2.0.38.gem` to install the development dependencies) +(for development, run `gem install --dev ./cloudsmith-api-2.0.39.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'cloudsmith-api', '~> 2.0.38' + gem 'cloudsmith-api', '~> 2.0.39' ### Install from Git @@ -444,6 +444,12 @@ Class | Method | HTTP request | Description *CloudsmithApi::ReposApi* | [**repos_upstream_ruby_partial_update**](docs/ReposApi.md#repos_upstream_ruby_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Partially update a Ruby upstream config for this repository. *CloudsmithApi::ReposApi* | [**repos_upstream_ruby_read**](docs/ReposApi.md#repos_upstream_ruby_read) | **GET** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Retrieve a Ruby upstream config for this repository. *CloudsmithApi::ReposApi* | [**repos_upstream_ruby_update**](docs/ReposApi.md#repos_upstream_ruby_update) | **PUT** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Update a Ruby upstream config for this repository. +*CloudsmithApi::ReposApi* | [**repos_upstream_skills_create**](docs/ReposApi.md#repos_upstream_skills_create) | **POST** /repos/{owner}/{identifier}/upstream/skills/ | Create an AI Skills upstream config for this repository. +*CloudsmithApi::ReposApi* | [**repos_upstream_skills_delete**](docs/ReposApi.md#repos_upstream_skills_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Delete an AI Skills upstream config for this repository. +*CloudsmithApi::ReposApi* | [**repos_upstream_skills_list**](docs/ReposApi.md#repos_upstream_skills_list) | **GET** /repos/{owner}/{identifier}/upstream/skills/ | List AI Skills upstream configs for this repository. +*CloudsmithApi::ReposApi* | [**repos_upstream_skills_partial_update**](docs/ReposApi.md#repos_upstream_skills_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Partially update an AI Skills upstream config for this repository. +*CloudsmithApi::ReposApi* | [**repos_upstream_skills_read**](docs/ReposApi.md#repos_upstream_skills_read) | **GET** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Retrieve an AI Skills upstream config for this repository. +*CloudsmithApi::ReposApi* | [**repos_upstream_skills_update**](docs/ReposApi.md#repos_upstream_skills_update) | **PUT** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Update an AI Skills upstream config for this repository. *CloudsmithApi::ReposApi* | [**repos_upstream_swift_create**](docs/ReposApi.md#repos_upstream_swift_create) | **POST** /repos/{owner}/{identifier}/upstream/swift/ | Create a Swift upstream config for this repository. *CloudsmithApi::ReposApi* | [**repos_upstream_swift_delete**](docs/ReposApi.md#repos_upstream_swift_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/swift/{slug_perm}/ | Delete a Swift upstream config for this repository. *CloudsmithApi::ReposApi* | [**repos_upstream_swift_list**](docs/ReposApi.md#repos_upstream_swift_list) | **GET** /repos/{owner}/{identifier}/upstream/swift/ | List Swift upstream configs for this repository. @@ -767,6 +773,10 @@ Class | Method | HTTP request | Description - [CloudsmithApi::ServiceTeams](docs/ServiceTeams.md) - [CloudsmithApi::SkillsPackageUpload](docs/SkillsPackageUpload.md) - [CloudsmithApi::SkillsPackageUploadRequest](docs/SkillsPackageUploadRequest.md) + - [CloudsmithApi::SkillsUpstream](docs/SkillsUpstream.md) + - [CloudsmithApi::SkillsUpstreamRequest](docs/SkillsUpstreamRequest.md) + - [CloudsmithApi::SkillsUpstreamRequestPatch](docs/SkillsUpstreamRequestPatch.md) + - [CloudsmithApi::SkillsUpstreamSelection](docs/SkillsUpstreamSelection.md) - [CloudsmithApi::StatusBasic](docs/StatusBasic.md) - [CloudsmithApi::StorageAllocatedLimit](docs/StorageAllocatedLimit.md) - [CloudsmithApi::StorageAllocatedLimitRaw](docs/StorageAllocatedLimitRaw.md) diff --git a/bindings/ruby/src/build.json b/bindings/ruby/src/build.json index 4ef4389dc..4c9cf4ddb 100644 --- a/bindings/ruby/src/build.json +++ b/bindings/ruby/src/build.json @@ -8,7 +8,7 @@ "gemName": "cloudsmith-api", "gemRequiredRubyVersion": ">= 1.9", "gemSummary": "Cloudsmith API", - "gemVersion": "2.0.38", + "gemVersion": "2.0.39", "hideGenerationTimestamp": true, "moduleName": "CloudsmithApi", "sortParamsByRequiredFlag": true diff --git a/bindings/ruby/src/docs/OrganizationApiKeyRule.md b/bindings/ruby/src/docs/OrganizationApiKeyRule.md index b08092805..ebc1f7918 100644 --- a/bindings/ruby/src/docs/OrganizationApiKeyRule.md +++ b/bindings/ruby/src/docs/OrganizationApiKeyRule.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **max_age_hours** | **Integer** | The maximum permitted age of an API key for use in the organization. API keys older than this will no longer have access until they are refreshed. To disable the rule unset this value. | [optional] **rule_type** | **String** | Specify which account types this rule applies to: all accounts (deprecated — prefer separate service/user rules), service accounts only, or user accounts only. | **slug** | **String** | Human-readable identifier for the rule type. Automatically generated based on the rule type. | [optional] -**slug_perm** | **String** | An auto-generated id that uniquely identifies the API key policy. | [optional] +**slug_perm** | **String** | An auto-generated id that uniquely identifies the rule. | [optional] **updated_at** | **DateTime** | | [optional] diff --git a/bindings/ruby/src/docs/ReposApi.md b/bindings/ruby/src/docs/ReposApi.md index 256d34d59..cbbe8524c 100644 --- a/bindings/ruby/src/docs/ReposApi.md +++ b/bindings/ruby/src/docs/ReposApi.md @@ -160,6 +160,12 @@ Method | HTTP request | Description [**repos_upstream_ruby_partial_update**](ReposApi.md#repos_upstream_ruby_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Partially update a Ruby upstream config for this repository. [**repos_upstream_ruby_read**](ReposApi.md#repos_upstream_ruby_read) | **GET** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Retrieve a Ruby upstream config for this repository. [**repos_upstream_ruby_update**](ReposApi.md#repos_upstream_ruby_update) | **PUT** /repos/{owner}/{identifier}/upstream/ruby/{slug_perm}/ | Update a Ruby upstream config for this repository. +[**repos_upstream_skills_create**](ReposApi.md#repos_upstream_skills_create) | **POST** /repos/{owner}/{identifier}/upstream/skills/ | Create an AI Skills upstream config for this repository. +[**repos_upstream_skills_delete**](ReposApi.md#repos_upstream_skills_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Delete an AI Skills upstream config for this repository. +[**repos_upstream_skills_list**](ReposApi.md#repos_upstream_skills_list) | **GET** /repos/{owner}/{identifier}/upstream/skills/ | List AI Skills upstream configs for this repository. +[**repos_upstream_skills_partial_update**](ReposApi.md#repos_upstream_skills_partial_update) | **PATCH** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Partially update an AI Skills upstream config for this repository. +[**repos_upstream_skills_read**](ReposApi.md#repos_upstream_skills_read) | **GET** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Retrieve an AI Skills upstream config for this repository. +[**repos_upstream_skills_update**](ReposApi.md#repos_upstream_skills_update) | **PUT** /repos/{owner}/{identifier}/upstream/skills/{slug_perm}/ | Update an AI Skills upstream config for this repository. [**repos_upstream_swift_create**](ReposApi.md#repos_upstream_swift_create) | **POST** /repos/{owner}/{identifier}/upstream/swift/ | Create a Swift upstream config for this repository. [**repos_upstream_swift_delete**](ReposApi.md#repos_upstream_swift_delete) | **DELETE** /repos/{owner}/{identifier}/upstream/swift/{slug_perm}/ | Delete a Swift upstream config for this repository. [**repos_upstream_swift_list**](ReposApi.md#repos_upstream_swift_list) | **GET** /repos/{owner}/{identifier}/upstream/swift/ | List Swift upstream configs for this repository. @@ -10359,6 +10365,401 @@ Name | Type | Description | Notes +# **repos_upstream_skills_create** +> SkillsUpstream repos_upstream_skills_create(owner, identifier, opts) + +Create an AI Skills upstream config for this repository. + +Create an AI Skills upstream config for this repository. + +### Example +```ruby +# load the gem +require 'cloudsmith-api' +# setup authorization +CloudsmithApi.configure do |config| + # Configure API key authorization: apikey + config.api_key['X-Api-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['X-Api-Key'] = 'Bearer' + + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = CloudsmithApi::ReposApi.new + +owner = 'owner_example' # String | + +identifier = 'identifier_example' # String | + +opts = { + data: CloudsmithApi::SkillsUpstreamRequest.new # SkillsUpstreamRequest | +} + +begin + #Create an AI Skills upstream config for this repository. + result = api_instance.repos_upstream_skills_create(owner, identifier, opts) + p result +rescue CloudsmithApi::ApiError => e + puts "Exception when calling ReposApi->repos_upstream_skills_create: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **data** | [**SkillsUpstreamRequest**](SkillsUpstreamRequest.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **repos_upstream_skills_delete** +> repos_upstream_skills_delete(owner, identifier, slug_perm) + +Delete an AI Skills upstream config for this repository. + +Delete an AI Skills upstream config for this repository. + +### Example +```ruby +# load the gem +require 'cloudsmith-api' +# setup authorization +CloudsmithApi.configure do |config| + # Configure API key authorization: apikey + config.api_key['X-Api-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['X-Api-Key'] = 'Bearer' + + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = CloudsmithApi::ReposApi.new + +owner = 'owner_example' # String | + +identifier = 'identifier_example' # String | + +slug_perm = 'slug_perm_example' # String | + + +begin + #Delete an AI Skills upstream config for this repository. + api_instance.repos_upstream_skills_delete(owner, identifier, slug_perm) +rescue CloudsmithApi::ApiError => e + puts "Exception when calling ReposApi->repos_upstream_skills_delete: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slug_perm** | **String**| | + +### Return type + +nil (empty response body) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **repos_upstream_skills_list** +> Array<SkillsUpstream> repos_upstream_skills_list(owner, identifier, opts) + +List AI Skills upstream configs for this repository. + +List AI Skills upstream configs for this repository. + +### Example +```ruby +# load the gem +require 'cloudsmith-api' +# setup authorization +CloudsmithApi.configure do |config| + # Configure API key authorization: apikey + config.api_key['X-Api-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['X-Api-Key'] = 'Bearer' + + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = CloudsmithApi::ReposApi.new + +owner = 'owner_example' # String | + +identifier = 'identifier_example' # String | + +opts = { + page: 56, # Integer | A page number within the paginated result set. + page_size: 56 # Integer | Number of results to return per page. +} + +begin + #List AI Skills upstream configs for this repository. + result = api_instance.repos_upstream_skills_list(owner, identifier, opts) + p result +rescue CloudsmithApi::ApiError => e + puts "Exception when calling ReposApi->repos_upstream_skills_list: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **page** | **Integer**| A page number within the paginated result set. | [optional] + **page_size** | **Integer**| Number of results to return per page. | [optional] + +### Return type + +[**Array<SkillsUpstream>**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **repos_upstream_skills_partial_update** +> SkillsUpstream repos_upstream_skills_partial_update(owner, identifier, slug_perm, opts) + +Partially update an AI Skills upstream config for this repository. + +Partially update an AI Skills upstream config for this repository. + +### Example +```ruby +# load the gem +require 'cloudsmith-api' +# setup authorization +CloudsmithApi.configure do |config| + # Configure API key authorization: apikey + config.api_key['X-Api-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['X-Api-Key'] = 'Bearer' + + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = CloudsmithApi::ReposApi.new + +owner = 'owner_example' # String | + +identifier = 'identifier_example' # String | + +slug_perm = 'slug_perm_example' # String | + +opts = { + data: CloudsmithApi::SkillsUpstreamRequestPatch.new # SkillsUpstreamRequestPatch | +} + +begin + #Partially update an AI Skills upstream config for this repository. + result = api_instance.repos_upstream_skills_partial_update(owner, identifier, slug_perm, opts) + p result +rescue CloudsmithApi::ApiError => e + puts "Exception when calling ReposApi->repos_upstream_skills_partial_update: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slug_perm** | **String**| | + **data** | [**SkillsUpstreamRequestPatch**](SkillsUpstreamRequestPatch.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **repos_upstream_skills_read** +> SkillsUpstream repos_upstream_skills_read(owner, identifier, slug_perm) + +Retrieve an AI Skills upstream config for this repository. + +Retrieve an AI Skills upstream config for this repository. + +### Example +```ruby +# load the gem +require 'cloudsmith-api' +# setup authorization +CloudsmithApi.configure do |config| + # Configure API key authorization: apikey + config.api_key['X-Api-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['X-Api-Key'] = 'Bearer' + + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = CloudsmithApi::ReposApi.new + +owner = 'owner_example' # String | + +identifier = 'identifier_example' # String | + +slug_perm = 'slug_perm_example' # String | + + +begin + #Retrieve an AI Skills upstream config for this repository. + result = api_instance.repos_upstream_skills_read(owner, identifier, slug_perm) + p result +rescue CloudsmithApi::ApiError => e + puts "Exception when calling ReposApi->repos_upstream_skills_read: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slug_perm** | **String**| | + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + +# **repos_upstream_skills_update** +> SkillsUpstream repos_upstream_skills_update(owner, identifier, slug_perm, opts) + +Update an AI Skills upstream config for this repository. + +Update an AI Skills upstream config for this repository. + +### Example +```ruby +# load the gem +require 'cloudsmith-api' +# setup authorization +CloudsmithApi.configure do |config| + # Configure API key authorization: apikey + config.api_key['X-Api-Key'] = 'YOUR API KEY' + # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) + #config.api_key_prefix['X-Api-Key'] = 'Bearer' + + # Configure HTTP basic authorization: basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' +end + +api_instance = CloudsmithApi::ReposApi.new + +owner = 'owner_example' # String | + +identifier = 'identifier_example' # String | + +slug_perm = 'slug_perm_example' # String | + +opts = { + data: CloudsmithApi::SkillsUpstreamRequest.new # SkillsUpstreamRequest | +} + +begin + #Update an AI Skills upstream config for this repository. + result = api_instance.repos_upstream_skills_update(owner, identifier, slug_perm, opts) + p result +rescue CloudsmithApi::ApiError => e + puts "Exception when calling ReposApi->repos_upstream_skills_update: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **identifier** | **String**| | + **slug_perm** | **String**| | + **data** | [**SkillsUpstreamRequest**](SkillsUpstreamRequest.md)| | [optional] + +### Return type + +[**SkillsUpstream**](SkillsUpstream.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + # **repos_upstream_swift_create** > SwiftUpstream repos_upstream_swift_create(owner, identifier, opts) diff --git a/bindings/ruby/src/docs/Service.md b/bindings/ruby/src/docs/Service.md index a11b15dda..fb1bb59e4 100644 --- a/bindings/ruby/src/docs/Service.md +++ b/bindings/ruby/src/docs/Service.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **created_by_url** | **String** | | [optional] **description** | **String** | The description of the service | [optional] **key** | **String** | The API key of the service | [optional] -**key_expires_at** | **DateTime** | The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. | [optional] +**key_expires_at** | **DateTime** | The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. | [optional] **name** | **String** | The name of the service | **role** | **String** | The role of the service. | [optional] [default to 'Member'] **slug** | **String** | The slug of the service | [optional] diff --git a/bindings/ruby/src/docs/SkillsUpstream.md b/bindings/ruby/src/docs/SkillsUpstream.md new file mode 100644 index 000000000..424416c69 --- /dev/null +++ b/bindings/ruby/src/docs/SkillsUpstream.md @@ -0,0 +1,34 @@ +# CloudsmithApi::SkillsUpstream + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **String** | The authentication mode to use when accessing this upstream. | [optional] [default to 'None'] +**auth_secret** | **String** | Secret to provide with requests to upstream. | [optional] +**auth_username** | **String** | Username to provide with requests to upstream. | [optional] +**available** | **BOOLEAN** | Whether the upstream is available for use. | [optional] +**can_reindex** | **BOOLEAN** | Whether the upstream can be reindexed. | [optional] +**contents** | **String** | The package types to serve from the upstream: skills, plugins, or both. | [optional] [default to 'Skills'] +**created_at** | **DateTime** | The datetime the upstream source was created. | [optional] +**disable_reason** | **String** | | [optional] [default to 'N/A'] +**disable_reason_text** | **String** | Human-readable explanation of why this upstream is disabled | [optional] +**extra_header_1** | **String** | The key for extra header #1 to send to upstream. | [optional] +**extra_header_2** | **String** | The key for extra header #2 to send to upstream. | [optional] +**extra_value_1** | **String** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extra_value_2** | **String** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**has_failed_signature_verification** | **BOOLEAN** | Whether the upstream has failed signature verification. | [optional] +**index_package_count** | **Integer** | The number of packages available in this upstream source | [optional] +**index_status** | **String** | The current indexing status of this upstream source | [optional] +**is_active** | **BOOLEAN** | Whether or not this upstream is active and ready for requests. | [optional] +**last_indexed** | **String** | The last time this upstream source was indexed | [optional] +**mode** | **String** | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] [default to 'Proxy Only'] +**name** | **String** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | +**pending_validation** | **BOOLEAN** | When true, this upstream source is pending validation. | [optional] +**priority** | **Integer** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**Array<SkillsUpstreamSelection>**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**slug_perm** | **String** | | [optional] +**updated_at** | **DateTime** | | [optional] +**upstream_url** | **String** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | +**verify_ssl** | **BOOLEAN** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + + diff --git a/bindings/ruby/src/docs/SkillsUpstreamRequest.md b/bindings/ruby/src/docs/SkillsUpstreamRequest.md new file mode 100644 index 000000000..dcde3c7cb --- /dev/null +++ b/bindings/ruby/src/docs/SkillsUpstreamRequest.md @@ -0,0 +1,22 @@ +# CloudsmithApi::SkillsUpstreamRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **String** | The authentication mode to use when accessing this upstream. | [optional] [default to 'None'] +**auth_secret** | **String** | Secret to provide with requests to upstream. | [optional] +**auth_username** | **String** | Username to provide with requests to upstream. | [optional] +**contents** | **String** | The package types to serve from the upstream: skills, plugins, or both. | [optional] [default to 'Skills'] +**extra_header_1** | **String** | The key for extra header #1 to send to upstream. | [optional] +**extra_header_2** | **String** | The key for extra header #2 to send to upstream. | [optional] +**extra_value_1** | **String** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extra_value_2** | **String** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**is_active** | **BOOLEAN** | Whether or not this upstream is active and ready for requests. | [optional] +**mode** | **String** | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] [default to 'Proxy Only'] +**name** | **String** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | +**priority** | **Integer** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**Array<SkillsUpstreamSelection>**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**upstream_url** | **String** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | +**verify_ssl** | **BOOLEAN** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + + diff --git a/bindings/ruby/src/docs/SkillsUpstreamRequestPatch.md b/bindings/ruby/src/docs/SkillsUpstreamRequestPatch.md new file mode 100644 index 000000000..76eaa9e04 --- /dev/null +++ b/bindings/ruby/src/docs/SkillsUpstreamRequestPatch.md @@ -0,0 +1,22 @@ +# CloudsmithApi::SkillsUpstreamRequestPatch + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_mode** | **String** | The authentication mode to use when accessing this upstream. | [optional] [default to 'None'] +**auth_secret** | **String** | Secret to provide with requests to upstream. | [optional] +**auth_username** | **String** | Username to provide with requests to upstream. | [optional] +**contents** | **String** | The package types to serve from the upstream: skills, plugins, or both. | [optional] [default to 'Skills'] +**extra_header_1** | **String** | The key for extra header #1 to send to upstream. | [optional] +**extra_header_2** | **String** | The key for extra header #2 to send to upstream. | [optional] +**extra_value_1** | **String** | The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**extra_value_2** | **String** | The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. | [optional] +**is_active** | **BOOLEAN** | Whether or not this upstream is active and ready for requests. | [optional] +**mode** | **String** | The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. | [optional] [default to 'Proxy Only'] +**name** | **String** | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. | [optional] +**priority** | **Integer** | Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. | [optional] +**selections** | [**Array<SkillsUpstreamSelection>**](SkillsUpstreamSelection.md) | Exact ClawHub releases to cache. | [optional] +**upstream_url** | **String** | The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. | [optional] +**verify_ssl** | **BOOLEAN** | If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. | [optional] + + diff --git a/bindings/ruby/src/docs/SkillsUpstreamSelection.md b/bindings/ruby/src/docs/SkillsUpstreamSelection.md new file mode 100644 index 000000000..a8c9ec667 --- /dev/null +++ b/bindings/ruby/src/docs/SkillsUpstreamSelection.md @@ -0,0 +1,10 @@ +# CloudsmithApi::SkillsUpstreamSelection + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The skill's ClawHub slug. | +**publisher** | **String** | The ClawHub owner handle that publishes the skill. | +**version** | **String** | The exact semantic version of the release. | + + diff --git a/bindings/ruby/src/lib/cloudsmith-api.rb b/bindings/ruby/src/lib/cloudsmith-api.rb index 668d30970..ece5f4096 100644 --- a/bindings/ruby/src/lib/cloudsmith-api.rb +++ b/bindings/ruby/src/lib/cloudsmith-api.rb @@ -309,6 +309,10 @@ require 'cloudsmith-api/models/service_teams' require 'cloudsmith-api/models/skills_package_upload' require 'cloudsmith-api/models/skills_package_upload_request' +require 'cloudsmith-api/models/skills_upstream' +require 'cloudsmith-api/models/skills_upstream_request' +require 'cloudsmith-api/models/skills_upstream_request_patch' +require 'cloudsmith-api/models/skills_upstream_selection' require 'cloudsmith-api/models/status_basic' require 'cloudsmith-api/models/storage_allocated_limit' require 'cloudsmith-api/models/storage_allocated_limit_raw' diff --git a/bindings/ruby/src/lib/cloudsmith-api/api/repos_api.rb b/bindings/ruby/src/lib/cloudsmith-api/api/repos_api.rb index 38250cd20..39ea3ec39 100644 --- a/bindings/ruby/src/lib/cloudsmith-api/api/repos_api.rb +++ b/bindings/ruby/src/lib/cloudsmith-api/api/repos_api.rb @@ -10142,6 +10142,401 @@ def repos_upstream_ruby_update_with_http_info(owner, identifier, slug_perm, opts end return data, status_code, headers end + # Create an AI Skills upstream config for this repository. + # Create an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequest] :data + # @return [SkillsUpstream] + def repos_upstream_skills_create(owner, identifier, opts = {}) + data, _status_code, _headers = repos_upstream_skills_create_with_http_info(owner, identifier, opts) + data + end + + # Create an AI Skills upstream config for this repository. + # Create an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequest] :data + # @return [Array<(SkillsUpstream, Fixnum, Hash)>] SkillsUpstream data, response status code and response headers + def repos_upstream_skills_create_with_http_info(owner, identifier, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReposApi.repos_upstream_skills_create ...' + 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 ReposApi.repos_upstream_skills_create" + end + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ReposApi.repos_upstream_skills_create" + end + # resource path + local_var_path = '/repos/{owner}/{identifier}/upstream/skills/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'identifier' + '}', identifier.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'data']) + auth_names = ['apikey', 'basic'] + data, status_code, headers = @api_client.call_api(:POST, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'SkillsUpstream') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReposApi#repos_upstream_skills_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an AI Skills upstream config for this repository. + # Delete an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @return [nil] + def repos_upstream_skills_delete(owner, identifier, slug_perm, opts = {}) + repos_upstream_skills_delete_with_http_info(owner, identifier, slug_perm, opts) + nil + end + + # Delete an AI Skills upstream config for this repository. + # Delete an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + def repos_upstream_skills_delete_with_http_info(owner, identifier, slug_perm, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReposApi.repos_upstream_skills_delete ...' + 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 ReposApi.repos_upstream_skills_delete" + end + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ReposApi.repos_upstream_skills_delete" + end + # verify the required parameter 'slug_perm' is set + if @api_client.config.client_side_validation && slug_perm.nil? + fail ArgumentError, "Missing the required parameter 'slug_perm' when calling ReposApi.repos_upstream_skills_delete" + end + # resource path + local_var_path = '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'slug_perm' + '}', slug_perm.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['apikey', 'basic'] + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReposApi#repos_upstream_skills_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List AI Skills upstream configs for this repository. + # List AI Skills upstream configs for this repository. + # @param owner + # @param identifier + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page A page number within the paginated result set. + # @option opts [Integer] :page_size Number of results to return per page. + # @return [Array] + def repos_upstream_skills_list(owner, identifier, opts = {}) + data, _status_code, _headers = repos_upstream_skills_list_with_http_info(owner, identifier, opts) + data + end + + # List AI Skills upstream configs for this repository. + # List AI Skills upstream configs for this repository. + # @param owner + # @param identifier + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page A page number within the paginated result set. + # @option opts [Integer] :page_size Number of results to return per page. + # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers + def repos_upstream_skills_list_with_http_info(owner, identifier, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReposApi.repos_upstream_skills_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 ReposApi.repos_upstream_skills_list" + end + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ReposApi.repos_upstream_skills_list" + end + # resource path + local_var_path = '/repos/{owner}/{identifier}/upstream/skills/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'identifier' + '}', identifier.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? + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['apikey', 'basic'] + 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') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReposApi#repos_upstream_skills_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Partially update an AI Skills upstream config for this repository. + # Partially update an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequestPatch] :data + # @return [SkillsUpstream] + def repos_upstream_skills_partial_update(owner, identifier, slug_perm, opts = {}) + data, _status_code, _headers = repos_upstream_skills_partial_update_with_http_info(owner, identifier, slug_perm, opts) + data + end + + # Partially update an AI Skills upstream config for this repository. + # Partially update an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequestPatch] :data + # @return [Array<(SkillsUpstream, Fixnum, Hash)>] SkillsUpstream data, response status code and response headers + def repos_upstream_skills_partial_update_with_http_info(owner, identifier, slug_perm, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReposApi.repos_upstream_skills_partial_update ...' + 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 ReposApi.repos_upstream_skills_partial_update" + end + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ReposApi.repos_upstream_skills_partial_update" + end + # verify the required parameter 'slug_perm' is set + if @api_client.config.client_side_validation && slug_perm.nil? + fail ArgumentError, "Missing the required parameter 'slug_perm' when calling ReposApi.repos_upstream_skills_partial_update" + end + # resource path + local_var_path = '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'slug_perm' + '}', slug_perm.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'data']) + auth_names = ['apikey', 'basic'] + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'SkillsUpstream') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReposApi#repos_upstream_skills_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Retrieve an AI Skills upstream config for this repository. + # Retrieve an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @return [SkillsUpstream] + def repos_upstream_skills_read(owner, identifier, slug_perm, opts = {}) + data, _status_code, _headers = repos_upstream_skills_read_with_http_info(owner, identifier, slug_perm, opts) + data + end + + # Retrieve an AI Skills upstream config for this repository. + # Retrieve an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @return [Array<(SkillsUpstream, Fixnum, Hash)>] SkillsUpstream data, response status code and response headers + def repos_upstream_skills_read_with_http_info(owner, identifier, slug_perm, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReposApi.repos_upstream_skills_read ...' + 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 ReposApi.repos_upstream_skills_read" + end + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ReposApi.repos_upstream_skills_read" + end + # verify the required parameter 'slug_perm' is set + if @api_client.config.client_side_validation && slug_perm.nil? + fail ArgumentError, "Missing the required parameter 'slug_perm' when calling ReposApi.repos_upstream_skills_read" + end + # resource path + local_var_path = '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'slug_perm' + '}', slug_perm.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = nil + auth_names = ['apikey', 'basic'] + 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 => 'SkillsUpstream') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReposApi#repos_upstream_skills_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an AI Skills upstream config for this repository. + # Update an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequest] :data + # @return [SkillsUpstream] + def repos_upstream_skills_update(owner, identifier, slug_perm, opts = {}) + data, _status_code, _headers = repos_upstream_skills_update_with_http_info(owner, identifier, slug_perm, opts) + data + end + + # Update an AI Skills upstream config for this repository. + # Update an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequest] :data + # @return [Array<(SkillsUpstream, Fixnum, Hash)>] SkillsUpstream data, response status code and response headers + def repos_upstream_skills_update_with_http_info(owner, identifier, slug_perm, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReposApi.repos_upstream_skills_update ...' + 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 ReposApi.repos_upstream_skills_update" + end + # verify the required parameter 'identifier' is set + if @api_client.config.client_side_validation && identifier.nil? + fail ArgumentError, "Missing the required parameter 'identifier' when calling ReposApi.repos_upstream_skills_update" + end + # verify the required parameter 'slug_perm' is set + if @api_client.config.client_side_validation && slug_perm.nil? + fail ArgumentError, "Missing the required parameter 'slug_perm' when calling ReposApi.repos_upstream_skills_update" + end + # resource path + local_var_path = '/repos/{owner}/{identifier}/upstream/skills/{slug_perm}/'.sub('{' + 'owner' + '}', owner.to_s).sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'slug_perm' + '}', slug_perm.to_s) + + # query parameters + query_params = {} + + # header parameters + header_params = {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = {} + + # http body (model) + post_body = @api_client.object_to_http_body(opts[:'data']) + auth_names = ['apikey', 'basic'] + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => 'SkillsUpstream') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReposApi#repos_upstream_skills_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end # Create a Swift upstream config for this repository. # Create a Swift upstream config for this repository. # @param owner diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/organization_api_key_rule.rb b/bindings/ruby/src/lib/cloudsmith-api/models/organization_api_key_rule.rb index d95c2929f..e8f3bbc3b 100644 --- a/bindings/ruby/src/lib/cloudsmith-api/models/organization_api_key_rule.rb +++ b/bindings/ruby/src/lib/cloudsmith-api/models/organization_api_key_rule.rb @@ -34,7 +34,7 @@ class OrganizationApiKeyRule # Human-readable identifier for the rule type. Automatically generated based on the rule type. attr_accessor :slug - # An auto-generated id that uniquely identifies the API key policy. + # An auto-generated id that uniquely identifies the rule. attr_accessor :slug_perm attr_accessor :updated_at diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/service.rb b/bindings/ruby/src/lib/cloudsmith-api/models/service.rb index a91f8f72d..d14fa5891 100644 --- a/bindings/ruby/src/lib/cloudsmith-api/models/service.rb +++ b/bindings/ruby/src/lib/cloudsmith-api/models/service.rb @@ -26,7 +26,7 @@ class Service # The API key of the service attr_accessor :key - # The time at which the API key will expire. This will only be populated if the Organization has an active API Key Policy. + # The time at which the API key will expire. This will only be populated if the Organization has an active API key rule. attr_accessor :key_expires_at # The name of the service diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream.rb b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream.rb new file mode 100644 index 000000000..2f997c7a7 --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream.rb @@ -0,0 +1,532 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'date' + +module CloudsmithApi +class SkillsUpstream + # The authentication mode to use when accessing this upstream. + attr_accessor :auth_mode + + # Secret to provide with requests to upstream. + attr_accessor :auth_secret + + # Username to provide with requests to upstream. + attr_accessor :auth_username + + # Whether the upstream is available for use. + attr_accessor :available + + # Whether the upstream can be reindexed. + attr_accessor :can_reindex + + # The package types to serve from the upstream: skills, plugins, or both. + attr_accessor :contents + + # The datetime the upstream source was created. + attr_accessor :created_at + + attr_accessor :disable_reason + + # Human-readable explanation of why this upstream is disabled + attr_accessor :disable_reason_text + + # The key for extra header #1 to send to upstream. + attr_accessor :extra_header_1 + + # The key for extra header #2 to send to upstream. + attr_accessor :extra_header_2 + + # The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + attr_accessor :extra_value_1 + + # The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + attr_accessor :extra_value_2 + + # Whether the upstream has failed signature verification. + attr_accessor :has_failed_signature_verification + + # The number of packages available in this upstream source + attr_accessor :index_package_count + + # The current indexing status of this upstream source + attr_accessor :index_status + + # Whether or not this upstream is active and ready for requests. + attr_accessor :is_active + + # The last time this upstream source was indexed + attr_accessor :last_indexed + + # The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + attr_accessor :mode + + # A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + attr_accessor :name + + # When true, this upstream source is pending validation. + attr_accessor :pending_validation + + # Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + attr_accessor :priority + + # Exact ClawHub releases to cache. + attr_accessor :selections + + attr_accessor :slug_perm + + attr_accessor :updated_at + + # The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + attr_accessor :upstream_url + + # If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + attr_accessor :verify_ssl + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_mode' => :'auth_mode', + :'auth_secret' => :'auth_secret', + :'auth_username' => :'auth_username', + :'available' => :'available', + :'can_reindex' => :'can_reindex', + :'contents' => :'contents', + :'created_at' => :'created_at', + :'disable_reason' => :'disable_reason', + :'disable_reason_text' => :'disable_reason_text', + :'extra_header_1' => :'extra_header_1', + :'extra_header_2' => :'extra_header_2', + :'extra_value_1' => :'extra_value_1', + :'extra_value_2' => :'extra_value_2', + :'has_failed_signature_verification' => :'has_failed_signature_verification', + :'index_package_count' => :'index_package_count', + :'index_status' => :'index_status', + :'is_active' => :'is_active', + :'last_indexed' => :'last_indexed', + :'mode' => :'mode', + :'name' => :'name', + :'pending_validation' => :'pending_validation', + :'priority' => :'priority', + :'selections' => :'selections', + :'slug_perm' => :'slug_perm', + :'updated_at' => :'updated_at', + :'upstream_url' => :'upstream_url', + :'verify_ssl' => :'verify_ssl' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'auth_mode' => :'String', + :'auth_secret' => :'String', + :'auth_username' => :'String', + :'available' => :'BOOLEAN', + :'can_reindex' => :'BOOLEAN', + :'contents' => :'String', + :'created_at' => :'DateTime', + :'disable_reason' => :'String', + :'disable_reason_text' => :'String', + :'extra_header_1' => :'String', + :'extra_header_2' => :'String', + :'extra_value_1' => :'String', + :'extra_value_2' => :'String', + :'has_failed_signature_verification' => :'BOOLEAN', + :'index_package_count' => :'Integer', + :'index_status' => :'String', + :'is_active' => :'BOOLEAN', + :'last_indexed' => :'String', + :'mode' => :'String', + :'name' => :'String', + :'pending_validation' => :'BOOLEAN', + :'priority' => :'Integer', + :'selections' => :'Array', + :'slug_perm' => :'String', + :'updated_at' => :'DateTime', + :'upstream_url' => :'String', + :'verify_ssl' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'auth_mode') + self.auth_mode = attributes[:'auth_mode'] + else + self.auth_mode = 'None' + end + + if attributes.has_key?(:'auth_secret') + self.auth_secret = attributes[:'auth_secret'] + end + + if attributes.has_key?(:'auth_username') + self.auth_username = attributes[:'auth_username'] + end + + if attributes.has_key?(:'available') + self.available = attributes[:'available'] + end + + if attributes.has_key?(:'can_reindex') + self.can_reindex = attributes[:'can_reindex'] + end + + if attributes.has_key?(:'contents') + self.contents = attributes[:'contents'] + else + self.contents = 'Skills' + end + + if attributes.has_key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.has_key?(:'disable_reason') + self.disable_reason = attributes[:'disable_reason'] + else + self.disable_reason = 'N/A' + end + + if attributes.has_key?(:'disable_reason_text') + self.disable_reason_text = attributes[:'disable_reason_text'] + end + + if attributes.has_key?(:'extra_header_1') + self.extra_header_1 = attributes[:'extra_header_1'] + end + + if attributes.has_key?(:'extra_header_2') + self.extra_header_2 = attributes[:'extra_header_2'] + end + + if attributes.has_key?(:'extra_value_1') + self.extra_value_1 = attributes[:'extra_value_1'] + end + + if attributes.has_key?(:'extra_value_2') + self.extra_value_2 = attributes[:'extra_value_2'] + end + + if attributes.has_key?(:'has_failed_signature_verification') + self.has_failed_signature_verification = attributes[:'has_failed_signature_verification'] + end + + if attributes.has_key?(:'index_package_count') + self.index_package_count = attributes[:'index_package_count'] + end + + if attributes.has_key?(:'index_status') + self.index_status = attributes[:'index_status'] + end + + if attributes.has_key?(:'is_active') + self.is_active = attributes[:'is_active'] + end + + if attributes.has_key?(:'last_indexed') + self.last_indexed = attributes[:'last_indexed'] + end + + if attributes.has_key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = 'Proxy Only' + end + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'pending_validation') + self.pending_validation = attributes[:'pending_validation'] + end + + if attributes.has_key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.has_key?(:'selections') + if (value = attributes[:'selections']).is_a?(Array) + self.selections = value + end + end + + if attributes.has_key?(:'slug_perm') + self.slug_perm = attributes[:'slug_perm'] + end + + if attributes.has_key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.has_key?(:'upstream_url') + self.upstream_url = attributes[:'upstream_url'] + end + + if attributes.has_key?(:'verify_ssl') + self.verify_ssl = attributes[:'verify_ssl'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @upstream_url.nil? + invalid_properties.push('invalid value for "upstream_url", upstream_url cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + auth_mode_validator = EnumAttributeValidator.new('String', ['None', 'Token']) + return false unless auth_mode_validator.valid?(@auth_mode) + contents_validator = EnumAttributeValidator.new('String', ['Skills', 'Plugins', 'Skills and plugins']) + return false unless contents_validator.valid?(@contents) + disable_reason_validator = EnumAttributeValidator.new('String', ['N/A', 'Upstream points to its own repository', 'Missing upstream source', 'RSA key did not verify the upstream\'s APKINDEX signature', 'Upstream was disabled by request of user']) + return false unless disable_reason_validator.valid?(@disable_reason) + mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only']) + return false unless mode_validator.valid?(@mode) + return false if @name.nil? + return false if @upstream_url.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] auth_mode Object to be assigned + def auth_mode=(auth_mode) + validator = EnumAttributeValidator.new('String', ['None', 'Token']) + unless validator.valid?(auth_mode) + fail ArgumentError, 'invalid value for "auth_mode", must be one of #{validator.allowable_values}.' + end + @auth_mode = auth_mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] contents Object to be assigned + def contents=(contents) + validator = EnumAttributeValidator.new('String', ['Skills', 'Plugins', 'Skills and plugins']) + unless validator.valid?(contents) + fail ArgumentError, 'invalid value for "contents", must be one of #{validator.allowable_values}.' + end + @contents = contents + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] disable_reason Object to be assigned + def disable_reason=(disable_reason) + validator = EnumAttributeValidator.new('String', ['N/A', 'Upstream points to its own repository', 'Missing upstream source', 'RSA key did not verify the upstream\'s APKINDEX signature', 'Upstream was disabled by request of user']) + unless validator.valid?(disable_reason) + fail ArgumentError, 'invalid value for "disable_reason", must be one of #{validator.allowable_values}.' + end + @disable_reason = disable_reason + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only']) + unless validator.valid?(mode) + fail ArgumentError, 'invalid value for "mode", must be one of #{validator.allowable_values}.' + end + @mode = mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_mode == o.auth_mode && + auth_secret == o.auth_secret && + auth_username == o.auth_username && + available == o.available && + can_reindex == o.can_reindex && + contents == o.contents && + created_at == o.created_at && + disable_reason == o.disable_reason && + disable_reason_text == o.disable_reason_text && + extra_header_1 == o.extra_header_1 && + extra_header_2 == o.extra_header_2 && + extra_value_1 == o.extra_value_1 && + extra_value_2 == o.extra_value_2 && + has_failed_signature_verification == o.has_failed_signature_verification && + index_package_count == o.index_package_count && + index_status == o.index_status && + is_active == o.is_active && + last_indexed == o.last_indexed && + mode == o.mode && + name == o.name && + pending_validation == o.pending_validation && + priority == o.priority && + selections == o.selections && + slug_perm == o.slug_perm && + updated_at == o.updated_at && + upstream_url == o.upstream_url && + verify_ssl == o.verify_ssl + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [auth_mode, auth_secret, auth_username, available, can_reindex, contents, created_at, disable_reason, disable_reason_text, extra_header_1, extra_header_2, extra_value_1, extra_value_2, has_failed_signature_verification, index_package_count, index_status, is_active, last_indexed, mode, name, pending_validation, priority, selections, slug_perm, updated_at, upstream_url, verify_ssl].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CloudsmithApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + +end +end diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request.rb b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request.rb new file mode 100644 index 000000000..04d350804 --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request.rb @@ -0,0 +1,401 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'date' + +module CloudsmithApi +class SkillsUpstreamRequest + # The authentication mode to use when accessing this upstream. + attr_accessor :auth_mode + + # Secret to provide with requests to upstream. + attr_accessor :auth_secret + + # Username to provide with requests to upstream. + attr_accessor :auth_username + + # The package types to serve from the upstream: skills, plugins, or both. + attr_accessor :contents + + # The key for extra header #1 to send to upstream. + attr_accessor :extra_header_1 + + # The key for extra header #2 to send to upstream. + attr_accessor :extra_header_2 + + # The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + attr_accessor :extra_value_1 + + # The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + attr_accessor :extra_value_2 + + # Whether or not this upstream is active and ready for requests. + attr_accessor :is_active + + # The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + attr_accessor :mode + + # A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + attr_accessor :name + + # Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + attr_accessor :priority + + # Exact ClawHub releases to cache. + attr_accessor :selections + + # The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + attr_accessor :upstream_url + + # If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + attr_accessor :verify_ssl + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_mode' => :'auth_mode', + :'auth_secret' => :'auth_secret', + :'auth_username' => :'auth_username', + :'contents' => :'contents', + :'extra_header_1' => :'extra_header_1', + :'extra_header_2' => :'extra_header_2', + :'extra_value_1' => :'extra_value_1', + :'extra_value_2' => :'extra_value_2', + :'is_active' => :'is_active', + :'mode' => :'mode', + :'name' => :'name', + :'priority' => :'priority', + :'selections' => :'selections', + :'upstream_url' => :'upstream_url', + :'verify_ssl' => :'verify_ssl' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'auth_mode' => :'String', + :'auth_secret' => :'String', + :'auth_username' => :'String', + :'contents' => :'String', + :'extra_header_1' => :'String', + :'extra_header_2' => :'String', + :'extra_value_1' => :'String', + :'extra_value_2' => :'String', + :'is_active' => :'BOOLEAN', + :'mode' => :'String', + :'name' => :'String', + :'priority' => :'Integer', + :'selections' => :'Array', + :'upstream_url' => :'String', + :'verify_ssl' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'auth_mode') + self.auth_mode = attributes[:'auth_mode'] + else + self.auth_mode = 'None' + end + + if attributes.has_key?(:'auth_secret') + self.auth_secret = attributes[:'auth_secret'] + end + + if attributes.has_key?(:'auth_username') + self.auth_username = attributes[:'auth_username'] + end + + if attributes.has_key?(:'contents') + self.contents = attributes[:'contents'] + else + self.contents = 'Skills' + end + + if attributes.has_key?(:'extra_header_1') + self.extra_header_1 = attributes[:'extra_header_1'] + end + + if attributes.has_key?(:'extra_header_2') + self.extra_header_2 = attributes[:'extra_header_2'] + end + + if attributes.has_key?(:'extra_value_1') + self.extra_value_1 = attributes[:'extra_value_1'] + end + + if attributes.has_key?(:'extra_value_2') + self.extra_value_2 = attributes[:'extra_value_2'] + end + + if attributes.has_key?(:'is_active') + self.is_active = attributes[:'is_active'] + end + + if attributes.has_key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = 'Proxy Only' + end + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.has_key?(:'selections') + if (value = attributes[:'selections']).is_a?(Array) + self.selections = value + end + end + + if attributes.has_key?(:'upstream_url') + self.upstream_url = attributes[:'upstream_url'] + end + + if attributes.has_key?(:'verify_ssl') + self.verify_ssl = attributes[:'verify_ssl'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @upstream_url.nil? + invalid_properties.push('invalid value for "upstream_url", upstream_url cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + auth_mode_validator = EnumAttributeValidator.new('String', ['None', 'Token']) + return false unless auth_mode_validator.valid?(@auth_mode) + contents_validator = EnumAttributeValidator.new('String', ['Skills', 'Plugins', 'Skills and plugins']) + return false unless contents_validator.valid?(@contents) + mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only']) + return false unless mode_validator.valid?(@mode) + return false if @name.nil? + return false if @upstream_url.nil? + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] auth_mode Object to be assigned + def auth_mode=(auth_mode) + validator = EnumAttributeValidator.new('String', ['None', 'Token']) + unless validator.valid?(auth_mode) + fail ArgumentError, 'invalid value for "auth_mode", must be one of #{validator.allowable_values}.' + end + @auth_mode = auth_mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] contents Object to be assigned + def contents=(contents) + validator = EnumAttributeValidator.new('String', ['Skills', 'Plugins', 'Skills and plugins']) + unless validator.valid?(contents) + fail ArgumentError, 'invalid value for "contents", must be one of #{validator.allowable_values}.' + end + @contents = contents + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only']) + unless validator.valid?(mode) + fail ArgumentError, 'invalid value for "mode", must be one of #{validator.allowable_values}.' + end + @mode = mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_mode == o.auth_mode && + auth_secret == o.auth_secret && + auth_username == o.auth_username && + contents == o.contents && + extra_header_1 == o.extra_header_1 && + extra_header_2 == o.extra_header_2 && + extra_value_1 == o.extra_value_1 && + extra_value_2 == o.extra_value_2 && + is_active == o.is_active && + mode == o.mode && + name == o.name && + priority == o.priority && + selections == o.selections && + upstream_url == o.upstream_url && + verify_ssl == o.verify_ssl + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [auth_mode, auth_secret, auth_username, contents, extra_header_1, extra_header_2, extra_value_1, extra_value_2, is_active, mode, name, priority, selections, upstream_url, verify_ssl].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CloudsmithApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + +end +end diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request_patch.rb b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request_patch.rb new file mode 100644 index 000000000..6fd26ca74 --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_request_patch.rb @@ -0,0 +1,391 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'date' + +module CloudsmithApi +class SkillsUpstreamRequestPatch + # The authentication mode to use when accessing this upstream. + attr_accessor :auth_mode + + # Secret to provide with requests to upstream. + attr_accessor :auth_secret + + # Username to provide with requests to upstream. + attr_accessor :auth_username + + # The package types to serve from the upstream: skills, plugins, or both. + attr_accessor :contents + + # The key for extra header #1 to send to upstream. + attr_accessor :extra_header_1 + + # The key for extra header #2 to send to upstream. + attr_accessor :extra_header_2 + + # The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted. + attr_accessor :extra_value_1 + + # The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted. + attr_accessor :extra_value_2 + + # Whether or not this upstream is active and ready for requests. + attr_accessor :is_active + + # The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode. + attr_accessor :mode + + # A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. + attr_accessor :name + + # Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. + attr_accessor :priority + + # Exact ClawHub releases to cache. + attr_accessor :selections + + # The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository. + attr_accessor :upstream_url + + # If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams. + attr_accessor :verify_ssl + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'auth_mode' => :'auth_mode', + :'auth_secret' => :'auth_secret', + :'auth_username' => :'auth_username', + :'contents' => :'contents', + :'extra_header_1' => :'extra_header_1', + :'extra_header_2' => :'extra_header_2', + :'extra_value_1' => :'extra_value_1', + :'extra_value_2' => :'extra_value_2', + :'is_active' => :'is_active', + :'mode' => :'mode', + :'name' => :'name', + :'priority' => :'priority', + :'selections' => :'selections', + :'upstream_url' => :'upstream_url', + :'verify_ssl' => :'verify_ssl' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'auth_mode' => :'String', + :'auth_secret' => :'String', + :'auth_username' => :'String', + :'contents' => :'String', + :'extra_header_1' => :'String', + :'extra_header_2' => :'String', + :'extra_value_1' => :'String', + :'extra_value_2' => :'String', + :'is_active' => :'BOOLEAN', + :'mode' => :'String', + :'name' => :'String', + :'priority' => :'Integer', + :'selections' => :'Array', + :'upstream_url' => :'String', + :'verify_ssl' => :'BOOLEAN' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'auth_mode') + self.auth_mode = attributes[:'auth_mode'] + else + self.auth_mode = 'None' + end + + if attributes.has_key?(:'auth_secret') + self.auth_secret = attributes[:'auth_secret'] + end + + if attributes.has_key?(:'auth_username') + self.auth_username = attributes[:'auth_username'] + end + + if attributes.has_key?(:'contents') + self.contents = attributes[:'contents'] + else + self.contents = 'Skills' + end + + if attributes.has_key?(:'extra_header_1') + self.extra_header_1 = attributes[:'extra_header_1'] + end + + if attributes.has_key?(:'extra_header_2') + self.extra_header_2 = attributes[:'extra_header_2'] + end + + if attributes.has_key?(:'extra_value_1') + self.extra_value_1 = attributes[:'extra_value_1'] + end + + if attributes.has_key?(:'extra_value_2') + self.extra_value_2 = attributes[:'extra_value_2'] + end + + if attributes.has_key?(:'is_active') + self.is_active = attributes[:'is_active'] + end + + if attributes.has_key?(:'mode') + self.mode = attributes[:'mode'] + else + self.mode = 'Proxy Only' + end + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.has_key?(:'selections') + if (value = attributes[:'selections']).is_a?(Array) + self.selections = value + end + end + + if attributes.has_key?(:'upstream_url') + self.upstream_url = attributes[:'upstream_url'] + end + + if attributes.has_key?(:'verify_ssl') + self.verify_ssl = attributes[:'verify_ssl'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + auth_mode_validator = EnumAttributeValidator.new('String', ['None', 'Token']) + return false unless auth_mode_validator.valid?(@auth_mode) + contents_validator = EnumAttributeValidator.new('String', ['Skills', 'Plugins', 'Skills and plugins']) + return false unless contents_validator.valid?(@contents) + mode_validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only']) + return false unless mode_validator.valid?(@mode) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] auth_mode Object to be assigned + def auth_mode=(auth_mode) + validator = EnumAttributeValidator.new('String', ['None', 'Token']) + unless validator.valid?(auth_mode) + fail ArgumentError, 'invalid value for "auth_mode", must be one of #{validator.allowable_values}.' + end + @auth_mode = auth_mode + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] contents Object to be assigned + def contents=(contents) + validator = EnumAttributeValidator.new('String', ['Skills', 'Plugins', 'Skills and plugins']) + unless validator.valid?(contents) + fail ArgumentError, 'invalid value for "contents", must be one of #{validator.allowable_values}.' + end + @contents = contents + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] mode Object to be assigned + def mode=(mode) + validator = EnumAttributeValidator.new('String', ['Proxy Only', 'Cache and Proxy', 'Cache Only']) + unless validator.valid?(mode) + fail ArgumentError, 'invalid value for "mode", must be one of #{validator.allowable_values}.' + end + @mode = mode + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + auth_mode == o.auth_mode && + auth_secret == o.auth_secret && + auth_username == o.auth_username && + contents == o.contents && + extra_header_1 == o.extra_header_1 && + extra_header_2 == o.extra_header_2 && + extra_value_1 == o.extra_value_1 && + extra_value_2 == o.extra_value_2 && + is_active == o.is_active && + mode == o.mode && + name == o.name && + priority == o.priority && + selections == o.selections && + upstream_url == o.upstream_url && + verify_ssl == o.verify_ssl + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [auth_mode, auth_secret, auth_username, contents, extra_header_1, extra_header_2, extra_value_1, extra_value_2, is_active, mode, name, priority, selections, upstream_url, verify_ssl].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CloudsmithApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + +end +end diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_selection.rb b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_selection.rb new file mode 100644 index 000000000..8c78a36e2 --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/skills_upstream_selection.rb @@ -0,0 +1,220 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'date' + +module CloudsmithApi +class SkillsUpstreamSelection + # The skill's ClawHub slug. + attr_accessor :name + + # The ClawHub owner handle that publishes the skill. + attr_accessor :publisher + + # The exact semantic version of the release. + attr_accessor :version + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'publisher' => :'publisher', + :'version' => :'version' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'name' => :'String', + :'publisher' => :'String', + :'version' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + return unless attributes.is_a?(Hash) + + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + + if attributes.has_key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.has_key?(:'publisher') + self.publisher = attributes[:'publisher'] + end + + if attributes.has_key?(:'version') + self.version = attributes[:'version'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @publisher.nil? + invalid_properties.push('invalid value for "publisher", publisher cannot be nil.') + end + + if @version.nil? + invalid_properties.push('invalid value for "version", version cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @publisher.nil? + return false if @version.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + publisher == o.publisher && + version == o.version + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Fixnum] Hash code + def hash + [name, publisher, version].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.swagger_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :BOOLEAN + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + temp_model = CloudsmithApi.const_get(type).new + temp_model.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + +end +end diff --git a/bindings/ruby/src/lib/cloudsmith-api/version.rb b/bindings/ruby/src/lib/cloudsmith-api/version.rb index 90466524e..fd0b3eb2d 100644 --- a/bindings/ruby/src/lib/cloudsmith-api/version.rb +++ b/bindings/ruby/src/lib/cloudsmith-api/version.rb @@ -11,5 +11,5 @@ =end module CloudsmithApi - VERSION = '2.0.38' + VERSION = '2.0.39' end diff --git a/bindings/ruby/src/spec/api/repos_api_spec.rb b/bindings/ruby/src/spec/api/repos_api_spec.rb index 00e5d9b9e..b561c40d0 100644 --- a/bindings/ruby/src/spec/api/repos_api_spec.rb +++ b/bindings/ruby/src/spec/api/repos_api_spec.rb @@ -2267,6 +2267,93 @@ end end + # unit tests for repos_upstream_skills_create + # Create an AI Skills upstream config for this repository. + # Create an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequest] :data + # @return [SkillsUpstream] + describe 'repos_upstream_skills_create test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for repos_upstream_skills_delete + # Delete an AI Skills upstream config for this repository. + # Delete an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'repos_upstream_skills_delete test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for repos_upstream_skills_list + # List AI Skills upstream configs for this repository. + # List AI Skills upstream configs for this repository. + # @param owner + # @param identifier + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page A page number within the paginated result set. + # @option opts [Integer] :page_size Number of results to return per page. + # @return [Array] + describe 'repos_upstream_skills_list test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for repos_upstream_skills_partial_update + # Partially update an AI Skills upstream config for this repository. + # Partially update an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequestPatch] :data + # @return [SkillsUpstream] + describe 'repos_upstream_skills_partial_update test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for repos_upstream_skills_read + # Retrieve an AI Skills upstream config for this repository. + # Retrieve an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @return [SkillsUpstream] + describe 'repos_upstream_skills_read test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for repos_upstream_skills_update + # Update an AI Skills upstream config for this repository. + # Update an AI Skills upstream config for this repository. + # @param owner + # @param identifier + # @param slug_perm + # @param [Hash] opts the optional parameters + # @option opts [SkillsUpstreamRequest] :data + # @return [SkillsUpstream] + describe 'repos_upstream_skills_update test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for repos_upstream_swift_create # Create a Swift upstream config for this repository. # Create a Swift upstream config for this repository. diff --git a/bindings/ruby/src/spec/models/skills_upstream_request_patch_spec.rb b/bindings/ruby/src/spec/models/skills_upstream_request_patch_spec.rb new file mode 100644 index 000000000..46b197742 --- /dev/null +++ b/bindings/ruby/src/spec/models/skills_upstream_request_patch_spec.rb @@ -0,0 +1,137 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::SkillsUpstreamRequestPatch +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'SkillsUpstreamRequestPatch' do + before do + # run before each test + @instance = CloudsmithApi::SkillsUpstreamRequestPatch.new + end + + after do + # run after each test + end + + describe 'test an instance of SkillsUpstreamRequestPatch' do + it 'should create an instance of SkillsUpstreamRequestPatch' do + expect(@instance).to be_instance_of(CloudsmithApi::SkillsUpstreamRequestPatch) + end + end + describe 'test attribute "auth_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["None", "Token"]) + # validator.allowable_values.each do |value| + # expect { @instance.auth_mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "auth_secret"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "auth_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contents"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Skills", "Plugins", "Skills and plugins"]) + # validator.allowable_values.each do |value| + # expect { @instance.contents = value }.not_to raise_error + # end + end + end + + describe 'test attribute "extra_header_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_header_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_value_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_value_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Proxy Only", "Cache and Proxy", "Cache Only"]) + # validator.allowable_values.each do |value| + # expect { @instance.mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "selections"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "upstream_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "verify_ssl"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/bindings/ruby/src/spec/models/skills_upstream_request_spec.rb b/bindings/ruby/src/spec/models/skills_upstream_request_spec.rb new file mode 100644 index 000000000..356d6ea0a --- /dev/null +++ b/bindings/ruby/src/spec/models/skills_upstream_request_spec.rb @@ -0,0 +1,137 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::SkillsUpstreamRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'SkillsUpstreamRequest' do + before do + # run before each test + @instance = CloudsmithApi::SkillsUpstreamRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of SkillsUpstreamRequest' do + it 'should create an instance of SkillsUpstreamRequest' do + expect(@instance).to be_instance_of(CloudsmithApi::SkillsUpstreamRequest) + end + end + describe 'test attribute "auth_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["None", "Token"]) + # validator.allowable_values.each do |value| + # expect { @instance.auth_mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "auth_secret"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "auth_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contents"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Skills", "Plugins", "Skills and plugins"]) + # validator.allowable_values.each do |value| + # expect { @instance.contents = value }.not_to raise_error + # end + end + end + + describe 'test attribute "extra_header_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_header_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_value_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_value_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Proxy Only", "Cache and Proxy", "Cache Only"]) + # validator.allowable_values.each do |value| + # expect { @instance.mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "selections"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "upstream_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "verify_ssl"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/bindings/ruby/src/spec/models/skills_upstream_selection_spec.rb b/bindings/ruby/src/spec/models/skills_upstream_selection_spec.rb new file mode 100644 index 000000000..44ed6f816 --- /dev/null +++ b/bindings/ruby/src/spec/models/skills_upstream_selection_spec.rb @@ -0,0 +1,53 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::SkillsUpstreamSelection +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'SkillsUpstreamSelection' do + before do + # run before each test + @instance = CloudsmithApi::SkillsUpstreamSelection.new + end + + after do + # run after each test + end + + describe 'test an instance of SkillsUpstreamSelection' do + it 'should create an instance of SkillsUpstreamSelection' do + expect(@instance).to be_instance_of(CloudsmithApi::SkillsUpstreamSelection) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "publisher"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "version"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/bindings/ruby/src/spec/models/skills_upstream_spec.rb b/bindings/ruby/src/spec/models/skills_upstream_spec.rb new file mode 100644 index 000000000..83b2e4dcb --- /dev/null +++ b/bindings/ruby/src/spec/models/skills_upstream_spec.rb @@ -0,0 +1,213 @@ +=begin +#Cloudsmith API (v1) + +#The API to the Cloudsmith Service + +OpenAPI spec version: v1 +Contact: support@cloudsmith.io +Generated by: https://github.com/swagger-api/swagger-codegen.git +Swagger Codegen version: 2.4.52 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::SkillsUpstream +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'SkillsUpstream' do + before do + # run before each test + @instance = CloudsmithApi::SkillsUpstream.new + end + + after do + # run after each test + end + + describe 'test an instance of SkillsUpstream' do + it 'should create an instance of SkillsUpstream' do + expect(@instance).to be_instance_of(CloudsmithApi::SkillsUpstream) + end + end + describe 'test attribute "auth_mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["None", "Token"]) + # validator.allowable_values.each do |value| + # expect { @instance.auth_mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "auth_secret"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "auth_username"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "available"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "can_reindex"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contents"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Skills", "Plugins", "Skills and plugins"]) + # validator.allowable_values.each do |value| + # expect { @instance.contents = value }.not_to raise_error + # end + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "disable_reason"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["N/A", "Upstream points to its own repository", "Missing upstream source", "RSA key did not verify the upstream's APKINDEX signature", "Upstream was disabled by request of user"]) + # validator.allowable_values.each do |value| + # expect { @instance.disable_reason = value }.not_to raise_error + # end + end + end + + describe 'test attribute "disable_reason_text"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_header_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_header_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_value_1"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "extra_value_2"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "has_failed_signature_verification"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "index_package_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "index_status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_indexed"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mode"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Proxy Only", "Cache and Proxy", "Cache Only"]) + # validator.allowable_values.each do |value| + # expect { @instance.mode = value }.not_to raise_error + # end + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pending_validation"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "priority"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "selections"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "slug_perm"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "updated_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "upstream_url"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "verify_ssl"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/scripts/common.sh b/scripts/common.sh index dc0b82b65..0a1230e39 100755 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -3,7 +3,7 @@ language=${1:-""} api_url=${2:-${api_url:-"https://api.cloudsmith.io/"}} api_version=$(curl -s "${api_url}status/check/basic/" | jq -r '.version') openapi_url="${api_url}?format=openapi" -package_version="2.0.38" +package_version="2.0.39" # Dependabot updates the image in codegen/Dockerfile. swagger_codegen_cli_image=$(awk '/^FROM / {print $2}' "$root_dir/codegen/Dockerfile") From 2704426d6e70b90499d3ca631716883138c58c6e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Oct 2026 13:36:53 +0000 Subject: [PATCH 2/2] Raise Java Maven minimum version Co-authored-by: barisa-cloudsmith <273087250+barisa-cloudsmith@users.noreply.github.com> --- bindings/java/release/pom.xml | 2 +- bindings/java/src/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/java/release/pom.xml b/bindings/java/release/pom.xml index 553dcd628..403b30165 100644 --- a/bindings/java/release/pom.xml +++ b/bindings/java/release/pom.xml @@ -47,7 +47,7 @@ - 2.2.0 + 3.6.3 diff --git a/bindings/java/src/pom.xml b/bindings/java/src/pom.xml index 2c63ef5bc..ee3b92898 100644 --- a/bindings/java/src/pom.xml +++ b/bindings/java/src/pom.xml @@ -47,7 +47,7 @@ - 2.2.0 + 3.6.3