diff --git a/bindings/java/src/README.md b/bindings/java/src/README.md index 18a80705..39f09b10 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.30 + 2.0.31 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.30" +compile "io.cloudsmith.api:cloudsmith-api:2.0.31" ``` ### Others @@ -63,7 +63,7 @@ mvn clean package Then manually install the following JARs: -* `target/cloudsmith-api-2.0.30.jar` +* `target/cloudsmith-api-2.0.31.jar` * `target/lib/*.jar` ## Getting Started @@ -149,6 +149,7 @@ Class | Method | HTTP request | Description *MetricsApi* | [**metricsPackagesList**](docs/MetricsApi.md#metricsPackagesList) | **GET** /metrics/packages/{owner}/{repo}/ | View for listing package usage metrics, for a repository. *NamespacesApi* | [**namespacesList**](docs/NamespacesApi.md#namespacesList) | **GET** /namespaces/ | Get a list of all namespaces the user belongs to. *NamespacesApi* | [**namespacesRead**](docs/NamespacesApi.md#namespacesRead) | **GET** /namespaces/{slug}/ | Get a specific namespace that the user belongs to. +*OpenidApi* | [**openidCreate**](docs/OpenidApi.md#openidCreate) | **POST** /openid/{owner}/ | Get a JWT token for a configured service account belonging to the requesting org. *OrgsApi* | [**orgsCustomDomainsList**](docs/OrgsApi.md#orgsCustomDomainsList) | **GET** /orgs/{org}/custom-domains/ | Get the details for all custom domains. *OrgsApi* | [**orgsDelete**](docs/OrgsApi.md#orgsDelete) | **DELETE** /orgs/{org}/ | Delete the specified organization. *OrgsApi* | [**orgsDenyPolicyCreate**](docs/OrgsApi.md#orgsDenyPolicyCreate) | **POST** /orgs/{org}/deny-policy/ | Create a package deny policy. @@ -624,6 +625,9 @@ Class | Method | HTTP request | Description - [NugetUpstream](docs/NugetUpstream.md) - [NugetUpstreamRequest](docs/NugetUpstreamRequest.md) - [NugetUpstreamRequestPatch](docs/NugetUpstreamRequestPatch.md) + - [Oidc](docs/Oidc.md) + - [Oidc1](docs/Oidc1.md) + - [OidcRequest](docs/OidcRequest.md) - [Organization](docs/Organization.md) - [OrganizationCustomDomainNestedRepo](docs/OrganizationCustomDomainNestedRepo.md) - [OrganizationCustomDomains](docs/OrganizationCustomDomains.md) diff --git a/bindings/java/src/build.gradle b/bindings/java/src/build.gradle index c08d2bea..e4a59bf3 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.30' +version = '2.0.31' buildscript { repositories { diff --git a/bindings/java/src/build.json b/bindings/java/src/build.json index 47d58d3d..11d41d51 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.30", + "artifactVersion": "2.0.31", "artifactDescription": "Cloudsmith API", "dateLibrary": "java8", "developerName": "Cloudsmith Ltd", diff --git a/bindings/java/src/build.sbt b/bindings/java/src/build.sbt index 2fc79f3e..11ba83be 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.30", + version := "2.0.31", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/bindings/java/src/docs/NixPackageUploadRequest.md b/bindings/java/src/docs/NixPackageUploadRequest.md index 1e4ca5d2..eab4da3e 100644 --- a/bindings/java/src/docs/NixPackageUploadRequest.md +++ b/bindings/java/src/docs/NixPackageUploadRequest.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **isMalwareDetected** | **Boolean** | Whether the package has been detected as containing malware. Requires Ultra plan. | [optional] -**narinfo** | **String** | The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. | [optional] +**narinfoFile** | **String** | The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. | [optional] **packageFile** | **String** | The primary file for the package. | **republish** | **Boolean** | If true, the uploaded package will overwrite any others with the same attributes (e.g. same version); otherwise, it will be flagged as a duplicate. | [optional] **tags** | **String** | A comma-separated values list of tags to add to the package. | [optional] diff --git a/bindings/java/src/docs/Oidc.md b/bindings/java/src/docs/Oidc.md new file mode 100644 index 00000000..30f8c6d7 --- /dev/null +++ b/bindings/java/src/docs/Oidc.md @@ -0,0 +1,9 @@ + +# Oidc + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/bindings/java/src/docs/Oidc1.md b/bindings/java/src/docs/Oidc1.md new file mode 100644 index 00000000..95039108 --- /dev/null +++ b/bindings/java/src/docs/Oidc1.md @@ -0,0 +1,10 @@ + +# Oidc1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **String** | Serialized JWT to be used for authentication. | [optional] + + + diff --git a/bindings/java/src/docs/OidcRequest.md b/bindings/java/src/docs/OidcRequest.md new file mode 100644 index 00000000..12a4a294 --- /dev/null +++ b/bindings/java/src/docs/OidcRequest.md @@ -0,0 +1,11 @@ + +# OidcRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**oidcToken** | **String** | Serialized OIDC token. | +**serviceSlug** | **String** | Slug for the service account. | + + + diff --git a/bindings/java/src/docs/OpenidApi.md b/bindings/java/src/docs/OpenidApi.md new file mode 100644 index 00000000..013b2b70 --- /dev/null +++ b/bindings/java/src/docs/OpenidApi.md @@ -0,0 +1,71 @@ +# OpenidApi + +All URIs are relative to *https://api.cloudsmith.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**openidCreate**](OpenidApi.md#openidCreate) | **POST** /openid/{owner}/ | Get a JWT token for a configured service account belonging to the requesting org. + + + +# **openidCreate** +> Oidc1 openidCreate(owner, data) + +Get a JWT token for a configured service account belonging to the requesting org. + +Get a JWT token for a configured service account belonging to the requesting org. + +### 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.OpenidApi; + +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"); + +OpenidApi apiInstance = new OpenidApi(); +String owner = "owner_example"; // String | +OidcRequest data = new OidcRequest(); // OidcRequest | +try { + Oidc1 result = apiInstance.openidCreate(owner, data); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling OpenidApi#openidCreate"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **data** | [**OidcRequest**](OidcRequest.md)| | [optional] + +### Return type + +[**Oidc1**](Oidc1.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/bindings/java/src/pom.xml b/bindings/java/src/pom.xml index c3b0905b..627a21e8 100644 --- a/bindings/java/src/pom.xml +++ b/bindings/java/src/pom.xml @@ -5,7 +5,7 @@ cloudsmith-api jar cloudsmith-api - 2.0.30 + 2.0.31 https://api.cloudsmith.io/?format=openapi Cloudsmith API 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 2f441ca0..5066a524 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.30/java"); + setUserAgent("Swagger-Codegen/2.0.31/java"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/JSON.java b/bindings/java/src/src/main/java/io/cloudsmith/api/JSON.java index 6a545658..8a952dc5 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/JSON.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/JSON.java @@ -24,322 +24,6 @@ import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; -import io.cloudsmith.api.models.*; import io.cloudsmith.api.models.*; import okio.ByteString; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/AuditLogApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/AuditLogApi.java index 2131bd52..4b581683 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/AuditLogApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/AuditLogApi.java @@ -40,7 +40,6 @@ import io.cloudsmith.api.models.NamespaceAuditLog; import io.cloudsmith.api.models.RepositoryAuditLog; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BadgesApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BadgesApi.java index 03a0a958..c6ed1e25 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BadgesApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BadgesApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.PackageVersionBadge; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BroadcastsApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BroadcastsApi.java index 585c6f58..f0c7227f 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BroadcastsApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BroadcastsApi.java @@ -40,7 +40,6 @@ import io.cloudsmith.api.models.BroadcastTokenInput; import io.cloudsmith.api.models.ErrorDetail; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BulkActionApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BulkActionApi.java index 85297bd0..c6d1955a 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BulkActionApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/BulkActionApi.java @@ -40,7 +40,6 @@ import io.cloudsmith.api.models.PackageBulkAction; import io.cloudsmith.api.models.PackageBulkActionResponse; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/DistrosApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/DistrosApi.java index b6546160..2f297703 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/DistrosApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/DistrosApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.DistributionFull; import io.cloudsmith.api.models.ErrorDetail; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/EntitlementsApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/EntitlementsApi.java index 9c6e1485..30dae841 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/EntitlementsApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/EntitlementsApi.java @@ -46,7 +46,6 @@ import io.cloudsmith.api.models.RepositoryTokenSync; import io.cloudsmith.api.models.RepositoryTokenSyncRequest; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FilesApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FilesApi.java index eb22da7d..c6bc6434 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FilesApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FilesApi.java @@ -41,7 +41,6 @@ import io.cloudsmith.api.models.PackageFileUpload; import io.cloudsmith.api.models.PackageFileUploadRequest; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FormatsApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FormatsApi.java index 794286b9..1662d059 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FormatsApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/FormatsApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.Format; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/MetricsApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/MetricsApi.java index b7ed5cbd..1bf2281e 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/MetricsApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/MetricsApi.java @@ -40,7 +40,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.PackageUsageMetrics; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/NamespacesApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/NamespacesApi.java index ac882ee9..e0a2c226 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/NamespacesApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/NamespacesApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.Namespace; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OpenidApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OpenidApi.java new file mode 100644 index 00000000..f095ec3f --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OpenidApi.java @@ -0,0 +1,216 @@ +/* + * 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.apis; + +import io.cloudsmith.api.ApiCallback; +import io.cloudsmith.api.ApiClient; +import io.cloudsmith.api.ApiException; +import io.cloudsmith.api.ApiResponse; +import io.cloudsmith.api.Configuration; +import io.cloudsmith.api.Pair; +import io.cloudsmith.api.ProgressRequestBody; +import io.cloudsmith.api.ProgressResponseBody; +import io.cloudsmith.api.BeanValidationException; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + +import javax.validation.constraints.*; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.ValidatorFactory; +import javax.validation.executable.ExecutableValidator; +import java.util.Set; +import java.lang.reflect.Method; +import java.lang.reflect.Type; + +import io.cloudsmith.api.models.ErrorDetail; +import io.cloudsmith.api.models.Oidc1; +import io.cloudsmith.api.models.OidcRequest; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OpenidApi { + private ApiClient apiClient; + private Map headers; + + public OpenidApi() { + this(Configuration.getDefaultApiClient()); + } + + public OpenidApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public void setHeadersOverrides(Map headers) { + this.headers = headers; + } + + /** + * Build call for openidCreate + * @param owner (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 openidCreateCall(String owner, OidcRequest data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = data; + + // create path and map variables + String localVarPath = "/openid/{owner}/" + .replaceAll("\\{" + "owner" + "\\}", apiClient.escapeString(owner.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 openidCreateValidateBeforeCall(String owner, OidcRequest data, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + try { + ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); + ExecutableValidator executableValidator = factory.getValidator().forExecutables(); + + Object[] parameterValues = { owner, data }; + Method method = this.getClass().getMethod("openidCreateWithHttpInfo", String.class, OidcRequest.class); + Set> violations = executableValidator.validateParameters(this, method, + parameterValues); + + if (violations.size() == 0) { + com.squareup.okhttp.Call call = openidCreateCall(owner, 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()); + } + + } + + /** + * Get a JWT token for a configured service account belonging to the requesting org. + * Get a JWT token for a configured service account belonging to the requesting org. + * @param owner (required) + * @param data (optional) + * @return Oidc1 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public Oidc1 openidCreate(String owner, OidcRequest data) throws ApiException { + ApiResponse resp = openidCreateWithHttpInfo(owner, data); + return resp.getData(); + } + + /** + * Get a JWT token for a configured service account belonging to the requesting org. + * Get a JWT token for a configured service account belonging to the requesting org. + * @param owner (required) + * @param data (optional) + * @return ApiResponse<Oidc1> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse openidCreateWithHttpInfo( @NotNull String owner, OidcRequest data) throws ApiException { + com.squareup.okhttp.Call call = openidCreateValidateBeforeCall(owner, data, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get a JWT token for a configured service account belonging to the requesting org. (asynchronously) + * Get a JWT token for a configured service account belonging to the requesting org. + * @param owner (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 openidCreateAsync(String owner, OidcRequest 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 = openidCreateValidateBeforeCall(owner, data, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OrgsApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OrgsApi.java index 8e2640d2..65faf76a 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OrgsApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/OrgsApi.java @@ -85,7 +85,6 @@ import io.cloudsmith.api.models.ServiceRequest; import io.cloudsmith.api.models.ServiceRequestPatch; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/PackagesApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/PackagesApi.java index 949f709d..021bbb1a 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/PackagesApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/PackagesApi.java @@ -112,7 +112,6 @@ import io.cloudsmith.api.models.VsxPackageUpload; import io.cloudsmith.api.models.VsxPackageUploadRequest; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/QuotaApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/QuotaApi.java index 9de38a37..83c24c39 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/QuotaApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/QuotaApi.java @@ -40,7 +40,6 @@ import io.cloudsmith.api.models.Quota; import io.cloudsmith.api.models.QuotaHistory; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RatesApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RatesApi.java index c92e883c..5abfb6b1 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RatesApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RatesApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.ResourcesRateCheck; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RecycleBinApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RecycleBinApi.java index 30f5f9c9..e8314917 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RecycleBinApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/RecycleBinApi.java @@ -41,7 +41,6 @@ import io.cloudsmith.api.models.PackageRecycleBin; import io.cloudsmith.api.models.RecycleBinPackage; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; 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 3ee8bd6f..0d1f0c6c 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 @@ -132,7 +132,6 @@ import io.cloudsmith.api.models.SwiftUpstreamRequest; import io.cloudsmith.api.models.SwiftUpstreamRequestPatch; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StatusApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StatusApi.java index b5037456..673f39c7 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StatusApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StatusApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.StatusBasic; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StorageRegionsApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StorageRegionsApi.java index 20f71f2b..553cd058 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StorageRegionsApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/StorageRegionsApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.StorageRegion; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UserApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UserApi.java index 7fa80de2..b1c2a2c5 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UserApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UserApi.java @@ -43,7 +43,6 @@ import io.cloudsmith.api.models.UserAuthenticationToken; import io.cloudsmith.api.models.UserBrief; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UsersApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UsersApi.java index 36791f24..92873ebe 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UsersApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/UsersApi.java @@ -39,7 +39,6 @@ import io.cloudsmith.api.models.ErrorDetail; import io.cloudsmith.api.models.UserProfile; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/VulnerabilitiesApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/VulnerabilitiesApi.java index 0607c2f8..3f00c0c5 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/VulnerabilitiesApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/VulnerabilitiesApi.java @@ -40,7 +40,6 @@ import io.cloudsmith.api.models.VulnerabilityScanResults; import io.cloudsmith.api.models.VulnerabilityScanResultsList; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/WebhooksApi.java b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/WebhooksApi.java index 9ba62907..c8ce4c7c 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/apis/WebhooksApi.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/apis/WebhooksApi.java @@ -41,7 +41,6 @@ import io.cloudsmith.api.models.RepositoryWebhookRequest; import io.cloudsmith.api.models.RepositoryWebhookRequestPatch; -import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/NixPackageUploadRequest.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/NixPackageUploadRequest.java index 9d5aa113..26e420f6 100644 --- a/bindings/java/src/src/main/java/io/cloudsmith/api/models/NixPackageUploadRequest.java +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/NixPackageUploadRequest.java @@ -38,8 +38,8 @@ public class NixPackageUploadRequest implements Serializable { @SerializedName("is_malware_detected") private Boolean isMalwareDetected = null; - @SerializedName("narinfo") - private String narinfo = null; + @SerializedName("narinfo_file") + private String narinfoFile = null; @SerializedName("package_file") private String packageFile = null; @@ -65,22 +65,22 @@ public Boolean isIsMalwareDetected() { return isMalwareDetected; } - public NixPackageUploadRequest narinfo(String narinfo) { - this.narinfo = narinfo; + public NixPackageUploadRequest narinfoFile(String narinfoFile) { + this.narinfoFile = narinfoFile; return this; } /** * The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. - * @return narinfo + * @return narinfoFile **/ @Size(min=1) @ApiModelProperty(value = "The narinfo sidecar metadata file (.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path.") - public String getNarinfo() { - return narinfo; + public String getNarinfoFile() { + return narinfoFile; } - public void setNarinfo(String narinfo) { - this.narinfo = narinfo; + public void setNarinfoFile(String narinfoFile) { + this.narinfoFile = narinfoFile; } public NixPackageUploadRequest packageFile(String packageFile) { @@ -186,7 +186,7 @@ public boolean equals(java.lang.Object o) { } NixPackageUploadRequest nixPackageUploadRequest = (NixPackageUploadRequest) o; return Objects.equals(this.isMalwareDetected, nixPackageUploadRequest.isMalwareDetected) && - Objects.equals(this.narinfo, nixPackageUploadRequest.narinfo) && + Objects.equals(this.narinfoFile, nixPackageUploadRequest.narinfoFile) && Objects.equals(this.packageFile, nixPackageUploadRequest.packageFile) && Objects.equals(this.republish, nixPackageUploadRequest.republish) && Objects.equals(this.tags, nixPackageUploadRequest.tags) && @@ -196,7 +196,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(isMalwareDetected, narinfo, packageFile, republish, tags, version, vulnerabilityCounts); + return Objects.hash(isMalwareDetected, narinfoFile, packageFile, republish, tags, version, vulnerabilityCounts); } @@ -206,7 +206,7 @@ public String toString() { sb.append("class NixPackageUploadRequest {\n"); sb.append(" isMalwareDetected: ").append(toIndentedString(isMalwareDetected)).append("\n"); - sb.append(" narinfo: ").append(toIndentedString(narinfo)).append("\n"); + sb.append(" narinfoFile: ").append(toIndentedString(narinfoFile)).append("\n"); sb.append(" packageFile: ").append(toIndentedString(packageFile)).append("\n"); sb.append(" republish: ").append(toIndentedString(republish)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); diff --git a/bindings/java/src/src/main/java/io/cloudsmith/api/models/Oidc.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/Oidc.java new file mode 100644 index 00000000..0893aca2 --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/Oidc.java @@ -0,0 +1,68 @@ +/* + * 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 java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * Oidc + */ + +public class Oidc implements Serializable { + private static final long serialVersionUID = 1L; + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Oidc {\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/Oidc1.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/Oidc1.java new file mode 100644 index 00000000..7e354ba3 --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/Oidc1.java @@ -0,0 +1,99 @@ +/* + * 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; + +/** + * Oidc1 + */ + +public class Oidc1 implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("token") + private String token = null; + + public Oidc1 token(String token) { + this.token = token; + return this; + } + + /** + * Serialized JWT to be used for authentication. + * @return token + **/ + @ApiModelProperty(value = "Serialized JWT to be used for authentication.") + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Oidc1 oidc1 = (Oidc1) o; + return Objects.equals(this.token, oidc1.token); + } + + @Override + public int hashCode() { + return Objects.hash(token); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Oidc1 {\n"); + + sb.append(" token: ").append(toIndentedString(token)).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/OidcRequest.java b/bindings/java/src/src/main/java/io/cloudsmith/api/models/OidcRequest.java new file mode 100644 index 00000000..8bee20d7 --- /dev/null +++ b/bindings/java/src/src/main/java/io/cloudsmith/api/models/OidcRequest.java @@ -0,0 +1,124 @@ +/* + * 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; + +/** + * OidcRequest + */ + +public class OidcRequest implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("oidc_token") + private String oidcToken = null; + + @SerializedName("service_slug") + private String serviceSlug = null; + + public OidcRequest oidcToken(String oidcToken) { + this.oidcToken = oidcToken; + return this; + } + + /** + * Serialized OIDC token. + * @return oidcToken + **/ + @NotNull + @Size(min=1) @ApiModelProperty(required = true, value = "Serialized OIDC token.") + public String getOidcToken() { + return oidcToken; + } + + public void setOidcToken(String oidcToken) { + this.oidcToken = oidcToken; + } + + public OidcRequest serviceSlug(String serviceSlug) { + this.serviceSlug = serviceSlug; + return this; + } + + /** + * Slug for the service account. + * @return serviceSlug + **/ + @NotNull + @Size(min=1) @ApiModelProperty(required = true, value = "Slug for the service account.") + public String getServiceSlug() { + return serviceSlug; + } + + public void setServiceSlug(String serviceSlug) { + this.serviceSlug = serviceSlug; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OidcRequest oidcRequest = (OidcRequest) o; + return Objects.equals(this.oidcToken, oidcRequest.oidcToken) && + Objects.equals(this.serviceSlug, oidcRequest.serviceSlug); + } + + @Override + public int hashCode() { + return Objects.hash(oidcToken, serviceSlug); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OidcRequest {\n"); + + sb.append(" oidcToken: ").append(toIndentedString(oidcToken)).append("\n"); + sb.append(" serviceSlug: ").append(toIndentedString(serviceSlug)).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/OpenidApiTest.java b/bindings/java/src/src/test/java/io/cloudsmith/api/apis/OpenidApiTest.java new file mode 100644 index 00000000..9cbf27f1 --- /dev/null +++ b/bindings/java/src/src/test/java/io/cloudsmith/api/apis/OpenidApiTest.java @@ -0,0 +1,54 @@ +/* + * 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.apis; + +import io.cloudsmith.api.models.ErrorDetail; +import io.cloudsmith.api.models.Oidc1; +import io.cloudsmith.api.models.OidcRequest; +import org.junit.Test; +import org.junit.Ignore; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for OpenidApi + */ +@Ignore +public class OpenidApiTest { + + private final OpenidApi api = new OpenidApi(); + + + /** + * Get a JWT token for a configured service account belonging to the requesting org. + * + * Get a JWT token for a configured service account belonging to the requesting org. + * + * @throws Exception + * if the Api call fails + */ + @Test + public void openidCreateTest() throws Exception { + String owner = null; + OidcRequest data = null; + Oidc1 response = api.openidCreate(owner, data); + + // TODO: test validations + } + +} diff --git a/bindings/python/src/README.md b/bindings/python/src/README.md index 14aae179..022e7747 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.30 +- Package version: 2.0.31 - Build package: io.swagger.codegen.languages.PythonClientCodegen For more information, please visit [https://help.cloudsmith.io](https://help.cloudsmith.io) @@ -114,6 +114,7 @@ Class | Method | HTTP request | Description *MetricsApi* | [**metrics_packages_list**](docs/MetricsApi.md#metrics_packages_list) | **GET** /metrics/packages/{owner}/{repo}/ | View for listing package usage metrics, for a repository. *NamespacesApi* | [**namespaces_list**](docs/NamespacesApi.md#namespaces_list) | **GET** /namespaces/ | Get a list of all namespaces the user belongs to. *NamespacesApi* | [**namespaces_read**](docs/NamespacesApi.md#namespaces_read) | **GET** /namespaces/{slug}/ | Get a specific namespace that the user belongs to. +*OpenidApi* | [**openid_create**](docs/OpenidApi.md#openid_create) | **POST** /openid/{owner}/ | Get a JWT token for a configured service account belonging to the requesting org. *OrgsApi* | [**orgs_custom_domains_list**](docs/OrgsApi.md#orgs_custom_domains_list) | **GET** /orgs/{org}/custom-domains/ | Get the details for all custom domains. *OrgsApi* | [**orgs_delete**](docs/OrgsApi.md#orgs_delete) | **DELETE** /orgs/{org}/ | Delete the specified organization. *OrgsApi* | [**orgs_deny_policy_create**](docs/OrgsApi.md#orgs_deny_policy_create) | **POST** /orgs/{org}/deny-policy/ | Create a package deny policy. @@ -588,6 +589,9 @@ Class | Method | HTTP request | Description - [NugetUpstream](docs/NugetUpstream.md) - [NugetUpstreamRequest](docs/NugetUpstreamRequest.md) - [NugetUpstreamRequestPatch](docs/NugetUpstreamRequestPatch.md) + - [Oidc](docs/Oidc.md) + - [Oidc1](docs/Oidc1.md) + - [OidcRequest](docs/OidcRequest.md) - [Organization](docs/Organization.md) - [OrganizationCustomDomainNestedRepo](docs/OrganizationCustomDomainNestedRepo.md) - [OrganizationCustomDomains](docs/OrganizationCustomDomains.md) diff --git a/bindings/python/src/build.json b/bindings/python/src/build.json index b60f95ed..a35583d1 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.30", + "packageVersion": "2.0.31", "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 9617dd2e..150f1d35 100644 --- a/bindings/python/src/cloudsmith_api/__init__.py +++ b/bindings/python/src/cloudsmith_api/__init__.py @@ -26,6 +26,7 @@ from cloudsmith_api.api.formats_api import FormatsApi from cloudsmith_api.api.metrics_api import MetricsApi from cloudsmith_api.api.namespaces_api import NamespacesApi +from cloudsmith_api.api.openid_api import OpenidApi from cloudsmith_api.api.orgs_api import OrgsApi from cloudsmith_api.api.packages_api import PackagesApi from cloudsmith_api.api.quota_api import QuotaApi @@ -174,6 +175,9 @@ from cloudsmith_api.models.nuget_upstream import NugetUpstream from cloudsmith_api.models.nuget_upstream_request import NugetUpstreamRequest from cloudsmith_api.models.nuget_upstream_request_patch import NugetUpstreamRequestPatch +from cloudsmith_api.models.oidc import Oidc +from cloudsmith_api.models.oidc1 import Oidc1 +from cloudsmith_api.models.oidc_request import OidcRequest from cloudsmith_api.models.organization import Organization from cloudsmith_api.models.organization_custom_domain_nested_repo import OrganizationCustomDomainNestedRepo from cloudsmith_api.models.organization_custom_domains import OrganizationCustomDomains diff --git a/bindings/python/src/cloudsmith_api/api/__init__.py b/bindings/python/src/cloudsmith_api/api/__init__.py index 3d33a8ad..eeba2794 100644 --- a/bindings/python/src/cloudsmith_api/api/__init__.py +++ b/bindings/python/src/cloudsmith_api/api/__init__.py @@ -13,6 +13,7 @@ from cloudsmith_api.api.formats_api import FormatsApi from cloudsmith_api.api.metrics_api import MetricsApi from cloudsmith_api.api.namespaces_api import NamespacesApi +from cloudsmith_api.api.openid_api import OpenidApi from cloudsmith_api.api.orgs_api import OrgsApi from cloudsmith_api.api.packages_api import PackagesApi from cloudsmith_api.api.quota_api import QuotaApi diff --git a/bindings/python/src/cloudsmith_api/api/openid_api.py b/bindings/python/src/cloudsmith_api/api/openid_api.py new file mode 100644 index 00000000..a905a3e7 --- /dev/null +++ b/bindings/python/src/cloudsmith_api/api/openid_api.py @@ -0,0 +1,137 @@ +# 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 re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from cloudsmith_api.api_client import ApiClient + + +class OpenidApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def openid_create(self, owner, **kwargs): # noqa: E501 + """Get a JWT token for a configured service account belonging to the requesting org. # noqa: E501 + + Get a JWT token for a configured service account belonging to the requesting org. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.openid_create(owner, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param OidcRequest data: + :return: Oidc1 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.openid_create_with_http_info(owner, **kwargs) # noqa: E501 + else: + (data) = self.openid_create_with_http_info(owner, **kwargs) # noqa: E501 + return data + + def openid_create_with_http_info(self, owner, **kwargs): # noqa: E501 + """Get a JWT token for a configured service account belonging to the requesting org. # noqa: E501 + + Get a JWT token for a configured service account belonging to the requesting org. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.openid_create_with_http_info(owner, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str owner: (required) + :param OidcRequest data: + :return: Oidc1 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['owner', '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 openid_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 `openid_create`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'owner' in params: + path_params['owner'] = params['owner'] # 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( + '/openid/{owner}/', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Oidc1', # 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) diff --git a/bindings/python/src/cloudsmith_api/api_client.py b/bindings/python/src/cloudsmith_api/api_client.py index a6d62c82..91099ad0 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.30/python' + self.user_agent = 'Swagger-Codegen/2.0.31/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 d6fe97c6..2e4de6ba 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.30".\ + "SDK Package Version: 2.0.31".\ 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 8e37aa84..2cf60caa 100644 --- a/bindings/python/src/cloudsmith_api/models/__init__.py +++ b/bindings/python/src/cloudsmith_api/models/__init__.py @@ -146,6 +146,9 @@ from cloudsmith_api.models.nuget_upstream import NugetUpstream from cloudsmith_api.models.nuget_upstream_request import NugetUpstreamRequest from cloudsmith_api.models.nuget_upstream_request_patch import NugetUpstreamRequestPatch +from cloudsmith_api.models.oidc import Oidc +from cloudsmith_api.models.oidc1 import Oidc1 +from cloudsmith_api.models.oidc_request import OidcRequest from cloudsmith_api.models.organization import Organization from cloudsmith_api.models.organization_custom_domain_nested_repo import OrganizationCustomDomainNestedRepo from cloudsmith_api.models.organization_custom_domains import OrganizationCustomDomains diff --git a/bindings/python/src/cloudsmith_api/models/nix_package_upload_request.py b/bindings/python/src/cloudsmith_api/models/nix_package_upload_request.py index 0cfc6702..88c02933 100644 --- a/bindings/python/src/cloudsmith_api/models/nix_package_upload_request.py +++ b/bindings/python/src/cloudsmith_api/models/nix_package_upload_request.py @@ -34,7 +34,7 @@ class NixPackageUploadRequest(object): """ swagger_types = { 'is_malware_detected': 'bool', - 'narinfo': 'str', + 'narinfo_file': 'str', 'package_file': 'str', 'republish': 'bool', 'tags': 'str', @@ -44,7 +44,7 @@ class NixPackageUploadRequest(object): attribute_map = { 'is_malware_detected': 'is_malware_detected', - 'narinfo': 'narinfo', + 'narinfo_file': 'narinfo_file', 'package_file': 'package_file', 'republish': 'republish', 'tags': 'tags', @@ -52,14 +52,14 @@ class NixPackageUploadRequest(object): 'vulnerability_counts': 'vulnerability_counts' } - def __init__(self, is_malware_detected=None, narinfo=None, package_file=None, republish=None, tags=None, version=None, vulnerability_counts=None, _configuration=None): # noqa: E501 + def __init__(self, is_malware_detected=None, narinfo_file=None, package_file=None, republish=None, tags=None, version=None, vulnerability_counts=None, _configuration=None): # noqa: E501 """NixPackageUploadRequest - a model defined in Swagger""" # noqa: E501 if _configuration is None: _configuration = Configuration() self._configuration = _configuration self._is_malware_detected = None - self._narinfo = None + self._narinfo_file = None self._package_file = None self._republish = None self._tags = None @@ -69,8 +69,8 @@ def __init__(self, is_malware_detected=None, narinfo=None, package_file=None, re if is_malware_detected is not None: self.is_malware_detected = is_malware_detected - if narinfo is not None: - self.narinfo = narinfo + if narinfo_file is not None: + self.narinfo_file = narinfo_file self.package_file = package_file if republish is not None: self.republish = republish @@ -105,30 +105,30 @@ def is_malware_detected(self, is_malware_detected): self._is_malware_detected = is_malware_detected @property - def narinfo(self): - """Gets the narinfo of this NixPackageUploadRequest. + def narinfo_file(self): + """Gets the narinfo_file of this NixPackageUploadRequest. The narinfo sidecar metadata file (.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. - :return: The narinfo of this NixPackageUploadRequest. + :return: The narinfo_file of this NixPackageUploadRequest. :rtype: str """ - return self._narinfo + return self._narinfo_file - @narinfo.setter - def narinfo(self, narinfo): - """Sets the narinfo of this NixPackageUploadRequest. + @narinfo_file.setter + def narinfo_file(self, narinfo_file): + """Sets the narinfo_file of this NixPackageUploadRequest. The narinfo sidecar metadata file (.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. - :param narinfo: The narinfo of this NixPackageUploadRequest. + :param narinfo_file: The narinfo_file of this NixPackageUploadRequest. :type: str """ if (self._configuration.client_side_validation and - narinfo is not None and len(narinfo) < 1): - raise ValueError("Invalid value for `narinfo`, length must be greater than or equal to `1`") # noqa: E501 + narinfo_file is not None and len(narinfo_file) < 1): + raise ValueError("Invalid value for `narinfo_file`, length must be greater than or equal to `1`") # noqa: E501 - self._narinfo = narinfo + self._narinfo_file = narinfo_file @property def package_file(self): diff --git a/bindings/python/src/cloudsmith_api/models/oidc.py b/bindings/python/src/cloudsmith_api/models/oidc.py new file mode 100644 index 00000000..92cfa052 --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/oidc.py @@ -0,0 +1,96 @@ +# 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 Oidc(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 = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """Oidc - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + 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(Oidc, 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, Oidc): + 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, Oidc): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/cloudsmith_api/models/oidc1.py b/bindings/python/src/cloudsmith_api/models/oidc1.py new file mode 100644 index 00000000..784732cf --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/oidc1.py @@ -0,0 +1,126 @@ +# 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 Oidc1(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 = { + 'token': 'str' + } + + attribute_map = { + 'token': 'token' + } + + def __init__(self, token=None, _configuration=None): # noqa: E501 + """Oidc1 - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._token = None + self.discriminator = None + + if token is not None: + self.token = token + + @property + def token(self): + """Gets the token of this Oidc1. + + Serialized JWT to be used for authentication. + + :return: The token of this Oidc1. + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this Oidc1. + + Serialized JWT to be used for authentication. + + :param token: The token of this Oidc1. + :type: str + """ + + self._token = token + + 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(Oidc1, 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, Oidc1): + 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, Oidc1): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/cloudsmith_api/models/oidc_request.py b/bindings/python/src/cloudsmith_api/models/oidc_request.py new file mode 100644 index 00000000..27f945c6 --- /dev/null +++ b/bindings/python/src/cloudsmith_api/models/oidc_request.py @@ -0,0 +1,162 @@ +# 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 OidcRequest(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 = { + 'oidc_token': 'str', + 'service_slug': 'str' + } + + attribute_map = { + 'oidc_token': 'oidc_token', + 'service_slug': 'service_slug' + } + + def __init__(self, oidc_token=None, service_slug=None, _configuration=None): # noqa: E501 + """OidcRequest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + + self._oidc_token = None + self._service_slug = None + self.discriminator = None + + self.oidc_token = oidc_token + self.service_slug = service_slug + + @property + def oidc_token(self): + """Gets the oidc_token of this OidcRequest. + + Serialized OIDC token. + + :return: The oidc_token of this OidcRequest. + :rtype: str + """ + return self._oidc_token + + @oidc_token.setter + def oidc_token(self, oidc_token): + """Sets the oidc_token of this OidcRequest. + + Serialized OIDC token. + + :param oidc_token: The oidc_token of this OidcRequest. + :type: str + """ + if self._configuration.client_side_validation and oidc_token is None: + raise ValueError("Invalid value for `oidc_token`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + oidc_token is not None and len(oidc_token) < 1): + raise ValueError("Invalid value for `oidc_token`, length must be greater than or equal to `1`") # noqa: E501 + + self._oidc_token = oidc_token + + @property + def service_slug(self): + """Gets the service_slug of this OidcRequest. + + Slug for the service account. + + :return: The service_slug of this OidcRequest. + :rtype: str + """ + return self._service_slug + + @service_slug.setter + def service_slug(self, service_slug): + """Sets the service_slug of this OidcRequest. + + Slug for the service account. + + :param service_slug: The service_slug of this OidcRequest. + :type: str + """ + if self._configuration.client_side_validation and service_slug is None: + raise ValueError("Invalid value for `service_slug`, must not be `None`") # noqa: E501 + if (self._configuration.client_side_validation and + service_slug is not None and len(service_slug) < 1): + raise ValueError("Invalid value for `service_slug`, length must be greater than or equal to `1`") # noqa: E501 + + self._service_slug = service_slug + + 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(OidcRequest, 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, OidcRequest): + 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, OidcRequest): + return True + + return self.to_dict() != other.to_dict() + diff --git a/bindings/python/src/docs/NixPackageUploadRequest.md b/bindings/python/src/docs/NixPackageUploadRequest.md index dbce97dc..ec195ac1 100644 --- a/bindings/python/src/docs/NixPackageUploadRequest.md +++ b/bindings/python/src/docs/NixPackageUploadRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **is_malware_detected** | **bool** | Whether the package has been detected as containing malware. Requires Ultra plan. | [optional] -**narinfo** | **str** | The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. | [optional] +**narinfo_file** | **str** | The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. | [optional] **package_file** | **str** | The primary file for the package. | **republish** | **bool** | If true, the uploaded package will overwrite any others with the same attributes (e.g. same version); otherwise, it will be flagged as a duplicate. | [optional] **tags** | **str** | A comma-separated values list of tags to add to the package. | [optional] diff --git a/bindings/python/src/docs/Oidc.md b/bindings/python/src/docs/Oidc.md new file mode 100644 index 00000000..1fe72d8a --- /dev/null +++ b/bindings/python/src/docs/Oidc.md @@ -0,0 +1,9 @@ +# Oidc + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/Oidc1.md b/bindings/python/src/docs/Oidc1.md new file mode 100644 index 00000000..dae87825 --- /dev/null +++ b/bindings/python/src/docs/Oidc1.md @@ -0,0 +1,10 @@ +# Oidc1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **str** | Serialized JWT to be used for authentication. | [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/OidcRequest.md b/bindings/python/src/docs/OidcRequest.md new file mode 100644 index 00000000..95cd49f1 --- /dev/null +++ b/bindings/python/src/docs/OidcRequest.md @@ -0,0 +1,11 @@ +# OidcRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**oidc_token** | **str** | Serialized OIDC token. | +**service_slug** | **str** | Slug for the service account. | + +[[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/OpenidApi.md b/bindings/python/src/docs/OpenidApi.md new file mode 100644 index 00000000..5a3a2c54 --- /dev/null +++ b/bindings/python/src/docs/OpenidApi.md @@ -0,0 +1,69 @@ +# cloudsmith_api.OpenidApi + +All URIs are relative to *https://api.cloudsmith.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**openid_create**](OpenidApi.md#openid_create) | **POST** /openid/{owner}/ | Get a JWT token for a configured service account belonging to the requesting org. + + +# **openid_create** +> Oidc1 openid_create(owner, data=data) + +Get a JWT token for a configured service account belonging to the requesting org. + +Get a JWT token for a configured service account belonging to the requesting org. + +### 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.OpenidApi(cloudsmith_api.ApiClient(configuration)) +owner = 'owner_example' # str | +data = cloudsmith_api.OidcRequest() # OidcRequest | (optional) + +try: + # Get a JWT token for a configured service account belonging to the requesting org. + api_response = api_instance.openid_create(owner, data=data) + pprint(api_response) +except ApiException as e: + print("Exception when calling OpenidApi->openid_create: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **str**| | + **data** | [**OidcRequest**](OidcRequest.md)| | [optional] + +### Return type + +[**Oidc1**](Oidc1.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) + diff --git a/bindings/python/src/setup.py b/bindings/python/src/setup.py index b4c64986..9485ecf9 100644 --- a/bindings/python/src/setup.py +++ b/bindings/python/src/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "cloudsmith_api" -VERSION = "2.0.30" +VERSION = "2.0.31" # To install the library, run the following # # python setup.py install diff --git a/bindings/python/src/test/test_oidc.py b/bindings/python/src/test/test_oidc.py new file mode 100644 index 00000000..5f10c282 --- /dev/null +++ b/bindings/python/src/test/test_oidc.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.oidc import Oidc # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestOidc(unittest.TestCase): + """Oidc unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOidc(self): + """Test Oidc""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.oidc.Oidc() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/python/src/test/test_oidc1.py b/bindings/python/src/test/test_oidc1.py new file mode 100644 index 00000000..6df31d73 --- /dev/null +++ b/bindings/python/src/test/test_oidc1.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.oidc1 import Oidc1 # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestOidc1(unittest.TestCase): + """Oidc1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOidc1(self): + """Test Oidc1""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.oidc1.Oidc1() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/python/src/test/test_oidc_request.py b/bindings/python/src/test/test_oidc_request.py new file mode 100644 index 00000000..c0808704 --- /dev/null +++ b/bindings/python/src/test/test_oidc_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.oidc_request import OidcRequest # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestOidcRequest(unittest.TestCase): + """OidcRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOidcRequest(self): + """Test OidcRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = cloudsmith_api.models.oidc_request.OidcRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/python/src/test/test_openid_api.py b/bindings/python/src/test/test_openid_api.py new file mode 100644 index 00000000..dd446274 --- /dev/null +++ b/bindings/python/src/test/test_openid_api.py @@ -0,0 +1,41 @@ +# 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.api.openid_api import OpenidApi # noqa: E501 +from cloudsmith_api.rest import ApiException + + +class TestOpenidApi(unittest.TestCase): + """OpenidApi unit test stubs""" + + def setUp(self): + self.api = cloudsmith_api.api.openid_api.OpenidApi() # noqa: E501 + + def tearDown(self): + pass + + def test_openid_create(self): + """Test case for openid_create + + Get a JWT token for a configured service account belonging to the requesting org. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/bindings/ruby/src/README.md b/bindings/ruby/src/README.md index 4353fb94..ec3e2df8 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.30 +- Package version: 2.0.31 - 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.30.gem +gem install ./cloudsmith-api-2.0.31.gem ``` -(for development, run `gem install --dev ./cloudsmith-api-2.0.30.gem` to install the development dependencies) +(for development, run `gem install --dev ./cloudsmith-api-2.0.31.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.30' + gem 'cloudsmith-api', '~> 2.0.31' ### Install from Git @@ -123,6 +123,7 @@ Class | Method | HTTP request | Description *CloudsmithApi::MetricsApi* | [**metrics_packages_list**](docs/MetricsApi.md#metrics_packages_list) | **GET** /metrics/packages/{owner}/{repo}/ | View for listing package usage metrics, for a repository. *CloudsmithApi::NamespacesApi* | [**namespaces_list**](docs/NamespacesApi.md#namespaces_list) | **GET** /namespaces/ | Get a list of all namespaces the user belongs to. *CloudsmithApi::NamespacesApi* | [**namespaces_read**](docs/NamespacesApi.md#namespaces_read) | **GET** /namespaces/{slug}/ | Get a specific namespace that the user belongs to. +*CloudsmithApi::OpenidApi* | [**openid_create**](docs/OpenidApi.md#openid_create) | **POST** /openid/{owner}/ | Get a JWT token for a configured service account belonging to the requesting org. *CloudsmithApi::OrgsApi* | [**orgs_custom_domains_list**](docs/OrgsApi.md#orgs_custom_domains_list) | **GET** /orgs/{org}/custom-domains/ | Get the details for all custom domains. *CloudsmithApi::OrgsApi* | [**orgs_delete**](docs/OrgsApi.md#orgs_delete) | **DELETE** /orgs/{org}/ | Delete the specified organization. *CloudsmithApi::OrgsApi* | [**orgs_deny_policy_create**](docs/OrgsApi.md#orgs_deny_policy_create) | **POST** /orgs/{org}/deny-policy/ | Create a package deny policy. @@ -597,6 +598,9 @@ Class | Method | HTTP request | Description - [CloudsmithApi::NugetUpstream](docs/NugetUpstream.md) - [CloudsmithApi::NugetUpstreamRequest](docs/NugetUpstreamRequest.md) - [CloudsmithApi::NugetUpstreamRequestPatch](docs/NugetUpstreamRequestPatch.md) + - [CloudsmithApi::Oidc](docs/Oidc.md) + - [CloudsmithApi::Oidc1](docs/Oidc1.md) + - [CloudsmithApi::OidcRequest](docs/OidcRequest.md) - [CloudsmithApi::Organization](docs/Organization.md) - [CloudsmithApi::OrganizationCustomDomainNestedRepo](docs/OrganizationCustomDomainNestedRepo.md) - [CloudsmithApi::OrganizationCustomDomains](docs/OrganizationCustomDomains.md) diff --git a/bindings/ruby/src/build.json b/bindings/ruby/src/build.json index e3544aae..6c1cecb5 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.30", + "gemVersion": "2.0.31", "hideGenerationTimestamp": true, "moduleName": "CloudsmithApi", "sortParamsByRequiredFlag": true diff --git a/bindings/ruby/src/docs/NixPackageUploadRequest.md b/bindings/ruby/src/docs/NixPackageUploadRequest.md index f03b890e..ed75516e 100644 --- a/bindings/ruby/src/docs/NixPackageUploadRequest.md +++ b/bindings/ruby/src/docs/NixPackageUploadRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **is_malware_detected** | **BOOLEAN** | Whether the package has been detected as containing malware. Requires Ultra plan. | [optional] -**narinfo** | **String** | The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. | [optional] +**narinfo_file** | **String** | The narinfo sidecar metadata file (<storeHash>.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. | [optional] **package_file** | **String** | The primary file for the package. | **republish** | **BOOLEAN** | If true, the uploaded package will overwrite any others with the same attributes (e.g. same version); otherwise, it will be flagged as a duplicate. | [optional] **tags** | **String** | A comma-separated values list of tags to add to the package. | [optional] diff --git a/bindings/ruby/src/docs/Oidc.md b/bindings/ruby/src/docs/Oidc.md new file mode 100644 index 00000000..45af3385 --- /dev/null +++ b/bindings/ruby/src/docs/Oidc.md @@ -0,0 +1,7 @@ +# CloudsmithApi::Oidc + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/bindings/ruby/src/docs/Oidc1.md b/bindings/ruby/src/docs/Oidc1.md new file mode 100644 index 00000000..5bf85c4c --- /dev/null +++ b/bindings/ruby/src/docs/Oidc1.md @@ -0,0 +1,8 @@ +# CloudsmithApi::Oidc1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **String** | Serialized JWT to be used for authentication. | [optional] + + diff --git a/bindings/ruby/src/docs/OidcRequest.md b/bindings/ruby/src/docs/OidcRequest.md new file mode 100644 index 00000000..d333f8db --- /dev/null +++ b/bindings/ruby/src/docs/OidcRequest.md @@ -0,0 +1,9 @@ +# CloudsmithApi::OidcRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**oidc_token** | **String** | Serialized OIDC token. | +**service_slug** | **String** | Slug for the service account. | + + diff --git a/bindings/ruby/src/docs/OpenidApi.md b/bindings/ruby/src/docs/OpenidApi.md new file mode 100644 index 00000000..df9f7b3c --- /dev/null +++ b/bindings/ruby/src/docs/OpenidApi.md @@ -0,0 +1,71 @@ +# CloudsmithApi::OpenidApi + +All URIs are relative to *https://api.cloudsmith.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**openid_create**](OpenidApi.md#openid_create) | **POST** /openid/{owner}/ | Get a JWT token for a configured service account belonging to the requesting org. + + +# **openid_create** +> Oidc1 openid_create(owner, opts) + +Get a JWT token for a configured service account belonging to the requesting org. + +Get a JWT token for a configured service account belonging to the requesting org. + +### 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::OpenidApi.new + +owner = 'owner_example' # String | + +opts = { + data: CloudsmithApi::OidcRequest.new # OidcRequest | +} + +begin + #Get a JWT token for a configured service account belonging to the requesting org. + result = api_instance.openid_create(owner, opts) + p result +rescue CloudsmithApi::ApiError => e + puts "Exception when calling OpenidApi->openid_create: #{e}" +end +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| | + **data** | [**OidcRequest**](OidcRequest.md)| | [optional] + +### Return type + +[**Oidc1**](Oidc1.md) + +### Authorization + +[apikey](../README.md#apikey), [basic](../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + + diff --git a/bindings/ruby/src/lib/cloudsmith-api.rb b/bindings/ruby/src/lib/cloudsmith-api.rb index 298bdbc9..274c02a8 100644 --- a/bindings/ruby/src/lib/cloudsmith-api.rb +++ b/bindings/ruby/src/lib/cloudsmith-api.rb @@ -148,6 +148,9 @@ require 'cloudsmith-api/models/nuget_upstream' require 'cloudsmith-api/models/nuget_upstream_request' require 'cloudsmith-api/models/nuget_upstream_request_patch' +require 'cloudsmith-api/models/oidc' +require 'cloudsmith-api/models/oidc_1' +require 'cloudsmith-api/models/oidc_request' require 'cloudsmith-api/models/organization' require 'cloudsmith-api/models/organization_custom_domain_nested_repo' require 'cloudsmith-api/models/organization_custom_domains' @@ -346,6 +349,7 @@ require 'cloudsmith-api/api/formats_api' require 'cloudsmith-api/api/metrics_api' require 'cloudsmith-api/api/namespaces_api' +require 'cloudsmith-api/api/openid_api' require 'cloudsmith-api/api/orgs_api' require 'cloudsmith-api/api/packages_api' require 'cloudsmith-api/api/quota_api' diff --git a/bindings/ruby/src/lib/cloudsmith-api/api/openid_api.rb b/bindings/ruby/src/lib/cloudsmith-api/api/openid_api.rb new file mode 100644 index 00000000..14ffa34c --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/api/openid_api.rb @@ -0,0 +1,79 @@ +=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.50 + +=end + +require 'uri' + +module CloudsmithApi + class OpenidApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Get a JWT token for a configured service account belonging to the requesting org. + # Get a JWT token for a configured service account belonging to the requesting org. + # @param owner + # @param [Hash] opts the optional parameters + # @option opts [OidcRequest] :data + # @return [Oidc1] + def openid_create(owner, opts = {}) + data, _status_code, _headers = openid_create_with_http_info(owner, opts) + data + end + + # Get a JWT token for a configured service account belonging to the requesting org. + # Get a JWT token for a configured service account belonging to the requesting org. + # @param owner + # @param [Hash] opts the optional parameters + # @option opts [OidcRequest] :data + # @return [Array<(Oidc1, Fixnum, Hash)>] Oidc1 data, response status code and response headers + def openid_create_with_http_info(owner, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OpenidApi.openid_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 OpenidApi.openid_create" + end + # resource path + local_var_path = '/openid/{owner}/'.sub('{' + 'owner' + '}', owner.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 => 'Oidc1') + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OpenidApi#openid_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/nix_package_upload_request.rb b/bindings/ruby/src/lib/cloudsmith-api/models/nix_package_upload_request.rb index 6ed90eb9..9628b52e 100644 --- a/bindings/ruby/src/lib/cloudsmith-api/models/nix_package_upload_request.rb +++ b/bindings/ruby/src/lib/cloudsmith-api/models/nix_package_upload_request.rb @@ -18,7 +18,7 @@ class NixPackageUploadRequest attr_accessor :is_malware_detected # The narinfo sidecar metadata file (.narinfo). Optional — the package can be completed later by publishing the matching narinfo via the native HTTP PUT path. - attr_accessor :narinfo + attr_accessor :narinfo_file # The primary file for the package. attr_accessor :package_file @@ -38,7 +38,7 @@ class NixPackageUploadRequest def self.attribute_map { :'is_malware_detected' => :'is_malware_detected', - :'narinfo' => :'narinfo', + :'narinfo_file' => :'narinfo_file', :'package_file' => :'package_file', :'republish' => :'republish', :'tags' => :'tags', @@ -51,7 +51,7 @@ def self.attribute_map def self.swagger_types { :'is_malware_detected' => :'BOOLEAN', - :'narinfo' => :'String', + :'narinfo_file' => :'String', :'package_file' => :'String', :'republish' => :'BOOLEAN', :'tags' => :'String', @@ -72,8 +72,8 @@ def initialize(attributes = {}) self.is_malware_detected = attributes[:'is_malware_detected'] end - if attributes.has_key?(:'narinfo') - self.narinfo = attributes[:'narinfo'] + if attributes.has_key?(:'narinfo_file') + self.narinfo_file = attributes[:'narinfo_file'] end if attributes.has_key?(:'package_file') @@ -121,7 +121,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && is_malware_detected == o.is_malware_detected && - narinfo == o.narinfo && + narinfo_file == o.narinfo_file && package_file == o.package_file && republish == o.republish && tags == o.tags && @@ -138,7 +138,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash - [is_malware_detected, narinfo, package_file, republish, tags, version, vulnerability_counts].hash + [is_malware_detected, narinfo_file, package_file, republish, tags, version, vulnerability_counts].hash end # Builds the object from hash diff --git a/bindings/ruby/src/lib/cloudsmith-api/models/oidc.rb b/bindings/ruby/src/lib/cloudsmith-api/models/oidc.rb new file mode 100644 index 00000000..f70c6c4c --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/oidc.rb @@ -0,0 +1,175 @@ +=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.50 + +=end + +require 'date' + +module CloudsmithApi +class Oidc + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Attribute type mapping. + def self.swagger_types + { + } + 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 } + 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? + 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 + 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 + [].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/oidc_1.rb b/bindings/ruby/src/lib/cloudsmith-api/models/oidc_1.rb new file mode 100644 index 00000000..4ad4ed7e --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/oidc_1.rb @@ -0,0 +1,185 @@ +=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.50 + +=end + +require 'date' + +module CloudsmithApi +class Oidc1 + # Serialized JWT to be used for authentication. + attr_accessor :token + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'token' => :'token' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'token' => :'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?(:'token') + self.token = attributes[:'token'] + 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? + 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 && + token == o.token + 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 + [token].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/oidc_request.rb b/bindings/ruby/src/lib/cloudsmith-api/models/oidc_request.rb new file mode 100644 index 00000000..04295c28 --- /dev/null +++ b/bindings/ruby/src/lib/cloudsmith-api/models/oidc_request.rb @@ -0,0 +1,205 @@ +=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.50 + +=end + +require 'date' + +module CloudsmithApi +class OidcRequest + # Serialized OIDC token. + attr_accessor :oidc_token + + # Slug for the service account. + attr_accessor :service_slug + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'oidc_token' => :'oidc_token', + :'service_slug' => :'service_slug' + } + end + + # Attribute type mapping. + def self.swagger_types + { + :'oidc_token' => :'String', + :'service_slug' => :'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?(:'oidc_token') + self.oidc_token = attributes[:'oidc_token'] + end + + if attributes.has_key?(:'service_slug') + self.service_slug = attributes[:'service_slug'] + 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 @oidc_token.nil? + invalid_properties.push('invalid value for "oidc_token", oidc_token cannot be nil.') + end + + if @service_slug.nil? + invalid_properties.push('invalid value for "service_slug", service_slug 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 @oidc_token.nil? + return false if @service_slug.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 && + oidc_token == o.oidc_token && + service_slug == o.service_slug + 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 + [oidc_token, service_slug].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 cf4554ae..4bb5b100 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.30' + VERSION = '2.0.31' end diff --git a/bindings/ruby/src/spec/api/openid_api_spec.rb b/bindings/ruby/src/spec/api/openid_api_spec.rb new file mode 100644 index 00000000..8b4de572 --- /dev/null +++ b/bindings/ruby/src/spec/api/openid_api_spec.rb @@ -0,0 +1,48 @@ +=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.50 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for CloudsmithApi::OpenidApi +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'OpenidApi' do + before do + # run before each test + @instance = CloudsmithApi::OpenidApi.new + end + + after do + # run after each test + end + + describe 'test an instance of OpenidApi' do + it 'should create an instance of OpenidApi' do + expect(@instance).to be_instance_of(CloudsmithApi::OpenidApi) + end + end + + # unit tests for openid_create + # Get a JWT token for a configured service account belonging to the requesting org. + # Get a JWT token for a configured service account belonging to the requesting org. + # @param owner + # @param [Hash] opts the optional parameters + # @option opts [OidcRequest] :data + # @return [Oidc1] + describe 'openid_create test' 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/nix_package_upload_request_spec.rb b/bindings/ruby/src/spec/models/nix_package_upload_request_spec.rb index 34a4c78d..1cf4c953 100644 --- a/bindings/ruby/src/spec/models/nix_package_upload_request_spec.rb +++ b/bindings/ruby/src/spec/models/nix_package_upload_request_spec.rb @@ -38,7 +38,7 @@ end end - describe 'test attribute "narinfo"' do + describe 'test attribute "narinfo_file"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/bindings/ruby/src/spec/models/oidc_1_spec.rb b/bindings/ruby/src/spec/models/oidc_1_spec.rb new file mode 100644 index 00000000..59f87972 --- /dev/null +++ b/bindings/ruby/src/spec/models/oidc_1_spec.rb @@ -0,0 +1,41 @@ +=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.50 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::Oidc1 +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'Oidc1' do + before do + # run before each test + @instance = CloudsmithApi::Oidc1.new + end + + after do + # run after each test + end + + describe 'test an instance of Oidc1' do + it 'should create an instance of Oidc1' do + expect(@instance).to be_instance_of(CloudsmithApi::Oidc1) + end + end + describe 'test attribute "token"' 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/oidc_request_spec.rb b/bindings/ruby/src/spec/models/oidc_request_spec.rb new file mode 100644 index 00000000..5b43f45e --- /dev/null +++ b/bindings/ruby/src/spec/models/oidc_request_spec.rb @@ -0,0 +1,47 @@ +=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.50 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::OidcRequest +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'OidcRequest' do + before do + # run before each test + @instance = CloudsmithApi::OidcRequest.new + end + + after do + # run after each test + end + + describe 'test an instance of OidcRequest' do + it 'should create an instance of OidcRequest' do + expect(@instance).to be_instance_of(CloudsmithApi::OidcRequest) + end + end + describe 'test attribute "oidc_token"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "service_slug"' 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/oidc_spec.rb b/bindings/ruby/src/spec/models/oidc_spec.rb new file mode 100644 index 00000000..bfdff8bc --- /dev/null +++ b/bindings/ruby/src/spec/models/oidc_spec.rb @@ -0,0 +1,35 @@ +=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.50 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for CloudsmithApi::Oidc +# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Please update as you see appropriate +describe 'Oidc' do + before do + # run before each test + @instance = CloudsmithApi::Oidc.new + end + + after do + # run after each test + end + + describe 'test an instance of Oidc' do + it 'should create an instance of Oidc' do + expect(@instance).to be_instance_of(CloudsmithApi::Oidc) + end + end +end diff --git a/scripts/common.sh b/scripts/common.sh index bf64397e..15b6ebab 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.30" +package_version="2.0.31" swagger_codegen_cli_image="swaggerapi/swagger-codegen-cli:v2.4.50" location=$(curl -s $openapi_url | grep Location | cut -d' ' -f2)