diff --git a/packages/connector-management-sdk/README.md b/packages/connector-management-sdk/README.md index c4c57d9e..aa4e794e 100644 --- a/packages/connector-management-sdk/README.md +++ b/packages/connector-management-sdk/README.md @@ -13,7 +13,7 @@ Connector Management API is a REST API to manage connectors. Building the API client library requires: -1. Java 1.8+ +1. Java 11+ 2. Maven/Gradle ## Installation @@ -50,14 +50,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy - repositories { - mavenCentral() // Needed if the 'connector-management-sdk' jar has been published to maven central. - mavenLocal() // Needed if the 'connector-management-sdk' jar has been published to the local maven repo. - } - - dependencies { - implementation "com.redhat.cloud:connector-management-sdk:0.1.0" - } +compile "com.redhat.cloud:connector-management-sdk:0.1.0" ``` ### Others @@ -80,26 +73,22 @@ Please follow the [installation](#installation) instruction and execute the foll ```java import com.openshift.cloud.api.connector.invoker.*; -import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class ConnectorClustersApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://api.openshift.com"); - - // Configure HTTP bearer authorization: Bearer - HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); - Bearer.setBearerToken("BEARER TOKEN"); - + // Configure clients using the `defaultClient` object, such as + // overriding the host and port, timeout, etc. ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); Boolean async = true; // Boolean | Perform the action in an asynchronous manner ConnectorClusterRequest connectorClusterRequest = new ConnectorClusterRequest(); // ConnectorClusterRequest | Connector cluster data try { - ConnectorCluster result = apiInstance.createConnectorCluster(async, connectorClusterRequest); - System.out.println(result); + CompletableFuture result = apiInstance.createConnectorCluster(async, connectorClusterRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#createConnectorCluster"); System.err.println("Status code: " + e.getCode()); @@ -119,23 +108,41 @@ All URIs are relative to *https://api.openshift.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *ConnectorClustersApi* | [**createConnectorCluster**](docs/ConnectorClustersApi.md#createConnectorCluster) | **POST** /api/connector_mgmt/v1/kafka_connector_clusters | Create a new connector cluster +*ConnectorClustersApi* | [**createConnectorClusterWithHttpInfo**](docs/ConnectorClustersApi.md#createConnectorClusterWithHttpInfo) | **POST** /api/connector_mgmt/v1/kafka_connector_clusters | Create a new connector cluster *ConnectorClustersApi* | [**deleteConnectorCluster**](docs/ConnectorClustersApi.md#deleteConnectorCluster) | **DELETE** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Delete a connector cluster +*ConnectorClustersApi* | [**deleteConnectorClusterWithHttpInfo**](docs/ConnectorClustersApi.md#deleteConnectorClusterWithHttpInfo) | **DELETE** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Delete a connector cluster *ConnectorClustersApi* | [**getConnectorCluster**](docs/ConnectorClustersApi.md#getConnectorCluster) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Get a connector cluster +*ConnectorClustersApi* | [**getConnectorClusterWithHttpInfo**](docs/ConnectorClustersApi.md#getConnectorClusterWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Get a connector cluster *ConnectorClustersApi* | [**getConnectorClusterAddonParameters**](docs/ConnectorClustersApi.md#getConnectorClusterAddonParameters) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/addon_parameters | Get a connector cluster's addon parameters +*ConnectorClustersApi* | [**getConnectorClusterAddonParametersWithHttpInfo**](docs/ConnectorClustersApi.md#getConnectorClusterAddonParametersWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/addon_parameters | Get a connector cluster's addon parameters *ConnectorClustersApi* | [**getConnectorClusterNamespaces**](docs/ConnectorClustersApi.md#getConnectorClusterNamespaces) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/namespaces | Get a connector cluster's namespaces +*ConnectorClustersApi* | [**getConnectorClusterNamespacesWithHttpInfo**](docs/ConnectorClustersApi.md#getConnectorClusterNamespacesWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/namespaces | Get a connector cluster's namespaces *ConnectorClustersApi* | [**listConnectorClusters**](docs/ConnectorClustersApi.md#listConnectorClusters) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters | Returns a list of connector clusters +*ConnectorClustersApi* | [**listConnectorClustersWithHttpInfo**](docs/ConnectorClustersApi.md#listConnectorClustersWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters | Returns a list of connector clusters *ConnectorClustersApi* | [**updateConnectorClusterById**](docs/ConnectorClustersApi.md#updateConnectorClusterById) | **PUT** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | udpate a connector cluster +*ConnectorClustersApi* | [**updateConnectorClusterByIdWithHttpInfo**](docs/ConnectorClustersApi.md#updateConnectorClusterByIdWithHttpInfo) | **PUT** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | udpate a connector cluster *ConnectorNamespacesApi* | [**createEvaluationNamespace**](docs/ConnectorNamespacesApi.md#createEvaluationNamespace) | **POST** /api/connector_mgmt/v1/kafka_connector_namespaces/eval | Create a new short lived evaluation connector namespace +*ConnectorNamespacesApi* | [**createEvaluationNamespaceWithHttpInfo**](docs/ConnectorNamespacesApi.md#createEvaluationNamespaceWithHttpInfo) | **POST** /api/connector_mgmt/v1/kafka_connector_namespaces/eval | Create a new short lived evaluation connector namespace *ConnectorNamespacesApi* | [**getConnectorNamespace**](docs/ConnectorNamespacesApi.md#getConnectorNamespace) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces/{connector_namespace_id} | Get a connector namespace +*ConnectorNamespacesApi* | [**getConnectorNamespaceWithHttpInfo**](docs/ConnectorNamespacesApi.md#getConnectorNamespaceWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces/{connector_namespace_id} | Get a connector namespace *ConnectorNamespacesApi* | [**listConnectorNamespaces**](docs/ConnectorNamespacesApi.md#listConnectorNamespaces) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces | Returns a list of connector namespaces +*ConnectorNamespacesApi* | [**listConnectorNamespacesWithHttpInfo**](docs/ConnectorNamespacesApi.md#listConnectorNamespacesWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces | Returns a list of connector namespaces *ConnectorServiceApi* | [**getVersionMetadata**](docs/ConnectorServiceApi.md#getVersionMetadata) | **GET** /api/connector_mgmt/v1 | Returns the version metadata +*ConnectorServiceApi* | [**getVersionMetadataWithHttpInfo**](docs/ConnectorServiceApi.md#getVersionMetadataWithHttpInfo) | **GET** /api/connector_mgmt/v1 | Returns the version metadata *ConnectorTypesApi* | [**getConnectorTypeByID**](docs/ConnectorTypesApi.md#getConnectorTypeByID) | **GET** /api/connector_mgmt/v1/kafka_connector_types/{connector_type_id} | Get a connector type by id +*ConnectorTypesApi* | [**getConnectorTypeByIDWithHttpInfo**](docs/ConnectorTypesApi.md#getConnectorTypeByIDWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_types/{connector_type_id} | Get a connector type by id *ConnectorTypesApi* | [**getConnectorTypes**](docs/ConnectorTypesApi.md#getConnectorTypes) | **GET** /api/connector_mgmt/v1/kafka_connector_types | Returns a list of connector types +*ConnectorTypesApi* | [**getConnectorTypesWithHttpInfo**](docs/ConnectorTypesApi.md#getConnectorTypesWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_types | Returns a list of connector types *ConnectorsApi* | [**createConnector**](docs/ConnectorsApi.md#createConnector) | **POST** /api/connector_mgmt/v1/kafka_connectors | Create a new connector +*ConnectorsApi* | [**createConnectorWithHttpInfo**](docs/ConnectorsApi.md#createConnectorWithHttpInfo) | **POST** /api/connector_mgmt/v1/kafka_connectors | Create a new connector *ConnectorsApi* | [**deleteConnector**](docs/ConnectorsApi.md#deleteConnector) | **DELETE** /api/connector_mgmt/v1/kafka_connectors/{id} | Delete a connector +*ConnectorsApi* | [**deleteConnectorWithHttpInfo**](docs/ConnectorsApi.md#deleteConnectorWithHttpInfo) | **DELETE** /api/connector_mgmt/v1/kafka_connectors/{id} | Delete a connector *ConnectorsApi* | [**getConnector**](docs/ConnectorsApi.md#getConnector) | **GET** /api/connector_mgmt/v1/kafka_connectors/{id} | Get a connector +*ConnectorsApi* | [**getConnectorWithHttpInfo**](docs/ConnectorsApi.md#getConnectorWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connectors/{id} | Get a connector *ConnectorsApi* | [**listConnectors**](docs/ConnectorsApi.md#listConnectors) | **GET** /api/connector_mgmt/v1/kafka_connectors | Returns a list of connector types +*ConnectorsApi* | [**listConnectorsWithHttpInfo**](docs/ConnectorsApi.md#listConnectorsWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connectors | Returns a list of connector types *ConnectorsApi* | [**patchConnector**](docs/ConnectorsApi.md#patchConnector) | **PATCH** /api/connector_mgmt/v1/kafka_connectors/{id} | Patch a connector +*ConnectorsApi* | [**patchConnectorWithHttpInfo**](docs/ConnectorsApi.md#patchConnectorWithHttpInfo) | **PATCH** /api/connector_mgmt/v1/kafka_connectors/{id} | Patch a connector ## Documentation for Models @@ -208,6 +215,7 @@ Authentication schemes defined for the API: ## Recommendation It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. +However, the instances of the api clients created from the `ApiClient` are thread-safe and can be re-used. ## Author diff --git a/packages/connector-management-sdk/docs/ConnectorClustersApi.md b/packages/connector-management-sdk/docs/ConnectorClustersApi.md index 0aefb6f2..23b44c9f 100644 --- a/packages/connector-management-sdk/docs/ConnectorClustersApi.md +++ b/packages/connector-management-sdk/docs/ConnectorClustersApi.md @@ -5,18 +5,25 @@ All URIs are relative to *https://api.openshift.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**createConnectorCluster**](ConnectorClustersApi.md#createConnectorCluster) | **POST** /api/connector_mgmt/v1/kafka_connector_clusters | Create a new connector cluster +[**createConnectorClusterWithHttpInfo**](ConnectorClustersApi.md#createConnectorClusterWithHttpInfo) | **POST** /api/connector_mgmt/v1/kafka_connector_clusters | Create a new connector cluster [**deleteConnectorCluster**](ConnectorClustersApi.md#deleteConnectorCluster) | **DELETE** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Delete a connector cluster +[**deleteConnectorClusterWithHttpInfo**](ConnectorClustersApi.md#deleteConnectorClusterWithHttpInfo) | **DELETE** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Delete a connector cluster [**getConnectorCluster**](ConnectorClustersApi.md#getConnectorCluster) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Get a connector cluster +[**getConnectorClusterWithHttpInfo**](ConnectorClustersApi.md#getConnectorClusterWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | Get a connector cluster [**getConnectorClusterAddonParameters**](ConnectorClustersApi.md#getConnectorClusterAddonParameters) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/addon_parameters | Get a connector cluster's addon parameters +[**getConnectorClusterAddonParametersWithHttpInfo**](ConnectorClustersApi.md#getConnectorClusterAddonParametersWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/addon_parameters | Get a connector cluster's addon parameters [**getConnectorClusterNamespaces**](ConnectorClustersApi.md#getConnectorClusterNamespaces) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/namespaces | Get a connector cluster's namespaces +[**getConnectorClusterNamespacesWithHttpInfo**](ConnectorClustersApi.md#getConnectorClusterNamespacesWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/namespaces | Get a connector cluster's namespaces [**listConnectorClusters**](ConnectorClustersApi.md#listConnectorClusters) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters | Returns a list of connector clusters +[**listConnectorClustersWithHttpInfo**](ConnectorClustersApi.md#listConnectorClustersWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_clusters | Returns a list of connector clusters [**updateConnectorClusterById**](ConnectorClustersApi.md#updateConnectorClusterById) | **PUT** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | udpate a connector cluster +[**updateConnectorClusterByIdWithHttpInfo**](ConnectorClustersApi.md#updateConnectorClusterByIdWithHttpInfo) | **PUT** /api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id} | udpate a connector cluster ## createConnectorCluster -> ConnectorCluster createConnectorCluster(async, connectorClusterRequest) +> CompletableFuture createConnectorCluster(async, connectorClusterRequest) Create a new connector cluster @@ -32,6 +39,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -46,8 +54,8 @@ public class Example { Boolean async = true; // Boolean | Perform the action in an asynchronous manner ConnectorClusterRequest connectorClusterRequest = new ConnectorClusterRequest(); // ConnectorClusterRequest | Connector cluster data try { - ConnectorCluster result = apiInstance.createConnectorCluster(async, connectorClusterRequest); - System.out.println(result); + CompletableFuture result = apiInstance.createConnectorCluster(async, connectorClusterRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#createConnectorCluster"); System.err.println("Status code: " + e.getCode()); @@ -69,7 +77,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorCluster**](ConnectorCluster.md) +CompletableFuture<[**ConnectorCluster**](ConnectorCluster.md)> + ### Authorization @@ -80,6 +89,92 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Validation errors occurred | - | +| **401** | Auth token is invalid | - | +| **404** | The requested resource doesn't exist | - | +| **500** | An unexpected error occurred creating the connector cluster | - | + +## createConnectorClusterWithHttpInfo + +> CompletableFuture> createConnectorCluster createConnectorClusterWithHttpInfo(async, connectorClusterRequest) + +Create a new connector cluster + +Create a new connector cluster + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + Boolean async = true; // Boolean | Perform the action in an asynchronous manner + ConnectorClusterRequest connectorClusterRequest = new ConnectorClusterRequest(); // ConnectorClusterRequest | Connector cluster data + try { + CompletableFuture> response = apiInstance.createConnectorClusterWithHttpInfo(async, connectorClusterRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#createConnectorCluster"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#createConnectorCluster"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **async** | **Boolean**| Perform the action in an asynchronous manner | + **connectorClusterRequest** | [**ConnectorClusterRequest**](ConnectorClusterRequest.md)| Connector cluster data | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -93,7 +188,7 @@ Name | Type | Description | Notes ## deleteConnectorCluster -> Error deleteConnectorCluster(connectorClusterId) +> CompletableFuture deleteConnectorCluster(connectorClusterId) Delete a connector cluster @@ -109,6 +204,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -122,8 +218,8 @@ public class Example { ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster try { - Error result = apiInstance.deleteConnectorCluster(connectorClusterId); - System.out.println(result); + CompletableFuture result = apiInstance.deleteConnectorCluster(connectorClusterId); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#deleteConnectorCluster"); System.err.println("Status code: " + e.getCode()); @@ -144,7 +240,8 @@ Name | Type | Description | Notes ### Return type -[**Error**](Error.md) +CompletableFuture<[**Error**](Error.md)> + ### Authorization @@ -155,6 +252,89 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Deleted | - | +| **401** | Auth token is invalid | - | +| **404** | No resource with specified ID exists | - | +| **500** | Unexpected error occurred | - | + +## deleteConnectorClusterWithHttpInfo + +> CompletableFuture> deleteConnectorCluster deleteConnectorClusterWithHttpInfo(connectorClusterId) + +Delete a connector cluster + +Delete a connector cluster + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster + try { + CompletableFuture> response = apiInstance.deleteConnectorClusterWithHttpInfo(connectorClusterId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#deleteConnectorCluster"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#deleteConnectorCluster"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorClusterId** | **String**| The id of the connector cluster | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -167,7 +347,7 @@ Name | Type | Description | Notes ## getConnectorCluster -> ConnectorCluster getConnectorCluster(connectorClusterId) +> CompletableFuture getConnectorCluster(connectorClusterId) Get a connector cluster @@ -183,6 +363,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -196,8 +377,8 @@ public class Example { ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster try { - ConnectorCluster result = apiInstance.getConnectorCluster(connectorClusterId); - System.out.println(result); + CompletableFuture result = apiInstance.getConnectorCluster(connectorClusterId); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#getConnectorCluster"); System.err.println("Status code: " + e.getCode()); @@ -218,7 +399,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorCluster**](ConnectorCluster.md) +CompletableFuture<[**ConnectorCluster**](ConnectorCluster.md)> + ### Authorization @@ -229,6 +411,90 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The connector cluster matching the request | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector cluster type exists | - | +| **410** | The requested resource doesn't exist anymore | - | +| **500** | Unexpected error occurred | - | + +## getConnectorClusterWithHttpInfo + +> CompletableFuture> getConnectorCluster getConnectorClusterWithHttpInfo(connectorClusterId) + +Get a connector cluster + +Get a connector cluster + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster + try { + CompletableFuture> response = apiInstance.getConnectorClusterWithHttpInfo(connectorClusterId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#getConnectorCluster"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#getConnectorCluster"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorClusterId** | **String**| The id of the connector cluster | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -242,7 +508,7 @@ Name | Type | Description | Notes ## getConnectorClusterAddonParameters -> List<AddonParameter> getConnectorClusterAddonParameters(connectorClusterId, resetCredentials) +> CompletableFuture> getConnectorClusterAddonParameters(connectorClusterId, resetCredentials) Get a connector cluster's addon parameters @@ -258,6 +524,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -272,8 +539,8 @@ public class Example { String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster Boolean resetCredentials = true; // Boolean | Resets cluster service account credentials when true try { - List result = apiInstance.getConnectorClusterAddonParameters(connectorClusterId, resetCredentials); - System.out.println(result); + CompletableFuture> result = apiInstance.getConnectorClusterAddonParameters(connectorClusterId, resetCredentials); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#getConnectorClusterAddonParameters"); System.err.println("Status code: " + e.getCode()); @@ -295,7 +562,8 @@ Name | Type | Description | Notes ### Return type -[**List<AddonParameter>**](AddonParameter.md) +CompletableFuture<[**List<AddonParameter>**](AddonParameter.md)> + ### Authorization @@ -306,6 +574,92 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The parameters that should be used to configure the managed connector addon on the cluster. | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector cluster type exists | - | +| **410** | The requested resource doesn't exist anymore | - | +| **500** | Unexpected error occurred | - | + +## getConnectorClusterAddonParametersWithHttpInfo + +> CompletableFuture>> getConnectorClusterAddonParameters getConnectorClusterAddonParametersWithHttpInfo(connectorClusterId, resetCredentials) + +Get a connector cluster's addon parameters + +Get a connector cluster's addon parameters + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster + Boolean resetCredentials = true; // Boolean | Resets cluster service account credentials when true + try { + CompletableFuture>> response = apiInstance.getConnectorClusterAddonParametersWithHttpInfo(connectorClusterId, resetCredentials); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#getConnectorClusterAddonParameters"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#getConnectorClusterAddonParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorClusterId** | **String**| The id of the connector cluster | + **resetCredentials** | **Boolean**| Resets cluster service account credentials when true | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -319,7 +673,7 @@ Name | Type | Description | Notes ## getConnectorClusterNamespaces -> ConnectorNamespaceList getConnectorClusterNamespaces(connectorClusterId, page, size, orderBy, search) +> CompletableFuture getConnectorClusterNamespaces(connectorClusterId, page, size, orderBy, search) Get a connector cluster's namespaces @@ -335,6 +689,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -352,8 +707,8 @@ public class Example { String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. try { - ConnectorNamespaceList result = apiInstance.getConnectorClusterNamespaces(connectorClusterId, page, size, orderBy, search); - System.out.println(result); + CompletableFuture result = apiInstance.getConnectorClusterNamespaces(connectorClusterId, page, size, orderBy, search); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#getConnectorClusterNamespaces"); System.err.println("Status code: " + e.getCode()); @@ -378,7 +733,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorNamespaceList**](ConnectorNamespaceList.md) +CompletableFuture<[**ConnectorNamespaceList**](ConnectorNamespaceList.md)> + ### Authorization @@ -389,6 +745,97 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The namespaces visible to user in the cluster. | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector cluster type exists | - | +| **500** | Unexpected error occurred | - | + +## getConnectorClusterNamespacesWithHttpInfo + +> CompletableFuture> getConnectorClusterNamespaces getConnectorClusterNamespacesWithHttpInfo(connectorClusterId, page, size, orderBy, search) + +Get a connector cluster's namespaces + +Get a connector cluster's namespaces + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster + String page = "1"; // String | Page index + String size = "100"; // String | Number of items in each page + String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. + String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. + try { + CompletableFuture> response = apiInstance.getConnectorClusterNamespacesWithHttpInfo(connectorClusterId, page, size, orderBy, search); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#getConnectorClusterNamespaces"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#getConnectorClusterNamespaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorClusterId** | **String**| The id of the connector cluster | + **page** | **String**| Page index | [optional] + **size** | **String**| Number of items in each page | [optional] + **orderBy** | **String**| Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. | [optional] + **search** | **String**| Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -401,7 +848,7 @@ Name | Type | Description | Notes ## listConnectorClusters -> ConnectorClusterList listConnectorClusters(page, size) +> CompletableFuture listConnectorClusters(page, size) Returns a list of connector clusters @@ -417,6 +864,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -431,8 +879,8 @@ public class Example { String page = "1"; // String | Page index String size = "100"; // String | Number of items in each page try { - ConnectorClusterList result = apiInstance.listConnectorClusters(page, size); - System.out.println(result); + CompletableFuture result = apiInstance.listConnectorClusters(page, size); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#listConnectorClusters"); System.err.println("Status code: " + e.getCode()); @@ -454,7 +902,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorClusterList**](ConnectorClusterList.md) +CompletableFuture<[**ConnectorClusterList**](ConnectorClusterList.md)> + ### Authorization @@ -465,6 +914,90 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of connector clusters | - | +| **401** | Auth token is invalid | - | +| **500** | Unexpected error occurred | - | + +## listConnectorClustersWithHttpInfo + +> CompletableFuture> listConnectorClusters listConnectorClustersWithHttpInfo(page, size) + +Returns a list of connector clusters + +Returns a list of connector clusters + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + String page = "1"; // String | Page index + String size = "100"; // String | Number of items in each page + try { + CompletableFuture> response = apiInstance.listConnectorClustersWithHttpInfo(page, size); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#listConnectorClusters"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#listConnectorClusters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **String**| Page index | [optional] + **size** | **String**| Number of items in each page | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -476,7 +1009,7 @@ Name | Type | Description | Notes ## updateConnectorClusterById -> updateConnectorClusterById(connectorClusterId, connectorClusterRequest) +> CompletableFuture updateConnectorClusterById(connectorClusterId, connectorClusterRequest) udpate a connector cluster @@ -492,6 +1025,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -506,7 +1040,7 @@ public class Example { String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster ConnectorClusterRequest connectorClusterRequest = new ConnectorClusterRequest(); // ConnectorClusterRequest | Data to updated connector with try { - apiInstance.updateConnectorClusterById(connectorClusterId, connectorClusterRequest); + CompletableFuture result = apiInstance.updateConnectorClusterById(connectorClusterId, connectorClusterRequest); } catch (ApiException e) { System.err.println("Exception when calling ConnectorClustersApi#updateConnectorClusterById"); System.err.println("Status code: " + e.getCode()); @@ -528,7 +1062,8 @@ Name | Type | Description | Notes ### Return type -null (empty response body) + +CompletableFuture (empty response body) ### Authorization @@ -539,6 +1074,90 @@ null (empty response body) - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Cluster status is updated | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector cluster exists | - | +| **500** | Unexpected error occurred | - | + +## updateConnectorClusterByIdWithHttpInfo + +> CompletableFuture> updateConnectorClusterById updateConnectorClusterByIdWithHttpInfo(connectorClusterId, connectorClusterRequest) + +udpate a connector cluster + +udpate a connector cluster + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorClustersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorClustersApi apiInstance = new ConnectorClustersApi(defaultClient); + String connectorClusterId = "connectorClusterId_example"; // String | The id of the connector cluster + ConnectorClusterRequest connectorClusterRequest = new ConnectorClusterRequest(); // ConnectorClusterRequest | Data to updated connector with + try { + CompletableFuture> response = apiInstance.updateConnectorClusterByIdWithHttpInfo(connectorClusterId, connectorClusterRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorClustersApi#updateConnectorClusterById"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorClustersApi#updateConnectorClusterById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorClusterId** | **String**| The id of the connector cluster | + **connectorClusterRequest** | [**ConnectorClusterRequest**](ConnectorClusterRequest.md)| Data to updated connector with | + +### Return type + + +CompletableFuture> + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/connector-management-sdk/docs/ConnectorNamespacesApi.md b/packages/connector-management-sdk/docs/ConnectorNamespacesApi.md index f237b5e8..46879e9e 100644 --- a/packages/connector-management-sdk/docs/ConnectorNamespacesApi.md +++ b/packages/connector-management-sdk/docs/ConnectorNamespacesApi.md @@ -5,14 +5,17 @@ All URIs are relative to *https://api.openshift.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**createEvaluationNamespace**](ConnectorNamespacesApi.md#createEvaluationNamespace) | **POST** /api/connector_mgmt/v1/kafka_connector_namespaces/eval | Create a new short lived evaluation connector namespace +[**createEvaluationNamespaceWithHttpInfo**](ConnectorNamespacesApi.md#createEvaluationNamespaceWithHttpInfo) | **POST** /api/connector_mgmt/v1/kafka_connector_namespaces/eval | Create a new short lived evaluation connector namespace [**getConnectorNamespace**](ConnectorNamespacesApi.md#getConnectorNamespace) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces/{connector_namespace_id} | Get a connector namespace +[**getConnectorNamespaceWithHttpInfo**](ConnectorNamespacesApi.md#getConnectorNamespaceWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces/{connector_namespace_id} | Get a connector namespace [**listConnectorNamespaces**](ConnectorNamespacesApi.md#listConnectorNamespaces) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces | Returns a list of connector namespaces +[**listConnectorNamespacesWithHttpInfo**](ConnectorNamespacesApi.md#listConnectorNamespacesWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_namespaces | Returns a list of connector namespaces ## createEvaluationNamespace -> ConnectorNamespace createEvaluationNamespace(connectorNamespaceEvalRequest) +> CompletableFuture createEvaluationNamespace(connectorNamespaceEvalRequest) Create a new short lived evaluation connector namespace @@ -28,6 +31,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorNamespacesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -41,8 +45,8 @@ public class Example { ConnectorNamespacesApi apiInstance = new ConnectorNamespacesApi(defaultClient); ConnectorNamespaceEvalRequest connectorNamespaceEvalRequest = new ConnectorNamespaceEvalRequest(); // ConnectorNamespaceEvalRequest | Connector namespace data try { - ConnectorNamespace result = apiInstance.createEvaluationNamespace(connectorNamespaceEvalRequest); - System.out.println(result); + CompletableFuture result = apiInstance.createEvaluationNamespace(connectorNamespaceEvalRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorNamespacesApi#createEvaluationNamespace"); System.err.println("Status code: " + e.getCode()); @@ -63,7 +67,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorNamespace**](ConnectorNamespace.md) +CompletableFuture<[**ConnectorNamespace**](ConnectorNamespace.md)> + ### Authorization @@ -74,6 +79,90 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Validation errors occurred | - | +| **401** | Auth token is invalid | - | +| **404** | The requested resource doesn't exist | - | +| **500** | An unexpected error occurred creating the connector namespace | - | + +## createEvaluationNamespaceWithHttpInfo + +> CompletableFuture> createEvaluationNamespace createEvaluationNamespaceWithHttpInfo(connectorNamespaceEvalRequest) + +Create a new short lived evaluation connector namespace + +Create a new evaluation connector namespace + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorNamespacesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorNamespacesApi apiInstance = new ConnectorNamespacesApi(defaultClient); + ConnectorNamespaceEvalRequest connectorNamespaceEvalRequest = new ConnectorNamespaceEvalRequest(); // ConnectorNamespaceEvalRequest | Connector namespace data + try { + CompletableFuture> response = apiInstance.createEvaluationNamespaceWithHttpInfo(connectorNamespaceEvalRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorNamespacesApi#createEvaluationNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorNamespacesApi#createEvaluationNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorNamespaceEvalRequest** | [**ConnectorNamespaceEvalRequest**](ConnectorNamespaceEvalRequest.md)| Connector namespace data | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -87,7 +176,7 @@ Name | Type | Description | Notes ## getConnectorNamespace -> ConnectorNamespace getConnectorNamespace(connectorNamespaceId) +> CompletableFuture getConnectorNamespace(connectorNamespaceId) Get a connector namespace @@ -103,6 +192,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorNamespacesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -116,8 +206,8 @@ public class Example { ConnectorNamespacesApi apiInstance = new ConnectorNamespacesApi(defaultClient); String connectorNamespaceId = "connectorNamespaceId_example"; // String | The id of the connector namespace try { - ConnectorNamespace result = apiInstance.getConnectorNamespace(connectorNamespaceId); - System.out.println(result); + CompletableFuture result = apiInstance.getConnectorNamespace(connectorNamespaceId); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorNamespacesApi#getConnectorNamespace"); System.err.println("Status code: " + e.getCode()); @@ -138,7 +228,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorNamespace**](ConnectorNamespace.md) +CompletableFuture<[**ConnectorNamespace**](ConnectorNamespace.md)> + ### Authorization @@ -149,6 +240,89 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The connector namespace matching the request | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector namespace type exists | - | +| **500** | Unexpected error occurred | - | + +## getConnectorNamespaceWithHttpInfo + +> CompletableFuture> getConnectorNamespace getConnectorNamespaceWithHttpInfo(connectorNamespaceId) + +Get a connector namespace + +Get a connector namespace + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorNamespacesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorNamespacesApi apiInstance = new ConnectorNamespacesApi(defaultClient); + String connectorNamespaceId = "connectorNamespaceId_example"; // String | The id of the connector namespace + try { + CompletableFuture> response = apiInstance.getConnectorNamespaceWithHttpInfo(connectorNamespaceId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorNamespacesApi#getConnectorNamespace"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorNamespacesApi#getConnectorNamespace"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorNamespaceId** | **String**| The id of the connector namespace | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -161,7 +335,7 @@ Name | Type | Description | Notes ## listConnectorNamespaces -> ConnectorNamespaceList listConnectorNamespaces(page, size, orderBy, search) +> CompletableFuture listConnectorNamespaces(page, size, orderBy, search) Returns a list of connector namespaces @@ -177,6 +351,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorNamespacesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -193,8 +368,8 @@ public class Example { String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. try { - ConnectorNamespaceList result = apiInstance.listConnectorNamespaces(page, size, orderBy, search); - System.out.println(result); + CompletableFuture result = apiInstance.listConnectorNamespaces(page, size, orderBy, search); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorNamespacesApi#listConnectorNamespaces"); System.err.println("Status code: " + e.getCode()); @@ -218,7 +393,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorNamespaceList**](ConnectorNamespaceList.md) +CompletableFuture<[**ConnectorNamespaceList**](ConnectorNamespaceList.md)> + ### Authorization @@ -229,6 +405,94 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of connector namespaces | - | +| **401** | Auth token is invalid | - | +| **500** | Unexpected error occurred | - | + +## listConnectorNamespacesWithHttpInfo + +> CompletableFuture> listConnectorNamespaces listConnectorNamespacesWithHttpInfo(page, size, orderBy, search) + +Returns a list of connector namespaces + +Returns a list of connector namespaces + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorNamespacesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorNamespacesApi apiInstance = new ConnectorNamespacesApi(defaultClient); + String page = "1"; // String | Page index + String size = "100"; // String | Number of items in each page + String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. + String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. + try { + CompletableFuture> response = apiInstance.listConnectorNamespacesWithHttpInfo(page, size, orderBy, search); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorNamespacesApi#listConnectorNamespaces"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorNamespacesApi#listConnectorNamespaces"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **String**| Page index | [optional] + **size** | **String**| Number of items in each page | [optional] + **orderBy** | **String**| Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. | [optional] + **search** | **String**| Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/connector-management-sdk/docs/ConnectorServiceApi.md b/packages/connector-management-sdk/docs/ConnectorServiceApi.md index c7b89c69..78c8a669 100644 --- a/packages/connector-management-sdk/docs/ConnectorServiceApi.md +++ b/packages/connector-management-sdk/docs/ConnectorServiceApi.md @@ -5,12 +5,13 @@ All URIs are relative to *https://api.openshift.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**getVersionMetadata**](ConnectorServiceApi.md#getVersionMetadata) | **GET** /api/connector_mgmt/v1 | Returns the version metadata +[**getVersionMetadataWithHttpInfo**](ConnectorServiceApi.md#getVersionMetadataWithHttpInfo) | **GET** /api/connector_mgmt/v1 | Returns the version metadata ## getVersionMetadata -> VersionMetadata getVersionMetadata() +> CompletableFuture getVersionMetadata() Returns the version metadata @@ -25,6 +26,7 @@ import com.openshift.cloud.api.connector.invoker.ApiException; import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorServiceApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -33,8 +35,8 @@ public class Example { ConnectorServiceApi apiInstance = new ConnectorServiceApi(defaultClient); try { - VersionMetadata result = apiInstance.getVersionMetadata(); - System.out.println(result); + CompletableFuture result = apiInstance.getVersionMetadata(); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorServiceApi#getVersionMetadata"); System.err.println("Status code: " + e.getCode()); @@ -52,7 +54,8 @@ This endpoint does not need any parameter. ### Return type -[**VersionMetadata**](VersionMetadata.md) +CompletableFuture<[**VersionMetadata**](VersionMetadata.md)> + ### Authorization @@ -63,6 +66,77 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Version metadata | - | + +## getVersionMetadataWithHttpInfo + +> CompletableFuture> getVersionMetadata getVersionMetadataWithHttpInfo() + +Returns the version metadata + +Returns the version metadata + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorServiceApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + ConnectorServiceApi apiInstance = new ConnectorServiceApi(defaultClient); + try { + CompletableFuture> response = apiInstance.getVersionMetadataWithHttpInfo(); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorServiceApi#getVersionMetadata"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorServiceApi#getVersionMetadata"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/connector-management-sdk/docs/ConnectorType.md b/packages/connector-management-sdk/docs/ConnectorType.md index 0fd4f296..1b8d6306 100644 --- a/packages/connector-management-sdk/docs/ConnectorType.md +++ b/packages/connector-management-sdk/docs/ConnectorType.md @@ -4,22 +4,36 @@ Represents a connector type supported by the API -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | [optional] -**kind** | **String** | | [optional] -**href** | **String** | | [optional] -**name** | **String** | Name of the connector type. | [optional] -**version** | **String** | Version of the connector type. | [optional] -**channels** | **List<Channel>** | Channels of the connector type. | [optional] -**description** | **String** | A description of the connector. | [optional] -**iconHref** | **String** | URL to an icon of the connector. | [optional] -**labels** | **List<String>** | Labels used to categorize the connector | [optional] -**capabilities** | **List<String>** | The capabilities supported by the conenctor | [optional] -**schema** | **Object** | A json schema that can be used to validate a ConnectorRequest connector field. | [optional] -**jsonSchema** | **Object** | A json schema that can be used to validate a ConnectorRequest connector field. | [optional] - +## oneOf schemas +* [ConnectorTypeAllOf](ConnectorTypeAllOf.md) +* [ObjectReference](ObjectReference.md) + +## Example +```java +// Import classes: +import com.openshift.cloud.api.connector.models.ConnectorType; +import com.openshift.cloud.api.connector.models.ConnectorTypeAllOf; +import com.openshift.cloud.api.connector.models.ObjectReference; + +public class Example { + public static void main(String[] args) { + ConnectorType exampleConnectorType = new ConnectorType(); + + // create a new ConnectorTypeAllOf + ConnectorTypeAllOf exampleConnectorTypeAllOf = new ConnectorTypeAllOf(); + // set ConnectorType to ConnectorTypeAllOf + exampleConnectorType.setActualInstance(exampleConnectorTypeAllOf); + // to get back the ConnectorTypeAllOf set earlier + ConnectorTypeAllOf testConnectorTypeAllOf = (ConnectorTypeAllOf) exampleConnectorType.getActualInstance(); + + // create a new ObjectReference + ObjectReference exampleObjectReference = new ObjectReference(); + // set ConnectorType to ObjectReference + exampleConnectorType.setActualInstance(exampleObjectReference); + // to get back the ObjectReference set earlier + ObjectReference testObjectReference = (ObjectReference) exampleConnectorType.getActualInstance(); + } +} +``` diff --git a/packages/connector-management-sdk/docs/ConnectorTypesApi.md b/packages/connector-management-sdk/docs/ConnectorTypesApi.md index 6d4cb91a..e0ef5f2d 100644 --- a/packages/connector-management-sdk/docs/ConnectorTypesApi.md +++ b/packages/connector-management-sdk/docs/ConnectorTypesApi.md @@ -5,13 +5,15 @@ All URIs are relative to *https://api.openshift.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**getConnectorTypeByID**](ConnectorTypesApi.md#getConnectorTypeByID) | **GET** /api/connector_mgmt/v1/kafka_connector_types/{connector_type_id} | Get a connector type by id +[**getConnectorTypeByIDWithHttpInfo**](ConnectorTypesApi.md#getConnectorTypeByIDWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_types/{connector_type_id} | Get a connector type by id [**getConnectorTypes**](ConnectorTypesApi.md#getConnectorTypes) | **GET** /api/connector_mgmt/v1/kafka_connector_types | Returns a list of connector types +[**getConnectorTypesWithHttpInfo**](ConnectorTypesApi.md#getConnectorTypesWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connector_types | Returns a list of connector types ## getConnectorTypeByID -> ConnectorType getConnectorTypeByID(connectorTypeId) +> CompletableFuture getConnectorTypeByID(connectorTypeId) Get a connector type by id @@ -27,6 +29,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorTypesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -40,8 +43,8 @@ public class Example { ConnectorTypesApi apiInstance = new ConnectorTypesApi(defaultClient); String connectorTypeId = "connectorTypeId_example"; // String | The id of the connector type try { - ConnectorType result = apiInstance.getConnectorTypeByID(connectorTypeId); - System.out.println(result); + CompletableFuture result = apiInstance.getConnectorTypeByID(connectorTypeId); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorTypesApi#getConnectorTypeByID"); System.err.println("Status code: " + e.getCode()); @@ -62,7 +65,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorType**](ConnectorType.md) +CompletableFuture<[**ConnectorType**](ConnectorType.md)> + ### Authorization @@ -73,6 +77,90 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The connector type matching the request | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector type exists | - | +| **410** | Connector type doesn't exist anymore | - | +| **500** | Unexpected error occurred | - | + +## getConnectorTypeByIDWithHttpInfo + +> CompletableFuture> getConnectorTypeByID getConnectorTypeByIDWithHttpInfo(connectorTypeId) + +Get a connector type by id + +Get a connector type by id + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorTypesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorTypesApi apiInstance = new ConnectorTypesApi(defaultClient); + String connectorTypeId = "connectorTypeId_example"; // String | The id of the connector type + try { + CompletableFuture> response = apiInstance.getConnectorTypeByIDWithHttpInfo(connectorTypeId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorTypesApi#getConnectorTypeByID"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorTypesApi#getConnectorTypeByID"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **connectorTypeId** | **String**| The id of the connector type | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -86,7 +174,7 @@ Name | Type | Description | Notes ## getConnectorTypes -> ConnectorTypeList getConnectorTypes(page, size, orderBy, search) +> CompletableFuture getConnectorTypes(page, size, orderBy, search) Returns a list of connector types @@ -102,6 +190,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorTypesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -118,8 +207,8 @@ public class Example { String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. try { - ConnectorTypeList result = apiInstance.getConnectorTypes(page, size, orderBy, search); - System.out.println(result); + CompletableFuture result = apiInstance.getConnectorTypes(page, size, orderBy, search); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorTypesApi#getConnectorTypes"); System.err.println("Status code: " + e.getCode()); @@ -143,7 +232,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorTypeList**](ConnectorTypeList.md) +CompletableFuture<[**ConnectorTypeList**](ConnectorTypeList.md)> + ### Authorization @@ -154,6 +244,94 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of connector types | - | +| **401** | Auth token is invalid | - | +| **500** | Unexpected error occurred | - | + +## getConnectorTypesWithHttpInfo + +> CompletableFuture> getConnectorTypes getConnectorTypesWithHttpInfo(page, size, orderBy, search) + +Returns a list of connector types + +Returns a list of connector types + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorTypesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorTypesApi apiInstance = new ConnectorTypesApi(defaultClient); + String page = "1"; // String | Page index + String size = "100"; // String | Number of items in each page + String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. + String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. + try { + CompletableFuture> response = apiInstance.getConnectorTypesWithHttpInfo(page, size, orderBy, search); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorTypesApi#getConnectorTypes"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorTypesApi#getConnectorTypes"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **String**| Page index | [optional] + **size** | **String**| Number of items in each page | [optional] + **orderBy** | **String**| Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. | [optional] + **search** | **String**| Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/connector-management-sdk/docs/ConnectorsApi.md b/packages/connector-management-sdk/docs/ConnectorsApi.md index d119564b..1b35396a 100644 --- a/packages/connector-management-sdk/docs/ConnectorsApi.md +++ b/packages/connector-management-sdk/docs/ConnectorsApi.md @@ -5,16 +5,21 @@ All URIs are relative to *https://api.openshift.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**createConnector**](ConnectorsApi.md#createConnector) | **POST** /api/connector_mgmt/v1/kafka_connectors | Create a new connector +[**createConnectorWithHttpInfo**](ConnectorsApi.md#createConnectorWithHttpInfo) | **POST** /api/connector_mgmt/v1/kafka_connectors | Create a new connector [**deleteConnector**](ConnectorsApi.md#deleteConnector) | **DELETE** /api/connector_mgmt/v1/kafka_connectors/{id} | Delete a connector +[**deleteConnectorWithHttpInfo**](ConnectorsApi.md#deleteConnectorWithHttpInfo) | **DELETE** /api/connector_mgmt/v1/kafka_connectors/{id} | Delete a connector [**getConnector**](ConnectorsApi.md#getConnector) | **GET** /api/connector_mgmt/v1/kafka_connectors/{id} | Get a connector +[**getConnectorWithHttpInfo**](ConnectorsApi.md#getConnectorWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connectors/{id} | Get a connector [**listConnectors**](ConnectorsApi.md#listConnectors) | **GET** /api/connector_mgmt/v1/kafka_connectors | Returns a list of connector types +[**listConnectorsWithHttpInfo**](ConnectorsApi.md#listConnectorsWithHttpInfo) | **GET** /api/connector_mgmt/v1/kafka_connectors | Returns a list of connector types [**patchConnector**](ConnectorsApi.md#patchConnector) | **PATCH** /api/connector_mgmt/v1/kafka_connectors/{id} | Patch a connector +[**patchConnectorWithHttpInfo**](ConnectorsApi.md#patchConnectorWithHttpInfo) | **PATCH** /api/connector_mgmt/v1/kafka_connectors/{id} | Patch a connector ## createConnector -> Connector createConnector(async, connectorRequest) +> CompletableFuture createConnector(async, connectorRequest) Create a new connector @@ -30,6 +35,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -44,8 +50,8 @@ public class Example { Boolean async = true; // Boolean | Perform the action in an asynchronous manner ConnectorRequest connectorRequest = new ConnectorRequest(); // ConnectorRequest | Connector data try { - Connector result = apiInstance.createConnector(async, connectorRequest); - System.out.println(result); + CompletableFuture result = apiInstance.createConnector(async, connectorRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorsApi#createConnector"); System.err.println("Status code: " + e.getCode()); @@ -67,7 +73,8 @@ Name | Type | Description | Notes ### Return type -[**Connector**](Connector.md) +CompletableFuture<[**Connector**](Connector.md)> + ### Authorization @@ -78,6 +85,92 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted | - | +| **400** | Validation errors occurred | - | +| **401** | Auth token is invalid | - | +| **404** | The requested resource doesn't exist | - | +| **500** | An unexpected error occurred creating the connector | - | + +## createConnectorWithHttpInfo + +> CompletableFuture> createConnector createConnectorWithHttpInfo(async, connectorRequest) + +Create a new connector + +Create a new connector + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); + Boolean async = true; // Boolean | Perform the action in an asynchronous manner + ConnectorRequest connectorRequest = new ConnectorRequest(); // ConnectorRequest | Connector data + try { + CompletableFuture> response = apiInstance.createConnectorWithHttpInfo(async, connectorRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorsApi#createConnector"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorsApi#createConnector"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **async** | **Boolean**| Perform the action in an asynchronous manner | + **connectorRequest** | [**ConnectorRequest**](ConnectorRequest.md)| Connector data | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -91,7 +184,7 @@ Name | Type | Description | Notes ## deleteConnector -> Error deleteConnector(id) +> CompletableFuture deleteConnector(id) Delete a connector @@ -107,6 +200,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -120,8 +214,8 @@ public class Example { ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); String id = "id_example"; // String | The ID of record try { - Error result = apiInstance.deleteConnector(id); - System.out.println(result); + CompletableFuture result = apiInstance.deleteConnector(id); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorsApi#deleteConnector"); System.err.println("Status code: " + e.getCode()); @@ -142,7 +236,8 @@ Name | Type | Description | Notes ### Return type -[**Error**](Error.md) +CompletableFuture<[**Error**](Error.md)> + ### Authorization @@ -153,6 +248,89 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | Deleted | - | +| **401** | Auth token is invalid | - | +| **404** | No kafka request with specified ID exists | - | +| **500** | Unexpected error occurred | - | + +## deleteConnectorWithHttpInfo + +> CompletableFuture> deleteConnector deleteConnectorWithHttpInfo(id) + +Delete a connector + +Delete a connector + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); + String id = "id_example"; // String | The ID of record + try { + CompletableFuture> response = apiInstance.deleteConnectorWithHttpInfo(id); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorsApi#deleteConnector"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorsApi#deleteConnector"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| The ID of record | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -165,7 +343,7 @@ Name | Type | Description | Notes ## getConnector -> Connector getConnector(id) +> CompletableFuture getConnector(id) Get a connector @@ -181,6 +359,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -194,8 +373,8 @@ public class Example { ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); String id = "id_example"; // String | The ID of record try { - Connector result = apiInstance.getConnector(id); - System.out.println(result); + CompletableFuture result = apiInstance.getConnector(id); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorsApi#getConnector"); System.err.println("Status code: " + e.getCode()); @@ -216,7 +395,8 @@ Name | Type | Description | Notes ### Return type -[**Connector**](Connector.md) +CompletableFuture<[**Connector**](Connector.md)> + ### Authorization @@ -227,6 +407,90 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The connector matching the request | - | +| **401** | Auth token is invalid | - | +| **404** | No matching connector exists | - | +| **410** | The requested resource doesn't exist anymore | - | +| **500** | Unexpected error occurred | - | + +## getConnectorWithHttpInfo + +> CompletableFuture> getConnector getConnectorWithHttpInfo(id) + +Get a connector + +Get a connector + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); + String id = "id_example"; // String | The ID of record + try { + CompletableFuture> response = apiInstance.getConnectorWithHttpInfo(id); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorsApi#getConnector"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorsApi#getConnector"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| The ID of record | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -240,7 +504,7 @@ Name | Type | Description | Notes ## listConnectors -> ConnectorList listConnectors(page, size, orderBy, search) +> CompletableFuture listConnectors(page, size, orderBy, search) Returns a list of connector types @@ -256,6 +520,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -272,8 +537,8 @@ public class Example { String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. try { - ConnectorList result = apiInstance.listConnectors(page, size, orderBy, search); - System.out.println(result); + CompletableFuture result = apiInstance.listConnectors(page, size, orderBy, search); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorsApi#listConnectors"); System.err.println("Status code: " + e.getCode()); @@ -297,7 +562,8 @@ Name | Type | Description | Notes ### Return type -[**ConnectorList**](ConnectorList.md) +CompletableFuture<[**ConnectorList**](ConnectorList.md)> + ### Authorization @@ -308,6 +574,94 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | A list of connectors | - | +| **401** | Auth token is invalid | - | +| **500** | Unexpected error occurred | - | + +## listConnectorsWithHttpInfo + +> CompletableFuture> listConnectors listConnectorsWithHttpInfo(page, size, orderBy, search) + +Returns a list of connector types + +Returns a list of connector types + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); + String page = "1"; // String | Page index + String size = "100"; // String | Number of items in each page + String orderBy = "name asc"; // String | Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. + String search = "name = aws-sqs-source and channel = stable"; // String | Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. + try { + CompletableFuture> response = apiInstance.listConnectorsWithHttpInfo(page, size, orderBy, search); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorsApi#listConnectors"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorsApi#listConnectors"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **String**| Page index | [optional] + **size** | **String**| Number of items in each page | [optional] + **orderBy** | **String**| Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. | [optional] + **search** | **String**| Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -319,7 +673,7 @@ Name | Type | Description | Notes ## patchConnector -> Connector patchConnector(id, body) +> CompletableFuture patchConnector(id, body) Patch a connector @@ -335,6 +689,7 @@ import com.openshift.cloud.api.connector.invoker.Configuration; import com.openshift.cloud.api.connector.invoker.auth.*; import com.openshift.cloud.api.connector.invoker.models.*; import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -349,8 +704,8 @@ public class Example { String id = "id_example"; // String | The ID of record Object body = null; // Object | Data to patch the connector with try { - Connector result = apiInstance.patchConnector(id, body); - System.out.println(result); + CompletableFuture result = apiInstance.patchConnector(id, body); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ConnectorsApi#patchConnector"); System.err.println("Status code: " + e.getCode()); @@ -372,7 +727,8 @@ Name | Type | Description | Notes ### Return type -[**Connector**](Connector.md) +CompletableFuture<[**Connector**](Connector.md)> + ### Authorization @@ -383,6 +739,92 @@ Name | Type | Description | Notes - **Content-Type**: application/merge-patch+json, application/json-patch+json, application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | The connector matching the request | - | +| **401** | Auth token is invalid | - | +| **404** | No matching resource exists | - | +| **410** | The requested resource doesn't exist anymore | - | +| **500** | Unexpected error occurred | - | + +## patchConnectorWithHttpInfo + +> CompletableFuture> patchConnector patchConnectorWithHttpInfo(id, body) + +Patch a connector + +Patch a connector + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.connector.invoker.ApiClient; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; +import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.auth.*; +import com.openshift.cloud.api.connector.invoker.models.*; +import com.openshift.cloud.api.connector.ConnectorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://api.openshift.com"); + + // Configure HTTP bearer authorization: Bearer + HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); + Bearer.setBearerToken("BEARER TOKEN"); + + ConnectorsApi apiInstance = new ConnectorsApi(defaultClient); + String id = "id_example"; // String | The ID of record + Object body = null; // Object | Data to patch the connector with + try { + CompletableFuture> response = apiInstance.patchConnectorWithHttpInfo(id, body); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ConnectorsApi#patchConnector"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ConnectorsApi#patchConnector"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| The ID of record | + **body** | **Object**| Data to patch the connector with | + +### Return type + +CompletableFuture> + + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/merge-patch+json, application/json-patch+json, application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/connector-management-sdk/pom.xml b/packages/connector-management-sdk/pom.xml index 556d2234..9c9ece0c 100644 --- a/packages/connector-management-sdk/pom.xml +++ b/packages/connector-management-sdk/pom.xml @@ -5,26 +5,15 @@ connector-management-sdk jar connector-management-sdk - Red Hat Aplicaiton Services Java SDK - https://github.com/redhat-developer/app-services-sdk-java - - 0.0.1-SNAPSHOT - + 0.1.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java scm:git:git@github.com:openapitools/openapi-generator.git scm:git:git@github.com:openapitools/openapi-generator.git https://github.com/openapitools/openapi-generator - - - ossrh - Central Repository OSSRH - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - Apache-2.0 @@ -45,9 +34,8 @@ - org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.0.0-M1 enforce-maven @@ -57,31 +45,31 @@ - 2.2.0 + 3 + + 11 + - org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.0.0-M3 - - - loggerPath - conf/log4j.properties - - + + conf/log4j.properties + -Xms512m -Xmx1500m methods - pertest + 10 maven-dependency-plugin + 3.1.1 package @@ -95,62 +83,29 @@ + org.apache.maven.plugins maven-jar-plugin - 3.2.2 - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 + 3.1.2 - add_sources - generate-sources - add-source + test-jar - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - + + - org.apache.maven.plugins maven-compiler-plugin - 3.9.0 - - 1.8 - 1.8 - + 3.8.1 org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 - - none - 1.8 - + 3.1.0 attach-javadocs @@ -161,53 +116,50 @@ - org.apache.maven.plugins maven-source-plugin + 3.1.0 - attach-sources - - jar - + attach-sources + + jar-no-fork + - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://oss.sonatype.org/ - true - - + + + + sign-artifacts + + + + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + + + + io.swagger swagger-annotations ${swagger-annotations-version} - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-version} - + com.fasterxml.jackson.core @@ -222,17 +174,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-databind-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - org.jboss.resteasy - resteasy-jackson2-provider - ${resteasy-version} + ${jackson-version} com.fasterxml.jackson.datatype @@ -240,16 +182,24 @@ ${jackson-version} - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + - javax.annotation - javax.annotation-api - ${javax-annotation-version} + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} provided + junit @@ -258,45 +208,15 @@ test + UTF-8 1.5.22 - 5.0.1.Final - 2.10.5 - 2.10.5.1 - 0.2.1 - 1.3.2 - 2.9.10 - 1.0.0 - 4.13 + 11 + 11 + 2.10.4 + 0.2.2 + 1.3.5 + 4.13.1 - - - release - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - --pinentry-mode - loopback - - - - - sign-artifacts - verify - - sign - - - - - - - - diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorClustersApi.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorClustersApi.java index 4ddc5c59..348d271e 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorClustersApi.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorClustersApi.java @@ -1,12 +1,22 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.connector; -import com.openshift.cloud.api.connector.invoker.ApiException; import com.openshift.cloud.api.connector.invoker.ApiClient; -import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; import com.openshift.cloud.api.connector.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.connector.models.AddonParameter; import com.openshift.cloud.api.connector.models.ConnectorCluster; import com.openshift.cloud.api.connector.models.ConnectorClusterList; @@ -14,29 +24,91 @@ import com.openshift.cloud.api.connector.models.ConnectorNamespaceList; import com.openshift.cloud.api.connector.models.Error; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClustersApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ConnectorClustersApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ConnectorClustersApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + /** + * Create a new connector cluster + * Create a new connector cluster + * @param async Perform the action in an asynchronous manner (required) + * @param connectorClusterRequest Connector cluster data (required) + * @return CompletableFuture<ConnectorCluster> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createConnectorCluster(Boolean async, ConnectorClusterRequest connectorClusterRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createConnectorClusterRequestBuilder(async, connectorClusterRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createConnectorCluster", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } } /** @@ -44,185 +116,399 @@ public void setApiClient(ApiClient apiClient) { * Create a new connector cluster * @param async Perform the action in an asynchronous manner (required) * @param connectorClusterRequest Connector cluster data (required) - * @return a {@code ConnectorCluster} + * @return CompletableFuture<ApiResponse<ConnectorCluster>> * @throws ApiException if fails to make API call */ - public ConnectorCluster createConnectorCluster(Boolean async, ConnectorClusterRequest connectorClusterRequest) throws ApiException { - Object localVarPostBody = connectorClusterRequest; - + public CompletableFuture> createConnectorClusterWithHttpInfo(Boolean async, ConnectorClusterRequest connectorClusterRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createConnectorClusterRequestBuilder(async, connectorClusterRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createConnectorCluster", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createConnectorClusterRequestBuilder(Boolean async, ConnectorClusterRequest connectorClusterRequest) throws ApiException { // verify the required parameter 'async' is set if (async == null) { throw new ApiException(400, "Missing the required parameter 'async' when calling createConnectorCluster"); } - // verify the required parameter 'connectorClusterRequest' is set if (connectorClusterRequest == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterRequest' when calling createConnectorCluster"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters".replaceAll("\\{format\\}","json"); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "async", async)); + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters"; - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("async", async)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(connectorClusterRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Delete a connector cluster + * Delete a connector cluster + * @param connectorClusterId The id of the connector cluster (required) + * @return CompletableFuture<Error> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteConnectorCluster(String connectorClusterId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deleteConnectorClusterRequestBuilder(connectorClusterId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteConnectorCluster", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Delete a connector cluster * Delete a connector cluster * @param connectorClusterId The id of the connector cluster (required) - * @return a {@code Error} + * @return CompletableFuture<ApiResponse<Error>> * @throws ApiException if fails to make API call */ - public Error deleteConnectorCluster(String connectorClusterId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> deleteConnectorClusterWithHttpInfo(String connectorClusterId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deleteConnectorClusterRequestBuilder(connectorClusterId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteConnectorCluster", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteConnectorClusterRequestBuilder(String connectorClusterId) throws ApiException { // verify the required parameter 'connectorClusterId' is set if (connectorClusterId == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterId' when calling deleteConnectorCluster"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_cluster_id" + "\\}", apiClient.escapeString(connectorClusterId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}" + .replace("{connector_cluster_id}", ApiClient.urlEncode(connectorClusterId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get a connector cluster + * Get a connector cluster + * @param connectorClusterId The id of the connector cluster (required) + * @return CompletableFuture<ConnectorCluster> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getConnectorCluster(String connectorClusterId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorClusterRequestBuilder(connectorClusterId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorCluster", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Get a connector cluster * Get a connector cluster * @param connectorClusterId The id of the connector cluster (required) - * @return a {@code ConnectorCluster} + * @return CompletableFuture<ApiResponse<ConnectorCluster>> * @throws ApiException if fails to make API call */ - public ConnectorCluster getConnectorCluster(String connectorClusterId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> getConnectorClusterWithHttpInfo(String connectorClusterId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorClusterRequestBuilder(connectorClusterId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorCluster", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorClusterRequestBuilder(String connectorClusterId) throws ApiException { // verify the required parameter 'connectorClusterId' is set if (connectorClusterId == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterId' when calling getConnectorCluster"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_cluster_id" + "\\}", apiClient.escapeString(connectorClusterId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}" + .replace("{connector_cluster_id}", ApiClient.urlEncode(connectorClusterId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get a connector cluster's addon parameters + * Get a connector cluster's addon parameters + * @param connectorClusterId The id of the connector cluster (required) + * @param resetCredentials Resets cluster service account credentials when true (optional) + * @return CompletableFuture<List<AddonParameter>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getConnectorClusterAddonParameters(String connectorClusterId, Boolean resetCredentials) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorClusterAddonParametersRequestBuilder(connectorClusterId, resetCredentials); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorClusterAddonParameters", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Get a connector cluster's addon parameters * Get a connector cluster's addon parameters * @param connectorClusterId The id of the connector cluster (required) * @param resetCredentials Resets cluster service account credentials when true (optional) - * @return a {@code List} + * @return CompletableFuture<ApiResponse<List<AddonParameter>>> * @throws ApiException if fails to make API call */ - public List getConnectorClusterAddonParameters(String connectorClusterId, Boolean resetCredentials) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture>> getConnectorClusterAddonParametersWithHttpInfo(String connectorClusterId, Boolean resetCredentials) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorClusterAddonParametersRequestBuilder(connectorClusterId, resetCredentials); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorClusterAddonParameters", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorClusterAddonParametersRequestBuilder(String connectorClusterId, Boolean resetCredentials) throws ApiException { // verify the required parameter 'connectorClusterId' is set if (connectorClusterId == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterId' when calling getConnectorClusterAddonParameters"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/addon_parameters".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_cluster_id" + "\\}", apiClient.escapeString(connectorClusterId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "reset_credentials", resetCredentials)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/addon_parameters" + .replace("{connector_cluster_id}", ApiClient.urlEncode(connectorClusterId.toString())); + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("reset_credentials", resetCredentials)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get a connector cluster's namespaces + * Get a connector cluster's namespaces + * @param connectorClusterId The id of the connector cluster (required) + * @param page Page index (optional) + * @param size Number of items in each page (optional) + * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) + * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) + * @return CompletableFuture<ConnectorNamespaceList> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getConnectorClusterNamespaces(String connectorClusterId, String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorClusterNamespacesRequestBuilder(connectorClusterId, page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorClusterNamespaces", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + /** * Get a connector cluster's namespaces * Get a connector cluster's namespaces @@ -231,91 +517,173 @@ public List getConnectorClusterAddonParameters(String connectorC * @param size Number of items in each page (optional) * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) - * @return a {@code ConnectorNamespaceList} + * @return CompletableFuture<ApiResponse<ConnectorNamespaceList>> * @throws ApiException if fails to make API call */ - public ConnectorNamespaceList getConnectorClusterNamespaces(String connectorClusterId, String page, String size, String orderBy, String search) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> getConnectorClusterNamespacesWithHttpInfo(String connectorClusterId, String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorClusterNamespacesRequestBuilder(connectorClusterId, page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorClusterNamespaces", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorClusterNamespacesRequestBuilder(String connectorClusterId, String page, String size, String orderBy, String search) throws ApiException { // verify the required parameter 'connectorClusterId' is set if (connectorClusterId == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterId' when calling getConnectorClusterNamespaces"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/namespaces".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_cluster_id" + "\\}", apiClient.escapeString(connectorClusterId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "orderBy", orderBy)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}/namespaces" + .replace("{connector_cluster_id}", ApiClient.urlEncode(connectorClusterId.toString())); + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("orderBy", orderBy)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("search", search)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Returns a list of connector clusters * Returns a list of connector clusters * @param page Page index (optional) * @param size Number of items in each page (optional) - * @return a {@code ConnectorClusterList} + * @return CompletableFuture<ConnectorClusterList> * @throws ApiException if fails to make API call */ - public ConnectorClusterList listConnectorClusters(String page, String size) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture listConnectorClusters(String page, String size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = listConnectorClustersRequestBuilder(page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("listConnectorClusters", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Returns a list of connector clusters + * Returns a list of connector clusters + * @param page Page index (optional) + * @param size Number of items in each page (optional) + * @return CompletableFuture<ApiResponse<ConnectorClusterList>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> listConnectorClustersWithHttpInfo(String page, String size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = listConnectorClustersRequestBuilder(page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("listConnectorClusters", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listConnectorClustersRequestBuilder(String page, String size) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * udpate a connector cluster * udpate a connector cluster @@ -323,46 +691,86 @@ public ConnectorClusterList listConnectorClusters(String page, String size) thro * @param connectorClusterRequest Data to updated connector with (required) * @throws ApiException if fails to make API call */ - public void updateConnectorClusterById(String connectorClusterId, ConnectorClusterRequest connectorClusterRequest) throws ApiException { - Object localVarPostBody = connectorClusterRequest; - + public CompletableFuture updateConnectorClusterById(String connectorClusterId, ConnectorClusterRequest connectorClusterRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = updateConnectorClusterByIdRequestBuilder(connectorClusterId, connectorClusterRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updateConnectorClusterById", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * udpate a connector cluster + * udpate a connector cluster + * @param connectorClusterId The id of the connector cluster (required) + * @param connectorClusterRequest Data to updated connector with (required) + * @return CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> updateConnectorClusterByIdWithHttpInfo(String connectorClusterId, ConnectorClusterRequest connectorClusterRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = updateConnectorClusterByIdRequestBuilder(connectorClusterId, connectorClusterRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("updateConnectorClusterById", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder updateConnectorClusterByIdRequestBuilder(String connectorClusterId, ConnectorClusterRequest connectorClusterRequest) throws ApiException { // verify the required parameter 'connectorClusterId' is set if (connectorClusterId == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterId' when calling updateConnectorClusterById"); } - // verify the required parameter 'connectorClusterRequest' is set if (connectorClusterRequest == null) { throw new ApiException(400, "Missing the required parameter 'connectorClusterRequest' when calling updateConnectorClusterById"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_cluster_id" + "\\}", apiClient.escapeString(connectorClusterId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_clusters/{connector_cluster_id}" + .replace("{connector_cluster_id}", ApiClient.urlEncode(connectorClusterId.toString())); - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - - apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(connectorClusterRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorNamespacesApi.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorNamespacesApi.java index 9755ec3f..05eb0ce2 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorNamespacesApi.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorNamespacesApi.java @@ -1,129 +1,303 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.connector; -import com.openshift.cloud.api.connector.invoker.ApiException; import com.openshift.cloud.api.connector.invoker.ApiClient; -import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; import com.openshift.cloud.api.connector.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.connector.models.ConnectorNamespace; import com.openshift.cloud.api.connector.models.ConnectorNamespaceEvalRequest; import com.openshift.cloud.api.connector.models.ConnectorNamespaceList; import com.openshift.cloud.api.connector.models.Error; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespacesApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ConnectorNamespacesApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ConnectorNamespacesApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create a new short lived evaluation connector namespace + * Create a new evaluation connector namespace + * @param connectorNamespaceEvalRequest Connector namespace data (required) + * @return CompletableFuture<ConnectorNamespace> + * @throws ApiException if fails to make API call + */ + public CompletableFuture createEvaluationNamespace(ConnectorNamespaceEvalRequest connectorNamespaceEvalRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createEvaluationNamespaceRequestBuilder(connectorNamespaceEvalRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createEvaluationNamespace", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } } /** * Create a new short lived evaluation connector namespace * Create a new evaluation connector namespace * @param connectorNamespaceEvalRequest Connector namespace data (required) - * @return a {@code ConnectorNamespace} + * @return CompletableFuture<ApiResponse<ConnectorNamespace>> * @throws ApiException if fails to make API call */ - public ConnectorNamespace createEvaluationNamespace(ConnectorNamespaceEvalRequest connectorNamespaceEvalRequest) throws ApiException { - Object localVarPostBody = connectorNamespaceEvalRequest; - + public CompletableFuture> createEvaluationNamespaceWithHttpInfo(ConnectorNamespaceEvalRequest connectorNamespaceEvalRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createEvaluationNamespaceRequestBuilder(connectorNamespaceEvalRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createEvaluationNamespace", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createEvaluationNamespaceRequestBuilder(ConnectorNamespaceEvalRequest connectorNamespaceEvalRequest) throws ApiException { // verify the required parameter 'connectorNamespaceEvalRequest' is set if (connectorNamespaceEvalRequest == null) { throw new ApiException(400, "Missing the required parameter 'connectorNamespaceEvalRequest' when calling createEvaluationNamespace"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_namespaces/eval".replaceAll("\\{format\\}","json"); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_namespaces/eval"; - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(connectorNamespaceEvalRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get a connector namespace + * Get a connector namespace + * @param connectorNamespaceId The id of the connector namespace (required) + * @return CompletableFuture<ConnectorNamespace> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getConnectorNamespace(String connectorNamespaceId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorNamespaceRequestBuilder(connectorNamespaceId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorNamespace", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Get a connector namespace * Get a connector namespace * @param connectorNamespaceId The id of the connector namespace (required) - * @return a {@code ConnectorNamespace} + * @return CompletableFuture<ApiResponse<ConnectorNamespace>> * @throws ApiException if fails to make API call */ - public ConnectorNamespace getConnectorNamespace(String connectorNamespaceId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> getConnectorNamespaceWithHttpInfo(String connectorNamespaceId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorNamespaceRequestBuilder(connectorNamespaceId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorNamespace", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorNamespaceRequestBuilder(String connectorNamespaceId) throws ApiException { // verify the required parameter 'connectorNamespaceId' is set if (connectorNamespaceId == null) { throw new ApiException(400, "Missing the required parameter 'connectorNamespaceId' when calling getConnectorNamespace"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_namespaces/{connector_namespace_id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_namespace_id" + "\\}", apiClient.escapeString(connectorNamespaceId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_namespaces/{connector_namespace_id}" + .replace("{connector_namespace_id}", ApiClient.urlEncode(connectorNamespaceId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Returns a list of connector namespaces + * Returns a list of connector namespaces + * @param page Page index (optional) + * @param size Number of items in each page (optional) + * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) + * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) + * @return CompletableFuture<ConnectorNamespaceList> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listConnectorNamespaces(String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = listConnectorNamespacesRequestBuilder(page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("listConnectorNamespaces", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Returns a list of connector namespaces * Returns a list of connector namespaces @@ -131,42 +305,68 @@ public ConnectorNamespace getConnectorNamespace(String connectorNamespaceId) thr * @param size Number of items in each page (optional) * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) - * @return a {@code ConnectorNamespaceList} + * @return CompletableFuture<ApiResponse<ConnectorNamespaceList>> * @throws ApiException if fails to make API call */ - public ConnectorNamespaceList listConnectorNamespaces(String page, String size, String orderBy, String search) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_namespaces".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "orderBy", orderBy)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> listConnectorNamespacesWithHttpInfo(String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = listConnectorNamespacesRequestBuilder(page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("listConnectorNamespaces", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listConnectorNamespacesRequestBuilder(String page, String size, String orderBy, String search) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_namespaces"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("orderBy", orderBy)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("search", search)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorServiceApi.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorServiceApi.java index a3f6e532..d39f3dca 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorServiceApi.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorServiceApi.java @@ -1,74 +1,162 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.connector; -import com.openshift.cloud.api.connector.invoker.ApiException; import com.openshift.cloud.api.connector.invoker.ApiClient; -import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; import com.openshift.cloud.api.connector.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.connector.models.VersionMetadata; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +import java.util.concurrent.CompletableFuture; + +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorServiceApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ConnectorServiceApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ConnectorServiceApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public ApiClient getApiClient() { - return apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + /** + * Returns the version metadata + * Returns the version metadata + * @return CompletableFuture<VersionMetadata> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getVersionMetadata() throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getVersionMetadataRequestBuilder(); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getVersionMetadata", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } } /** * Returns the version metadata * Returns the version metadata - * @return a {@code VersionMetadata} + * @return CompletableFuture<ApiResponse<VersionMetadata>> * @throws ApiException if fails to make API call */ - public VersionMetadata getVersionMetadata() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> getVersionMetadataWithHttpInfo() throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getVersionMetadataRequestBuilder(); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getVersionMetadata", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getVersionMetadataRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorTypesApi.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorTypesApi.java index 1594668e..72d09ce1 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorTypesApi.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorTypesApi.java @@ -1,85 +1,206 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.connector; -import com.openshift.cloud.api.connector.invoker.ApiException; import com.openshift.cloud.api.connector.invoker.ApiClient; -import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; import com.openshift.cloud.api.connector.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.connector.models.ConnectorType; import com.openshift.cloud.api.connector.models.ConnectorTypeList; import com.openshift.cloud.api.connector.models.Error; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +import java.util.concurrent.CompletableFuture; + +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorTypesApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ConnectorTypesApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ConnectorTypesApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } /** * Get a connector type by id * Get a connector type by id * @param connectorTypeId The id of the connector type (required) - * @return a {@code ConnectorType} + * @return CompletableFuture<ConnectorType> * @throws ApiException if fails to make API call */ - public ConnectorType getConnectorTypeByID(String connectorTypeId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture getConnectorTypeByID(String connectorTypeId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorTypeByIDRequestBuilder(connectorTypeId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorTypeByID", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get a connector type by id + * Get a connector type by id + * @param connectorTypeId The id of the connector type (required) + * @return CompletableFuture<ApiResponse<ConnectorType>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> getConnectorTypeByIDWithHttpInfo(String connectorTypeId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorTypeByIDRequestBuilder(connectorTypeId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorTypeByID", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorTypeByIDRequestBuilder(String connectorTypeId) throws ApiException { // verify the required parameter 'connectorTypeId' is set if (connectorTypeId == null) { throw new ApiException(400, "Missing the required parameter 'connectorTypeId' when calling getConnectorTypeByID"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_types/{connector_type_id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "connector_type_id" + "\\}", apiClient.escapeString(connectorTypeId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_types/{connector_type_id}" + .replace("{connector_type_id}", ApiClient.urlEncode(connectorTypeId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Returns a list of connector types + * Returns a list of connector types + * @param page Page index (optional) + * @param size Number of items in each page (optional) + * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) + * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) + * @return CompletableFuture<ConnectorTypeList> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getConnectorTypes(String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorTypesRequestBuilder(page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorTypes", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + /** * Returns a list of connector types * Returns a list of connector types @@ -87,42 +208,68 @@ public ConnectorType getConnectorTypeByID(String connectorTypeId) throws ApiExce * @param size Number of items in each page (optional) * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) - * @return a {@code ConnectorTypeList} + * @return CompletableFuture<ApiResponse<ConnectorTypeList>> * @throws ApiException if fails to make API call */ - public ConnectorTypeList getConnectorTypes(String page, String size, String orderBy, String search) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connector_types".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "orderBy", orderBy)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> getConnectorTypesWithHttpInfo(String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorTypesRequestBuilder(page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnectorTypes", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorTypesRequestBuilder(String page, String size, String orderBy, String search) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connector_types"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("orderBy", orderBy)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("search", search)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorsApi.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorsApi.java index 42f2f2a8..7680a69d 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorsApi.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/ConnectorsApi.java @@ -1,40 +1,81 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.connector; -import com.openshift.cloud.api.connector.invoker.ApiException; import com.openshift.cloud.api.connector.invoker.ApiClient; -import com.openshift.cloud.api.connector.invoker.Configuration; +import com.openshift.cloud.api.connector.invoker.ApiException; +import com.openshift.cloud.api.connector.invoker.ApiResponse; import com.openshift.cloud.api.connector.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.connector.models.Connector; import com.openshift.cloud.api.connector.models.ConnectorList; import com.openshift.cloud.api.connector.models.ConnectorRequest; import com.openshift.cloud.api.connector.models.Error; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorsApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ConnectorsApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ConnectorsApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } /** @@ -42,139 +83,327 @@ public void setApiClient(ApiClient apiClient) { * Create a new connector * @param async Perform the action in an asynchronous manner (required) * @param connectorRequest Connector data (required) - * @return a {@code Connector} + * @return CompletableFuture<Connector> * @throws ApiException if fails to make API call */ - public Connector createConnector(Boolean async, ConnectorRequest connectorRequest) throws ApiException { - Object localVarPostBody = connectorRequest; - + public CompletableFuture createConnector(Boolean async, ConnectorRequest connectorRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createConnectorRequestBuilder(async, connectorRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a new connector + * Create a new connector + * @param async Perform the action in an asynchronous manner (required) + * @param connectorRequest Connector data (required) + * @return CompletableFuture<ApiResponse<Connector>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> createConnectorWithHttpInfo(Boolean async, ConnectorRequest connectorRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = createConnectorRequestBuilder(async, connectorRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("createConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder createConnectorRequestBuilder(Boolean async, ConnectorRequest connectorRequest) throws ApiException { // verify the required parameter 'async' is set if (async == null) { throw new ApiException(400, "Missing the required parameter 'async' when calling createConnector"); } - // verify the required parameter 'connectorRequest' is set if (connectorRequest == null) { throw new ApiException(400, "Missing the required parameter 'connectorRequest' when calling createConnector"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connectors".replaceAll("\\{format\\}","json"); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connectors"; - localVarQueryParams.addAll(apiClient.parameterToPairs("", "async", async)); + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("async", async)); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(connectorRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Delete a connector + * Delete a connector + * @param id The ID of record (required) + * @return CompletableFuture<Error> + * @throws ApiException if fails to make API call + */ + public CompletableFuture deleteConnector(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deleteConnectorRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Delete a connector * Delete a connector * @param id The ID of record (required) - * @return a {@code Error} + * @return CompletableFuture<ApiResponse<Error>> * @throws ApiException if fails to make API call */ - public Error deleteConnector(String id) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> deleteConnectorWithHttpInfo(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = deleteConnectorRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("deleteConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder deleteConnectorRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling deleteConnector"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connectors/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/connector_mgmt/v1/kafka_connectors/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get a connector + * Get a connector + * @param id The ID of record (required) + * @return CompletableFuture<Connector> + * @throws ApiException if fails to make API call + */ + public CompletableFuture getConnector(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Get a connector * Get a connector * @param id The ID of record (required) - * @return a {@code Connector} + * @return CompletableFuture<ApiResponse<Connector>> * @throws ApiException if fails to make API call */ - public Connector getConnector(String id) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> getConnectorWithHttpInfo(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = getConnectorRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("getConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder getConnectorRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getConnector"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connectors/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/connector_mgmt/v1/kafka_connectors/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Returns a list of connector types + * Returns a list of connector types + * @param page Page index (optional) + * @param size Number of items in each page (optional) + * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) + * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) + * @return CompletableFuture<ConnectorList> + * @throws ApiException if fails to make API call + */ + public CompletableFuture listConnectors(String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = listConnectorsRequestBuilder(page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("listConnectors", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Returns a list of connector types * Returns a list of connector types @@ -182,92 +411,171 @@ public Connector getConnector(String id) throws ApiException { * @param size Number of items in each page (optional) * @param orderBy Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the `order by` clause of an SQL statement. Each query can be ordered by any of the `ConnectorType` fields. For example, to return all Connector types ordered by their name, use the following syntax: ```sql name asc ``` To return all Connector types ordered by their name _and_ version, use the following syntax: ```sql name asc, version asc ``` If the parameter isn't provided, or if the value is empty, then the results are ordered by name. (optional) * @param search Search criteria. The syntax of this parameter is similar to the syntax of the `where` clause of a SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`. Allowed operators are `<>`, `=`, or `LIKE`. Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query. Examples: To return a Connector Type with the name `aws-sqs-source` and the channel `stable`, use the following syntax: ``` name = aws-sqs-source and channel = stable ```[p-] To return a Kafka instance with a name that starts with `aws`, use the following syntax: ``` name like aws%25 ``` If the parameter isn't provided, or if the value is empty, then all the Connector Type that the user has permission to see are returned. Note. If the query is invalid, an error is returned. (optional) - * @return a {@code ConnectorList} + * @return CompletableFuture<ApiResponse<ConnectorList>> * @throws ApiException if fails to make API call */ - public ConnectorList listConnectors(String page, String size, String orderBy, String search) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connectors".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "orderBy", orderBy)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "Bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> listConnectorsWithHttpInfo(String page, String size, String orderBy, String search) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = listConnectorsRequestBuilder(page, size, orderBy, search); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("listConnectors", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder listConnectorsRequestBuilder(String page, String size, String orderBy, String search) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/connector_mgmt/v1/kafka_connectors"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("orderBy", orderBy)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("search", search)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Patch a connector + * Patch a connector + * @param id The ID of record (required) + * @param body Data to patch the connector with (required) + * @return CompletableFuture<Connector> + * @throws ApiException if fails to make API call + */ + public CompletableFuture patchConnector(String id, Object body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = patchConnectorRequestBuilder(id, body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("patchConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + /** * Patch a connector * Patch a connector * @param id The ID of record (required) * @param body Data to patch the connector with (required) - * @return a {@code Connector} + * @return CompletableFuture<ApiResponse<Connector>> * @throws ApiException if fails to make API call */ - public Connector patchConnector(String id, Object body) throws ApiException { - Object localVarPostBody = body; - + public CompletableFuture> patchConnectorWithHttpInfo(String id, Object body) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = patchConnectorRequestBuilder(id, body); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("patchConnector", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder patchConnectorRequestBuilder(String id, Object body) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling patchConnector"); } - // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing the required parameter 'body' when calling patchConnector"); } - - // create path and map variables - String localVarPath = "/api/connector_mgmt/v1/kafka_connectors/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/api/connector_mgmt/v1/kafka_connectors/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - final String[] localVarContentTypes = { - "application/merge-patch+json", "application/json-patch+json", "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "Bearer" }; + localVarRequestBuilder.header("Content-Type", "application/merge-patch+json"); + localVarRequestBuilder.header("Accept", "application/json"); - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiClient.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiClient.java index 74502ce9..abd58de5 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiClient.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiClient.java @@ -1,738 +1,417 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.connector.invoker; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; + import java.io.InputStream; -import java.io.UnsupportedEncodingException; +import java.net.URI; import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Collection; import java.util.Collections; -import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TimeZone; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.time.OffsetDateTime; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import org.jboss.logging.Logger; -import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.jboss.resteasy.spi.ResteasyProviderFactory; - -import com.openshift.cloud.api.connector.invoker.auth.Authentication; -import com.openshift.cloud.api.connector.invoker.auth.HttpBasicAuth; -import com.openshift.cloud.api.connector.invoker.auth.HttpBearerAuth; -import com.openshift.cloud.api.connector.invoker.auth.ApiKeyAuth; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiClient extends JavaTimeFormatter { - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String basePath = "https://api.openshift.com"; - private boolean debugging = false; - - private Client httpClient; - private JSON json; - private String tempFolderPath = null; - - private Map authentications; - - private int statusCode; - private Map> responseHeaders; - - private DateFormat dateFormat; - - public ApiClient() { - json = new JSON(); - httpClient = buildHttpClient(debugging); - - this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT); - - // Use UTC as the default time zone. - this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - - this.json.setDateFormat((DateFormat) dateFormat.clone()); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/0.1.0/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("Bearer", new HttpBearerAuth("bearer")); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class.

+ * + *

This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe.

+ * + *

The setter methods of this class return the current object to facilitate + * a fluent style of configuration.

+ */ +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiClient { + + private HttpClient.Builder builder; + private ObjectMapper mapper; + private String scheme; + private String host; + private int port; + private String basePath; + private Consumer interceptor; + private Consumer> responseInterceptor; + private Consumer> asyncResponseInterceptor; + private Duration readTimeout; + + private static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); } /** - * Gets the JSON instance to do JSON serialization and deserialization. - * @return the JSON utility class + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. */ - public JSON getJSON() { - return json; - } - - public Client getHttpClient() { - return httpClient; - } - - public ApiClient setHttpClient(Client httpClient) { - this.httpClient = httpClient; - return this; - } - - public String getBasePath() { - return basePath; - } - - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } /** - * Gets the status code of the previous request - * @return the status code of the previous request + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. */ - public int getStatusCode() { - return statusCode; + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); } /** - * Gets the response headers of the previous request - * @return the response headers of the previous request + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. */ - public Map> getResponseHeaders() { - return responseHeaders; - } + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } - /** - * Get authentications (key: authentication name, value: authentication). - * @return the authentications - */ - public Map getAuthentications() { - return authentications; - } + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username the username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password the password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); } - throw new RuntimeException("No HTTP basic authentication configured!"); + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); } /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey the API key + * Ctor. */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; } /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix the API key prefix + * Ctor. */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; } - /** - * Set the User-Agent header's value (by adding to the default header map). - * @param userAgent the User-Agent header value - * @return this {@code ApiClient} - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; + protected ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); + return mapper; } - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return this {@code ApiClient} - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; + protected String getDefaultBaseUri() { + return "https://api.openshift.com"; } - /** - * Check that whether debugging is enabled for this API client. - * @return {@code true} if debugging is enabled for this API client - */ - public boolean isDebugging() { - return debugging; + protected HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); } /** - * Enable/disable debugging for this API client. + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. * - * @param debugging To enable (true) or disable (false) debugging - * @return this {@code ApiClient} + * @param builder Custom client builder. + * @return This object. */ - public ApiClient setDebugging(boolean debugging) { - this.debugging = debugging; - // Rebuild HTTP Client according to the new "debugging" value. - this.httpClient = buildHttpClient(debugging); + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; return this; } /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe.

* - * @return the temporary folder path - * @see createTempFile + * @return The HTTP client. */ - public String getTempFolderPath() { - return tempFolderPath; + public HttpClient getHttpClient() { + return builder.build(); } - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; return this; } /** - * Get the date format used to parse/format date parameters. - * @return the date format used to parse/format date parameters + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. */ - public DateFormat getDateFormat() { - return dateFormat; + public ObjectMapper getObjectMapper() { + return mapper.copy(); } /** - * Set the date format used to parse/format date parameters. - * @param dateFormat a date format used to parse/format date parameters - * @return this {@code ApiClient} + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - // also set the date format for model (de)serialization with Date properties - this.json.setDateFormat((DateFormat) dateFormat.clone()); + public ApiClient setHost(String host) { + this.host = host; return this; } /** - * Parse the given string into Date object. - * @param str a string to parse - * @return a {@code Date} object + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. */ - public Date parseDate(String str) { - try { - return dateFormat.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } + public ApiClient setPort(int port) { + this.port = port; + return this; } /** - * Format the given Date object into string. - * @param date a {@code Date} object to format - * @return the {@code String} version of the {@code Date} object + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. */ - public String formatDate(Date date) { - return dateFormat.format(date); + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; } /** - * Format the given parameter object into string. - * @param param an object to format - * @return the {@code String} version of the object + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /* - Format to {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null) return params; - - Collection valueCollection = null; - if (value instanceof Collection) { - valueCollection = (Collection) value; - } else { - params.add(new Pair(name, parameterToString(value))); - return params; - } - - if (valueCollection.isEmpty()){ - return params; - } - - // get the collection format - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv - - // create the params based on the collection format - if (collectionFormat.equals("multi")) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } - - return params; - } - - String delimiter = ","; - - if (collectionFormat.equals("csv")) { - delimiter = ","; - } else if (collectionFormat.equals("ssv")) { - delimiter = " "; - } else if (collectionFormat.equals("tsv")) { - delimiter = "\t"; - } else if (collectionFormat.equals("pipes")) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - params.add(new Pair(name, sb.substring(1))); - - return params; + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; } /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out.

+ * + *

This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring.

* - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; } /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. + * Get the custom interceptor. * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * JSON will be used. + * @return The custom interceptor that was set, or null if there isn't any. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return "application/json"; - } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - return contentTypes[0]; + public Consumer getRequestInterceptor() { + return interceptor; } /** - * Escape the given string to be used as URL query value. - * @param str a {@code String} to escape - * @return the escaped version of the {@code String} + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; } - /** - * Serialize the given Java object into string entity according the given - * Content-Type (only JSON is supported for now). - * @param obj the object to serialize - * @param formParams the form parameters - * @param contentType the content type - * @return an {@code Entity} - * @throws ApiException on failure to serialize + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. */ - public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { - Entity entity = null; - if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); - //MultiPart multiPart = new MultiPart(); - for (Entry param: formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } catch (FileNotFoundException e) { - throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); - } - } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } - } - entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); - } else if (contentType.startsWith("application/x-www-form-urlencoded")) { - Form form = new Form(); - for (Entry param: formParams.entrySet()) { - form.param(param.getKey(), parameterToString(param.getValue())); - } - entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); - } else { - // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); - } - return entity; + public Consumer> getResponseInterceptor() { + return responseInterceptor; } /** - * Deserialize response body to Java object according to the Content-Type. - * @param a Java type parameter - * @param response the response body to deserialize - * @param returnType a Java type to deserialize into - * @return a deserialized Java object - * @throws ApiException on failure to deserialize + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public T deserialize(Response response, GenericType returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - return (T) response.readEntity(byte[].class); - } else if (returnType.equals(File.class)) { - // Handle file downloading. - @SuppressWarnings("unchecked") - T file = (T) downloadFileFromResponse(response); - return file; - } - - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - if (contentType == null) - throw new ApiException(500, "missing Content-Type in response"); - - return response.readEntity(returnType); + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; } - /** - * Download file from the given response. - * @param response a response - * @return a file from the given response - * @throws ApiException If fail to read file content from response and write to disk + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - Files.copy(response.readEntity(InputStream.class), file.toPath()); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) - filename = matcher.group(1); - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; } /** - * Invoke API by sending HTTP request with the given options. + * Set the read timeout for the http client. * - * @param a Java type parameter - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param accept The request's Accept header - * @param contentType The request's Content-Type header - * @param authNames The authentications to apply - * @param returnType The return type into which to deserialize the response - * @return The response body in type of string - * @throws ApiException if the invocation failed - */ - public T invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - - // Not using `.target(this.basePath).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" - WebTarget target = httpClient.target(this.basePath + path); - - if (queryParams != null) { - for (Pair queryParam : queryParams) { - if (queryParam.getValue() != null) { - target = target.queryParam(queryParam.getName(), queryParam.getValue()); - } - } - } - - Invocation.Builder invocationBuilder = target.request().accept(accept); - - for (Entry headerParamsEntry : headerParams.entrySet()) { - String value = headerParamsEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(headerParamsEntry.getKey(), value); - } - } - - for (Entry defaultHeaderEntry: defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(defaultHeaderEntry.getKey())) { - String value = defaultHeaderEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(defaultHeaderEntry.getKey(), value); - } - } - } - - for (Entry cookieParamsEntry : cookieParams.entrySet()) { - String value = cookieParamsEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(cookieParamsEntry.getKey(), value); - } - } - - for (Entry defaultCookieEntry: defaultHeaderMap.entrySet()) { - if (!cookieParams.containsKey(defaultCookieEntry.getKey())) { - String value = defaultCookieEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(defaultCookieEntry.getKey(), value); - } - } - } - - Entity entity = serialize(body, formParams, contentType); - - Response response = null; - - if ("GET".equals(method)) { - response = invocationBuilder.get(); - } else if ("POST".equals(method)) { - response = invocationBuilder.post(entity); - } else if ("PUT".equals(method)) { - response = invocationBuilder.put(entity); - } else if ("DELETE".equals(method)) { - response = invocationBuilder.method("DELETE", entity); - } else if ("PATCH".equals(method)) { - response = invocationBuilder.method("PATCH", entity); - } else if ("HEAD".equals(method)) { - response = invocationBuilder.head(); - } else if ("OPTIONS".equals(method)) { - response = invocationBuilder.options(); - } else if ("TRACE".equals(method)) { - response = invocationBuilder.trace(); - } else { - throw new ApiException(500, "unknown method type " + method); - } - - statusCode = response.getStatusInfo().getStatusCode(); - responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return null; - } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { - if (returnType == null) - return null; - else - return deserialize(response, returnType); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } - } - - /** - * Build the Client used to make HTTP requests. + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. */ - private Client buildHttpClient(boolean debugging) { - final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance()); - clientConfig.register(json); - if(debugging){ - clientConfig.register(Logger.class); - } - return ClientBuilder.newClient(clientConfig); - } - private Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); - for (Entry> entry: response.getHeaders().entrySet()) { - List values = entry.getValue(); - List headers = new ArrayList(); - for (Object o : values) { - headers.add(String.valueOf(o)); - } - responseHeaders.put(entry.getKey(), headers); - } - return responseHeaders; + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; } /** - * Update query and header parameters based on authentication settings. + * Get the read timeout that was set. * - * @param authNames The authentications to apply + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. */ - private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams, cookieParams); - } + public Duration getReadTimeout() { + return readTimeout; } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiException.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiException.java index a0a0200d..607ed9f3 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiException.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiException.java @@ -13,13 +13,12 @@ package com.openshift.cloud.api.connector.invoker; -import java.util.Map; -import java.util.List; +import java.net.http.HttpHeaders; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; - private Map> responseHeaders = null; + private HttpHeaders responseHeaders = null; private String responseBody = null; public ApiException() {} @@ -32,22 +31,22 @@ public ApiException(String message) { super(message); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { this(message, throwable, code, responseHeaders, null); } - public ApiException(int code, Map> responseHeaders, String responseBody) { + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { this((String) null, (Throwable) null, code, responseHeaders, responseBody); } @@ -56,7 +55,7 @@ public ApiException(int code, String message) { this.code = code; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; @@ -74,9 +73,9 @@ public int getCode() { /** * Get the HTTP response headers. * - * @return A map of list of string + * @return Headers as an HttpHeaders object */ - public Map> getResponseHeaders() { + public HttpHeaders getResponseHeaders() { return responseHeaders; } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiResponse.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiResponse.java new file mode 100644 index 00000000..07586d71 --- /dev/null +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/ApiResponse.java @@ -0,0 +1,59 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.openshift.cloud.api.connector.invoker; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Configuration.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Configuration.java index 52372422..e5126eec 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Configuration.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Configuration.java @@ -13,7 +13,7 @@ package com.openshift.cloud.api.connector.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JSON.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JSON.java index 0e06f685..d256ed5e 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JSON.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JSON.java @@ -3,40 +3,238 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import org.openapitools.jackson.nullable.JsonNullableModule; -import com.fasterxml.jackson.datatype.jsr310.*; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.openshift.cloud.api.connector.models.*; import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; -import javax.ws.rs.ext.ContextResolver; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class JSON implements ContextResolver { +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JSON { private ObjectMapper mapper; public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); - mapper.registerModule(new JavaTimeModule()); } /** * Set the date format for JSON (de)serialization with Date properties. - * @param dateFormat the date format to set + * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { mapper.setDateFormat(dateFormat); } - @Override - public ObjectMapper getContext(Class type) { - return mapper; + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JavaTimeFormatter.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JavaTimeFormatter.java deleted file mode 100644 index 2a8c25d0..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/JavaTimeFormatter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Connector Management API - * Connector Management API is a REST API to manage connectors. - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.openshift.cloud.api.connector.invoker; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - -/** - * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. - * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class JavaTimeFormatter { - - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } - - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; - } - - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Pair.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Pair.java index 68684ea9..83d28957 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Pair.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/Pair.java @@ -13,7 +13,7 @@ package com.openshift.cloud.api.connector.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pair { private String name = ""; private String value = ""; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/StringUtil.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/StringUtil.java deleted file mode 100644 index ff09aed9..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/StringUtil.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Connector Management API - * Connector Management API is a REST API to manage connectors. - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.connector.invoker; - -import java.util.Collection; -import java.util.Iterator; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/ApiKeyAuth.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/ApiKeyAuth.java deleted file mode 100644 index d94e9ce4..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/ApiKeyAuth.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Connector Management API - * Connector Management API is a REST API to manage connectors. - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.connector.invoker.auth; - -import com.openshift.cloud.api.connector.invoker.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/Authentication.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/Authentication.java deleted file mode 100644 index 344553dd..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/Authentication.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Connector Management API - * Connector Management API is a REST API to manage connectors. - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.connector.invoker.auth; - -import com.openshift.cloud.api.connector.invoker.Pair; - -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); -} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/HttpBasicAuth.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/HttpBasicAuth.java deleted file mode 100644 index 288c3e67..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/HttpBasicAuth.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Connector Management API - * Connector Management API is a REST API to manage connectors. - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.connector.invoker.auth; - -import com.openshift.cloud.api.connector.invoker.Pair; - -import java.util.Base64; -import java.nio.charset.StandardCharsets; - -import java.util.Map; -import java.util.List; - - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if (username == null && password == null) { - return; - } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); - } -} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/HttpBearerAuth.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/HttpBearerAuth.java deleted file mode 100644 index a8f1939a..00000000 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/invoker/auth/HttpBearerAuth.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Connector Management API - * Connector Management API is a REST API to manage connectors. - * - * The version of the OpenAPI document: 0.1.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.connector.invoker.auth; - -import com.openshift.cloud.api.connector.invoker.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AbstractOpenApiSchema.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AbstractOpenApiSchema.java new file mode 100644 index 00000000..8740696f --- /dev/null +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AbstractOpenApiSchema.java @@ -0,0 +1,148 @@ +/* + * Connector Management API + * Connector Management API is a REST API to manage connectors. + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.openshift.cloud.api.connector.models; + +import com.openshift.cloud.api.connector.invoker.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AddonParameter.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AddonParameter.java index 363b7319..80368543 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AddonParameter.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/AddonParameter.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * A addon parameter @@ -33,8 +35,7 @@ AddonParameter.JSON_PROPERTY_ID, AddonParameter.JSON_PROPERTY_VALUE }) -@JsonTypeName("AddonParameter") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AddonParameter { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -46,7 +47,6 @@ public AddonParameter() { } public AddonParameter id(String id) { - this.id = id; return this; } @@ -73,7 +73,6 @@ public void setId(String id) { public AddonParameter value(String value) { - this.value = value; return this; } @@ -99,6 +98,9 @@ public void setValue(String value) { } + /** + * Return true if this AddonParameter object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Channel.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Channel.java index 77c31b3b..8b35b243 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Channel.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Channel.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Connector.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Connector.java index 2627a010..52911306 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Connector.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Connector.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -34,7 +36,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Connector @@ -58,8 +60,7 @@ Connector.JSON_PROPERTY_CONNECTOR, Connector.JSON_PROPERTY_STATUS }) -@JsonTypeName("Connector") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Connector { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -116,7 +117,6 @@ public Connector() { } public Connector id(String id) { - this.id = id; return this; } @@ -143,7 +143,6 @@ public void setId(String id) { public Connector kind(String kind) { - this.kind = kind; return this; } @@ -170,7 +169,6 @@ public void setKind(String kind) { public Connector href(String href) { - this.href = href; return this; } @@ -197,7 +195,6 @@ public void setHref(String href) { public Connector owner(String owner) { - this.owner = owner; return this; } @@ -224,7 +221,6 @@ public void setOwner(String owner) { public Connector createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -251,7 +247,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public Connector modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -278,7 +273,6 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { public Connector name(String name) { - this.name = name; return this; } @@ -305,7 +299,6 @@ public void setName(String name) { public Connector connectorTypeId(String connectorTypeId) { - this.connectorTypeId = connectorTypeId; return this; } @@ -332,7 +325,6 @@ public void setConnectorTypeId(String connectorTypeId) { public Connector namespaceId(String namespaceId) { - this.namespaceId = namespaceId; return this; } @@ -359,7 +351,6 @@ public void setNamespaceId(String namespaceId) { public Connector channel(Channel channel) { - this.channel = channel; return this; } @@ -386,7 +377,6 @@ public void setChannel(Channel channel) { public Connector desiredState(ConnectorDesiredState desiredState) { - this.desiredState = desiredState; return this; } @@ -413,7 +403,6 @@ public void setDesiredState(ConnectorDesiredState desiredState) { public Connector resourceVersion(Long resourceVersion) { - this.resourceVersion = resourceVersion; return this; } @@ -440,7 +429,6 @@ public void setResourceVersion(Long resourceVersion) { public Connector kafka(KafkaConnectionSettings kafka) { - this.kafka = kafka; return this; } @@ -467,7 +455,6 @@ public void setKafka(KafkaConnectionSettings kafka) { public Connector serviceAccount(ServiceAccount serviceAccount) { - this.serviceAccount = serviceAccount; return this; } @@ -494,7 +481,6 @@ public void setServiceAccount(ServiceAccount serviceAccount) { public Connector schemaRegistry(SchemaRegistryConnectionSettings schemaRegistry) { - this.schemaRegistry = schemaRegistry; return this; } @@ -521,7 +507,6 @@ public void setSchemaRegistry(SchemaRegistryConnectionSettings schemaRegistry) { public Connector connector(Object connector) { - this.connector = connector; return this; } @@ -548,7 +533,6 @@ public void setConnector(Object connector) { public Connector status(ConnectorStatusStatus status) { - this.status = status; return this; } @@ -574,6 +558,9 @@ public void setStatus(ConnectorStatusStatus status) { } + /** + * Return true if this Connector object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorCluster.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorCluster.java index 6b60d233..e47b6a45 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorCluster.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorCluster.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,7 +30,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorCluster @@ -43,8 +45,7 @@ ConnectorCluster.JSON_PROPERTY_NAME, ConnectorCluster.JSON_PROPERTY_STATUS }) -@JsonTypeName("ConnectorCluster") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorCluster { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -74,7 +75,6 @@ public ConnectorCluster() { } public ConnectorCluster id(String id) { - this.id = id; return this; } @@ -101,7 +101,6 @@ public void setId(String id) { public ConnectorCluster kind(String kind) { - this.kind = kind; return this; } @@ -128,7 +127,6 @@ public void setKind(String kind) { public ConnectorCluster href(String href) { - this.href = href; return this; } @@ -155,7 +153,6 @@ public void setHref(String href) { public ConnectorCluster owner(String owner) { - this.owner = owner; return this; } @@ -182,7 +179,6 @@ public void setOwner(String owner) { public ConnectorCluster createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -209,7 +205,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public ConnectorCluster modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -236,7 +231,6 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { public ConnectorCluster name(String name) { - this.name = name; return this; } @@ -263,7 +257,6 @@ public void setName(String name) { public ConnectorCluster status(ConnectorClusterStatusStatus status) { - this.status = status; return this; } @@ -289,6 +282,9 @@ public void setStatus(ConnectorClusterStatusStatus status) { } + /** + * Return true if this ConnectorCluster object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterList.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterList.java index 99229a5b..80a16a36 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterList.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterList.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,7 +30,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorClusterList @@ -40,8 +42,7 @@ ConnectorClusterList.JSON_PROPERTY_TOTAL, ConnectorClusterList.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorClusterList") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterList { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -62,7 +63,6 @@ public ConnectorClusterList() { } public ConnectorClusterList kind(String kind) { - this.kind = kind; return this; } @@ -89,7 +89,6 @@ public void setKind(String kind) { public ConnectorClusterList page(Integer page) { - this.page = page; return this; } @@ -116,7 +115,6 @@ public void setPage(Integer page) { public ConnectorClusterList size(Integer size) { - this.size = size; return this; } @@ -143,7 +141,6 @@ public void setSize(Integer size) { public ConnectorClusterList total(Integer total) { - this.total = total; return this; } @@ -170,7 +167,6 @@ public void setTotal(Integer total) { public ConnectorClusterList items(List items) { - this.items = items; return this; } @@ -201,6 +197,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorClusterList object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterListAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterListAllOf.java index e5b73e29..d9be488b 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterListAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterListAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorClusterListAllOf @@ -34,8 +36,7 @@ @JsonPropertyOrder({ ConnectorClusterListAllOf.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorClusterList_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterListAllOf { public static final String JSON_PROPERTY_ITEMS = "items"; private List items = null; @@ -44,7 +45,6 @@ public ConnectorClusterListAllOf() { } public ConnectorClusterListAllOf items(List items) { - this.items = items; return this; } @@ -78,6 +78,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorClusterList_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterMeta.java index 0bffb425..725ccd51 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorClusterMeta @@ -37,8 +39,7 @@ ConnectorClusterMeta.JSON_PROPERTY_MODIFIED_AT, ConnectorClusterMeta.JSON_PROPERTY_NAME }) -@JsonTypeName("ConnectorClusterMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterMeta { public static final String JSON_PROPERTY_OWNER = "owner"; private String owner; @@ -56,7 +57,6 @@ public ConnectorClusterMeta() { } public ConnectorClusterMeta owner(String owner) { - this.owner = owner; return this; } @@ -83,7 +83,6 @@ public void setOwner(String owner) { public ConnectorClusterMeta createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -110,7 +109,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public ConnectorClusterMeta modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -137,7 +135,6 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { public ConnectorClusterMeta name(String name) { - this.name = name; return this; } @@ -163,6 +160,9 @@ public void setName(String name) { } + /** + * Return true if this ConnectorClusterMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequest.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequest.java index 1f0b581d..dd8e7ec5 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequest.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Schema for the request to update a data plane cluster's name @@ -33,8 +35,7 @@ @JsonPropertyOrder({ ConnectorClusterRequest.JSON_PROPERTY_NAME }) -@JsonTypeName("ConnectorClusterRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -43,7 +44,6 @@ public ConnectorClusterRequest() { } public ConnectorClusterRequest name(String name) { - this.name = name; return this; } @@ -69,6 +69,9 @@ public void setName(String name) { } + /** + * Return true if this ConnectorClusterRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequestMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequestMeta.java index 3c55ed51..0b44ca1b 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequestMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterRequestMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorClusterRequestMeta @@ -31,8 +33,7 @@ @JsonPropertyOrder({ ConnectorClusterRequestMeta.JSON_PROPERTY_NAME }) -@JsonTypeName("ConnectorClusterRequestMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterRequestMeta { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -41,7 +42,6 @@ public ConnectorClusterRequestMeta() { } public ConnectorClusterRequestMeta name(String name) { - this.name = name; return this; } @@ -67,6 +67,9 @@ public void setName(String name) { } + /** + * Return true if this ConnectorClusterRequestMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterState.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterState.java index 54787299..fd716931 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterState.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterState.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatus.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatus.java index 3f9addac..b3d17089 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatus.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatus.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorClusterStatus @@ -32,8 +34,7 @@ @JsonPropertyOrder({ ConnectorClusterStatus.JSON_PROPERTY_STATUS }) -@JsonTypeName("ConnectorClusterStatus") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterStatus { public static final String JSON_PROPERTY_STATUS = "status"; private ConnectorClusterStatusStatus status; @@ -42,7 +43,6 @@ public ConnectorClusterStatus() { } public ConnectorClusterStatus status(ConnectorClusterStatusStatus status) { - this.status = status; return this; } @@ -68,6 +68,9 @@ public void setStatus(ConnectorClusterStatusStatus status) { } + /** + * Return true if this ConnectorClusterStatus object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatusStatus.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatusStatus.java index e058f06c..e1db9584 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatusStatus.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorClusterStatusStatus.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorClusterStatusStatus @@ -33,8 +35,7 @@ ConnectorClusterStatusStatus.JSON_PROPERTY_STATE, ConnectorClusterStatusStatus.JSON_PROPERTY_ERROR }) -@JsonTypeName("ConnectorClusterStatus_status") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorClusterStatusStatus { public static final String JSON_PROPERTY_STATE = "state"; private ConnectorClusterState state; @@ -46,7 +47,6 @@ public ConnectorClusterStatusStatus() { } public ConnectorClusterStatusStatus state(ConnectorClusterState state) { - this.state = state; return this; } @@ -73,7 +73,6 @@ public void setState(ConnectorClusterState state) { public ConnectorClusterStatusStatus error(String error) { - this.error = error; return this; } @@ -99,6 +98,9 @@ public void setError(String error) { } + /** + * Return true if this ConnectorClusterStatus_status object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorConfiguration.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorConfiguration.java index 8f586d1b..6fa0411c 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorConfiguration.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorConfiguration.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorConfiguration @@ -37,8 +39,7 @@ ConnectorConfiguration.JSON_PROPERTY_SCHEMA_REGISTRY, ConnectorConfiguration.JSON_PROPERTY_CONNECTOR }) -@JsonTypeName("ConnectorConfiguration") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorConfiguration { public static final String JSON_PROPERTY_KAFKA = "kafka"; private KafkaConnectionSettings kafka; @@ -56,7 +57,6 @@ public ConnectorConfiguration() { } public ConnectorConfiguration kafka(KafkaConnectionSettings kafka) { - this.kafka = kafka; return this; } @@ -83,7 +83,6 @@ public void setKafka(KafkaConnectionSettings kafka) { public ConnectorConfiguration serviceAccount(ServiceAccount serviceAccount) { - this.serviceAccount = serviceAccount; return this; } @@ -110,7 +109,6 @@ public void setServiceAccount(ServiceAccount serviceAccount) { public ConnectorConfiguration schemaRegistry(SchemaRegistryConnectionSettings schemaRegistry) { - this.schemaRegistry = schemaRegistry; return this; } @@ -137,7 +135,6 @@ public void setSchemaRegistry(SchemaRegistryConnectionSettings schemaRegistry) { public ConnectorConfiguration connector(Object connector) { - this.connector = connector; return this; } @@ -163,6 +160,9 @@ public void setConnector(Object connector) { } + /** + * Return true if this ConnectorConfiguration object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorDesiredState.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorDesiredState.java index 69d0e3bf..390bcbe4 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorDesiredState.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorDesiredState.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorList.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorList.java index faf33db0..dd521f3b 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorList.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorList.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,7 +30,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorList @@ -40,8 +42,7 @@ ConnectorList.JSON_PROPERTY_TOTAL, ConnectorList.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorList") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorList { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -62,7 +63,6 @@ public ConnectorList() { } public ConnectorList kind(String kind) { - this.kind = kind; return this; } @@ -89,7 +89,6 @@ public void setKind(String kind) { public ConnectorList page(Integer page) { - this.page = page; return this; } @@ -116,7 +115,6 @@ public void setPage(Integer page) { public ConnectorList size(Integer size) { - this.size = size; return this; } @@ -143,7 +141,6 @@ public void setSize(Integer size) { public ConnectorList total(Integer total) { - this.total = total; return this; } @@ -170,7 +167,6 @@ public void setTotal(Integer total) { public ConnectorList items(List items) { - this.items = items; return this; } @@ -201,6 +197,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorList object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorListAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorListAllOf.java index 28c73511..cb8dd527 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorListAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorListAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorListAllOf @@ -34,8 +36,7 @@ @JsonPropertyOrder({ ConnectorListAllOf.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorList_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorListAllOf { public static final String JSON_PROPERTY_ITEMS = "items"; private List items = null; @@ -44,7 +45,6 @@ public ConnectorListAllOf() { } public ConnectorListAllOf items(List items) { - this.items = items; return this; } @@ -78,6 +78,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorList_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMeta.java index c36998ab..dd9103c0 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -29,7 +31,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorMeta @@ -45,8 +47,7 @@ ConnectorMeta.JSON_PROPERTY_DESIRED_STATE, ConnectorMeta.JSON_PROPERTY_RESOURCE_VERSION }) -@JsonTypeName("ConnectorMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorMeta { public static final String JSON_PROPERTY_OWNER = "owner"; private String owner; @@ -79,7 +80,6 @@ public ConnectorMeta() { } public ConnectorMeta owner(String owner) { - this.owner = owner; return this; } @@ -106,7 +106,6 @@ public void setOwner(String owner) { public ConnectorMeta createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -133,7 +132,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public ConnectorMeta modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -160,7 +158,6 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { public ConnectorMeta name(String name) { - this.name = name; return this; } @@ -187,7 +184,6 @@ public void setName(String name) { public ConnectorMeta connectorTypeId(String connectorTypeId) { - this.connectorTypeId = connectorTypeId; return this; } @@ -214,7 +210,6 @@ public void setConnectorTypeId(String connectorTypeId) { public ConnectorMeta namespaceId(String namespaceId) { - this.namespaceId = namespaceId; return this; } @@ -241,7 +236,6 @@ public void setNamespaceId(String namespaceId) { public ConnectorMeta channel(Channel channel) { - this.channel = channel; return this; } @@ -268,7 +262,6 @@ public void setChannel(Channel channel) { public ConnectorMeta desiredState(ConnectorDesiredState desiredState) { - this.desiredState = desiredState; return this; } @@ -295,7 +288,6 @@ public void setDesiredState(ConnectorDesiredState desiredState) { public ConnectorMeta resourceVersion(Long resourceVersion) { - this.resourceVersion = resourceVersion; return this; } @@ -321,6 +313,9 @@ public void setResourceVersion(Long resourceVersion) { } + /** + * Return true if this ConnectorMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMetaAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMetaAllOf.java index 8cee279a..b15eaed2 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMetaAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorMetaAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorMetaAllOf @@ -31,8 +33,7 @@ @JsonPropertyOrder({ ConnectorMetaAllOf.JSON_PROPERTY_RESOURCE_VERSION }) -@JsonTypeName("ConnectorMeta_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorMetaAllOf { public static final String JSON_PROPERTY_RESOURCE_VERSION = "resource_version"; private Long resourceVersion; @@ -41,7 +42,6 @@ public ConnectorMetaAllOf() { } public ConnectorMetaAllOf resourceVersion(Long resourceVersion) { - this.resourceVersion = resourceVersion; return this; } @@ -67,6 +67,9 @@ public void setResourceVersion(Long resourceVersion) { } + /** + * Return true if this ConnectorMeta_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespace.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespace.java index 62a77250..49a286ad 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespace.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespace.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,7 +35,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * A connector namespace @@ -55,8 +57,7 @@ ConnectorNamespace.JSON_PROPERTY_TENANT, ConnectorNamespace.JSON_PROPERTY_STATUS }) -@JsonTypeName("ConnectorNamespace") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespace { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -104,7 +105,6 @@ public ConnectorNamespace() { } public ConnectorNamespace id(String id) { - this.id = id; return this; } @@ -131,7 +131,6 @@ public void setId(String id) { public ConnectorNamespace kind(String kind) { - this.kind = kind; return this; } @@ -158,7 +157,6 @@ public void setKind(String kind) { public ConnectorNamespace href(String href) { - this.href = href; return this; } @@ -185,7 +183,6 @@ public void setHref(String href) { public ConnectorNamespace owner(String owner) { - this.owner = owner; return this; } @@ -212,7 +209,6 @@ public void setOwner(String owner) { public ConnectorNamespace createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -239,7 +235,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public ConnectorNamespace modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -266,7 +261,6 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { public ConnectorNamespace name(String name) { - this.name = name; return this; } @@ -293,7 +287,6 @@ public void setName(String name) { public ConnectorNamespace annotations(Map annotations) { - this.annotations = annotations; return this; } @@ -328,7 +321,6 @@ public void setAnnotations(Map annotations) { public ConnectorNamespace resourceVersion(Long resourceVersion) { - this.resourceVersion = resourceVersion; return this; } @@ -355,7 +347,6 @@ public void setResourceVersion(Long resourceVersion) { public ConnectorNamespace quota(ConnectorNamespaceQuota quota) { - this.quota = quota; return this; } @@ -382,7 +373,6 @@ public void setQuota(ConnectorNamespaceQuota quota) { public ConnectorNamespace clusterId(String clusterId) { - this.clusterId = clusterId; return this; } @@ -409,7 +399,6 @@ public void setClusterId(String clusterId) { public ConnectorNamespace expiration(String expiration) { - this.expiration = expiration; return this; } @@ -436,7 +425,6 @@ public void setExpiration(String expiration) { public ConnectorNamespace tenant(ConnectorNamespaceTenant tenant) { - this.tenant = tenant; return this; } @@ -463,7 +451,6 @@ public void setTenant(ConnectorNamespaceTenant tenant) { public ConnectorNamespace status(ConnectorNamespaceStatus status) { - this.status = status; return this; } @@ -489,6 +476,9 @@ public void setStatus(ConnectorNamespaceStatus status) { } + /** + * Return true if this ConnectorNamespace object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceAllOf.java index ed034c44..7e611875 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -25,7 +27,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceAllOf @@ -37,8 +39,7 @@ ConnectorNamespaceAllOf.JSON_PROPERTY_TENANT, ConnectorNamespaceAllOf.JSON_PROPERTY_STATUS }) -@JsonTypeName("ConnectorNamespace_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceAllOf { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -59,7 +60,6 @@ public ConnectorNamespaceAllOf() { } public ConnectorNamespaceAllOf name(String name) { - this.name = name; return this; } @@ -86,7 +86,6 @@ public void setName(String name) { public ConnectorNamespaceAllOf clusterId(String clusterId) { - this.clusterId = clusterId; return this; } @@ -113,7 +112,6 @@ public void setClusterId(String clusterId) { public ConnectorNamespaceAllOf expiration(String expiration) { - this.expiration = expiration; return this; } @@ -140,7 +138,6 @@ public void setExpiration(String expiration) { public ConnectorNamespaceAllOf tenant(ConnectorNamespaceTenant tenant) { - this.tenant = tenant; return this; } @@ -167,7 +164,6 @@ public void setTenant(ConnectorNamespaceTenant tenant) { public ConnectorNamespaceAllOf status(ConnectorNamespaceStatus status) { - this.status = status; return this; } @@ -193,6 +189,9 @@ public void setStatus(ConnectorNamespaceStatus status) { } + /** + * Return true if this ConnectorNamespace_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceEvalRequest.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceEvalRequest.java index 4d9133e8..b96070fa 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceEvalRequest.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceEvalRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -27,7 +29,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * An evaluation connector namespace create request @@ -37,8 +39,7 @@ ConnectorNamespaceEvalRequest.JSON_PROPERTY_NAME, ConnectorNamespaceEvalRequest.JSON_PROPERTY_ANNOTATIONS }) -@JsonTypeName("ConnectorNamespaceEvalRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceEvalRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -50,7 +51,6 @@ public ConnectorNamespaceEvalRequest() { } public ConnectorNamespaceEvalRequest name(String name) { - this.name = name; return this; } @@ -77,7 +77,6 @@ public void setName(String name) { public ConnectorNamespaceEvalRequest annotations(Map annotations) { - this.annotations = annotations; return this; } @@ -111,6 +110,9 @@ public void setAnnotations(Map annotations) { } + /** + * Return true if this ConnectorNamespaceEvalRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceList.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceList.java index da800364..807c3a38 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceList.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceList.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,7 +30,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceList @@ -40,8 +42,7 @@ ConnectorNamespaceList.JSON_PROPERTY_TOTAL, ConnectorNamespaceList.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorNamespaceList") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceList { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -62,7 +63,6 @@ public ConnectorNamespaceList() { } public ConnectorNamespaceList kind(String kind) { - this.kind = kind; return this; } @@ -89,7 +89,6 @@ public void setKind(String kind) { public ConnectorNamespaceList page(Integer page) { - this.page = page; return this; } @@ -116,7 +115,6 @@ public void setPage(Integer page) { public ConnectorNamespaceList size(Integer size) { - this.size = size; return this; } @@ -143,7 +141,6 @@ public void setSize(Integer size) { public ConnectorNamespaceList total(Integer total) { - this.total = total; return this; } @@ -170,7 +167,6 @@ public void setTotal(Integer total) { public ConnectorNamespaceList items(List items) { - this.items = items; return this; } @@ -201,6 +197,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorNamespaceList object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceListAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceListAllOf.java index 6bee3f21..bfcbba81 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceListAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceListAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceListAllOf @@ -34,8 +36,7 @@ @JsonPropertyOrder({ ConnectorNamespaceListAllOf.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorNamespaceList_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceListAllOf { public static final String JSON_PROPERTY_ITEMS = "items"; private List items = null; @@ -44,7 +45,6 @@ public ConnectorNamespaceListAllOf() { } public ConnectorNamespaceListAllOf items(List items) { - this.items = items; return this; } @@ -78,6 +78,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorNamespaceList_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMeta.java index 9b1fb2ce..1f490cec 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -31,7 +33,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceMeta @@ -45,8 +47,7 @@ ConnectorNamespaceMeta.JSON_PROPERTY_RESOURCE_VERSION, ConnectorNamespaceMeta.JSON_PROPERTY_QUOTA }) -@JsonTypeName("ConnectorNamespaceMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceMeta { public static final String JSON_PROPERTY_OWNER = "owner"; private String owner; @@ -73,7 +74,6 @@ public ConnectorNamespaceMeta() { } public ConnectorNamespaceMeta owner(String owner) { - this.owner = owner; return this; } @@ -100,7 +100,6 @@ public void setOwner(String owner) { public ConnectorNamespaceMeta createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -127,7 +126,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public ConnectorNamespaceMeta modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -154,7 +152,6 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { public ConnectorNamespaceMeta name(String name) { - this.name = name; return this; } @@ -181,7 +178,6 @@ public void setName(String name) { public ConnectorNamespaceMeta annotations(Map annotations) { - this.annotations = annotations; return this; } @@ -216,7 +212,6 @@ public void setAnnotations(Map annotations) { public ConnectorNamespaceMeta resourceVersion(Long resourceVersion) { - this.resourceVersion = resourceVersion; return this; } @@ -243,7 +238,6 @@ public void setResourceVersion(Long resourceVersion) { public ConnectorNamespaceMeta quota(ConnectorNamespaceQuota quota) { - this.quota = quota; return this; } @@ -269,6 +263,9 @@ public void setQuota(ConnectorNamespaceQuota quota) { } + /** + * Return true if this ConnectorNamespaceMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMetaAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMetaAllOf.java index e1f26209..7c5d488c 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMetaAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceMetaAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceMetaAllOf @@ -33,8 +35,7 @@ ConnectorNamespaceMetaAllOf.JSON_PROPERTY_RESOURCE_VERSION, ConnectorNamespaceMetaAllOf.JSON_PROPERTY_QUOTA }) -@JsonTypeName("ConnectorNamespaceMeta_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceMetaAllOf { public static final String JSON_PROPERTY_RESOURCE_VERSION = "resource_version"; private Long resourceVersion; @@ -46,7 +47,6 @@ public ConnectorNamespaceMetaAllOf() { } public ConnectorNamespaceMetaAllOf resourceVersion(Long resourceVersion) { - this.resourceVersion = resourceVersion; return this; } @@ -73,7 +73,6 @@ public void setResourceVersion(Long resourceVersion) { public ConnectorNamespaceMetaAllOf quota(ConnectorNamespaceQuota quota) { - this.quota = quota; return this; } @@ -99,6 +98,9 @@ public void setQuota(ConnectorNamespaceQuota quota) { } + /** + * Return true if this ConnectorNamespaceMeta_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespacePatchRequest.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespacePatchRequest.java index 21c95e30..38449e6f 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespacePatchRequest.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespacePatchRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -27,7 +29,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * A connector namespace patch request @@ -37,8 +39,7 @@ ConnectorNamespacePatchRequest.JSON_PROPERTY_NAME, ConnectorNamespacePatchRequest.JSON_PROPERTY_ANNOTATIONS }) -@JsonTypeName("ConnectorNamespacePatchRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespacePatchRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -50,7 +51,6 @@ public ConnectorNamespacePatchRequest() { } public ConnectorNamespacePatchRequest name(String name) { - this.name = name; return this; } @@ -77,7 +77,6 @@ public void setName(String name) { public ConnectorNamespacePatchRequest annotations(Map annotations) { - this.annotations = annotations; return this; } @@ -111,6 +110,9 @@ public void setAnnotations(Map annotations) { } + /** + * Return true if this ConnectorNamespacePatchRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceQuota.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceQuota.java index 9847d4d6..ab834fb1 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceQuota.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceQuota.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceQuota @@ -35,8 +37,7 @@ ConnectorNamespaceQuota.JSON_PROPERTY_CPU_REQUESTS, ConnectorNamespaceQuota.JSON_PROPERTY_CPU_LIMITS }) -@JsonTypeName("ConnectorNamespaceQuota") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceQuota { public static final String JSON_PROPERTY_CONNECTORS = "connectors"; private Integer connectors; @@ -57,7 +58,6 @@ public ConnectorNamespaceQuota() { } public ConnectorNamespaceQuota connectors(Integer connectors) { - this.connectors = connectors; return this; } @@ -84,7 +84,6 @@ public void setConnectors(Integer connectors) { public ConnectorNamespaceQuota memoryRequests(String memoryRequests) { - this.memoryRequests = memoryRequests; return this; } @@ -111,7 +110,6 @@ public void setMemoryRequests(String memoryRequests) { public ConnectorNamespaceQuota memoryLimits(String memoryLimits) { - this.memoryLimits = memoryLimits; return this; } @@ -138,7 +136,6 @@ public void setMemoryLimits(String memoryLimits) { public ConnectorNamespaceQuota cpuRequests(String cpuRequests) { - this.cpuRequests = cpuRequests; return this; } @@ -165,7 +162,6 @@ public void setCpuRequests(String cpuRequests) { public ConnectorNamespaceQuota cpuLimits(String cpuLimits) { - this.cpuLimits = cpuLimits; return this; } @@ -191,6 +187,9 @@ public void setCpuLimits(String cpuLimits) { } + /** + * Return true if this ConnectorNamespaceQuota object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequest.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequest.java index cae575ed..6b1d53ae 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequest.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -29,7 +31,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * A connector namespace create request @@ -41,8 +43,7 @@ ConnectorNamespaceRequest.JSON_PROPERTY_CLUSTER_ID, ConnectorNamespaceRequest.JSON_PROPERTY_KIND }) -@JsonTypeName("ConnectorNamespaceRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -60,7 +61,6 @@ public ConnectorNamespaceRequest() { } public ConnectorNamespaceRequest name(String name) { - this.name = name; return this; } @@ -87,7 +87,6 @@ public void setName(String name) { public ConnectorNamespaceRequest annotations(Map annotations) { - this.annotations = annotations; return this; } @@ -122,7 +121,6 @@ public void setAnnotations(Map annotations) { public ConnectorNamespaceRequest clusterId(String clusterId) { - this.clusterId = clusterId; return this; } @@ -149,7 +147,6 @@ public void setClusterId(String clusterId) { public ConnectorNamespaceRequest kind(ConnectorNamespaceTenantKind kind) { - this.kind = kind; return this; } @@ -175,6 +172,9 @@ public void setKind(ConnectorNamespaceTenantKind kind) { } + /** + * Return true if this ConnectorNamespaceRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestAllOf.java index da8f5810..ec8aae81 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceRequestAllOf @@ -33,8 +35,7 @@ ConnectorNamespaceRequestAllOf.JSON_PROPERTY_CLUSTER_ID, ConnectorNamespaceRequestAllOf.JSON_PROPERTY_KIND }) -@JsonTypeName("ConnectorNamespaceRequest_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceRequestAllOf { public static final String JSON_PROPERTY_CLUSTER_ID = "cluster_id"; private String clusterId; @@ -46,7 +47,6 @@ public ConnectorNamespaceRequestAllOf() { } public ConnectorNamespaceRequestAllOf clusterId(String clusterId) { - this.clusterId = clusterId; return this; } @@ -73,7 +73,6 @@ public void setClusterId(String clusterId) { public ConnectorNamespaceRequestAllOf kind(ConnectorNamespaceTenantKind kind) { - this.kind = kind; return this; } @@ -99,6 +98,9 @@ public void setKind(ConnectorNamespaceTenantKind kind) { } + /** + * Return true if this ConnectorNamespaceRequest_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestMeta.java index 81cfee73..f7c464ff 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceRequestMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceRequestMeta @@ -35,8 +37,7 @@ ConnectorNamespaceRequestMeta.JSON_PROPERTY_NAME, ConnectorNamespaceRequestMeta.JSON_PROPERTY_ANNOTATIONS }) -@JsonTypeName("ConnectorNamespaceRequestMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceRequestMeta { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -48,7 +49,6 @@ public ConnectorNamespaceRequestMeta() { } public ConnectorNamespaceRequestMeta name(String name) { - this.name = name; return this; } @@ -75,7 +75,6 @@ public void setName(String name) { public ConnectorNamespaceRequestMeta annotations(Map annotations) { - this.annotations = annotations; return this; } @@ -109,6 +108,9 @@ public void setAnnotations(Map annotations) { } + /** + * Return true if this ConnectorNamespaceRequestMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceState.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceState.java index e5ce4b67..bb80b8d7 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceState.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceState.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceStatus.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceStatus.java index 80bbb318..143f4853 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceStatus.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceStatus.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceStatus @@ -35,8 +37,7 @@ ConnectorNamespaceStatus.JSON_PROPERTY_CONNECTORS_DEPLOYED, ConnectorNamespaceStatus.JSON_PROPERTY_ERROR }) -@JsonTypeName("ConnectorNamespaceStatus") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceStatus { public static final String JSON_PROPERTY_STATE = "state"; private ConnectorNamespaceState state; @@ -54,7 +55,6 @@ public ConnectorNamespaceStatus() { } public ConnectorNamespaceStatus state(ConnectorNamespaceState state) { - this.state = state; return this; } @@ -81,7 +81,6 @@ public void setState(ConnectorNamespaceState state) { public ConnectorNamespaceStatus version(String version) { - this.version = version; return this; } @@ -108,7 +107,6 @@ public void setVersion(String version) { public ConnectorNamespaceStatus connectorsDeployed(Integer connectorsDeployed) { - this.connectorsDeployed = connectorsDeployed; return this; } @@ -135,7 +133,6 @@ public void setConnectorsDeployed(Integer connectorsDeployed) { public ConnectorNamespaceStatus error(String error) { - this.error = error; return this; } @@ -161,6 +158,9 @@ public void setError(String error) { } + /** + * Return true if this ConnectorNamespaceStatus object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenant.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenant.java index 2910d0b9..0eba2520 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenant.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenant.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorNamespaceTenant @@ -33,8 +35,7 @@ ConnectorNamespaceTenant.JSON_PROPERTY_KIND, ConnectorNamespaceTenant.JSON_PROPERTY_ID }) -@JsonTypeName("ConnectorNamespaceTenant") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorNamespaceTenant { public static final String JSON_PROPERTY_KIND = "kind"; private ConnectorNamespaceTenantKind kind; @@ -46,7 +47,6 @@ public ConnectorNamespaceTenant() { } public ConnectorNamespaceTenant kind(ConnectorNamespaceTenantKind kind) { - this.kind = kind; return this; } @@ -73,7 +73,6 @@ public void setKind(ConnectorNamespaceTenantKind kind) { public ConnectorNamespaceTenant id(String id) { - this.id = id; return this; } @@ -99,6 +98,9 @@ public void setId(String id) { } + /** + * Return true if this ConnectorNamespaceTenant object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenantKind.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenantKind.java index 96971ac6..a3602978 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenantKind.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorNamespaceTenantKind.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequest.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequest.java index 96dbe81d..fbee0d87 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequest.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -30,7 +32,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorRequest @@ -46,8 +48,7 @@ ConnectorRequest.JSON_PROPERTY_SCHEMA_REGISTRY, ConnectorRequest.JSON_PROPERTY_CONNECTOR }) -@JsonTypeName("ConnectorRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -80,7 +81,6 @@ public ConnectorRequest() { } public ConnectorRequest name(String name) { - this.name = name; return this; } @@ -107,7 +107,6 @@ public void setName(String name) { public ConnectorRequest connectorTypeId(String connectorTypeId) { - this.connectorTypeId = connectorTypeId; return this; } @@ -134,7 +133,6 @@ public void setConnectorTypeId(String connectorTypeId) { public ConnectorRequest namespaceId(String namespaceId) { - this.namespaceId = namespaceId; return this; } @@ -161,7 +159,6 @@ public void setNamespaceId(String namespaceId) { public ConnectorRequest channel(Channel channel) { - this.channel = channel; return this; } @@ -188,7 +185,6 @@ public void setChannel(Channel channel) { public ConnectorRequest desiredState(ConnectorDesiredState desiredState) { - this.desiredState = desiredState; return this; } @@ -215,7 +211,6 @@ public void setDesiredState(ConnectorDesiredState desiredState) { public ConnectorRequest kafka(KafkaConnectionSettings kafka) { - this.kafka = kafka; return this; } @@ -242,7 +237,6 @@ public void setKafka(KafkaConnectionSettings kafka) { public ConnectorRequest serviceAccount(ServiceAccount serviceAccount) { - this.serviceAccount = serviceAccount; return this; } @@ -269,7 +263,6 @@ public void setServiceAccount(ServiceAccount serviceAccount) { public ConnectorRequest schemaRegistry(SchemaRegistryConnectionSettings schemaRegistry) { - this.schemaRegistry = schemaRegistry; return this; } @@ -296,7 +289,6 @@ public void setSchemaRegistry(SchemaRegistryConnectionSettings schemaRegistry) { public ConnectorRequest connector(Object connector) { - this.connector = connector; return this; } @@ -322,6 +314,9 @@ public void setConnector(Object connector) { } + /** + * Return true if this ConnectorRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequestMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequestMeta.java index ea5ee91c..78a634f7 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequestMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorRequestMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -25,7 +27,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorRequestMeta @@ -37,8 +39,7 @@ ConnectorRequestMeta.JSON_PROPERTY_CHANNEL, ConnectorRequestMeta.JSON_PROPERTY_DESIRED_STATE }) -@JsonTypeName("ConnectorRequestMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorRequestMeta { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -59,7 +60,6 @@ public ConnectorRequestMeta() { } public ConnectorRequestMeta name(String name) { - this.name = name; return this; } @@ -86,7 +86,6 @@ public void setName(String name) { public ConnectorRequestMeta connectorTypeId(String connectorTypeId) { - this.connectorTypeId = connectorTypeId; return this; } @@ -113,7 +112,6 @@ public void setConnectorTypeId(String connectorTypeId) { public ConnectorRequestMeta namespaceId(String namespaceId) { - this.namespaceId = namespaceId; return this; } @@ -140,7 +138,6 @@ public void setNamespaceId(String namespaceId) { public ConnectorRequestMeta channel(Channel channel) { - this.channel = channel; return this; } @@ -167,7 +164,6 @@ public void setChannel(Channel channel) { public ConnectorRequestMeta desiredState(ConnectorDesiredState desiredState) { - this.desiredState = desiredState; return this; } @@ -193,6 +189,9 @@ public void setDesiredState(ConnectorDesiredState desiredState) { } + /** + * Return true if this ConnectorRequestMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorState.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorState.java index e7fff4bc..5fa04f88 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorState.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorState.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatus.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatus.java index 12d4956a..145f1120 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatus.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatus.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorStatus @@ -32,8 +34,7 @@ @JsonPropertyOrder({ ConnectorStatus.JSON_PROPERTY_STATUS }) -@JsonTypeName("ConnectorStatus") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorStatus { public static final String JSON_PROPERTY_STATUS = "status"; private ConnectorStatusStatus status; @@ -42,7 +43,6 @@ public ConnectorStatus() { } public ConnectorStatus status(ConnectorStatusStatus status) { - this.status = status; return this; } @@ -68,6 +68,9 @@ public void setStatus(ConnectorStatusStatus status) { } + /** + * Return true if this ConnectorStatus object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatusStatus.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatusStatus.java index 759a2ec5..3cabb14d 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatusStatus.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorStatusStatus.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorStatusStatus @@ -33,8 +35,7 @@ ConnectorStatusStatus.JSON_PROPERTY_STATE, ConnectorStatusStatus.JSON_PROPERTY_ERROR }) -@JsonTypeName("ConnectorStatus_status") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorStatusStatus { public static final String JSON_PROPERTY_STATE = "state"; private ConnectorState state; @@ -46,7 +47,6 @@ public ConnectorStatusStatus() { } public ConnectorStatusStatus state(ConnectorState state) { - this.state = state; return this; } @@ -73,7 +73,6 @@ public void setState(ConnectorState state) { public ConnectorStatusStatus error(String error) { - this.error = error; return this; } @@ -99,6 +98,9 @@ public void setError(String error) { } + /** + * Return true if this ConnectorStatus_status object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorType.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorType.java index f156fa83..c828a206 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorType.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorType.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,474 +30,220 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents a connector type supported by the API - */ -@ApiModel(description = "Represents a connector type supported by the API") -@JsonPropertyOrder({ - ConnectorType.JSON_PROPERTY_ID, - ConnectorType.JSON_PROPERTY_KIND, - ConnectorType.JSON_PROPERTY_HREF, - ConnectorType.JSON_PROPERTY_NAME, - ConnectorType.JSON_PROPERTY_VERSION, - ConnectorType.JSON_PROPERTY_CHANNELS, - ConnectorType.JSON_PROPERTY_DESCRIPTION, - ConnectorType.JSON_PROPERTY_ICON_HREF, - ConnectorType.JSON_PROPERTY_LABELS, - ConnectorType.JSON_PROPERTY_CAPABILITIES, - ConnectorType.JSON_PROPERTY_SCHEMA, - ConnectorType.JSON_PROPERTY_JSON_SCHEMA -}) -@JsonTypeName("ConnectorType") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ConnectorType { - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_KIND = "kind"; - private String kind; - - public static final String JSON_PROPERTY_HREF = "href"; - private String href; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_VERSION = "version"; - private String version; - - public static final String JSON_PROPERTY_CHANNELS = "channels"; - private List channels = null; - - public static final String JSON_PROPERTY_DESCRIPTION = "description"; - private String description; - - public static final String JSON_PROPERTY_ICON_HREF = "icon_href"; - private String iconHref; - - public static final String JSON_PROPERTY_LABELS = "labels"; - private List labels = null; - - public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; - private List capabilities = null; - - public static final String JSON_PROPERTY_SCHEMA = "schema"; - private Object schema; - - public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; - private Object jsonSchema; - - public ConnectorType() { - } - - public ConnectorType id(String id) { - - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(String id) { - this.id = id; - } - - - public ConnectorType kind(String kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(String kind) { - this.kind = kind; - } - - - public ConnectorType href(String href) { - - this.href = href; - return this; - } - - /** - * Get href - * @return href - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_HREF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getHref() { - return href; - } - - - @JsonProperty(JSON_PROPERTY_HREF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHref(String href) { - this.href = href; - } - - - public ConnectorType name(String name) { - - this.name = name; - return this; - } - - /** - * Name of the connector type. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Name of the connector type.") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public ConnectorType version(String version) { - - this.version = version; - return this; - } - - /** - * Version of the connector type. - * @return version - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Version of the connector type.") - @JsonProperty(JSON_PROPERTY_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getVersion() { - return version; - } - - - @JsonProperty(JSON_PROPERTY_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVersion(String version) { - this.version = version; - } - - public ConnectorType channels(List channels) { - - this.channels = channels; - return this; - } +import com.fasterxml.jackson.core.type.TypeReference; - public ConnectorType addChannelsItem(Channel channelsItem) { - if (this.channels == null) { - this.channels = new ArrayList<>(); +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import com.openshift.cloud.api.connector.invoker.JSON; + +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonDeserialize(using = ConnectorType.ConnectorTypeDeserializer.class) +@JsonSerialize(using = ConnectorType.ConnectorTypeSerializer.class) +public class ConnectorType extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ConnectorType.class.getName()); + + public static class ConnectorTypeSerializer extends StdSerializer { + public ConnectorTypeSerializer(Class t) { + super(t); + } + + public ConnectorTypeSerializer() { + this(null); + } + + @Override + public void serialize(ConnectorType value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } } - this.channels.add(channelsItem); - return this; - } - - /** - * Channels of the connector type. - * @return channels - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Channels of the connector type.") - @JsonProperty(JSON_PROPERTY_CHANNELS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getChannels() { - return channels; - } - - - @JsonProperty(JSON_PROPERTY_CHANNELS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setChannels(List channels) { - this.channels = channels; - } - - - public ConnectorType description(String description) { - - this.description = description; - return this; - } - - /** - * A description of the connector. - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A description of the connector.") - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getDescription() { - return description; - } - - - @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(String description) { - this.description = description; - } - - public ConnectorType iconHref(String iconHref) { - - this.iconHref = iconHref; - return this; - } - - /** - * URL to an icon of the connector. - * @return iconHref - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "URL to an icon of the connector.") - @JsonProperty(JSON_PROPERTY_ICON_HREF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getIconHref() { - return iconHref; - } - - - @JsonProperty(JSON_PROPERTY_ICON_HREF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIconHref(String iconHref) { - this.iconHref = iconHref; - } - - - public ConnectorType labels(List labels) { - - this.labels = labels; - return this; - } - - public ConnectorType addLabelsItem(String labelsItem) { - if (this.labels == null) { - this.labels = new ArrayList<>(); + public static class ConnectorTypeDeserializer extends StdDeserializer { + public ConnectorTypeDeserializer() { + this(ConnectorType.class); + } + + public ConnectorTypeDeserializer(Class vc) { + super(vc); + } + + @Override + public ConnectorType deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ConnectorTypeAllOf + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ConnectorTypeAllOf.class.equals(Integer.class) || ConnectorTypeAllOf.class.equals(Long.class) || ConnectorTypeAllOf.class.equals(Float.class) || ConnectorTypeAllOf.class.equals(Double.class) || ConnectorTypeAllOf.class.equals(Boolean.class) || ConnectorTypeAllOf.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ConnectorTypeAllOf.class.equals(Integer.class) || ConnectorTypeAllOf.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ConnectorTypeAllOf.class.equals(Float.class) || ConnectorTypeAllOf.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ConnectorTypeAllOf.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ConnectorTypeAllOf.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ConnectorTypeAllOf.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ConnectorTypeAllOf'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ConnectorTypeAllOf'", e); + } + + // deserialize ObjectReference + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (ObjectReference.class.equals(Integer.class) || ObjectReference.class.equals(Long.class) || ObjectReference.class.equals(Float.class) || ObjectReference.class.equals(Double.class) || ObjectReference.class.equals(Boolean.class) || ObjectReference.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= ((ObjectReference.class.equals(Integer.class) || ObjectReference.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= ((ObjectReference.class.equals(Float.class) || ObjectReference.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= (ObjectReference.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (ObjectReference.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ObjectReference.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ObjectReference'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ObjectReference'", e); + } + + if (match == 1) { + ConnectorType ret = new ConnectorType(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for ConnectorType: %d classes match result, expected 1", match)); + } + + /** + * Handle deserialization of the 'null' value. + */ + @Override + public ConnectorType getNullValue(DeserializationContext ctxt) throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "ConnectorType cannot be null"); + } } - this.labels.add(labelsItem); - return this; - } - - /** - * Labels used to categorize the connector - * @return labels - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "Labels used to categorize the connector") - @JsonProperty(JSON_PROPERTY_LABELS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getLabels() { - return labels; - } - - @JsonProperty(JSON_PROPERTY_LABELS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLabels(List labels) { - this.labels = labels; - } + // store a list of schema names defined in oneOf + public static final Map> schemas = new HashMap<>(); - - public ConnectorType capabilities(List capabilities) { - - this.capabilities = capabilities; - return this; - } - - public ConnectorType addCapabilitiesItem(String capabilitiesItem) { - if (this.capabilities == null) { - this.capabilities = new ArrayList<>(); + public ConnectorType() { + super("oneOf", Boolean.FALSE); } - this.capabilities.add(capabilitiesItem); - return this; - } - - /** - * The capabilities supported by the conenctor - * @return capabilities - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "The capabilities supported by the conenctor") - @JsonProperty(JSON_PROPERTY_CAPABILITIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getCapabilities() { - return capabilities; - } - - - @JsonProperty(JSON_PROPERTY_CAPABILITIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapabilities(List capabilities) { - this.capabilities = capabilities; - } - - - public ConnectorType schema(Object schema) { - - this.schema = schema; - return this; - } - - /** - * A json schema that can be used to validate a ConnectorRequest connector field. - * @return schema - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A json schema that can be used to validate a ConnectorRequest connector field.") - @JsonProperty(JSON_PROPERTY_SCHEMA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getSchema() { - return schema; - } - - - @JsonProperty(JSON_PROPERTY_SCHEMA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSchema(Object schema) { - this.schema = schema; - } - - - public ConnectorType jsonSchema(Object jsonSchema) { - - this.jsonSchema = jsonSchema; - return this; - } - - /** - * A json schema that can be used to validate a ConnectorRequest connector field. - * @return jsonSchema - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "A json schema that can be used to validate a ConnectorRequest connector field.") - @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getJsonSchema() { - return jsonSchema; - } + public ConnectorType(ConnectorTypeAllOf o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } - @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJsonSchema(Object jsonSchema) { - this.jsonSchema = jsonSchema; - } + public ConnectorType(ObjectReference o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { + schemas.put("ConnectorTypeAllOf", ConnectorTypeAllOf.class); + schemas.put("ObjectReference", ObjectReference.class); + JSON.registerDescendants(ConnectorType.class, Collections.unmodifiableMap(schemas)); + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @Override + public Map> getSchemas() { + return ConnectorType.schemas; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ConnectorTypeAllOf, ObjectReference + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ConnectorTypeAllOf.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(ObjectReference.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ConnectorTypeAllOf, ObjectReference"); } - ConnectorType connectorType = (ConnectorType) o; - return Objects.equals(this.id, connectorType.id) && - Objects.equals(this.kind, connectorType.kind) && - Objects.equals(this.href, connectorType.href) && - Objects.equals(this.name, connectorType.name) && - Objects.equals(this.version, connectorType.version) && - Objects.equals(this.channels, connectorType.channels) && - Objects.equals(this.description, connectorType.description) && - Objects.equals(this.iconHref, connectorType.iconHref) && - Objects.equals(this.labels, connectorType.labels) && - Objects.equals(this.capabilities, connectorType.capabilities) && - Objects.equals(this.schema, connectorType.schema) && - Objects.equals(this.jsonSchema, connectorType.jsonSchema); - } - @Override - public int hashCode() { - return Objects.hash(id, kind, href, name, version, channels, description, iconHref, labels, capabilities, schema, jsonSchema); - } + /** + * Get the actual instance, which can be the following: + * ConnectorTypeAllOf, ObjectReference + * + * @return The actual instance (ConnectorTypeAllOf, ObjectReference) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ConnectorType {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append(" href: ").append(toIndentedString(href)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" channels: ").append(toIndentedString(channels)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" iconHref: ").append(toIndentedString(iconHref)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); - sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); - sb.append(" schema: ").append(toIndentedString(schema)).append("\n"); - sb.append(" jsonSchema: ").append(toIndentedString(jsonSchema)).append("\n"); - sb.append("}"); - return sb.toString(); - } + /** + * Get the actual instance of `ConnectorTypeAllOf`. If the actual instance is not `ConnectorTypeAllOf`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ConnectorTypeAllOf` + * @throws ClassCastException if the instance is not `ConnectorTypeAllOf` + */ + public ConnectorTypeAllOf getConnectorTypeAllOf() throws ClassCastException { + return (ConnectorTypeAllOf)super.getActualInstance(); + } - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Get the actual instance of `ObjectReference`. If the actual instance is not `ObjectReference`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ObjectReference` + * @throws ClassCastException if the instance is not `ObjectReference` + */ + public ObjectReference getObjectReference() throws ClassCastException { + return (ObjectReference)super.getActualInstance(); } - return o.toString().replace("\n", "\n "); - } } diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeAllOf.java index 51c94c2c..dc8f8d39 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorTypeAllOf @@ -42,8 +44,7 @@ ConnectorTypeAllOf.JSON_PROPERTY_SCHEMA, ConnectorTypeAllOf.JSON_PROPERTY_JSON_SCHEMA }) -@JsonTypeName("ConnectorType_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorTypeAllOf { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -76,7 +77,6 @@ public ConnectorTypeAllOf() { } public ConnectorTypeAllOf name(String name) { - this.name = name; return this; } @@ -103,7 +103,6 @@ public void setName(String name) { public ConnectorTypeAllOf version(String version) { - this.version = version; return this; } @@ -130,7 +129,6 @@ public void setVersion(String version) { public ConnectorTypeAllOf channels(List channels) { - this.channels = channels; return this; } @@ -165,7 +163,6 @@ public void setChannels(List channels) { public ConnectorTypeAllOf description(String description) { - this.description = description; return this; } @@ -192,7 +189,6 @@ public void setDescription(String description) { public ConnectorTypeAllOf iconHref(String iconHref) { - this.iconHref = iconHref; return this; } @@ -219,7 +215,6 @@ public void setIconHref(String iconHref) { public ConnectorTypeAllOf labels(List labels) { - this.labels = labels; return this; } @@ -254,7 +249,6 @@ public void setLabels(List labels) { public ConnectorTypeAllOf capabilities(List capabilities) { - this.capabilities = capabilities; return this; } @@ -289,7 +283,6 @@ public void setCapabilities(List capabilities) { public ConnectorTypeAllOf schema(Object schema) { - this.schema = schema; return this; } @@ -316,7 +309,6 @@ public void setSchema(Object schema) { public ConnectorTypeAllOf jsonSchema(Object jsonSchema) { - this.jsonSchema = jsonSchema; return this; } @@ -342,6 +334,9 @@ public void setJsonSchema(Object jsonSchema) { } + /** + * Return true if this ConnectorType_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeList.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeList.java index 3b028393..33c1af47 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeList.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeList.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -28,7 +30,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorTypeList @@ -40,8 +42,7 @@ ConnectorTypeList.JSON_PROPERTY_TOTAL, ConnectorTypeList.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorTypeList") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorTypeList { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -62,7 +63,6 @@ public ConnectorTypeList() { } public ConnectorTypeList kind(String kind) { - this.kind = kind; return this; } @@ -89,7 +89,6 @@ public void setKind(String kind) { public ConnectorTypeList page(Integer page) { - this.page = page; return this; } @@ -116,7 +115,6 @@ public void setPage(Integer page) { public ConnectorTypeList size(Integer size) { - this.size = size; return this; } @@ -143,7 +141,6 @@ public void setSize(Integer size) { public ConnectorTypeList total(Integer total) { - this.total = total; return this; } @@ -170,7 +167,6 @@ public void setTotal(Integer total) { public ConnectorTypeList items(List items) { - this.items = items; return this; } @@ -201,6 +197,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorTypeList object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeListAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeListAllOf.java index 65f0108a..03902692 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeListAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ConnectorTypeListAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ConnectorTypeListAllOf @@ -34,8 +36,7 @@ @JsonPropertyOrder({ ConnectorTypeListAllOf.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ConnectorTypeList_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ConnectorTypeListAllOf { public static final String JSON_PROPERTY_ITEMS = "items"; private List items = null; @@ -44,7 +45,6 @@ public ConnectorTypeListAllOf() { } public ConnectorTypeListAllOf items(List items) { - this.items = items; return this; } @@ -78,6 +78,9 @@ public void setItems(List items) { } + /** + * Return true if this ConnectorTypeList_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Error.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Error.java index bb61a177..eae8c9c4 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Error.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/Error.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -25,7 +27,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Error @@ -38,8 +40,7 @@ Error.JSON_PROPERTY_REASON, Error.JSON_PROPERTY_OPERATION_ID }) -@JsonTypeName("Error") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Error { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -63,7 +64,6 @@ public Error() { } public Error id(String id) { - this.id = id; return this; } @@ -90,7 +90,6 @@ public void setId(String id) { public Error kind(String kind) { - this.kind = kind; return this; } @@ -117,7 +116,6 @@ public void setKind(String kind) { public Error href(String href) { - this.href = href; return this; } @@ -144,7 +142,6 @@ public void setHref(String href) { public Error code(String code) { - this.code = code; return this; } @@ -171,7 +168,6 @@ public void setCode(String code) { public Error reason(String reason) { - this.reason = reason; return this; } @@ -198,7 +194,6 @@ public void setReason(String reason) { public Error operationId(String operationId) { - this.operationId = operationId; return this; } @@ -224,6 +219,9 @@ public void setOperationId(String operationId) { } + /** + * Return true if this Error object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ErrorAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ErrorAllOf.java index aef48ac4..1c3c1b56 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ErrorAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ErrorAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ErrorAllOf @@ -33,8 +35,7 @@ ErrorAllOf.JSON_PROPERTY_REASON, ErrorAllOf.JSON_PROPERTY_OPERATION_ID }) -@JsonTypeName("Error_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorAllOf { public static final String JSON_PROPERTY_CODE = "code"; private String code; @@ -49,7 +50,6 @@ public ErrorAllOf() { } public ErrorAllOf code(String code) { - this.code = code; return this; } @@ -76,7 +76,6 @@ public void setCode(String code) { public ErrorAllOf reason(String reason) { - this.reason = reason; return this; } @@ -103,7 +102,6 @@ public void setReason(String reason) { public ErrorAllOf operationId(String operationId) { - this.operationId = operationId; return this; } @@ -129,6 +127,9 @@ public void setOperationId(String operationId) { } + /** + * Return true if this Error_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/KafkaConnectionSettings.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/KafkaConnectionSettings.java index 3c2e03fd..29fe1bb2 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/KafkaConnectionSettings.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/KafkaConnectionSettings.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Holds the configuration to connect to a Kafka Instance. @@ -34,8 +36,7 @@ KafkaConnectionSettings.JSON_PROPERTY_ID, KafkaConnectionSettings.JSON_PROPERTY_URL }) -@JsonTypeName("KafkaConnectionSettings") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class KafkaConnectionSettings { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -47,7 +48,6 @@ public KafkaConnectionSettings() { } public KafkaConnectionSettings id(String id) { - this.id = id; return this; } @@ -74,7 +74,6 @@ public void setId(String id) { public KafkaConnectionSettings url(String url) { - this.url = url; return this; } @@ -100,6 +99,9 @@ public void setUrl(String url) { } + /** + * Return true if this KafkaConnectionSettings object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ModelList.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ModelList.java index ad82e761..de7e65a7 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ModelList.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ModelList.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ModelList @@ -34,8 +36,7 @@ ModelList.JSON_PROPERTY_SIZE, ModelList.JSON_PROPERTY_TOTAL }) -@JsonTypeName("List") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -53,7 +54,6 @@ public ModelList() { } public ModelList kind(String kind) { - this.kind = kind; return this; } @@ -80,7 +80,6 @@ public void setKind(String kind) { public ModelList page(Integer page) { - this.page = page; return this; } @@ -107,7 +106,6 @@ public void setPage(Integer page) { public ModelList size(Integer size) { - this.size = size; return this; } @@ -134,7 +132,6 @@ public void setSize(Integer size) { public ModelList total(Integer total) { - this.total = total; return this; } @@ -160,6 +157,9 @@ public void setTotal(Integer total) { } + /** + * Return true if this List object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectMeta.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectMeta.java index 9b9e53f3..513f6100 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectMeta.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectMeta.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ObjectMeta @@ -34,8 +36,7 @@ ObjectMeta.JSON_PROPERTY_CREATED_AT, ObjectMeta.JSON_PROPERTY_MODIFIED_AT }) -@JsonTypeName("ObjectMeta") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ObjectMeta { public static final String JSON_PROPERTY_OWNER = "owner"; private String owner; @@ -50,7 +51,6 @@ public ObjectMeta() { } public ObjectMeta owner(String owner) { - this.owner = owner; return this; } @@ -77,7 +77,6 @@ public void setOwner(String owner) { public ObjectMeta createdAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; return this; } @@ -104,7 +103,6 @@ public void setCreatedAt(OffsetDateTime createdAt) { public ObjectMeta modifiedAt(OffsetDateTime modifiedAt) { - this.modifiedAt = modifiedAt; return this; } @@ -130,6 +128,9 @@ public void setModifiedAt(OffsetDateTime modifiedAt) { } + /** + * Return true if this ObjectMeta object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectReference.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectReference.java index faace2c5..e64cea55 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectReference.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ObjectReference.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ObjectReference @@ -33,8 +35,7 @@ ObjectReference.JSON_PROPERTY_KIND, ObjectReference.JSON_PROPERTY_HREF }) -@JsonTypeName("ObjectReference") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ObjectReference { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -49,7 +50,6 @@ public ObjectReference() { } public ObjectReference id(String id) { - this.id = id; return this; } @@ -76,7 +76,6 @@ public void setId(String id) { public ObjectReference kind(String kind) { - this.kind = kind; return this; } @@ -103,7 +102,6 @@ public void setKind(String kind) { public ObjectReference href(String href) { - this.href = href; return this; } @@ -129,6 +127,9 @@ public void setHref(String href) { } + /** + * Return true if this ObjectReference object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/SchemaRegistryConnectionSettings.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/SchemaRegistryConnectionSettings.java index b4bd93e8..b42fdc9f 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/SchemaRegistryConnectionSettings.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/SchemaRegistryConnectionSettings.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Holds the configuration to connect to a Schem Registry Instance. @@ -34,8 +36,7 @@ SchemaRegistryConnectionSettings.JSON_PROPERTY_ID, SchemaRegistryConnectionSettings.JSON_PROPERTY_URL }) -@JsonTypeName("SchemaRegistryConnectionSettings") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SchemaRegistryConnectionSettings { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -47,7 +48,6 @@ public SchemaRegistryConnectionSettings() { } public SchemaRegistryConnectionSettings id(String id) { - this.id = id; return this; } @@ -74,7 +74,6 @@ public void setId(String id) { public SchemaRegistryConnectionSettings url(String url) { - this.url = url; return this; } @@ -100,6 +99,9 @@ public void setUrl(String url) { } + /** + * Return true if this SchemaRegistryConnectionSettings object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceAccount.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceAccount.java index 00a71c4c..d1d5eb99 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceAccount.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceAccount.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ServiceAccount @@ -32,8 +34,7 @@ ServiceAccount.JSON_PROPERTY_CLIENT_ID, ServiceAccount.JSON_PROPERTY_CLIENT_SECRET }) -@JsonTypeName("ServiceAccount") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ServiceAccount { public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; private String clientId; @@ -45,7 +46,6 @@ public ServiceAccount() { } public ServiceAccount clientId(String clientId) { - this.clientId = clientId; return this; } @@ -72,7 +72,6 @@ public void setClientId(String clientId) { public ServiceAccount clientSecret(String clientSecret) { - this.clientSecret = clientSecret; return this; } @@ -98,6 +97,9 @@ public void setClientSecret(String clientSecret) { } + /** + * Return true if this ServiceAccount object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceConnectionSettings.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceConnectionSettings.java index 81e0273f..e3dcfb4e 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceConnectionSettings.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/ServiceConnectionSettings.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ServiceConnectionSettings @@ -32,8 +34,7 @@ ServiceConnectionSettings.JSON_PROPERTY_ID, ServiceConnectionSettings.JSON_PROPERTY_URL }) -@JsonTypeName("ServiceConnectionSettings") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ServiceConnectionSettings { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -45,7 +46,6 @@ public ServiceConnectionSettings() { } public ServiceConnectionSettings id(String id) { - this.id = id; return this; } @@ -72,7 +72,6 @@ public void setId(String id) { public ServiceConnectionSettings url(String url) { - this.url = url; return this; } @@ -98,6 +97,9 @@ public void setUrl(String url) { } + /** + * Return true if this ServiceConnectionSettings object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadata.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadata.java index 46d378af..5b8e504d 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadata.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadata.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -27,7 +29,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * VersionMetadata @@ -38,8 +40,7 @@ VersionMetadata.JSON_PROPERTY_HREF, VersionMetadata.JSON_PROPERTY_COLLECTIONS }) -@JsonTypeName("VersionMetadata") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class VersionMetadata { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -57,7 +58,6 @@ public VersionMetadata() { } public VersionMetadata id(String id) { - this.id = id; return this; } @@ -84,7 +84,6 @@ public void setId(String id) { public VersionMetadata kind(String kind) { - this.kind = kind; return this; } @@ -111,7 +110,6 @@ public void setKind(String kind) { public VersionMetadata href(String href) { - this.href = href; return this; } @@ -138,7 +136,6 @@ public void setHref(String href) { public VersionMetadata collections(List collections) { - this.collections = collections; return this; } @@ -172,6 +169,9 @@ public void setCollections(List collections) { } + /** + * Return true if this VersionMetadata object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadataAllOf.java b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadataAllOf.java index c8387264..c58ad9ba 100644 --- a/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadataAllOf.java +++ b/packages/connector-management-sdk/src/main/java/com/openshift/cloud/api/connector/models/VersionMetadataAllOf.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * VersionMetadataAllOf @@ -34,8 +36,7 @@ @JsonPropertyOrder({ VersionMetadataAllOf.JSON_PROPERTY_COLLECTIONS }) -@JsonTypeName("VersionMetadata_allOf") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class VersionMetadataAllOf { public static final String JSON_PROPERTY_COLLECTIONS = "collections"; private List collections = null; @@ -44,7 +45,6 @@ public VersionMetadataAllOf() { } public VersionMetadataAllOf collections(List collections) { - this.collections = collections; return this; } @@ -78,6 +78,9 @@ public void setCollections(List collections) { } + /** + * Return true if this VersionMetadata_allOf object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/kafka-instance-sdk/api/openapi.yaml b/packages/kafka-instance-sdk/api/openapi.yaml index a2cb7621..2abaac45 100644 --- a/packages/kafka-instance-sdk/api/openapi.yaml +++ b/packages/kafka-instance-sdk/api/openapi.yaml @@ -30,11 +30,10 @@ paths: those records the requestor is authorized to view. operationId: getTopics parameters: - - deprecated: true - description: Maximum number of records to return + - description: Number of records per page explode: true in: query - name: limit + name: size required: false schema: format: int32 @@ -566,11 +565,10 @@ paths: authorized to view. operationId: getConsumerGroups parameters: - - deprecated: true - description: Maximum number of records to return + - description: Number of records per page explode: true in: query - name: limit + name: size required: false schema: format: int32 diff --git a/packages/kafka-instance-sdk/docs/GroupsApi.md b/packages/kafka-instance-sdk/docs/GroupsApi.md index d1602247..e9bfebe3 100644 --- a/packages/kafka-instance-sdk/docs/GroupsApi.md +++ b/packages/kafka-instance-sdk/docs/GroupsApi.md @@ -171,7 +171,7 @@ Name | Type | Description | Notes ## getConsumerGroups -> ConsumerGroupList getConsumerGroups(limit, page, topic, groupIdFilter, order, orderKey) +> ConsumerGroupList getConsumerGroups(size, page, topic, groupIdFilter, order, orderKey) List of consumer groups in the Kafka instance. @@ -198,14 +198,14 @@ public class Example { Bearer.setAccessToken("YOUR ACCESS TOKEN"); GroupsApi apiInstance = new GroupsApi(defaultClient); - Integer limit = 56; // Integer | Maximum number of records to return + Integer size = 56; // Integer | Number of records per page Integer page = 56; // Integer | Page number String topic = "topic_example"; // String | Return consumer groups where the topic name contains this value String groupIdFilter = "groupIdFilter_example"; // String | Return the consumer groups where the ID contains this value SortDirection order = SortDirection.fromValue("asc"); // SortDirection | Order items are sorted ConsumerGroupOrderKey orderKey = new ConsumerGroupOrderKey(); // ConsumerGroupOrderKey | try { - ConsumerGroupList result = apiInstance.getConsumerGroups(limit, page, topic, groupIdFilter, order, orderKey); + ConsumerGroupList result = apiInstance.getConsumerGroups(size, page, topic, groupIdFilter, order, orderKey); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling GroupsApi#getConsumerGroups"); @@ -223,7 +223,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Maximum number of records to return | [optional] + **size** | **Integer**| Number of records per page | [optional] **page** | **Integer**| Page number | [optional] **topic** | **String**| Return consumer groups where the topic name contains this value | [optional] **groupIdFilter** | **String**| Return the consumer groups where the ID contains this value | [optional] diff --git a/packages/kafka-instance-sdk/docs/TopicsApi.md b/packages/kafka-instance-sdk/docs/TopicsApi.md index 71a77ca6..9254ec90 100644 --- a/packages/kafka-instance-sdk/docs/TopicsApi.md +++ b/packages/kafka-instance-sdk/docs/TopicsApi.md @@ -241,7 +241,7 @@ Name | Type | Description | Notes ## getTopics -> TopicsList getTopics(limit, filter, page, order, orderKey) +> TopicsList getTopics(size, filter, page, order, orderKey) Retrieves a list of topics @@ -268,13 +268,13 @@ public class Example { Bearer.setAccessToken("YOUR ACCESS TOKEN"); TopicsApi apiInstance = new TopicsApi(defaultClient); - Integer limit = 56; // Integer | Maximum number of records to return + Integer size = 56; // Integer | Number of records per page String filter = "filter_example"; // String | Filter to apply when returning the list of topics Integer page = 56; // Integer | Page number SortDirection order = SortDirection.fromValue("asc"); // SortDirection | Order items are sorted TopicOrderKey orderKey = new TopicOrderKey(); // TopicOrderKey | Order key to sort the topics by. try { - TopicsList result = apiInstance.getTopics(limit, filter, page, order, orderKey); + TopicsList result = apiInstance.getTopics(size, filter, page, order, orderKey); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling TopicsApi#getTopics"); @@ -292,7 +292,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Maximum number of records to return | [optional] + **size** | **Integer**| Number of records per page | [optional] **filter** | **String**| Filter to apply when returning the list of topics | [optional] **page** | **Integer**| Page number | [optional] **order** | [**SortDirection**](.md)| Order items are sorted | [optional] [enum: asc, desc] diff --git a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java index 7c26265b..1d006b7a 100644 --- a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java +++ b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/GroupsApi.java @@ -139,7 +139,7 @@ public ConsumerGroup getConsumerGroupById(String consumerGroupId, SortDirection /** * List of consumer groups in the Kafka instance. * Returns a list of all consumer groups for a particular Kafka instance. The consumer groups returned are limited to those records the requestor is authorized to view. - * @param limit Maximum number of records to return (optional) + * @param size Number of records per page (optional) * @param page Page number (optional) * @param topic Return consumer groups where the topic name contains this value (optional) * @param groupIdFilter Return the consumer groups where the ID contains this value (optional) @@ -148,7 +148,7 @@ public ConsumerGroup getConsumerGroupById(String consumerGroupId, SortDirection * @return a {@code ConsumerGroupList} * @throws ApiException if fails to make API call */ - public ConsumerGroupList getConsumerGroups(Integer limit, Integer page, String topic, String groupIdFilter, SortDirection order, ConsumerGroupOrderKey orderKey) throws ApiException { + public ConsumerGroupList getConsumerGroups(Integer size, Integer page, String topic, String groupIdFilter, SortDirection order, ConsumerGroupOrderKey orderKey) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -160,7 +160,7 @@ public ConsumerGroupList getConsumerGroups(Integer limit, Integer page, String t Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "topic", topic)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "group-id-filter", groupIdFilter)); diff --git a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java index 6f06fec0..cb9059a2 100644 --- a/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java +++ b/packages/kafka-instance-sdk/src/main/java/com/openshift/cloud/api/kas/auth/TopicsApi.java @@ -173,7 +173,7 @@ public Topic getTopic(String topicName) throws ApiException { /** * Retrieves a list of topics * Returns a list of all of the available topics, or the list of topics that meet the request query parameters. The topics returned are limited to those records the requestor is authorized to view. - * @param limit Maximum number of records to return (optional) + * @param size Number of records per page (optional) * @param filter Filter to apply when returning the list of topics (optional) * @param page Page number (optional) * @param order Order items are sorted (optional) @@ -181,7 +181,7 @@ public Topic getTopic(String topicName) throws ApiException { * @return a {@code TopicsList} * @throws ApiException if fails to make API call */ - public TopicsList getTopics(Integer limit, String filter, Integer page, SortDirection order, TopicOrderKey orderKey) throws ApiException { + public TopicsList getTopics(Integer size, String filter, Integer page, SortDirection order, TopicOrderKey orderKey) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -193,7 +193,7 @@ public TopicsList getTopics(Integer limit, String filter, Integer page, SortDire Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter", filter)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "order", order)); diff --git a/packages/service-accounts-sdk/README.md b/packages/service-accounts-sdk/README.md index 4eed0a5a..5bf051c7 100644 --- a/packages/service-accounts-sdk/README.md +++ b/packages/service-accounts-sdk/README.md @@ -13,7 +13,7 @@ This is the API documentation for Service Accounts Building the API client library requires: -1. Java 1.8+ +1. Java 11+ 2. Maven/Gradle ## Installation @@ -50,14 +50,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy - repositories { - mavenCentral() // Needed if the 'service-accounts-sdk' jar has been published to maven central. - mavenLocal() // Needed if the 'service-accounts-sdk' jar has been published to the local maven repo. - } - - dependencies { - implementation "com.redhat.cloud:service-accounts-sdk:5.0.19" - } +compile "com.redhat.cloud:service-accounts-sdk:5.0.19" ``` ### Others @@ -80,7 +73,6 @@ Please follow the [installation](#installation) instruction and execute the foll ```java import com.openshift.cloud.api.serviceaccounts.invoker.*; -import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; import com.openshift.cloud.api.serviceaccounts.models.*; import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; @@ -88,16 +80,8 @@ public class ServiceAccountsApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); - - // Configure OAuth2 access token for authorization: authFlow - OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); - authFlow.setAccessToken("YOUR ACCESS TOKEN"); - - // Configure OAuth2 access token for authorization: serviceAccounts - OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); - serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); - + // Configure clients using the `defaultClient` object, such as + // overriding the host and port, timeout, etc. ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); ServiceAccountCreateRequestData serviceAccountCreateRequestData = new ServiceAccountCreateRequestData(); // ServiceAccountCreateRequestData | 'name' and 'description' of the service account try { @@ -122,11 +106,17 @@ All URIs are relative to *https://sso.redhat.com/auth/realms/redhat-external* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *ServiceAccountsApi* | [**createServiceAccount**](docs/ServiceAccountsApi.md#createServiceAccount) | **POST** /apis/service_accounts/v1 | Create service account +*ServiceAccountsApi* | [**createServiceAccountWithHttpInfo**](docs/ServiceAccountsApi.md#createServiceAccountWithHttpInfo) | **POST** /apis/service_accounts/v1 | Create service account *ServiceAccountsApi* | [**deleteServiceAccount**](docs/ServiceAccountsApi.md#deleteServiceAccount) | **DELETE** /apis/service_accounts/v1/{id} | Delete service account by id +*ServiceAccountsApi* | [**deleteServiceAccountWithHttpInfo**](docs/ServiceAccountsApi.md#deleteServiceAccountWithHttpInfo) | **DELETE** /apis/service_accounts/v1/{id} | Delete service account by id *ServiceAccountsApi* | [**getServiceAccount**](docs/ServiceAccountsApi.md#getServiceAccount) | **GET** /apis/service_accounts/v1/{id} | Get service account by id +*ServiceAccountsApi* | [**getServiceAccountWithHttpInfo**](docs/ServiceAccountsApi.md#getServiceAccountWithHttpInfo) | **GET** /apis/service_accounts/v1/{id} | Get service account by id *ServiceAccountsApi* | [**getServiceAccounts**](docs/ServiceAccountsApi.md#getServiceAccounts) | **GET** /apis/service_accounts/v1 | List all service accounts +*ServiceAccountsApi* | [**getServiceAccountsWithHttpInfo**](docs/ServiceAccountsApi.md#getServiceAccountsWithHttpInfo) | **GET** /apis/service_accounts/v1 | List all service accounts *ServiceAccountsApi* | [**resetServiceAccountSecret**](docs/ServiceAccountsApi.md#resetServiceAccountSecret) | **POST** /apis/service_accounts/v1/{id}/resetSecret | Reset service account secret by id +*ServiceAccountsApi* | [**resetServiceAccountSecretWithHttpInfo**](docs/ServiceAccountsApi.md#resetServiceAccountSecretWithHttpInfo) | **POST** /apis/service_accounts/v1/{id}/resetSecret | Reset service account secret by id *ServiceAccountsApi* | [**updateServiceAccount**](docs/ServiceAccountsApi.md#updateServiceAccount) | **PATCH** /apis/service_accounts/v1/{id} | Update service account +*ServiceAccountsApi* | [**updateServiceAccountWithHttpInfo**](docs/ServiceAccountsApi.md#updateServiceAccountWithHttpInfo) | **PATCH** /apis/service_accounts/v1/{id} | Update service account ## Documentation for Models @@ -171,6 +161,7 @@ Authentication schemes defined for the API: ## Recommendation It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. +However, the instances of the api clients created from the `ApiClient` are thread-safe and can be re-used. ## Author diff --git a/packages/service-accounts-sdk/docs/ServiceaccountsApi.md b/packages/service-accounts-sdk/docs/ServiceaccountsApi.md index bdeb2acf..ee69f1e8 100644 --- a/packages/service-accounts-sdk/docs/ServiceaccountsApi.md +++ b/packages/service-accounts-sdk/docs/ServiceaccountsApi.md @@ -1,21 +1,499 @@ -# ServiceaccountsApi +# ServiceAccountsApi -All URIs are relative to *http://localhost* +All URIs are relative to *https://sso.redhat.com/auth/realms/redhat-external* Method | HTTP request | Description ------------- | ------------- | ------------- -[**getServiceAccount**](ServiceaccountsApi.md#getServiceAccount) | **GET** /apis/service_accounts/v1/{id} | Get service account by id -[**resetServiceAccountSecret**](ServiceaccountsApi.md#resetServiceAccountSecret) | **POST** /apis/service_accounts/v1/{id}/resetSecret | Reset service account secret by id +[**createServiceAccount**](ServiceAccountsApi.md#createServiceAccount) | **POST** /apis/service_accounts/v1 | Create service account +[**createServiceAccountWithHttpInfo**](ServiceAccountsApi.md#createServiceAccountWithHttpInfo) | **POST** /apis/service_accounts/v1 | Create service account +[**deleteServiceAccount**](ServiceAccountsApi.md#deleteServiceAccount) | **DELETE** /apis/service_accounts/v1/{id} | Delete service account by id +[**deleteServiceAccountWithHttpInfo**](ServiceAccountsApi.md#deleteServiceAccountWithHttpInfo) | **DELETE** /apis/service_accounts/v1/{id} | Delete service account by id +[**getServiceAccount**](ServiceAccountsApi.md#getServiceAccount) | **GET** /apis/service_accounts/v1/{id} | Get service account by id +[**getServiceAccountWithHttpInfo**](ServiceAccountsApi.md#getServiceAccountWithHttpInfo) | **GET** /apis/service_accounts/v1/{id} | Get service account by id +[**getServiceAccounts**](ServiceAccountsApi.md#getServiceAccounts) | **GET** /apis/service_accounts/v1 | List all service accounts +[**getServiceAccountsWithHttpInfo**](ServiceAccountsApi.md#getServiceAccountsWithHttpInfo) | **GET** /apis/service_accounts/v1 | List all service accounts +[**resetServiceAccountSecret**](ServiceAccountsApi.md#resetServiceAccountSecret) | **POST** /apis/service_accounts/v1/{id}/resetSecret | Reset service account secret by id +[**resetServiceAccountSecretWithHttpInfo**](ServiceAccountsApi.md#resetServiceAccountSecretWithHttpInfo) | **POST** /apis/service_accounts/v1/{id}/resetSecret | Reset service account secret by id +[**updateServiceAccount**](ServiceAccountsApi.md#updateServiceAccount) | **PATCH** /apis/service_accounts/v1/{id} | Update service account +[**updateServiceAccountWithHttpInfo**](ServiceAccountsApi.md#updateServiceAccountWithHttpInfo) | **PATCH** /apis/service_accounts/v1/{id} | Update service account +## createServiceAccount + +> ServiceAccountData createServiceAccount(serviceAccountCreateRequestData) + +Create service account + +Create a service account. Created service account is associated with the user defined in the bearer token. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + ServiceAccountCreateRequestData serviceAccountCreateRequestData = new ServiceAccountCreateRequestData(); // ServiceAccountCreateRequestData | 'name' and 'description' of the service account + try { + ServiceAccountData result = apiInstance.createServiceAccount(serviceAccountCreateRequestData); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#createServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **serviceAccountCreateRequestData** | [**ServiceAccountCreateRequestData**](ServiceAccountCreateRequestData.md)| 'name' and 'description' of the service account | + +### Return type + +[**ServiceAccountData**](ServiceAccountData.md) + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | OK | - | +| **400** | All fields did not pass validation. | - | +| **401** | Unauthorized | - | +| **403** | Exceeded account level threshold limits for creating service accounts. | - | + +## createServiceAccountWithHttpInfo + +> ApiResponse createServiceAccount createServiceAccountWithHttpInfo(serviceAccountCreateRequestData) + +Create service account + +Create a service account. Created service account is associated with the user defined in the bearer token. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + ServiceAccountCreateRequestData serviceAccountCreateRequestData = new ServiceAccountCreateRequestData(); // ServiceAccountCreateRequestData | 'name' and 'description' of the service account + try { + ApiResponse response = apiInstance.createServiceAccountWithHttpInfo(serviceAccountCreateRequestData); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#createServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **serviceAccountCreateRequestData** | [**ServiceAccountCreateRequestData**](ServiceAccountCreateRequestData.md)| 'name' and 'description' of the service account | + +### Return type + +ApiResponse<[**ServiceAccountData**](ServiceAccountData.md)> + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | OK | - | +| **400** | All fields did not pass validation. | - | +| **401** | Unauthorized | - | +| **403** | Exceeded account level threshold limits for creating service accounts. | - | + + +## deleteServiceAccount + +> void deleteServiceAccount(id) + +Delete service account by id + +Delete service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + try { + apiInstance.deleteServiceAccount(id); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#deleteServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + + +null (empty response body) + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **404** | Not Found | - | + +## deleteServiceAccountWithHttpInfo + +> ApiResponse deleteServiceAccount deleteServiceAccountWithHttpInfo(id) + +Delete service account by id + +Delete service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + try { + ApiResponse response = apiInstance.deleteServiceAccountWithHttpInfo(id); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#deleteServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + + +ApiResponse + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **404** | Not Found | - | + + ## getServiceAccount -> ServiceAccountData getServiceAccount(id) +> ServiceAccountData getServiceAccount(id) + +Get service account by id + +Returns service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + try { + ServiceAccountData result = apiInstance.getServiceAccount(id); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#getServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +[**ServiceAccountData**](ServiceAccountData.md) + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **404** | Not Found | - | + +## getServiceAccountWithHttpInfo + +> ApiResponse getServiceAccount getServiceAccountWithHttpInfo(id) + +Get service account by id + +Returns service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + try { + ApiResponse response = apiInstance.getServiceAccountWithHttpInfo(id); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#getServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +ApiResponse<[**ServiceAccountData**](ServiceAccountData.md)> + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) -Get service account by id +### HTTP request headers -Returns service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **404** | Not Found | - | + + +## getServiceAccounts + +> List getServiceAccounts(first, max, clientId) + +List all service accounts + +Returns a list of service accounts created by a user. User information is obtained from the bearer token. The list is paginated with starting index as 'first' and page size as 'max'. ### Example @@ -26,24 +504,30 @@ import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; import com.openshift.cloud.api.serviceaccounts.invoker.models.*; -import com.openshift.cloud.api.serviceaccounts.ServiceaccountsApi; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); - - ServiceaccountsApi apiInstance = new ServiceaccountsApi(defaultClient); - String id = "id_example"; // String | + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + Integer first = 0; // Integer | + Integer max = 20; // Integer | + Set clientId = Arrays.asList(); // Set | try { - ServiceAccountData result = apiInstance.getServiceAccount(id); + List result = apiInstance.getServiceAccounts(first, max, clientId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ServiceaccountsApi#getServiceAccount"); + System.err.println("Exception when calling ServiceAccountsApi#getServiceAccounts"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -58,27 +542,112 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **String**| | + **first** | **Integer**| | [optional] [default to 0] + **max** | **Integer**| | [optional] [default to 20] + **clientId** | [**Set<String>**](String.md)| | [optional] ### Return type -[**ServiceAccountData**](ServiceAccountData.md) +[**List<ServiceAccountData>**](ServiceAccountData.md) + ### Authorization -[bearerAuth](../README.md#bearerAuth) +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request if page filters are invalid | - | +| **401** | Unauthorized | - | + +## getServiceAccountsWithHttpInfo + +> ApiResponse> getServiceAccounts getServiceAccountsWithHttpInfo(first, max, clientId) + +List all service accounts + +Returns a list of service accounts created by a user. User information is obtained from the bearer token. The list is paginated with starting index as 'first' and page size as 'max'. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + Integer first = 0; // Integer | + Integer max = 20; // Integer | + Set clientId = Arrays.asList(); // Set | + try { + ApiResponse> response = apiInstance.getServiceAccountsWithHttpInfo(first, max, clientId); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#getServiceAccounts"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **first** | **Integer**| | [optional] [default to 0] + **max** | **Integer**| | [optional] [default to 20] + **clientId** | [**Set<String>**](String.md)| | [optional] + +### Return type + +ApiResponse<[**List<ServiceAccountData>**](ServiceAccountData.md)> + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | -| **404** | Not Found | - | +| **400** | Bad Request if page filters are invalid | - | | **401** | Unauthorized | - | @@ -99,24 +668,28 @@ import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; import com.openshift.cloud.api.serviceaccounts.invoker.models.*; -import com.openshift.cloud.api.serviceaccounts.ServiceaccountsApi; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); - // Configure HTTP bearer authorization: bearerAuth - HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth"); - bearerAuth.setBearerToken("BEARER TOKEN"); + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); - ServiceaccountsApi apiInstance = new ServiceaccountsApi(defaultClient); + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); String id = "id_example"; // String | try { ServiceAccountData result = apiInstance.resetServiceAccountSecret(id); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ServiceaccountsApi#resetServiceAccountSecret"); + System.err.println("Exception when calling ServiceAccountsApi#resetServiceAccountSecret"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -137,20 +710,261 @@ Name | Type | Description | Notes [**ServiceAccountData**](ServiceAccountData.md) + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **404** | Not Found | - | + +## resetServiceAccountSecretWithHttpInfo + +> ApiResponse resetServiceAccountSecret resetServiceAccountSecretWithHttpInfo(id) + +Reset service account secret by id + +Reset service account secret by id . Throws not found exception if the service account is not found or the user does not have access to this service account + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + try { + ApiResponse response = apiInstance.resetServiceAccountSecretWithHttpInfo(id); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#resetServiceAccountSecret"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +ApiResponse<[**ServiceAccountData**](ServiceAccountData.md)> + + ### Authorization -[bearerAuth](../README.md#bearerAuth) +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **404** | Not Found | - | + + +## updateServiceAccount + +> ServiceAccountData updateServiceAccount(id, serviceAccountRequestData) + +Update service account + +Update a service account by id. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + ServiceAccountRequestData serviceAccountRequestData = new ServiceAccountRequestData(); // ServiceAccountRequestData | 'name' and 'description' of the service account + try { + ServiceAccountData result = apiInstance.updateServiceAccount(id, serviceAccountRequestData); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#updateServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **serviceAccountRequestData** | [**ServiceAccountRequestData**](ServiceAccountRequestData.md)| 'name' and 'description' of the service account | + +### Return type + +[**ServiceAccountData**](ServiceAccountData.md) + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | - | +| **400** | Bad Request | - | +| **401** | Unauthorized | - | | **404** | Not Found | - | + +## updateServiceAccountWithHttpInfo + +> ApiResponse updateServiceAccount updateServiceAccountWithHttpInfo(id, serviceAccountRequestData) + +Update service account + +Update a service account by id. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; +import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.auth.*; +import com.openshift.cloud.api.serviceaccounts.invoker.models.*; +import com.openshift.cloud.api.serviceaccounts.ServiceAccountsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://sso.redhat.com/auth/realms/redhat-external"); + + // Configure OAuth2 access token for authorization: authFlow + OAuth authFlow = (OAuth) defaultClient.getAuthentication("authFlow"); + authFlow.setAccessToken("YOUR ACCESS TOKEN"); + + // Configure OAuth2 access token for authorization: serviceAccounts + OAuth serviceAccounts = (OAuth) defaultClient.getAuthentication("serviceAccounts"); + serviceAccounts.setAccessToken("YOUR ACCESS TOKEN"); + + ServiceAccountsApi apiInstance = new ServiceAccountsApi(defaultClient); + String id = "id_example"; // String | + ServiceAccountRequestData serviceAccountRequestData = new ServiceAccountRequestData(); // ServiceAccountRequestData | 'name' and 'description' of the service account + try { + ApiResponse response = apiInstance.updateServiceAccountWithHttpInfo(id, serviceAccountRequestData); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ServiceAccountsApi#updateServiceAccount"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **serviceAccountRequestData** | [**ServiceAccountRequestData**](ServiceAccountRequestData.md)| 'name' and 'description' of the service account | + +### Return type + +ApiResponse<[**ServiceAccountData**](ServiceAccountData.md)> + + +### Authorization + +[authFlow](../README.md#authFlow), [serviceAccounts](../README.md#serviceAccounts) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | | **401** | Unauthorized | - | +| **404** | Not Found | - | diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/ServiceAccountsApi.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/ServiceAccountsApi.java index 3ba49da7..4383b510 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/ServiceAccountsApi.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/ServiceAccountsApi.java @@ -1,12 +1,22 @@ +/* + * Service Accounts API Documentation + * This is the API documentation for Service Accounts + * + * The version of the OpenAPI document: 5.0.19 + * Contact: it-user-team-list@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.serviceaccounts; -import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; import com.openshift.cloud.api.serviceaccounts.invoker.ApiClient; -import com.openshift.cloud.api.serviceaccounts.invoker.Configuration; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import com.openshift.cloud.api.serviceaccounts.invoker.ApiResponse; import com.openshift.cloud.api.serviceaccounts.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.serviceaccounts.models.Error; import com.openshift.cloud.api.serviceaccounts.models.RedHatErrorRepresentation; import com.openshift.cloud.api.serviceaccounts.models.ServiceAccountCreateRequestData; @@ -15,74 +25,139 @@ import java.util.Set; import com.openshift.cloud.api.serviceaccounts.models.ValidationExceptionData; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ServiceAccountsApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ServiceAccountsApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ServiceAccountsApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } /** * Create service account * Create a service account. Created service account is associated with the user defined in the bearer token. * @param serviceAccountCreateRequestData 'name' and 'description' of the service account (required) - * @return a {@code ServiceAccountData} + * @return ServiceAccountData * @throws ApiException if fails to make API call */ public ServiceAccountData createServiceAccount(ServiceAccountCreateRequestData serviceAccountCreateRequestData) throws ApiException { - Object localVarPostBody = serviceAccountCreateRequestData; - + ApiResponse localVarResponse = createServiceAccountWithHttpInfo(serviceAccountCreateRequestData); + return localVarResponse.getData(); + } + + /** + * Create service account + * Create a service account. Created service account is associated with the user defined in the bearer token. + * @param serviceAccountCreateRequestData 'name' and 'description' of the service account (required) + * @return ApiResponse<ServiceAccountData> + * @throws ApiException if fails to make API call + */ + public ApiResponse createServiceAccountWithHttpInfo(ServiceAccountCreateRequestData serviceAccountCreateRequestData) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createServiceAccountRequestBuilder(serviceAccountCreateRequestData); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("createServiceAccount", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder createServiceAccountRequestBuilder(ServiceAccountCreateRequestData serviceAccountCreateRequestData) throws ApiException { // verify the required parameter 'serviceAccountCreateRequestData' is set if (serviceAccountCreateRequestData == null) { throw new ApiException(400, "Missing the required parameter 'serviceAccountCreateRequestData' when calling createServiceAccount"); } - - // create path and map variables - String localVarPath = "/apis/service_accounts/v1".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/apis/service_accounts/v1"; - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "authFlow", "serviceAccounts" }; + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(serviceAccountCreateRequestData); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Delete service account by id * Delete service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account @@ -90,221 +165,387 @@ public ServiceAccountData createServiceAccount(ServiceAccountCreateRequestData s * @throws ApiException if fails to make API call */ public void deleteServiceAccount(String id) throws ApiException { - Object localVarPostBody = null; - + deleteServiceAccountWithHttpInfo(id); + } + + /** + * Delete service account by id + * Delete service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account + * @param id (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteServiceAccountWithHttpInfo(String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteServiceAccountRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("deleteServiceAccount", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + + null + ); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deleteServiceAccountRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling deleteServiceAccount"); } - - // create path and map variables - String localVarPath = "/apis/service_accounts/v1/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/apis/service_accounts/v1/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "authFlow", "serviceAccounts" }; + localVarRequestBuilder.header("Accept", "application/json"); - - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } /** * Get service account by id * Returns service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account * @param id (required) - * @return a {@code ServiceAccountData} + * @return ServiceAccountData * @throws ApiException if fails to make API call */ public ServiceAccountData getServiceAccount(String id) throws ApiException { - Object localVarPostBody = null; - + ApiResponse localVarResponse = getServiceAccountWithHttpInfo(id); + return localVarResponse.getData(); + } + + /** + * Get service account by id + * Returns service account by id. Throws not found exception if the service account is not found or the user does not have access to this service account + * @param id (required) + * @return ApiResponse<ServiceAccountData> + * @throws ApiException if fails to make API call + */ + public ApiResponse getServiceAccountWithHttpInfo(String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getServiceAccountRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getServiceAccount", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getServiceAccountRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getServiceAccount"); } - - // create path and map variables - String localVarPath = "/apis/service_accounts/v1/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/apis/service_accounts/v1/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "authFlow", "serviceAccounts" }; + localVarRequestBuilder.header("Accept", "application/json"); - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * List all service accounts * Returns a list of service accounts created by a user. User information is obtained from the bearer token. The list is paginated with starting index as 'first' and page size as 'max'. * @param first (optional, default to 0) * @param max (optional, default to 20) - * @param clientId (optional) - * @return a {@code List} + * @param clientId (optional + * @return List<ServiceAccountData> * @throws ApiException if fails to make API call */ public List getServiceAccounts(Integer first, Integer max, Set clientId) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/service_accounts/v1".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "first", first)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "max", max)); - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "clientId", clientId)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "authFlow", "serviceAccounts" }; - - GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); + ApiResponse> localVarResponse = getServiceAccountsWithHttpInfo(first, max, clientId); + return localVarResponse.getData(); + } + + /** + * List all service accounts + * Returns a list of service accounts created by a user. User information is obtained from the bearer token. The list is paginated with starting index as 'first' and page size as 'max'. + * @param first (optional, default to 0) + * @param max (optional, default to 20) + * @param clientId (optional + * @return ApiResponse<List<ServiceAccountData>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getServiceAccountsWithHttpInfo(Integer first, Integer max, Set clientId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getServiceAccountsRequestBuilder(first, max, clientId); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("getServiceAccounts", localVarResponse); + } + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream + + ); + } finally { } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getServiceAccountsRequestBuilder(Integer first, Integer max, Set clientId) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/apis/service_accounts/v1"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("first", first)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("max", max)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "clientId", clientId)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Reset service account secret by id * Reset service account secret by id . Throws not found exception if the service account is not found or the user does not have access to this service account * @param id (required) - * @return a {@code ServiceAccountData} + * @return ServiceAccountData * @throws ApiException if fails to make API call */ public ServiceAccountData resetServiceAccountSecret(String id) throws ApiException { - Object localVarPostBody = null; - + ApiResponse localVarResponse = resetServiceAccountSecretWithHttpInfo(id); + return localVarResponse.getData(); + } + + /** + * Reset service account secret by id + * Reset service account secret by id . Throws not found exception if the service account is not found or the user does not have access to this service account + * @param id (required) + * @return ApiResponse<ServiceAccountData> + * @throws ApiException if fails to make API call + */ + public ApiResponse resetServiceAccountSecretWithHttpInfo(String id) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = resetServiceAccountSecretRequestBuilder(id); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("resetServiceAccountSecret", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder resetServiceAccountSecretRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling resetServiceAccountSecret"); } - - // create path and map variables - String localVarPath = "/apis/service_accounts/v1/{id}/resetSecret".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/apis/service_accounts/v1/{id}/resetSecret" + .replace("{id}", ApiClient.urlEncode(id.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "authFlow", "serviceAccounts" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Update service account * Update a service account by id. * @param id (required) * @param serviceAccountRequestData 'name' and 'description' of the service account (required) - * @return a {@code ServiceAccountData} + * @return ServiceAccountData * @throws ApiException if fails to make API call */ public ServiceAccountData updateServiceAccount(String id, ServiceAccountRequestData serviceAccountRequestData) throws ApiException { - Object localVarPostBody = serviceAccountRequestData; - + ApiResponse localVarResponse = updateServiceAccountWithHttpInfo(id, serviceAccountRequestData); + return localVarResponse.getData(); + } + + /** + * Update service account + * Update a service account by id. + * @param id (required) + * @param serviceAccountRequestData 'name' and 'description' of the service account (required) + * @return ApiResponse<ServiceAccountData> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateServiceAccountWithHttpInfo(String id, ServiceAccountRequestData serviceAccountRequestData) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateServiceAccountRequestBuilder(id, serviceAccountRequestData); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("updateServiceAccount", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateServiceAccountRequestBuilder(String id, ServiceAccountRequestData serviceAccountRequestData) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling updateServiceAccount"); } - // verify the required parameter 'serviceAccountRequestData' is set if (serviceAccountRequestData == null) { throw new ApiException(400, "Missing the required parameter 'serviceAccountRequestData' when calling updateServiceAccount"); } - - // create path and map variables - String localVarPath = "/apis/service_accounts/v1/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/apis/service_accounts/v1/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "authFlow", "serviceAccounts" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(serviceAccountRequestData); + localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiClient.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiClient.java index 2effd7d8..1afae1fc 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiClient.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiClient.java @@ -1,755 +1,417 @@ +/* + * Service Accounts API Documentation + * This is the API documentation for Service Accounts + * + * The version of the OpenAPI document: 5.0.19 + * Contact: it-user-team-list@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.serviceaccounts.invoker; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; + import java.io.InputStream; -import java.io.UnsupportedEncodingException; +import java.net.URI; import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Collection; import java.util.Collections; -import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TimeZone; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.time.OffsetDateTime; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import org.jboss.logging.Logger; -import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.jboss.resteasy.spi.ResteasyProviderFactory; - -import com.openshift.cloud.api.serviceaccounts.invoker.auth.Authentication; -import com.openshift.cloud.api.serviceaccounts.invoker.auth.HttpBasicAuth; -import com.openshift.cloud.api.serviceaccounts.invoker.auth.HttpBearerAuth; -import com.openshift.cloud.api.serviceaccounts.invoker.auth.ApiKeyAuth; -import com.openshift.cloud.api.serviceaccounts.invoker.auth.OAuth; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiClient extends JavaTimeFormatter { - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String basePath = "https://sso.redhat.com/auth/realms/redhat-external"; - private boolean debugging = false; - - private Client httpClient; - private JSON json; - private String tempFolderPath = null; - - private Map authentications; - - private int statusCode; - private Map> responseHeaders; - - private DateFormat dateFormat; - - public ApiClient() { - json = new JSON(); - httpClient = buildHttpClient(debugging); - - this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT); - - // Use UTC as the default time zone. - this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - - this.json.setDateFormat((DateFormat) dateFormat.clone()); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/5.0.19/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("authFlow", new OAuth()); - authentications.put("bearerAuth", new HttpBearerAuth("bearer")); - authentications.put("serviceAccounts", new OAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class.

+ * + *

This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe.

+ * + *

The setter methods of this class return the current object to facilitate + * a fluent style of configuration.

+ */ +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiClient { + + private HttpClient.Builder builder; + private ObjectMapper mapper; + private String scheme; + private String host; + private int port; + private String basePath; + private Consumer interceptor; + private Consumer> responseInterceptor; + private Consumer> asyncResponseInterceptor; + private Duration readTimeout; + + private static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); } /** - * Gets the JSON instance to do JSON serialization and deserialization. - * @return the JSON utility class + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. */ - public JSON getJSON() { - return json; - } - - public Client getHttpClient() { - return httpClient; - } - - public ApiClient setHttpClient(Client httpClient) { - this.httpClient = httpClient; - return this; - } - - public String getBasePath() { - return basePath; - } - - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } /** - * Gets the status code of the previous request - * @return the status code of the previous request + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. */ - public int getStatusCode() { - return statusCode; + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); } /** - * Gets the response headers of the previous request - * @return the response headers of the previous request + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. */ - public Map> getResponseHeaders() { - return responseHeaders; - } + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } - /** - * Get authentications (key: authentication name, value: authentication). - * @return the authentications - */ - public Map getAuthentications() { - return authentications; - } + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username the username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password the password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); } - throw new RuntimeException("No HTTP basic authentication configured!"); + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); } /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey the API key + * Ctor. */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; } /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix the API key prefix + * Ctor. */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; } - /** - * Helper method to set access token for the first OAuth2 authentication. - * @param accessToken the access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); + protected ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); + return mapper; } - /** - * Set the User-Agent header's value (by adding to the default header map). - * @param userAgent the User-Agent header value - * @return this {@code ApiClient} - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; + protected String getDefaultBaseUri() { + return "https://sso.redhat.com/auth/realms/redhat-external"; } - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return this {@code ApiClient} - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; + protected HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); } - /** - * Check that whether debugging is enabled for this API client. - * @return {@code true} if debugging is enabled for this API client - */ - public boolean isDebugging() { - return debugging; + public void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); } /** - * Enable/disable debugging for this API client. + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. * - * @param debugging To enable (true) or disable (false) debugging - * @return this {@code ApiClient} + * @param builder Custom client builder. + * @return This object. */ - public ApiClient setDebugging(boolean debugging) { - this.debugging = debugging; - // Rebuild HTTP Client according to the new "debugging" value. - this.httpClient = buildHttpClient(debugging); + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; return this; } /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe.

* - * @return the temporary folder path - * @see createTempFile + * @return The HTTP client. */ - public String getTempFolderPath() { - return tempFolderPath; + public HttpClient getHttpClient() { + return builder.build(); } - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; return this; } /** - * Get the date format used to parse/format date parameters. - * @return the date format used to parse/format date parameters + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. */ - public DateFormat getDateFormat() { - return dateFormat; + public ObjectMapper getObjectMapper() { + return mapper.copy(); } /** - * Set the date format used to parse/format date parameters. - * @param dateFormat a date format used to parse/format date parameters - * @return this {@code ApiClient} + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - // also set the date format for model (de)serialization with Date properties - this.json.setDateFormat((DateFormat) dateFormat.clone()); + public ApiClient setHost(String host) { + this.host = host; return this; } /** - * Parse the given string into Date object. - * @param str a string to parse - * @return a {@code Date} object + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. */ - public Date parseDate(String str) { - try { - return dateFormat.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } + public ApiClient setPort(int port) { + this.port = port; + return this; } /** - * Format the given Date object into string. - * @param date a {@code Date} object to format - * @return the {@code String} version of the {@code Date} object + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. */ - public String formatDate(Date date) { - return dateFormat.format(date); + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; } /** - * Format the given parameter object into string. - * @param param an object to format - * @return the {@code String} version of the object + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /* - Format to {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null) return params; - - Collection valueCollection = null; - if (value instanceof Collection) { - valueCollection = (Collection) value; - } else { - params.add(new Pair(name, parameterToString(value))); - return params; - } - - if (valueCollection.isEmpty()){ - return params; - } - - // get the collection format - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv - - // create the params based on the collection format - if (collectionFormat.equals("multi")) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } - - return params; - } - - String delimiter = ","; - - if (collectionFormat.equals("csv")) { - delimiter = ","; - } else if (collectionFormat.equals("ssv")) { - delimiter = " "; - } else if (collectionFormat.equals("tsv")) { - delimiter = "\t"; - } else if (collectionFormat.equals("pipes")) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - params.add(new Pair(name, sb.substring(1))); - - return params; + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; } /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out.

+ * + *

This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring.

* - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; } /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. + * Get the custom interceptor. * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * JSON will be used. + * @return The custom interceptor that was set, or null if there isn't any. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return "application/json"; - } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - return contentTypes[0]; + public Consumer getRequestInterceptor() { + return interceptor; } /** - * Escape the given string to be used as URL query value. - * @param str a {@code String} to escape - * @return the escaped version of the {@code String} + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; } - /** - * Serialize the given Java object into string entity according the given - * Content-Type (only JSON is supported for now). - * @param obj the object to serialize - * @param formParams the form parameters - * @param contentType the content type - * @return an {@code Entity} - * @throws ApiException on failure to serialize + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. */ - public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { - Entity entity = null; - if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); - //MultiPart multiPart = new MultiPart(); - for (Entry param: formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } catch (FileNotFoundException e) { - throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); - } - } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } - } - entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); - } else if (contentType.startsWith("application/x-www-form-urlencoded")) { - Form form = new Form(); - for (Entry param: formParams.entrySet()) { - form.param(param.getKey(), parameterToString(param.getValue())); - } - entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); - } else { - // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); - } - return entity; + public Consumer> getResponseInterceptor() { + return responseInterceptor; } /** - * Deserialize response body to Java object according to the Content-Type. - * @param a Java type parameter - * @param response the response body to deserialize - * @param returnType a Java type to deserialize into - * @return a deserialized Java object - * @throws ApiException on failure to deserialize + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public T deserialize(Response response, GenericType returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - return (T) response.readEntity(byte[].class); - } else if (returnType.equals(File.class)) { - // Handle file downloading. - @SuppressWarnings("unchecked") - T file = (T) downloadFileFromResponse(response); - return file; - } - - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - if (contentType == null) - throw new ApiException(500, "missing Content-Type in response"); - - return response.readEntity(returnType); + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; } - /** - * Download file from the given response. - * @param response a response - * @return a file from the given response - * @throws ApiException If fail to read file content from response and write to disk + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - Files.copy(response.readEntity(InputStream.class), file.toPath()); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) - filename = matcher.group(1); - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; } /** - * Invoke API by sending HTTP request with the given options. + * Set the read timeout for the http client. * - * @param a Java type parameter - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param accept The request's Accept header - * @param contentType The request's Content-Type header - * @param authNames The authentications to apply - * @param returnType The return type into which to deserialize the response - * @return The response body in type of string - * @throws ApiException if the invocation failed - */ - public T invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - - // Not using `.target(this.basePath).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" - WebTarget target = httpClient.target(this.basePath + path); - - if (queryParams != null) { - for (Pair queryParam : queryParams) { - if (queryParam.getValue() != null) { - target = target.queryParam(queryParam.getName(), queryParam.getValue()); - } - } - } - - Invocation.Builder invocationBuilder = target.request().accept(accept); - - for (Entry headerParamsEntry : headerParams.entrySet()) { - String value = headerParamsEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(headerParamsEntry.getKey(), value); - } - } - - for (Entry defaultHeaderEntry: defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(defaultHeaderEntry.getKey())) { - String value = defaultHeaderEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(defaultHeaderEntry.getKey(), value); - } - } - } - - for (Entry cookieParamsEntry : cookieParams.entrySet()) { - String value = cookieParamsEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(cookieParamsEntry.getKey(), value); - } - } - - for (Entry defaultCookieEntry: defaultHeaderMap.entrySet()) { - if (!cookieParams.containsKey(defaultCookieEntry.getKey())) { - String value = defaultCookieEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(defaultCookieEntry.getKey(), value); - } - } - } - - Entity entity = serialize(body, formParams, contentType); - - Response response = null; - - if ("GET".equals(method)) { - response = invocationBuilder.get(); - } else if ("POST".equals(method)) { - response = invocationBuilder.post(entity); - } else if ("PUT".equals(method)) { - response = invocationBuilder.put(entity); - } else if ("DELETE".equals(method)) { - response = invocationBuilder.method("DELETE", entity); - } else if ("PATCH".equals(method)) { - response = invocationBuilder.method("PATCH", entity); - } else if ("HEAD".equals(method)) { - response = invocationBuilder.head(); - } else if ("OPTIONS".equals(method)) { - response = invocationBuilder.options(); - } else if ("TRACE".equals(method)) { - response = invocationBuilder.trace(); - } else { - throw new ApiException(500, "unknown method type " + method); - } - - statusCode = response.getStatusInfo().getStatusCode(); - responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return null; - } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { - if (returnType == null) - return null; - else - return deserialize(response, returnType); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } - } - - /** - * Build the Client used to make HTTP requests. + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. */ - private Client buildHttpClient(boolean debugging) { - final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance()); - clientConfig.register(json); - if(debugging){ - clientConfig.register(Logger.class); - } - return ClientBuilder.newClient(clientConfig); - } - private Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); - for (Entry> entry: response.getHeaders().entrySet()) { - List values = entry.getValue(); - List headers = new ArrayList(); - for (Object o : values) { - headers.add(String.valueOf(o)); - } - responseHeaders.put(entry.getKey(), headers); - } - return responseHeaders; + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; } /** - * Update query and header parameters based on authentication settings. + * Get the read timeout that was set. * - * @param authNames The authentications to apply + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. */ - private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams, cookieParams); - } + public Duration getReadTimeout() { + return readTimeout; } } diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiException.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiException.java index da7abf1a..292d05f4 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiException.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiException.java @@ -13,13 +13,12 @@ package com.openshift.cloud.api.serviceaccounts.invoker; -import java.util.Map; -import java.util.List; +import java.net.http.HttpHeaders; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; - private Map> responseHeaders = null; + private HttpHeaders responseHeaders = null; private String responseBody = null; public ApiException() {} @@ -32,22 +31,22 @@ public ApiException(String message) { super(message); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { this(message, throwable, code, responseHeaders, null); } - public ApiException(int code, Map> responseHeaders, String responseBody) { + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { this((String) null, (Throwable) null, code, responseHeaders, responseBody); } @@ -56,7 +55,7 @@ public ApiException(int code, String message) { this.code = code; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; @@ -74,9 +73,9 @@ public int getCode() { /** * Get the HTTP response headers. * - * @return A map of list of string + * @return Headers as an HttpHeaders object */ - public Map> getResponseHeaders() { + public HttpHeaders getResponseHeaders() { return responseHeaders; } diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiResponse.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiResponse.java new file mode 100644 index 00000000..e4a4db9d --- /dev/null +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/ApiResponse.java @@ -0,0 +1,59 @@ +/* + * Service Accounts API Documentation + * This is the API documentation for Service Accounts + * + * The version of the OpenAPI document: 5.0.19 + * Contact: it-user-team-list@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.openshift.cloud.api.serviceaccounts.invoker; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Configuration.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Configuration.java index 48fd468e..c40a67fc 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Configuration.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Configuration.java @@ -13,7 +13,7 @@ package com.openshift.cloud.api.serviceaccounts.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JSON.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JSON.java index 05b18361..af2d8855 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JSON.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JSON.java @@ -3,40 +3,238 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import org.openapitools.jackson.nullable.JsonNullableModule; -import com.fasterxml.jackson.datatype.jsr310.*; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.openshift.cloud.api.serviceaccounts.models.*; import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; -import javax.ws.rs.ext.ContextResolver; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class JSON implements ContextResolver { +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JSON { private ObjectMapper mapper; public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); - mapper.registerModule(new JavaTimeModule()); } /** * Set the date format for JSON (de)serialization with Date properties. - * @param dateFormat the date format to set + * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { mapper.setDateFormat(dateFormat); } - @Override - public ObjectMapper getContext(Class type) { - return mapper; + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; } } diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JavaTimeFormatter.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JavaTimeFormatter.java deleted file mode 100644 index a6b80e65..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/JavaTimeFormatter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.openshift.cloud.api.serviceaccounts.invoker; - -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeParseException; - -/** - * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. - * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class JavaTimeFormatter { - - private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - - /** - * Get the date format used to parse/format {@code OffsetDateTime} parameters. - * @return DateTimeFormatter - */ - public DateTimeFormatter getOffsetDateTimeFormatter() { - return offsetDateTimeFormatter; - } - - /** - * Set the date format used to parse/format {@code OffsetDateTime} parameters. - * @param offsetDateTimeFormatter {@code DateTimeFormatter} - */ - public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { - this.offsetDateTimeFormatter = offsetDateTimeFormatter; - } - - /** - * Parse the given string into {@code OffsetDateTime} object. - * @param str String - * @return {@code OffsetDateTime} - */ - public OffsetDateTime parseOffsetDateTime(String str) { - try { - return OffsetDateTime.parse(str, offsetDateTimeFormatter); - } catch (DateTimeParseException e) { - throw new RuntimeException(e); - } - } - /** - * Format the given {@code OffsetDateTime} object into string. - * @param offsetDateTime {@code OffsetDateTime} - * @return {@code OffsetDateTime} in string format - */ - public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { - return offsetDateTimeFormatter.format(offsetDateTime); - } -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Pair.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Pair.java index 7eda2293..19769dd9 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Pair.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/Pair.java @@ -13,7 +13,7 @@ package com.openshift.cloud.api.serviceaccounts.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pair { private String name = ""; private String value = ""; diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/StringUtil.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/StringUtil.java deleted file mode 100644 index 0269d9bb..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/StringUtil.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker; - -import java.util.Collection; -import java.util.Iterator; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) { - return true; - } - if (value != null && value.equalsIgnoreCase(str)) { - return true; - } - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) { - return ""; - } - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } - - /** - * Join a list of strings with the given separator. - * - * @param list The list of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(Collection list, String separator) { - Iterator iterator = list.iterator(); - StringBuilder out = new StringBuilder(); - if (iterator.hasNext()) { - out.append(iterator.next()); - } - while (iterator.hasNext()) { - out.append(separator).append(iterator.next()); - } - return out.toString(); - } -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/ApiKeyAuth.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/ApiKeyAuth.java deleted file mode 100644 index 75c92b12..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/ApiKeyAuth.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker.auth; - -import com.openshift.cloud.api.serviceaccounts.invoker.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } else if ("cookie".equals(location)) { - cookieParams.put(paramName, value); - } - } -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/Authentication.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/Authentication.java deleted file mode 100644 index 97501d75..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/Authentication.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker.auth; - -import com.openshift.cloud.api.serviceaccounts.invoker.Pair; - -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/HttpBasicAuth.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/HttpBasicAuth.java deleted file mode 100644 index b6053028..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/HttpBasicAuth.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker.auth; - -import com.openshift.cloud.api.serviceaccounts.invoker.Pair; - -import java.util.Base64; -import java.nio.charset.StandardCharsets; - -import java.util.Map; -import java.util.List; - - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if (username == null && password == null) { - return; - } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); - } -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/HttpBearerAuth.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/HttpBearerAuth.java deleted file mode 100644 index 7e709e32..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/HttpBearerAuth.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker.auth; - -import com.openshift.cloud.api.serviceaccounts.invoker.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class HttpBearerAuth implements Authentication { - private final String scheme; - private String bearerToken; - - public HttpBearerAuth(String scheme) { - this.scheme = scheme; - } - - /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @return The bearer token - */ - public String getBearerToken() { - return bearerToken; - } - - /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. - * - * @param bearerToken The bearer token to send in the Authorization header - */ - public void setBearerToken(String bearerToken) { - this.bearerToken = bearerToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { - return; - } - - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); - } - - private static String upperCaseBearer(String scheme) { - return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; - } -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/OAuth.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/OAuth.java deleted file mode 100644 index 8e3bd8ca..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/OAuth.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker.auth; - -import com.openshift.cloud.api.serviceaccounts.invoker.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/OAuthFlow.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/OAuthFlow.java deleted file mode 100644 index c59ca39f..00000000 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/invoker/auth/OAuthFlow.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Service Accounts API Documentation - * This is the API documentation for Service Accounts - * - * The version of the OpenAPI document: 5.0.19 - * Contact: it-user-team-list@redhat.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package com.openshift.cloud.api.serviceaccounts.invoker.auth; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public enum OAuthFlow { - accessCode, //called authorizationCode in OpenAPI 3.0 - implicit, - password, - application //called clientCredentials in OpenAPI 3.0 -} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/AbstractOpenApiSchema.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/AbstractOpenApiSchema.java new file mode 100644 index 00000000..b1cec3a3 --- /dev/null +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/AbstractOpenApiSchema.java @@ -0,0 +1,148 @@ +/* + * Service Accounts API Documentation + * This is the API documentation for Service Accounts + * + * The version of the OpenAPI document: 5.0.19 + * Contact: it-user-team-list@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.openshift.cloud.api.serviceaccounts.models; + +import com.openshift.cloud.api.serviceaccounts.invoker.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/Error.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/Error.java index 6c87e3df..8ec89f5b 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/Error.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/Error.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Error @@ -31,8 +33,7 @@ @JsonPropertyOrder({ Error.JSON_PROPERTY_ERROR }) -@JsonTypeName("Error") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Error { public static final String JSON_PROPERTY_ERROR = "error"; private String error; @@ -41,7 +42,6 @@ public Error() { } public Error error(String error) { - this.error = error; return this; } @@ -67,6 +67,9 @@ public void setError(String error) { } + /** + * Return true if this Error object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/RedHatErrorRepresentation.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/RedHatErrorRepresentation.java index 98f45f9e..acd1b554 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/RedHatErrorRepresentation.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/RedHatErrorRepresentation.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * RedHatErrorRepresentation @@ -32,8 +34,7 @@ RedHatErrorRepresentation.JSON_PROPERTY_ERROR, RedHatErrorRepresentation.JSON_PROPERTY_ERROR_DESCRIPTION }) -@JsonTypeName("RedHatErrorRepresentation") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class RedHatErrorRepresentation { /** * Gets or Sets error @@ -84,7 +85,6 @@ public RedHatErrorRepresentation() { } public RedHatErrorRepresentation error(ErrorEnum error) { - this.error = error; return this; } @@ -111,7 +111,6 @@ public void setError(ErrorEnum error) { public RedHatErrorRepresentation errorDescription(String errorDescription) { - this.errorDescription = errorDescription; return this; } @@ -137,6 +136,9 @@ public void setErrorDescription(String errorDescription) { } + /** + * Return true if this RedHatErrorRepresentation object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountCreateRequestData.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountCreateRequestData.java index f43d2c4c..dcae7fad 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountCreateRequestData.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountCreateRequestData.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ServiceAccountCreateRequestData @@ -32,8 +34,7 @@ ServiceAccountCreateRequestData.JSON_PROPERTY_NAME, ServiceAccountCreateRequestData.JSON_PROPERTY_DESCRIPTION }) -@JsonTypeName("ServiceAccountCreateRequestData") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ServiceAccountCreateRequestData { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -45,7 +46,6 @@ public ServiceAccountCreateRequestData() { } public ServiceAccountCreateRequestData name(String name) { - this.name = name; return this; } @@ -72,7 +72,6 @@ public void setName(String name) { public ServiceAccountCreateRequestData description(String description) { - this.description = description; return this; } @@ -98,6 +97,9 @@ public void setDescription(String description) { } + /** + * Return true if this ServiceAccountCreateRequestData object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountData.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountData.java index baa6a5f6..7e73fc7e 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountData.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountData.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ServiceAccountData @@ -37,8 +39,7 @@ ServiceAccountData.JSON_PROPERTY_CREATED_BY, ServiceAccountData.JSON_PROPERTY_CREATED_AT }) -@JsonTypeName("ServiceAccountData") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ServiceAccountData { public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -65,7 +66,6 @@ public ServiceAccountData() { } public ServiceAccountData id(String id) { - this.id = id; return this; } @@ -92,7 +92,6 @@ public void setId(String id) { public ServiceAccountData clientId(String clientId) { - this.clientId = clientId; return this; } @@ -119,7 +118,6 @@ public void setClientId(String clientId) { public ServiceAccountData secret(String secret) { - this.secret = secret; return this; } @@ -146,7 +144,6 @@ public void setSecret(String secret) { public ServiceAccountData name(String name) { - this.name = name; return this; } @@ -173,7 +170,6 @@ public void setName(String name) { public ServiceAccountData description(String description) { - this.description = description; return this; } @@ -200,7 +196,6 @@ public void setDescription(String description) { public ServiceAccountData createdBy(String createdBy) { - this.createdBy = createdBy; return this; } @@ -227,7 +222,6 @@ public void setCreatedBy(String createdBy) { public ServiceAccountData createdAt(Long createdAt) { - this.createdAt = createdAt; return this; } @@ -253,6 +247,9 @@ public void setCreatedAt(Long createdAt) { } + /** + * Return true if this ServiceAccountData object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountRequestData.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountRequestData.java index ef5b8094..7576cc35 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountRequestData.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ServiceAccountRequestData.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ServiceAccountRequestData @@ -32,8 +34,7 @@ ServiceAccountRequestData.JSON_PROPERTY_NAME, ServiceAccountRequestData.JSON_PROPERTY_DESCRIPTION }) -@JsonTypeName("ServiceAccountRequestData") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ServiceAccountRequestData { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -45,7 +46,6 @@ public ServiceAccountRequestData() { } public ServiceAccountRequestData name(String name) { - this.name = name; return this; } @@ -72,7 +72,6 @@ public void setName(String name) { public ServiceAccountRequestData description(String description) { - this.description = description; return this; } @@ -98,6 +97,9 @@ public void setDescription(String description) { } + /** + * Return true if this ServiceAccountRequestData object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ValidationExceptionData.java b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ValidationExceptionData.java index 4db7cbf8..7a71b03c 100644 --- a/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ValidationExceptionData.java +++ b/packages/service-accounts-sdk/src/main/java/com/openshift/cloud/api/serviceaccounts/models/ValidationExceptionData.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.List; import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ValidationExceptionData @@ -36,8 +38,7 @@ ValidationExceptionData.JSON_PROPERTY_ERROR, ValidationExceptionData.JSON_PROPERTY_ERROR_DESCRIPTION }) -@JsonTypeName("ValidationExceptionData") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ValidationExceptionData { public static final String JSON_PROPERTY_FIELDS = "fields"; private Map fields = null; @@ -52,7 +53,6 @@ public ValidationExceptionData() { } public ValidationExceptionData fields(Map fields) { - this.fields = fields; return this; } @@ -87,7 +87,6 @@ public void setFields(Map fields) { public ValidationExceptionData error(String error) { - this.error = error; return this; } @@ -114,7 +113,6 @@ public void setError(String error) { public ValidationExceptionData errorDescription(String errorDescription) { - this.errorDescription = errorDescription; return this; } @@ -140,6 +138,9 @@ public void setErrorDescription(String errorDescription) { } + /** + * Return true if this ValidationExceptionData object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/README.md b/packages/smartevents-management-sdk/README.md index e9050f88..0b718964 100644 --- a/packages/smartevents-management-sdk/README.md +++ b/packages/smartevents-management-sdk/README.md @@ -13,7 +13,7 @@ The API exposed by the fleet manager of the SmartEvents service. Building the API client library requires: -1. Java 1.8+ +1. Java 11+ 2. Maven/Gradle ## Installation @@ -50,14 +50,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy - repositories { - mavenCentral() // Needed if the 'smartevents-management-sdk' jar has been published to maven central. - mavenLocal() // Needed if the 'smartevents-management-sdk' jar has been published to the local maven repo. - } - - dependencies { - implementation "com.redhat.cloud:smartevents-management-sdk:0.0.2" - } +compile "com.redhat.cloud:smartevents-management-sdk:0.0.2" ``` ### Others @@ -80,25 +73,21 @@ Please follow the [installation](#installation) instruction and execute the foll ```java import com.openshift.cloud.api.smartevents.invoker.*; -import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.models.*; import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; public class BridgesApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - // Configure HTTP bearer authorization: bearer - HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); - bearer.setBearerToken("BEARER TOKEN"); - + // Configure clients using the `defaultClient` object, such as + // overriding the host and port, timeout, etc. BridgesApi apiInstance = new BridgesApi(defaultClient); BridgeRequest bridgeRequest = new BridgeRequest(); // BridgeRequest | try { - BridgeResponse result = apiInstance.bridgesAPICreateBridge(bridgeRequest); - System.out.println(result); + CompletableFuture result = apiInstance.bridgesAPICreateBridge(bridgeRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling BridgesApi#bridgesAPICreateBridge"); System.err.println("Status code: " + e.getCode()); @@ -118,22 +107,39 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *BridgesApi* | [**bridgesAPICreateBridge**](docs/BridgesApi.md#bridgesAPICreateBridge) | **POST** /api/v1/bridges | Create a Bridge instance +*BridgesApi* | [**bridgesAPICreateBridgeWithHttpInfo**](docs/BridgesApi.md#bridgesAPICreateBridgeWithHttpInfo) | **POST** /api/v1/bridges | Create a Bridge instance *BridgesApi* | [**bridgesAPIDeleteBridge**](docs/BridgesApi.md#bridgesAPIDeleteBridge) | **DELETE** /api/v1/bridges/{bridgeId} | Delete a Bridge instance +*BridgesApi* | [**bridgesAPIDeleteBridgeWithHttpInfo**](docs/BridgesApi.md#bridgesAPIDeleteBridgeWithHttpInfo) | **DELETE** /api/v1/bridges/{bridgeId} | Delete a Bridge instance *BridgesApi* | [**bridgesAPIGetBridge**](docs/BridgesApi.md#bridgesAPIGetBridge) | **GET** /api/v1/bridges/{bridgeId} | Get a Bridge instance +*BridgesApi* | [**bridgesAPIGetBridgeWithHttpInfo**](docs/BridgesApi.md#bridgesAPIGetBridgeWithHttpInfo) | **GET** /api/v1/bridges/{bridgeId} | Get a Bridge instance *BridgesApi* | [**bridgesAPIGetBridges**](docs/BridgesApi.md#bridgesAPIGetBridges) | **GET** /api/v1/bridges | Get the list of Bridge instances +*BridgesApi* | [**bridgesAPIGetBridgesWithHttpInfo**](docs/BridgesApi.md#bridgesAPIGetBridgesWithHttpInfo) | **GET** /api/v1/bridges | Get the list of Bridge instances *CloudProvidersApi* | [**cloudProviderAPIGetCloudProvider**](docs/CloudProvidersApi.md#cloudProviderAPIGetCloudProvider) | **GET** /api/v1/cloud_providers/{id} | Get Cloud Provider. +*CloudProvidersApi* | [**cloudProviderAPIGetCloudProviderWithHttpInfo**](docs/CloudProvidersApi.md#cloudProviderAPIGetCloudProviderWithHttpInfo) | **GET** /api/v1/cloud_providers/{id} | Get Cloud Provider. *CloudProvidersApi* | [**cloudProviderAPIListCloudProviderRegions**](docs/CloudProvidersApi.md#cloudProviderAPIListCloudProviderRegions) | **GET** /api/v1/cloud_providers/{id}/regions | List Supported Cloud Regions. +*CloudProvidersApi* | [**cloudProviderAPIListCloudProviderRegionsWithHttpInfo**](docs/CloudProvidersApi.md#cloudProviderAPIListCloudProviderRegionsWithHttpInfo) | **GET** /api/v1/cloud_providers/{id}/regions | List Supported Cloud Regions. *CloudProvidersApi* | [**cloudProviderAPIListCloudProviders**](docs/CloudProvidersApi.md#cloudProviderAPIListCloudProviders) | **GET** /api/v1/cloud_providers | List Supported Cloud Providers. +*CloudProvidersApi* | [**cloudProviderAPIListCloudProvidersWithHttpInfo**](docs/CloudProvidersApi.md#cloudProviderAPIListCloudProvidersWithHttpInfo) | **GET** /api/v1/cloud_providers | List Supported Cloud Providers. *ErrorCatalogApi* | [**errorsAPIGetError**](docs/ErrorCatalogApi.md#errorsAPIGetError) | **GET** /api/v1/errors/{id} | Get an error from the error catalog. +*ErrorCatalogApi* | [**errorsAPIGetErrorWithHttpInfo**](docs/ErrorCatalogApi.md#errorsAPIGetErrorWithHttpInfo) | **GET** /api/v1/errors/{id} | Get an error from the error catalog. *ErrorCatalogApi* | [**errorsAPIGetErrors**](docs/ErrorCatalogApi.md#errorsAPIGetErrors) | **GET** /api/v1/errors | Get the list of errors. +*ErrorCatalogApi* | [**errorsAPIGetErrorsWithHttpInfo**](docs/ErrorCatalogApi.md#errorsAPIGetErrorsWithHttpInfo) | **GET** /api/v1/errors | Get the list of errors. *ProcessorsApi* | [**processorsAPIAddProcessorToBridge**](docs/ProcessorsApi.md#processorsAPIAddProcessorToBridge) | **POST** /api/v1/bridges/{bridgeId}/processors | Create a Processor of a Bridge instance +*ProcessorsApi* | [**processorsAPIAddProcessorToBridgeWithHttpInfo**](docs/ProcessorsApi.md#processorsAPIAddProcessorToBridgeWithHttpInfo) | **POST** /api/v1/bridges/{bridgeId}/processors | Create a Processor of a Bridge instance *ProcessorsApi* | [**processorsAPIDeleteProcessor**](docs/ProcessorsApi.md#processorsAPIDeleteProcessor) | **DELETE** /api/v1/bridges/{bridgeId}/processors/{processorId} | Delete a Processor of a Bridge instance +*ProcessorsApi* | [**processorsAPIDeleteProcessorWithHttpInfo**](docs/ProcessorsApi.md#processorsAPIDeleteProcessorWithHttpInfo) | **DELETE** /api/v1/bridges/{bridgeId}/processors/{processorId} | Delete a Processor of a Bridge instance *ProcessorsApi* | [**processorsAPIGetProcessor**](docs/ProcessorsApi.md#processorsAPIGetProcessor) | **GET** /api/v1/bridges/{bridgeId}/processors/{processorId} | Get a Processor of a Bridge instance +*ProcessorsApi* | [**processorsAPIGetProcessorWithHttpInfo**](docs/ProcessorsApi.md#processorsAPIGetProcessorWithHttpInfo) | **GET** /api/v1/bridges/{bridgeId}/processors/{processorId} | Get a Processor of a Bridge instance *ProcessorsApi* | [**processorsAPIListProcessors**](docs/ProcessorsApi.md#processorsAPIListProcessors) | **GET** /api/v1/bridges/{bridgeId}/processors | Get the list of Processors of a Bridge instance +*ProcessorsApi* | [**processorsAPIListProcessorsWithHttpInfo**](docs/ProcessorsApi.md#processorsAPIListProcessorsWithHttpInfo) | **GET** /api/v1/bridges/{bridgeId}/processors | Get the list of Processors of a Bridge instance *ProcessorsApi* | [**processorsAPIUpdateProcessor**](docs/ProcessorsApi.md#processorsAPIUpdateProcessor) | **PUT** /api/v1/bridges/{bridgeId}/processors/{processorId} | Update a Processor instance Filter definition or Transformation template. +*ProcessorsApi* | [**processorsAPIUpdateProcessorWithHttpInfo**](docs/ProcessorsApi.md#processorsAPIUpdateProcessorWithHttpInfo) | **PUT** /api/v1/bridges/{bridgeId}/processors/{processorId} | Update a Processor instance Filter definition or Transformation template. *SchemaCatalogApi* | [**schemaAPIGetActionProcessorSchema**](docs/SchemaCatalogApi.md#schemaAPIGetActionProcessorSchema) | **GET** /api/v1/schemas/actions/{id} | Get action processor schema +*SchemaCatalogApi* | [**schemaAPIGetActionProcessorSchemaWithHttpInfo**](docs/SchemaCatalogApi.md#schemaAPIGetActionProcessorSchemaWithHttpInfo) | **GET** /api/v1/schemas/actions/{id} | Get action processor schema *SchemaCatalogApi* | [**schemaAPIGetCatalog**](docs/SchemaCatalogApi.md#schemaAPIGetCatalog) | **GET** /api/v1/schemas | Get processor catalog +*SchemaCatalogApi* | [**schemaAPIGetCatalogWithHttpInfo**](docs/SchemaCatalogApi.md#schemaAPIGetCatalogWithHttpInfo) | **GET** /api/v1/schemas | Get processor catalog *SchemaCatalogApi* | [**schemaAPIGetSourceProcessorSchema**](docs/SchemaCatalogApi.md#schemaAPIGetSourceProcessorSchema) | **GET** /api/v1/schemas/sources/{id} | Get source processor schema +*SchemaCatalogApi* | [**schemaAPIGetSourceProcessorSchemaWithHttpInfo**](docs/SchemaCatalogApi.md#schemaAPIGetSourceProcessorSchemaWithHttpInfo) | **GET** /api/v1/schemas/sources/{id} | Get source processor schema ## Documentation for Models @@ -174,6 +180,7 @@ Authentication schemes defined for the API: ## Recommendation It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. +However, the instances of the api clients created from the `ApiClient` are thread-safe and can be re-used. ## Author diff --git a/packages/smartevents-management-sdk/docs/BridgesApi.md b/packages/smartevents-management-sdk/docs/BridgesApi.md index 92621802..f21cc016 100644 --- a/packages/smartevents-management-sdk/docs/BridgesApi.md +++ b/packages/smartevents-management-sdk/docs/BridgesApi.md @@ -5,15 +5,19 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**bridgesAPICreateBridge**](BridgesApi.md#bridgesAPICreateBridge) | **POST** /api/v1/bridges | Create a Bridge instance +[**bridgesAPICreateBridgeWithHttpInfo**](BridgesApi.md#bridgesAPICreateBridgeWithHttpInfo) | **POST** /api/v1/bridges | Create a Bridge instance [**bridgesAPIDeleteBridge**](BridgesApi.md#bridgesAPIDeleteBridge) | **DELETE** /api/v1/bridges/{bridgeId} | Delete a Bridge instance +[**bridgesAPIDeleteBridgeWithHttpInfo**](BridgesApi.md#bridgesAPIDeleteBridgeWithHttpInfo) | **DELETE** /api/v1/bridges/{bridgeId} | Delete a Bridge instance [**bridgesAPIGetBridge**](BridgesApi.md#bridgesAPIGetBridge) | **GET** /api/v1/bridges/{bridgeId} | Get a Bridge instance +[**bridgesAPIGetBridgeWithHttpInfo**](BridgesApi.md#bridgesAPIGetBridgeWithHttpInfo) | **GET** /api/v1/bridges/{bridgeId} | Get a Bridge instance [**bridgesAPIGetBridges**](BridgesApi.md#bridgesAPIGetBridges) | **GET** /api/v1/bridges | Get the list of Bridge instances +[**bridgesAPIGetBridgesWithHttpInfo**](BridgesApi.md#bridgesAPIGetBridgesWithHttpInfo) | **GET** /api/v1/bridges | Get the list of Bridge instances ## bridgesAPICreateBridge -> BridgeResponse bridgesAPICreateBridge(bridgeRequest) +> CompletableFuture bridgesAPICreateBridge(bridgeRequest) Create a Bridge instance @@ -29,6 +33,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -42,8 +47,8 @@ public class Example { BridgesApi apiInstance = new BridgesApi(defaultClient); BridgeRequest bridgeRequest = new BridgeRequest(); // BridgeRequest | try { - BridgeResponse result = apiInstance.bridgesAPICreateBridge(bridgeRequest); - System.out.println(result); + CompletableFuture result = apiInstance.bridgesAPICreateBridge(bridgeRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling BridgesApi#bridgesAPICreateBridge"); System.err.println("Status code: " + e.getCode()); @@ -64,7 +69,8 @@ Name | Type | Description | Notes ### Return type -[**BridgeResponse**](BridgeResponse.md) +CompletableFuture<[**BridgeResponse**](BridgeResponse.md)> + ### Authorization @@ -75,6 +81,90 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **500** | Internal error. | - | + +## bridgesAPICreateBridgeWithHttpInfo + +> CompletableFuture> bridgesAPICreateBridge bridgesAPICreateBridgeWithHttpInfo(bridgeRequest) + +Create a Bridge instance + +Create a Bridge instance for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + BridgesApi apiInstance = new BridgesApi(defaultClient); + BridgeRequest bridgeRequest = new BridgeRequest(); // BridgeRequest | + try { + CompletableFuture> response = apiInstance.bridgesAPICreateBridgeWithHttpInfo(bridgeRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling BridgesApi#bridgesAPICreateBridge"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling BridgesApi#bridgesAPICreateBridge"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeRequest** | [**BridgeRequest**](BridgeRequest.md)| | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -88,7 +178,7 @@ Name | Type | Description | Notes ## bridgesAPIDeleteBridge -> bridgesAPIDeleteBridge(bridgeId) +> CompletableFuture bridgesAPIDeleteBridge(bridgeId) Delete a Bridge instance @@ -104,6 +194,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -117,7 +208,7 @@ public class Example { BridgesApi apiInstance = new BridgesApi(defaultClient); String bridgeId = "bridgeId_example"; // String | try { - apiInstance.bridgesAPIDeleteBridge(bridgeId); + CompletableFuture result = apiInstance.bridgesAPIDeleteBridge(bridgeId); } catch (ApiException e) { System.err.println("Exception when calling BridgesApi#bridgesAPIDeleteBridge"); System.err.println("Status code: " + e.getCode()); @@ -138,7 +229,8 @@ Name | Type | Description | Notes ### Return type -null (empty response body) + +CompletableFuture (empty response body) ### Authorization @@ -149,6 +241,90 @@ null (empty response body) - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## bridgesAPIDeleteBridgeWithHttpInfo + +> CompletableFuture> bridgesAPIDeleteBridge bridgesAPIDeleteBridgeWithHttpInfo(bridgeId) + +Delete a Bridge instance + +Delete a Bridge instance of the authenticated user by ID. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + BridgesApi apiInstance = new BridgesApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + try { + CompletableFuture> response = apiInstance.bridgesAPIDeleteBridgeWithHttpInfo(bridgeId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling BridgesApi#bridgesAPIDeleteBridge"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling BridgesApi#bridgesAPIDeleteBridge"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + +### Return type + + +CompletableFuture> + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -163,7 +339,7 @@ null (empty response body) ## bridgesAPIGetBridge -> BridgeResponse bridgesAPIGetBridge(bridgeId) +> CompletableFuture bridgesAPIGetBridge(bridgeId) Get a Bridge instance @@ -179,6 +355,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -192,8 +369,8 @@ public class Example { BridgesApi apiInstance = new BridgesApi(defaultClient); String bridgeId = "bridgeId_example"; // String | try { - BridgeResponse result = apiInstance.bridgesAPIGetBridge(bridgeId); - System.out.println(result); + CompletableFuture result = apiInstance.bridgesAPIGetBridge(bridgeId); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling BridgesApi#bridgesAPIGetBridge"); System.err.println("Status code: " + e.getCode()); @@ -214,7 +391,8 @@ Name | Type | Description | Notes ### Return type -[**BridgeResponse**](BridgeResponse.md) +CompletableFuture<[**BridgeResponse**](BridgeResponse.md)> + ### Authorization @@ -225,6 +403,91 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## bridgesAPIGetBridgeWithHttpInfo + +> CompletableFuture> bridgesAPIGetBridge bridgesAPIGetBridgeWithHttpInfo(bridgeId) + +Get a Bridge instance + +Get a Bridge instance of the authenticated user by ID. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + BridgesApi apiInstance = new BridgesApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + try { + CompletableFuture> response = apiInstance.bridgesAPIGetBridgeWithHttpInfo(bridgeId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling BridgesApi#bridgesAPIGetBridge"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling BridgesApi#bridgesAPIGetBridge"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -239,7 +502,7 @@ Name | Type | Description | Notes ## bridgesAPIGetBridges -> BridgeListResponse bridgesAPIGetBridges(name, page, size, status) +> CompletableFuture bridgesAPIGetBridges(name, page, size, status) Get the list of Bridge instances @@ -255,6 +518,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -271,8 +535,8 @@ public class Example { Integer size = 100; // Integer | Set status = Arrays.asList(); // Set | try { - BridgeListResponse result = apiInstance.bridgesAPIGetBridges(name, page, size, status); - System.out.println(result); + CompletableFuture result = apiInstance.bridgesAPIGetBridges(name, page, size, status); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling BridgesApi#bridgesAPIGetBridges"); System.err.println("Status code: " + e.getCode()); @@ -296,7 +560,8 @@ Name | Type | Description | Notes ### Return type -[**BridgeListResponse**](BridgeListResponse.md) +CompletableFuture<[**BridgeListResponse**](BridgeListResponse.md)> + ### Authorization @@ -307,6 +572,97 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## bridgesAPIGetBridgesWithHttpInfo + +> CompletableFuture> bridgesAPIGetBridges bridgesAPIGetBridgesWithHttpInfo(name, page, size, status) + +Get the list of Bridge instances + +Get the list of Bridge instances for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.BridgesApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + BridgesApi apiInstance = new BridgesApi(defaultClient); + String name = "name_example"; // String | + Integer page = 0; // Integer | + Integer size = 100; // Integer | + Set status = Arrays.asList(); // Set | + try { + CompletableFuture> response = apiInstance.bridgesAPIGetBridgesWithHttpInfo(name, page, size, status); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling BridgesApi#bridgesAPIGetBridges"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling BridgesApi#bridgesAPIGetBridges"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| | [optional] + **page** | **Integer**| | [optional] [default to 0] + **size** | **Integer**| | [optional] [default to 100] + **status** | [**Set<ManagedResourceStatus>**](ManagedResourceStatus.md)| | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/smartevents-management-sdk/docs/CloudProvidersApi.md b/packages/smartevents-management-sdk/docs/CloudProvidersApi.md index afc0ba3a..9f1bdf26 100644 --- a/packages/smartevents-management-sdk/docs/CloudProvidersApi.md +++ b/packages/smartevents-management-sdk/docs/CloudProvidersApi.md @@ -5,14 +5,17 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**cloudProviderAPIGetCloudProvider**](CloudProvidersApi.md#cloudProviderAPIGetCloudProvider) | **GET** /api/v1/cloud_providers/{id} | Get Cloud Provider. +[**cloudProviderAPIGetCloudProviderWithHttpInfo**](CloudProvidersApi.md#cloudProviderAPIGetCloudProviderWithHttpInfo) | **GET** /api/v1/cloud_providers/{id} | Get Cloud Provider. [**cloudProviderAPIListCloudProviderRegions**](CloudProvidersApi.md#cloudProviderAPIListCloudProviderRegions) | **GET** /api/v1/cloud_providers/{id}/regions | List Supported Cloud Regions. +[**cloudProviderAPIListCloudProviderRegionsWithHttpInfo**](CloudProvidersApi.md#cloudProviderAPIListCloudProviderRegionsWithHttpInfo) | **GET** /api/v1/cloud_providers/{id}/regions | List Supported Cloud Regions. [**cloudProviderAPIListCloudProviders**](CloudProvidersApi.md#cloudProviderAPIListCloudProviders) | **GET** /api/v1/cloud_providers | List Supported Cloud Providers. +[**cloudProviderAPIListCloudProvidersWithHttpInfo**](CloudProvidersApi.md#cloudProviderAPIListCloudProvidersWithHttpInfo) | **GET** /api/v1/cloud_providers | List Supported Cloud Providers. ## cloudProviderAPIGetCloudProvider -> CloudProviderListResponse cloudProviderAPIGetCloudProvider(id) +> CompletableFuture cloudProviderAPIGetCloudProvider(id) Get Cloud Provider. @@ -27,6 +30,7 @@ import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.CloudProvidersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -36,8 +40,8 @@ public class Example { CloudProvidersApi apiInstance = new CloudProvidersApi(defaultClient); String id = "id_example"; // String | try { - CloudProviderListResponse result = apiInstance.cloudProviderAPIGetCloudProvider(id); - System.out.println(result); + CompletableFuture result = apiInstance.cloudProviderAPIGetCloudProvider(id); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIGetCloudProvider"); System.err.println("Status code: " + e.getCode()); @@ -58,7 +62,8 @@ Name | Type | Description | Notes ### Return type -[**CloudProviderListResponse**](CloudProviderListResponse.md) +CompletableFuture<[**CloudProviderListResponse**](CloudProviderListResponse.md)> + ### Authorization @@ -69,6 +74,83 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **500** | Internal error. | - | + +## cloudProviderAPIGetCloudProviderWithHttpInfo + +> CompletableFuture> cloudProviderAPIGetCloudProvider cloudProviderAPIGetCloudProviderWithHttpInfo(id) + +Get Cloud Provider. + +Get details of the Cloud Provider specified by id. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.CloudProvidersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + CloudProvidersApi apiInstance = new CloudProvidersApi(defaultClient); + String id = "id_example"; // String | + try { + CompletableFuture> response = apiInstance.cloudProviderAPIGetCloudProviderWithHttpInfo(id); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIGetCloudProvider"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIGetCloudProvider"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -80,7 +162,7 @@ No authorization required ## cloudProviderAPIListCloudProviderRegions -> CloudRegionListResponse cloudProviderAPIListCloudProviderRegions(id, page, size) +> CompletableFuture cloudProviderAPIListCloudProviderRegions(id, page, size) List Supported Cloud Regions. @@ -95,6 +177,7 @@ import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.CloudProvidersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -106,8 +189,8 @@ public class Example { Integer page = 0; // Integer | Integer size = 100; // Integer | try { - CloudRegionListResponse result = apiInstance.cloudProviderAPIListCloudProviderRegions(id, page, size); - System.out.println(result); + CompletableFuture result = apiInstance.cloudProviderAPIListCloudProviderRegions(id, page, size); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIListCloudProviderRegions"); System.err.println("Status code: " + e.getCode()); @@ -130,7 +213,8 @@ Name | Type | Description | Notes ### Return type -[**CloudRegionListResponse**](CloudRegionListResponse.md) +CompletableFuture<[**CloudRegionListResponse**](CloudRegionListResponse.md)> + ### Authorization @@ -141,6 +225,87 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **500** | Internal error. | - | + +## cloudProviderAPIListCloudProviderRegionsWithHttpInfo + +> CompletableFuture> cloudProviderAPIListCloudProviderRegions cloudProviderAPIListCloudProviderRegionsWithHttpInfo(id, page, size) + +List Supported Cloud Regions. + +Returns the list of supported Regions of the specified Cloud Provider. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.CloudProvidersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + CloudProvidersApi apiInstance = new CloudProvidersApi(defaultClient); + String id = "id_example"; // String | + Integer page = 0; // Integer | + Integer size = 100; // Integer | + try { + CompletableFuture> response = apiInstance.cloudProviderAPIListCloudProviderRegionsWithHttpInfo(id, page, size); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIListCloudProviderRegions"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIListCloudProviderRegions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + **page** | **Integer**| | [optional] [default to 0] + **size** | **Integer**| | [optional] [default to 100] + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -152,7 +317,7 @@ No authorization required ## cloudProviderAPIListCloudProviders -> CloudProviderListResponse cloudProviderAPIListCloudProviders(page, size) +> CompletableFuture cloudProviderAPIListCloudProviders(page, size) List Supported Cloud Providers. @@ -167,6 +332,7 @@ import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.CloudProvidersApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -177,8 +343,8 @@ public class Example { Integer page = 0; // Integer | Integer size = 100; // Integer | try { - CloudProviderListResponse result = apiInstance.cloudProviderAPIListCloudProviders(page, size); - System.out.println(result); + CompletableFuture result = apiInstance.cloudProviderAPIListCloudProviders(page, size); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIListCloudProviders"); System.err.println("Status code: " + e.getCode()); @@ -200,7 +366,8 @@ Name | Type | Description | Notes ### Return type -[**CloudProviderListResponse**](CloudProviderListResponse.md) +CompletableFuture<[**CloudProviderListResponse**](CloudProviderListResponse.md)> + ### Authorization @@ -211,6 +378,85 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **500** | Internal error. | - | + +## cloudProviderAPIListCloudProvidersWithHttpInfo + +> CompletableFuture> cloudProviderAPIListCloudProviders cloudProviderAPIListCloudProvidersWithHttpInfo(page, size) + +List Supported Cloud Providers. + +Returns the list of supported Cloud Providers. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.CloudProvidersApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + CloudProvidersApi apiInstance = new CloudProvidersApi(defaultClient); + Integer page = 0; // Integer | + Integer size = 100; // Integer | + try { + CompletableFuture> response = apiInstance.cloudProviderAPIListCloudProvidersWithHttpInfo(page, size); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIListCloudProviders"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling CloudProvidersApi#cloudProviderAPIListCloudProviders"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Integer**| | [optional] [default to 0] + **size** | **Integer**| | [optional] [default to 100] + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/smartevents-management-sdk/docs/ErrorCatalogApi.md b/packages/smartevents-management-sdk/docs/ErrorCatalogApi.md index 8ea3489d..b73238de 100644 --- a/packages/smartevents-management-sdk/docs/ErrorCatalogApi.md +++ b/packages/smartevents-management-sdk/docs/ErrorCatalogApi.md @@ -5,13 +5,15 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**errorsAPIGetError**](ErrorCatalogApi.md#errorsAPIGetError) | **GET** /api/v1/errors/{id} | Get an error from the error catalog. +[**errorsAPIGetErrorWithHttpInfo**](ErrorCatalogApi.md#errorsAPIGetErrorWithHttpInfo) | **GET** /api/v1/errors/{id} | Get an error from the error catalog. [**errorsAPIGetErrors**](ErrorCatalogApi.md#errorsAPIGetErrors) | **GET** /api/v1/errors | Get the list of errors. +[**errorsAPIGetErrorsWithHttpInfo**](ErrorCatalogApi.md#errorsAPIGetErrorsWithHttpInfo) | **GET** /api/v1/errors | Get the list of errors. ## errorsAPIGetError -> BridgeError errorsAPIGetError(id) +> CompletableFuture errorsAPIGetError(id) Get an error from the error catalog. @@ -26,6 +28,7 @@ import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ErrorCatalogApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -35,8 +38,8 @@ public class Example { ErrorCatalogApi apiInstance = new ErrorCatalogApi(defaultClient); Integer id = 56; // Integer | try { - BridgeError result = apiInstance.errorsAPIGetError(id); - System.out.println(result); + CompletableFuture result = apiInstance.errorsAPIGetError(id); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ErrorCatalogApi#errorsAPIGetError"); System.err.println("Status code: " + e.getCode()); @@ -57,7 +60,8 @@ Name | Type | Description | Notes ### Return type -[**BridgeError**](BridgeError.md) +CompletableFuture<[**BridgeError**](BridgeError.md)> + ### Authorization @@ -68,6 +72,84 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **500** | Internal error. | - | + +## errorsAPIGetErrorWithHttpInfo + +> CompletableFuture> errorsAPIGetError errorsAPIGetErrorWithHttpInfo(id) + +Get an error from the error catalog. + +Get an error from the error catalog. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ErrorCatalogApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ErrorCatalogApi apiInstance = new ErrorCatalogApi(defaultClient); + Integer id = 56; // Integer | + try { + CompletableFuture> response = apiInstance.errorsAPIGetErrorWithHttpInfo(id); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ErrorCatalogApi#errorsAPIGetError"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ErrorCatalogApi#errorsAPIGetError"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Integer**| | + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -80,7 +162,7 @@ No authorization required ## errorsAPIGetErrors -> ErrorListResponse errorsAPIGetErrors(page, size) +> CompletableFuture errorsAPIGetErrors(page, size) Get the list of errors. @@ -95,6 +177,7 @@ import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ErrorCatalogApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -105,8 +188,8 @@ public class Example { Integer page = 0; // Integer | Integer size = 100; // Integer | try { - ErrorListResponse result = apiInstance.errorsAPIGetErrors(page, size); - System.out.println(result); + CompletableFuture result = apiInstance.errorsAPIGetErrors(page, size); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ErrorCatalogApi#errorsAPIGetErrors"); System.err.println("Status code: " + e.getCode()); @@ -128,7 +211,8 @@ Name | Type | Description | Notes ### Return type -[**ErrorListResponse**](ErrorListResponse.md) +CompletableFuture<[**ErrorListResponse**](ErrorListResponse.md)> + ### Authorization @@ -139,6 +223,86 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **500** | Internal error. | - | + +## errorsAPIGetErrorsWithHttpInfo + +> CompletableFuture> errorsAPIGetErrors errorsAPIGetErrorsWithHttpInfo(page, size) + +Get the list of errors. + +Get the list of errors from the error catalog. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ErrorCatalogApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + ErrorCatalogApi apiInstance = new ErrorCatalogApi(defaultClient); + Integer page = 0; // Integer | + Integer size = 100; // Integer | + try { + CompletableFuture> response = apiInstance.errorsAPIGetErrorsWithHttpInfo(page, size); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ErrorCatalogApi#errorsAPIGetErrors"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ErrorCatalogApi#errorsAPIGetErrors"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Integer**| | [optional] [default to 0] + **size** | **Integer**| | [optional] [default to 100] + +### Return type + +CompletableFuture> + + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/smartevents-management-sdk/docs/ProcessorsApi.md b/packages/smartevents-management-sdk/docs/ProcessorsApi.md index b4549980..9d0ba86b 100644 --- a/packages/smartevents-management-sdk/docs/ProcessorsApi.md +++ b/packages/smartevents-management-sdk/docs/ProcessorsApi.md @@ -5,16 +5,21 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**processorsAPIAddProcessorToBridge**](ProcessorsApi.md#processorsAPIAddProcessorToBridge) | **POST** /api/v1/bridges/{bridgeId}/processors | Create a Processor of a Bridge instance +[**processorsAPIAddProcessorToBridgeWithHttpInfo**](ProcessorsApi.md#processorsAPIAddProcessorToBridgeWithHttpInfo) | **POST** /api/v1/bridges/{bridgeId}/processors | Create a Processor of a Bridge instance [**processorsAPIDeleteProcessor**](ProcessorsApi.md#processorsAPIDeleteProcessor) | **DELETE** /api/v1/bridges/{bridgeId}/processors/{processorId} | Delete a Processor of a Bridge instance +[**processorsAPIDeleteProcessorWithHttpInfo**](ProcessorsApi.md#processorsAPIDeleteProcessorWithHttpInfo) | **DELETE** /api/v1/bridges/{bridgeId}/processors/{processorId} | Delete a Processor of a Bridge instance [**processorsAPIGetProcessor**](ProcessorsApi.md#processorsAPIGetProcessor) | **GET** /api/v1/bridges/{bridgeId}/processors/{processorId} | Get a Processor of a Bridge instance +[**processorsAPIGetProcessorWithHttpInfo**](ProcessorsApi.md#processorsAPIGetProcessorWithHttpInfo) | **GET** /api/v1/bridges/{bridgeId}/processors/{processorId} | Get a Processor of a Bridge instance [**processorsAPIListProcessors**](ProcessorsApi.md#processorsAPIListProcessors) | **GET** /api/v1/bridges/{bridgeId}/processors | Get the list of Processors of a Bridge instance +[**processorsAPIListProcessorsWithHttpInfo**](ProcessorsApi.md#processorsAPIListProcessorsWithHttpInfo) | **GET** /api/v1/bridges/{bridgeId}/processors | Get the list of Processors of a Bridge instance [**processorsAPIUpdateProcessor**](ProcessorsApi.md#processorsAPIUpdateProcessor) | **PUT** /api/v1/bridges/{bridgeId}/processors/{processorId} | Update a Processor instance Filter definition or Transformation template. +[**processorsAPIUpdateProcessorWithHttpInfo**](ProcessorsApi.md#processorsAPIUpdateProcessorWithHttpInfo) | **PUT** /api/v1/bridges/{bridgeId}/processors/{processorId} | Update a Processor instance Filter definition or Transformation template. ## processorsAPIAddProcessorToBridge -> ProcessorResponse processorsAPIAddProcessorToBridge(bridgeId, processorRequest) +> CompletableFuture processorsAPIAddProcessorToBridge(bridgeId, processorRequest) Create a Processor of a Bridge instance @@ -30,6 +35,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -44,8 +50,8 @@ public class Example { String bridgeId = "bridgeId_example"; // String | ProcessorRequest processorRequest = new ProcessorRequest(); // ProcessorRequest | try { - ProcessorResponse result = apiInstance.processorsAPIAddProcessorToBridge(bridgeId, processorRequest); - System.out.println(result); + CompletableFuture result = apiInstance.processorsAPIAddProcessorToBridge(bridgeId, processorRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ProcessorsApi#processorsAPIAddProcessorToBridge"); System.err.println("Status code: " + e.getCode()); @@ -67,7 +73,8 @@ Name | Type | Description | Notes ### Return type -[**ProcessorResponse**](ProcessorResponse.md) +CompletableFuture<[**ProcessorResponse**](ProcessorResponse.md)> + ### Authorization @@ -78,6 +85,93 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## processorsAPIAddProcessorToBridgeWithHttpInfo + +> CompletableFuture> processorsAPIAddProcessorToBridge processorsAPIAddProcessorToBridgeWithHttpInfo(bridgeId, processorRequest) + +Create a Processor of a Bridge instance + +Create a Processor of a Bridge instance for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + ProcessorsApi apiInstance = new ProcessorsApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + ProcessorRequest processorRequest = new ProcessorRequest(); // ProcessorRequest | + try { + CompletableFuture> response = apiInstance.processorsAPIAddProcessorToBridgeWithHttpInfo(bridgeId, processorRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ProcessorsApi#processorsAPIAddProcessorToBridge"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ProcessorsApi#processorsAPIAddProcessorToBridge"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + **processorRequest** | [**ProcessorRequest**](ProcessorRequest.md)| | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -92,7 +186,7 @@ Name | Type | Description | Notes ## processorsAPIDeleteProcessor -> processorsAPIDeleteProcessor(bridgeId, processorId) +> CompletableFuture processorsAPIDeleteProcessor(bridgeId, processorId) Delete a Processor of a Bridge instance @@ -108,6 +202,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -122,7 +217,7 @@ public class Example { String bridgeId = "bridgeId_example"; // String | String processorId = "processorId_example"; // String | try { - apiInstance.processorsAPIDeleteProcessor(bridgeId, processorId); + CompletableFuture result = apiInstance.processorsAPIDeleteProcessor(bridgeId, processorId); } catch (ApiException e) { System.err.println("Exception when calling ProcessorsApi#processorsAPIDeleteProcessor"); System.err.println("Status code: " + e.getCode()); @@ -144,7 +239,8 @@ Name | Type | Description | Notes ### Return type -null (empty response body) + +CompletableFuture (empty response body) ### Authorization @@ -155,6 +251,92 @@ null (empty response body) - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## processorsAPIDeleteProcessorWithHttpInfo + +> CompletableFuture> processorsAPIDeleteProcessor processorsAPIDeleteProcessorWithHttpInfo(bridgeId, processorId) + +Delete a Processor of a Bridge instance + +Delete a Processor of a Bridge instance for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + ProcessorsApi apiInstance = new ProcessorsApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + String processorId = "processorId_example"; // String | + try { + CompletableFuture> response = apiInstance.processorsAPIDeleteProcessorWithHttpInfo(bridgeId, processorId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ProcessorsApi#processorsAPIDeleteProcessor"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ProcessorsApi#processorsAPIDeleteProcessor"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + **processorId** | **String**| | + +### Return type + + +CompletableFuture> + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -169,7 +351,7 @@ null (empty response body) ## processorsAPIGetProcessor -> ProcessorResponse processorsAPIGetProcessor(bridgeId, processorId) +> CompletableFuture processorsAPIGetProcessor(bridgeId, processorId) Get a Processor of a Bridge instance @@ -185,6 +367,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -199,8 +382,8 @@ public class Example { String bridgeId = "bridgeId_example"; // String | String processorId = "processorId_example"; // String | try { - ProcessorResponse result = apiInstance.processorsAPIGetProcessor(bridgeId, processorId); - System.out.println(result); + CompletableFuture result = apiInstance.processorsAPIGetProcessor(bridgeId, processorId); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ProcessorsApi#processorsAPIGetProcessor"); System.err.println("Status code: " + e.getCode()); @@ -222,7 +405,8 @@ Name | Type | Description | Notes ### Return type -[**ProcessorResponse**](ProcessorResponse.md) +CompletableFuture<[**ProcessorResponse**](ProcessorResponse.md)> + ### Authorization @@ -233,6 +417,93 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## processorsAPIGetProcessorWithHttpInfo + +> CompletableFuture> processorsAPIGetProcessor processorsAPIGetProcessorWithHttpInfo(bridgeId, processorId) + +Get a Processor of a Bridge instance + +Get a Processor of a Bridge instance for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + ProcessorsApi apiInstance = new ProcessorsApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + String processorId = "processorId_example"; // String | + try { + CompletableFuture> response = apiInstance.processorsAPIGetProcessorWithHttpInfo(bridgeId, processorId); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ProcessorsApi#processorsAPIGetProcessor"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ProcessorsApi#processorsAPIGetProcessor"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + **processorId** | **String**| | + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -247,7 +518,7 @@ Name | Type | Description | Notes ## processorsAPIListProcessors -> ProcessorListResponse processorsAPIListProcessors(bridgeId, name, page, size, status, type) +> CompletableFuture processorsAPIListProcessors(bridgeId, name, page, size, status, type) Get the list of Processors of a Bridge instance @@ -263,6 +534,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -281,8 +553,8 @@ public class Example { Set status = Arrays.asList(); // Set | ProcessorType type = ProcessorType.fromValue("source"); // ProcessorType | try { - ProcessorListResponse result = apiInstance.processorsAPIListProcessors(bridgeId, name, page, size, status, type); - System.out.println(result); + CompletableFuture result = apiInstance.processorsAPIListProcessors(bridgeId, name, page, size, status, type); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ProcessorsApi#processorsAPIListProcessors"); System.err.println("Status code: " + e.getCode()); @@ -308,7 +580,8 @@ Name | Type | Description | Notes ### Return type -[**ProcessorListResponse**](ProcessorListResponse.md) +CompletableFuture<[**ProcessorListResponse**](ProcessorListResponse.md)> + ### Authorization @@ -319,6 +592,101 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## processorsAPIListProcessorsWithHttpInfo + +> CompletableFuture> processorsAPIListProcessors processorsAPIListProcessorsWithHttpInfo(bridgeId, name, page, size, status, type) + +Get the list of Processors of a Bridge instance + +Get the list of Processors of a Bridge instance for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + ProcessorsApi apiInstance = new ProcessorsApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + String name = "name_example"; // String | + Integer page = 0; // Integer | + Integer size = 100; // Integer | + Set status = Arrays.asList(); // Set | + ProcessorType type = ProcessorType.fromValue("source"); // ProcessorType | + try { + CompletableFuture> response = apiInstance.processorsAPIListProcessorsWithHttpInfo(bridgeId, name, page, size, status, type); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ProcessorsApi#processorsAPIListProcessors"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ProcessorsApi#processorsAPIListProcessors"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + **name** | **String**| | [optional] + **page** | **Integer**| | [optional] [default to 0] + **size** | **Integer**| | [optional] [default to 100] + **status** | [**Set<ManagedResourceStatus>**](ManagedResourceStatus.md)| | [optional] + **type** | [**ProcessorType**](.md)| | [optional] [enum: source, sink, error_handler] + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -333,7 +701,7 @@ Name | Type | Description | Notes ## processorsAPIUpdateProcessor -> ProcessorResponse processorsAPIUpdateProcessor(bridgeId, processorId, processorRequest) +> CompletableFuture processorsAPIUpdateProcessor(bridgeId, processorId, processorRequest) Update a Processor instance Filter definition or Transformation template. @@ -349,6 +717,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -364,8 +733,8 @@ public class Example { String processorId = "processorId_example"; // String | ProcessorRequest processorRequest = new ProcessorRequest(); // ProcessorRequest | try { - ProcessorResponse result = apiInstance.processorsAPIUpdateProcessor(bridgeId, processorId, processorRequest); - System.out.println(result); + CompletableFuture result = apiInstance.processorsAPIUpdateProcessor(bridgeId, processorId, processorRequest); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling ProcessorsApi#processorsAPIUpdateProcessor"); System.err.println("Status code: " + e.getCode()); @@ -388,7 +757,8 @@ Name | Type | Description | Notes ### Return type -[**ProcessorResponse**](ProcessorResponse.md) +CompletableFuture<[**ProcessorResponse**](ProcessorResponse.md)> + ### Authorization @@ -399,6 +769,95 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **202** | Accepted. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **404** | Not found. | - | +| **500** | Internal error. | - | + +## processorsAPIUpdateProcessorWithHttpInfo + +> CompletableFuture> processorsAPIUpdateProcessor processorsAPIUpdateProcessorWithHttpInfo(bridgeId, processorId, processorRequest) + +Update a Processor instance Filter definition or Transformation template. + +Update a Processor instance Filter definition or Transformation template for the authenticated user. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.ProcessorsApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + ProcessorsApi apiInstance = new ProcessorsApi(defaultClient); + String bridgeId = "bridgeId_example"; // String | + String processorId = "processorId_example"; // String | + ProcessorRequest processorRequest = new ProcessorRequest(); // ProcessorRequest | + try { + CompletableFuture> response = apiInstance.processorsAPIUpdateProcessorWithHttpInfo(bridgeId, processorId, processorRequest); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling ProcessorsApi#processorsAPIUpdateProcessor"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling ProcessorsApi#processorsAPIUpdateProcessor"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **bridgeId** | **String**| | + **processorId** | **String**| | + **processorRequest** | [**ProcessorRequest**](ProcessorRequest.md)| | [optional] + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/smartevents-management-sdk/docs/SchemaCatalogApi.md b/packages/smartevents-management-sdk/docs/SchemaCatalogApi.md index f7499b88..84e92e3e 100644 --- a/packages/smartevents-management-sdk/docs/SchemaCatalogApi.md +++ b/packages/smartevents-management-sdk/docs/SchemaCatalogApi.md @@ -5,14 +5,17 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**schemaAPIGetActionProcessorSchema**](SchemaCatalogApi.md#schemaAPIGetActionProcessorSchema) | **GET** /api/v1/schemas/actions/{id} | Get action processor schema +[**schemaAPIGetActionProcessorSchemaWithHttpInfo**](SchemaCatalogApi.md#schemaAPIGetActionProcessorSchemaWithHttpInfo) | **GET** /api/v1/schemas/actions/{id} | Get action processor schema [**schemaAPIGetCatalog**](SchemaCatalogApi.md#schemaAPIGetCatalog) | **GET** /api/v1/schemas | Get processor catalog +[**schemaAPIGetCatalogWithHttpInfo**](SchemaCatalogApi.md#schemaAPIGetCatalogWithHttpInfo) | **GET** /api/v1/schemas | Get processor catalog [**schemaAPIGetSourceProcessorSchema**](SchemaCatalogApi.md#schemaAPIGetSourceProcessorSchema) | **GET** /api/v1/schemas/sources/{id} | Get source processor schema +[**schemaAPIGetSourceProcessorSchemaWithHttpInfo**](SchemaCatalogApi.md#schemaAPIGetSourceProcessorSchemaWithHttpInfo) | **GET** /api/v1/schemas/sources/{id} | Get source processor schema ## schemaAPIGetActionProcessorSchema -> Object schemaAPIGetActionProcessorSchema(id) +> CompletableFuture schemaAPIGetActionProcessorSchema(id) Get action processor schema @@ -28,6 +31,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.SchemaCatalogApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -41,8 +45,8 @@ public class Example { SchemaCatalogApi apiInstance = new SchemaCatalogApi(defaultClient); String id = "id_example"; // String | try { - Object result = apiInstance.schemaAPIGetActionProcessorSchema(id); - System.out.println(result); + CompletableFuture result = apiInstance.schemaAPIGetActionProcessorSchema(id); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetActionProcessorSchema"); System.err.println("Status code: " + e.getCode()); @@ -63,7 +67,8 @@ Name | Type | Description | Notes ### Return type -**Object** +CompletableFuture<**Object**> + ### Authorization @@ -74,6 +79,90 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **500** | Internal error. | - | + +## schemaAPIGetActionProcessorSchemaWithHttpInfo + +> CompletableFuture> schemaAPIGetActionProcessorSchema schemaAPIGetActionProcessorSchemaWithHttpInfo(id) + +Get action processor schema + +Get the action processor JSON schema. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.SchemaCatalogApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + SchemaCatalogApi apiInstance = new SchemaCatalogApi(defaultClient); + String id = "id_example"; // String | + try { + CompletableFuture> response = apiInstance.schemaAPIGetActionProcessorSchemaWithHttpInfo(id); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetActionProcessorSchema"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetActionProcessorSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -87,7 +176,7 @@ Name | Type | Description | Notes ## schemaAPIGetCatalog -> ProcessorCatalogResponse schemaAPIGetCatalog() +> CompletableFuture schemaAPIGetCatalog() Get processor catalog @@ -103,6 +192,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.SchemaCatalogApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -115,8 +205,8 @@ public class Example { SchemaCatalogApi apiInstance = new SchemaCatalogApi(defaultClient); try { - ProcessorCatalogResponse result = apiInstance.schemaAPIGetCatalog(); - System.out.println(result); + CompletableFuture result = apiInstance.schemaAPIGetCatalog(); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetCatalog"); System.err.println("Status code: " + e.getCode()); @@ -134,7 +224,8 @@ This endpoint does not need any parameter. ### Return type -[**ProcessorCatalogResponse**](ProcessorCatalogResponse.md) +CompletableFuture<[**ProcessorCatalogResponse**](ProcessorCatalogResponse.md)> + ### Authorization @@ -145,6 +236,86 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **500** | Internal error. | - | + +## schemaAPIGetCatalogWithHttpInfo + +> CompletableFuture> schemaAPIGetCatalog schemaAPIGetCatalogWithHttpInfo() + +Get processor catalog + +Get the processor catalog with all the available sources and actions. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.SchemaCatalogApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + SchemaCatalogApi apiInstance = new SchemaCatalogApi(defaultClient); + try { + CompletableFuture> response = apiInstance.schemaAPIGetCatalogWithHttpInfo(); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetCatalog"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetCatalog"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | @@ -158,7 +329,7 @@ This endpoint does not need any parameter. ## schemaAPIGetSourceProcessorSchema -> Object schemaAPIGetSourceProcessorSchema(id) +> CompletableFuture schemaAPIGetSourceProcessorSchema(id) Get source processor schema @@ -174,6 +345,7 @@ import com.openshift.cloud.api.smartevents.invoker.Configuration; import com.openshift.cloud.api.smartevents.invoker.auth.*; import com.openshift.cloud.api.smartevents.invoker.models.*; import com.openshift.cloud.api.smartevents.SchemaCatalogApi; +import java.util.concurrent.CompletableFuture; public class Example { public static void main(String[] args) { @@ -187,8 +359,8 @@ public class Example { SchemaCatalogApi apiInstance = new SchemaCatalogApi(defaultClient); String id = "id_example"; // String | try { - Object result = apiInstance.schemaAPIGetSourceProcessorSchema(id); - System.out.println(result); + CompletableFuture result = apiInstance.schemaAPIGetSourceProcessorSchema(id); + System.out.println(result.get()); } catch (ApiException e) { System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetSourceProcessorSchema"); System.err.println("Status code: " + e.getCode()); @@ -209,7 +381,8 @@ Name | Type | Description | Notes ### Return type -**Object** +CompletableFuture<**Object**> + ### Authorization @@ -220,6 +393,90 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success. | - | +| **400** | Bad request. | - | +| **401** | Unauthorized. | - | +| **403** | Forbidden. | - | +| **500** | Internal error. | - | + +## schemaAPIGetSourceProcessorSchemaWithHttpInfo + +> CompletableFuture> schemaAPIGetSourceProcessorSchema schemaAPIGetSourceProcessorSchemaWithHttpInfo(id) + +Get source processor schema + +Get the source processor JSON schema. + +### Example + +```java +// Import classes: +import com.openshift.cloud.api.smartevents.invoker.ApiClient; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; +import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.auth.*; +import com.openshift.cloud.api.smartevents.invoker.models.*; +import com.openshift.cloud.api.smartevents.SchemaCatalogApi; +import java.util.concurrent.CompletableFuture; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure HTTP bearer authorization: bearer + HttpBearerAuth bearer = (HttpBearerAuth) defaultClient.getAuthentication("bearer"); + bearer.setBearerToken("BEARER TOKEN"); + + SchemaCatalogApi apiInstance = new SchemaCatalogApi(defaultClient); + String id = "id_example"; // String | + try { + CompletableFuture> response = apiInstance.schemaAPIGetSourceProcessorSchemaWithHttpInfo(id); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + System.out.println("Response body: " + response.get().getData()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetSourceProcessorSchema"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling SchemaCatalogApi#schemaAPIGetSourceProcessorSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| | + +### Return type + +CompletableFuture> + + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | diff --git a/packages/smartevents-management-sdk/pom.xml b/packages/smartevents-management-sdk/pom.xml index ada27a27..0c2a5e16 100644 --- a/packages/smartevents-management-sdk/pom.xml +++ b/packages/smartevents-management-sdk/pom.xml @@ -5,26 +5,15 @@ smartevents-management-sdk jar smartevents-management-sdk - Red Hat Aplicaiton Services Java SDK - https://github.com/redhat-developer/app-services-sdk-java - - 0.0.1-SNAPSHOT - + 0.0.2 + https://github.com/openapitools/openapi-generator + OpenAPI Java scm:git:git@github.com:openapitools/openapi-generator.git scm:git:git@github.com:openapitools/openapi-generator.git https://github.com/openapitools/openapi-generator - - - ossrh - Central Repository OSSRH - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - Apache-2.0 @@ -45,9 +34,8 @@ - org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.0.0-M1 enforce-maven @@ -57,31 +45,31 @@ - 2.2.0 + 3 + + 11 + - org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + 3.0.0-M3 - - - loggerPath - conf/log4j.properties - - + + conf/log4j.properties + -Xms512m -Xmx1500m methods - pertest + 10 maven-dependency-plugin + 3.1.1 package @@ -95,62 +83,29 @@ + org.apache.maven.plugins maven-jar-plugin - 3.2.2 - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.3.0 + 3.1.2 - add_sources - generate-sources - add-source + test-jar - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - + + - org.apache.maven.plugins maven-compiler-plugin - 3.9.0 - - 1.8 - 1.8 - + 3.8.1 org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 - - none - 1.8 - + 3.1.0 attach-javadocs @@ -161,53 +116,50 @@ - org.apache.maven.plugins maven-source-plugin + 3.1.0 - attach-sources - - jar - + attach-sources + + jar-no-fork + - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://oss.sonatype.org/ - true - - + + + + sign-artifacts + + + + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + + + + io.swagger swagger-annotations ${swagger-annotations-version} - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-version} - + com.fasterxml.jackson.core @@ -222,17 +174,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson-databind-version} - - - org.openapitools - jackson-databind-nullable - ${jackson-databind-nullable-version} - - - org.jboss.resteasy - resteasy-jackson2-provider - ${resteasy-version} + ${jackson-version} com.fasterxml.jackson.datatype @@ -240,16 +182,24 @@ ${jackson-version} - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + - javax.annotation - javax.annotation-api - ${javax-annotation-version} + com.google.code.findbugs + jsr305 + 3.0.2 + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation-version} provided + junit @@ -258,45 +208,15 @@ test + UTF-8 1.5.22 - 5.0.1.Final - 2.10.5 - 2.10.5.1 - 0.2.1 - 1.3.2 - 2.9.10 - 1.0.0 - 4.13 + 11 + 11 + 2.10.4 + 0.2.2 + 1.3.5 + 4.13.1 - - - release - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - --pinentry-mode - loopback - - - - - sign-artifacts - verify - - sign - - - - - - - - diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/BridgesApi.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/BridgesApi.java index 4fa35384..00af28a2 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/BridgesApi.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/BridgesApi.java @@ -1,211 +1,446 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.smartevents; -import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.ApiClient; -import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; import com.openshift.cloud.api.smartevents.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.smartevents.models.BridgeListResponse; import com.openshift.cloud.api.smartevents.models.BridgeRequest; import com.openshift.cloud.api.smartevents.models.BridgeResponse; import com.openshift.cloud.api.smartevents.models.ManagedResourceStatus; import java.util.Set; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BridgesApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public BridgesApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public BridgesApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } /** * Create a Bridge instance * Create a Bridge instance for the authenticated user. * @param bridgeRequest (optional) - * @return a {@code BridgeResponse} + * @return CompletableFuture<BridgeResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture bridgesAPICreateBridge(BridgeRequest bridgeRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPICreateBridgeRequestBuilder(bridgeRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPICreateBridge", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a Bridge instance + * Create a Bridge instance for the authenticated user. + * @param bridgeRequest (optional) + * @return CompletableFuture<ApiResponse<BridgeResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> bridgesAPICreateBridgeWithHttpInfo(BridgeRequest bridgeRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPICreateBridgeRequestBuilder(bridgeRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPICreateBridge", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder bridgesAPICreateBridgeRequestBuilder(BridgeRequest bridgeRequest) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/bridges"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(bridgeRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Delete a Bridge instance + * Delete a Bridge instance of the authenticated user by ID. + * @param bridgeId (required) * @throws ApiException if fails to make API call */ - public BridgeResponse bridgesAPICreateBridge(BridgeRequest bridgeRequest) throws ApiException { - Object localVarPostBody = bridgeRequest; - - // create path and map variables - String localVarPath = "/api/v1/bridges".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture bridgesAPIDeleteBridge(String bridgeId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPIDeleteBridgeRequestBuilder(bridgeId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPIDeleteBridge", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + /** * Delete a Bridge instance * Delete a Bridge instance of the authenticated user by ID. * @param bridgeId (required) + * @return CompletableFuture<ApiResponse<Void>> * @throws ApiException if fails to make API call */ - public void bridgesAPIDeleteBridge(String bridgeId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> bridgesAPIDeleteBridgeWithHttpInfo(String bridgeId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPIDeleteBridgeRequestBuilder(bridgeId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPIDeleteBridge", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder bridgesAPIDeleteBridgeRequestBuilder(String bridgeId) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling bridgesAPIDeleteBridge"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/v1/bridges/{bridgeId}" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "bearer" }; - - - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } /** * Get a Bridge instance * Get a Bridge instance of the authenticated user by ID. * @param bridgeId (required) - * @return a {@code BridgeResponse} + * @return CompletableFuture<BridgeResponse> * @throws ApiException if fails to make API call */ - public BridgeResponse bridgesAPIGetBridge(String bridgeId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture bridgesAPIGetBridge(String bridgeId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPIGetBridgeRequestBuilder(bridgeId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPIGetBridge", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get a Bridge instance + * Get a Bridge instance of the authenticated user by ID. + * @param bridgeId (required) + * @return CompletableFuture<ApiResponse<BridgeResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> bridgesAPIGetBridgeWithHttpInfo(String bridgeId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPIGetBridgeRequestBuilder(bridgeId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPIGetBridge", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder bridgesAPIGetBridgeRequestBuilder(String bridgeId) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling bridgesAPIGetBridge"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/v1/bridges/{bridgeId}" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "bearer" }; + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get the list of Bridge instances + * Get the list of Bridge instances for the authenticated user. + * @param name (optional) + * @param page (optional, default to 0) + * @param size (optional, default to 100) + * @param status (optional + * @return CompletableFuture<BridgeListResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture bridgesAPIGetBridges(String name, Integer page, Integer size, Set status) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPIGetBridgesRequestBuilder(name, page, size, status); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPIGetBridges", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Get the list of Bridge instances * Get the list of Bridge instances for the authenticated user. * @param name (optional) * @param page (optional, default to 0) * @param size (optional, default to 100) - * @param status (optional) - * @return a {@code BridgeListResponse} + * @param status (optional + * @return CompletableFuture<ApiResponse<BridgeListResponse>> * @throws ApiException if fails to make API call */ - public BridgeListResponse bridgesAPIGetBridges(String name, Integer page, Integer size, Set status) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v1/bridges".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "name", name)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> bridgesAPIGetBridgesWithHttpInfo(String name, Integer page, Integer size, Set status) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = bridgesAPIGetBridgesRequestBuilder(name, page, size, status); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("bridgesAPIGetBridges", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder bridgesAPIGetBridgesRequestBuilder(String name, Integer page, Integer size, Set status) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/bridges"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "status", status)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/CloudProvidersApi.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/CloudProvidersApi.java index f356ddea..a5ede916 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/CloudProvidersApi.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/CloudProvidersApi.java @@ -1,171 +1,373 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.smartevents; -import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.ApiClient; -import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; import com.openshift.cloud.api.smartevents.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.smartevents.models.CloudProviderListResponse; import com.openshift.cloud.api.smartevents.models.CloudRegionListResponse; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CloudProvidersApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public CloudProvidersApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public CloudProvidersApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } /** * Get Cloud Provider. * Get details of the Cloud Provider specified by id. * @param id (required) - * @return a {@code CloudProviderListResponse} + * @return CompletableFuture<CloudProviderListResponse> * @throws ApiException if fails to make API call */ - public CloudProviderListResponse cloudProviderAPIGetCloudProvider(String id) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture cloudProviderAPIGetCloudProvider(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = cloudProviderAPIGetCloudProviderRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("cloudProviderAPIGetCloudProvider", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get Cloud Provider. + * Get details of the Cloud Provider specified by id. + * @param id (required) + * @return CompletableFuture<ApiResponse<CloudProviderListResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> cloudProviderAPIGetCloudProviderWithHttpInfo(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = cloudProviderAPIGetCloudProviderRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("cloudProviderAPIGetCloudProvider", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder cloudProviderAPIGetCloudProviderRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling cloudProviderAPIGetCloudProvider"); } - - // create path and map variables - String localVarPath = "/api/v1/cloud_providers/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/v1/cloud_providers/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { }; + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * List Supported Cloud Regions. + * Returns the list of supported Regions of the specified Cloud Provider. + * @param id (required) + * @param page (optional, default to 0) + * @param size (optional, default to 100) + * @return CompletableFuture<CloudRegionListResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture cloudProviderAPIListCloudProviderRegions(String id, Integer page, Integer size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = cloudProviderAPIListCloudProviderRegionsRequestBuilder(id, page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("cloudProviderAPIListCloudProviderRegions", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * List Supported Cloud Regions. * Returns the list of supported Regions of the specified Cloud Provider. * @param id (required) * @param page (optional, default to 0) * @param size (optional, default to 100) - * @return a {@code CloudRegionListResponse} + * @return CompletableFuture<ApiResponse<CloudRegionListResponse>> * @throws ApiException if fails to make API call */ - public CloudRegionListResponse cloudProviderAPIListCloudProviderRegions(String id, Integer page, Integer size) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> cloudProviderAPIListCloudProviderRegionsWithHttpInfo(String id, Integer page, Integer size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = cloudProviderAPIListCloudProviderRegionsRequestBuilder(id, page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("cloudProviderAPIListCloudProviderRegions", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder cloudProviderAPIListCloudProviderRegionsRequestBuilder(String id, Integer page, Integer size) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling cloudProviderAPIListCloudProviderRegions"); } - - // create path and map variables - String localVarPath = "/api/v1/cloud_providers/{id}/regions".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/cloud_providers/{id}/regions" + .replace("{id}", ApiClient.urlEncode(id.toString())); + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * List Supported Cloud Providers. * Returns the list of supported Cloud Providers. * @param page (optional, default to 0) * @param size (optional, default to 100) - * @return a {@code CloudProviderListResponse} + * @return CompletableFuture<CloudProviderListResponse> * @throws ApiException if fails to make API call */ - public CloudProviderListResponse cloudProviderAPIListCloudProviders(Integer page, Integer size) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v1/cloud_providers".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture cloudProviderAPIListCloudProviders(Integer page, Integer size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = cloudProviderAPIListCloudProvidersRequestBuilder(page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("cloudProviderAPIListCloudProviders", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * List Supported Cloud Providers. + * Returns the list of supported Cloud Providers. + * @param page (optional, default to 0) + * @param size (optional, default to 100) + * @return CompletableFuture<ApiResponse<CloudProviderListResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> cloudProviderAPIListCloudProvidersWithHttpInfo(Integer page, Integer size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = cloudProviderAPIListCloudProvidersRequestBuilder(page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("cloudProviderAPIListCloudProviders", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder cloudProviderAPIListCloudProvidersRequestBuilder(Integer page, Integer size) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/cloud_providers"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ErrorCatalogApi.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ErrorCatalogApi.java index 06afdcf0..d02c4133 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ErrorCatalogApi.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ErrorCatalogApi.java @@ -1,123 +1,268 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.smartevents; -import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.ApiClient; -import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; import com.openshift.cloud.api.smartevents.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.smartevents.models.BridgeError; import com.openshift.cloud.api.smartevents.models.ErrorListResponse; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorCatalogApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ErrorCatalogApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ErrorCatalogApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Get an error from the error catalog. + * Get an error from the error catalog. + * @param id (required) + * @return CompletableFuture<BridgeError> + * @throws ApiException if fails to make API call + */ + public CompletableFuture errorsAPIGetError(Integer id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = errorsAPIGetErrorRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("errorsAPIGetError", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } } /** * Get an error from the error catalog. * Get an error from the error catalog. * @param id (required) - * @return a {@code BridgeError} + * @return CompletableFuture<ApiResponse<BridgeError>> * @throws ApiException if fails to make API call */ - public BridgeError errorsAPIGetError(Integer id) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> errorsAPIGetErrorWithHttpInfo(Integer id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = errorsAPIGetErrorRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("errorsAPIGetError", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder errorsAPIGetErrorRequestBuilder(Integer id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling errorsAPIGetError"); } - - // create path and map variables - String localVarPath = "/api/v1/errors/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/errors/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get the list of errors. + * Get the list of errors from the error catalog. + * @param page (optional, default to 0) + * @param size (optional, default to 100) + * @return CompletableFuture<ErrorListResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture errorsAPIGetErrors(Integer page, Integer size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = errorsAPIGetErrorsRequestBuilder(page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("errorsAPIGetErrors", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + /** * Get the list of errors. * Get the list of errors from the error catalog. * @param page (optional, default to 0) * @param size (optional, default to 100) - * @return a {@code ErrorListResponse} + * @return CompletableFuture<ApiResponse<ErrorListResponse>> * @throws ApiException if fails to make API call */ - public ErrorListResponse errorsAPIGetErrors(Integer page, Integer size) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v1/errors".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> errorsAPIGetErrorsWithHttpInfo(Integer page, Integer size) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = errorsAPIGetErrorsRequestBuilder(page, size); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("errorsAPIGetErrors", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder errorsAPIGetErrorsRequestBuilder(Integer page, Integer size) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/errors"; + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ProcessorsApi.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ProcessorsApi.java index a07714f0..7d3526dd 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ProcessorsApi.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/ProcessorsApi.java @@ -1,12 +1,22 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.smartevents; -import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.ApiClient; -import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; import com.openshift.cloud.api.smartevents.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.smartevents.models.ManagedResourceStatus; import com.openshift.cloud.api.smartevents.models.ProcessorListResponse; import com.openshift.cloud.api.smartevents.models.ProcessorRequest; @@ -14,29 +24,60 @@ import com.openshift.cloud.api.smartevents.models.ProcessorType; import java.util.Set; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; + +import java.util.concurrent.CompletableFuture; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ProcessorsApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public ProcessorsApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public ProcessorsApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); } - public ApiClient getApiClient() { - return apiClient; + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } /** @@ -44,147 +85,282 @@ public void setApiClient(ApiClient apiClient) { * Create a Processor of a Bridge instance for the authenticated user. * @param bridgeId (required) * @param processorRequest (optional) - * @return a {@code ProcessorResponse} + * @return CompletableFuture<ProcessorResponse> * @throws ApiException if fails to make API call */ - public ProcessorResponse processorsAPIAddProcessorToBridge(String bridgeId, ProcessorRequest processorRequest) throws ApiException { - Object localVarPostBody = processorRequest; - + public CompletableFuture processorsAPIAddProcessorToBridge(String bridgeId, ProcessorRequest processorRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIAddProcessorToBridgeRequestBuilder(bridgeId, processorRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIAddProcessorToBridge", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Create a Processor of a Bridge instance + * Create a Processor of a Bridge instance for the authenticated user. + * @param bridgeId (required) + * @param processorRequest (optional) + * @return CompletableFuture<ApiResponse<ProcessorResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> processorsAPIAddProcessorToBridgeWithHttpInfo(String bridgeId, ProcessorRequest processorRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIAddProcessorToBridgeRequestBuilder(bridgeId, processorRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIAddProcessorToBridge", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder processorsAPIAddProcessorToBridgeRequestBuilder(String bridgeId, ProcessorRequest processorRequest) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling processorsAPIAddProcessorToBridge"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}/processors".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/v1/bridges/{bridgeId}/processors" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "bearer" }; + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(processorRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Delete a Processor of a Bridge instance + * Delete a Processor of a Bridge instance for the authenticated user. + * @param bridgeId (required) + * @param processorId (required) + * @throws ApiException if fails to make API call + */ + public CompletableFuture processorsAPIDeleteProcessor(String bridgeId, String processorId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIDeleteProcessorRequestBuilder(bridgeId, processorId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIDeleteProcessor", localVarResponse)); + } + return CompletableFuture.completedFuture(null); + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Delete a Processor of a Bridge instance * Delete a Processor of a Bridge instance for the authenticated user. * @param bridgeId (required) * @param processorId (required) + * @return CompletableFuture<ApiResponse<Void>> * @throws ApiException if fails to make API call */ - public void processorsAPIDeleteProcessor(String bridgeId, String processorId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> processorsAPIDeleteProcessorWithHttpInfo(String bridgeId, String processorId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIDeleteProcessorRequestBuilder(bridgeId, processorId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIDeleteProcessor", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse(localVarResponse.statusCode(), localVarResponse.headers().map(), null) + ); + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder processorsAPIDeleteProcessorRequestBuilder(String bridgeId, String processorId) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling processorsAPIDeleteProcessor"); } - // verify the required parameter 'processorId' is set if (processorId == null) { throw new ApiException(400, "Missing the required parameter 'processorId' when calling processorsAPIDeleteProcessor"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}/processors/{processorId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())) - .replaceAll("\\{" + "processorId" + "\\}", apiClient.escapeString(processorId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/api/v1/bridges/{bridgeId}/processors/{processorId}" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())) + .replace("{processorId}", ApiClient.urlEncode(processorId.toString())); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "bearer" }; + localVarRequestBuilder.header("Accept", "application/json"); - - apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } /** * Get a Processor of a Bridge instance * Get a Processor of a Bridge instance for the authenticated user. * @param bridgeId (required) * @param processorId (required) - * @return a {@code ProcessorResponse} + * @return CompletableFuture<ProcessorResponse> * @throws ApiException if fails to make API call */ - public ProcessorResponse processorsAPIGetProcessor(String bridgeId, String processorId) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture processorsAPIGetProcessor(String bridgeId, String processorId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIGetProcessorRequestBuilder(bridgeId, processorId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIGetProcessor", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get a Processor of a Bridge instance + * Get a Processor of a Bridge instance for the authenticated user. + * @param bridgeId (required) + * @param processorId (required) + * @return CompletableFuture<ApiResponse<ProcessorResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> processorsAPIGetProcessorWithHttpInfo(String bridgeId, String processorId) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIGetProcessorRequestBuilder(bridgeId, processorId); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIGetProcessor", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder processorsAPIGetProcessorRequestBuilder(String bridgeId, String processorId) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling processorsAPIGetProcessor"); } - // verify the required parameter 'processorId' is set if (processorId == null) { throw new ApiException(400, "Missing the required parameter 'processorId' when calling processorsAPIGetProcessor"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}/processors/{processorId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())) - .replaceAll("\\{" + "processorId" + "\\}", apiClient.escapeString(processorId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/bridges/{bridgeId}/processors/{processorId}" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())) + .replace("{processorId}", ApiClient.urlEncode(processorId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Get the list of Processors of a Bridge instance * Get the list of Processors of a Bridge instance for the authenticated user. @@ -192,103 +368,217 @@ public ProcessorResponse processorsAPIGetProcessor(String bridgeId, String proce * @param name (optional) * @param page (optional, default to 0) * @param size (optional, default to 100) - * @param status (optional) + * @param status (optional * @param type (optional) - * @return a {@code ProcessorListResponse} + * @return CompletableFuture<ProcessorListResponse> * @throws ApiException if fails to make API call */ - public ProcessorListResponse processorsAPIListProcessors(String bridgeId, String name, Integer page, Integer size, Set status, ProcessorType type) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture processorsAPIListProcessors(String bridgeId, String name, Integer page, Integer size, Set status, ProcessorType type) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIListProcessorsRequestBuilder(bridgeId, name, page, size, status, type); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIListProcessors", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get the list of Processors of a Bridge instance + * Get the list of Processors of a Bridge instance for the authenticated user. + * @param bridgeId (required) + * @param name (optional) + * @param page (optional, default to 0) + * @param size (optional, default to 100) + * @param status (optional + * @param type (optional) + * @return CompletableFuture<ApiResponse<ProcessorListResponse>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> processorsAPIListProcessorsWithHttpInfo(String bridgeId, String name, Integer page, Integer size, Set status, ProcessorType type) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIListProcessorsRequestBuilder(bridgeId, name, page, size, status, type); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIListProcessors", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder processorsAPIListProcessorsRequestBuilder(String bridgeId, String name, Integer page, Integer size, Set status, ProcessorType type) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling processorsAPIListProcessors"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}/processors".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "name", name)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "size", size)); - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "status", status)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type)); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/bridges/{bridgeId}/processors" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())); + + List localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(ApiClient.parameterToPairs("name", name)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("page", page)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("size", size)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "status", status)); + localVarQueryParams.addAll(ApiClient.parameterToPairs("type", type)); + + if (!localVarQueryParams.isEmpty()) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Update a Processor instance Filter definition or Transformation template. + * Update a Processor instance Filter definition or Transformation template for the authenticated user. + * @param bridgeId (required) + * @param processorId (required) + * @param processorRequest (optional) + * @return CompletableFuture<ProcessorResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture processorsAPIUpdateProcessor(String bridgeId, String processorId, ProcessorRequest processorRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIUpdateProcessorRequestBuilder(bridgeId, processorId, processorRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIUpdateProcessor", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + /** * Update a Processor instance Filter definition or Transformation template. * Update a Processor instance Filter definition or Transformation template for the authenticated user. * @param bridgeId (required) * @param processorId (required) * @param processorRequest (optional) - * @return a {@code ProcessorResponse} + * @return CompletableFuture<ApiResponse<ProcessorResponse>> * @throws ApiException if fails to make API call */ - public ProcessorResponse processorsAPIUpdateProcessor(String bridgeId, String processorId, ProcessorRequest processorRequest) throws ApiException { - Object localVarPostBody = processorRequest; - + public CompletableFuture> processorsAPIUpdateProcessorWithHttpInfo(String bridgeId, String processorId, ProcessorRequest processorRequest) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = processorsAPIUpdateProcessorRequestBuilder(bridgeId, processorId, processorRequest); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("processorsAPIUpdateProcessor", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder processorsAPIUpdateProcessorRequestBuilder(String bridgeId, String processorId, ProcessorRequest processorRequest) throws ApiException { // verify the required parameter 'bridgeId' is set if (bridgeId == null) { throw new ApiException(400, "Missing the required parameter 'bridgeId' when calling processorsAPIUpdateProcessor"); } - // verify the required parameter 'processorId' is set if (processorId == null) { throw new ApiException(400, "Missing the required parameter 'processorId' when calling processorsAPIUpdateProcessor"); } - - // create path and map variables - String localVarPath = "/api/v1/bridges/{bridgeId}/processors/{processorId}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "bridgeId" + "\\}", apiClient.escapeString(bridgeId.toString())) - .replaceAll("\\{" + "processorId" + "\\}", apiClient.escapeString(processorId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/bridges/{bridgeId}/processors/{processorId}" + .replace("{bridgeId}", ApiClient.urlEncode(bridgeId.toString())) + .replace("{processorId}", ApiClient.urlEncode(processorId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(processorRequest); + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/SchemaCatalogApi.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/SchemaCatalogApi.java index aac488e5..17f27cf3 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/SchemaCatalogApi.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/SchemaCatalogApi.java @@ -1,162 +1,344 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.smartevents; -import com.openshift.cloud.api.smartevents.invoker.ApiException; import com.openshift.cloud.api.smartevents.invoker.ApiClient; -import com.openshift.cloud.api.smartevents.invoker.Configuration; +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import com.openshift.cloud.api.smartevents.invoker.ApiResponse; import com.openshift.cloud.api.smartevents.invoker.Pair; -import javax.ws.rs.core.GenericType; - import com.openshift.cloud.api.smartevents.models.ProcessorCatalogResponse; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.util.function.Consumer; + import java.util.ArrayList; -import java.util.HashMap; +import java.util.StringJoiner; import java.util.List; import java.util.Map; +import java.util.Set; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +import java.util.concurrent.CompletableFuture; + +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SchemaCatalogApi { - private ApiClient apiClient; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; public SchemaCatalogApi() { - this(Configuration.getDefaultApiClient()); + this(new ApiClient()); } public SchemaCatalogApi(ApiClient apiClient) { - this.apiClient = apiClient; + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + private ApiException getApiException(String operationId, HttpResponse response) { + String message = formatExceptionMessage(operationId, response.statusCode(), response.body()); + return new ApiException(response.statusCode(), message, response.headers(), response.body()); } - public ApiClient getApiClient() { - return apiClient; + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; } - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; + /** + * Get action processor schema + * Get the action processor JSON schema. + * @param id (required) + * @return CompletableFuture<Object> + * @throws ApiException if fails to make API call + */ + public CompletableFuture schemaAPIGetActionProcessorSchema(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = schemaAPIGetActionProcessorSchemaRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("schemaAPIGetActionProcessorSchema", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } } /** * Get action processor schema * Get the action processor JSON schema. * @param id (required) - * @return a {@code Object} + * @return CompletableFuture<ApiResponse<Object>> * @throws ApiException if fails to make API call */ - public Object schemaAPIGetActionProcessorSchema(String id) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture> schemaAPIGetActionProcessorSchemaWithHttpInfo(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = schemaAPIGetActionProcessorSchemaRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("schemaAPIGetActionProcessorSchema", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder schemaAPIGetActionProcessorSchemaRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling schemaAPIGetActionProcessorSchema"); } - - // create path and map variables - String localVarPath = "/api/v1/schemas/actions/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/api/v1/schemas/actions/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.header("Accept", "application/json"); - String[] localVarAuthNames = new String[] { "bearer" }; + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Get processor catalog + * Get the processor catalog with all the available sources and actions. + * @return CompletableFuture<ProcessorCatalogResponse> + * @throws ApiException if fails to make API call + */ + public CompletableFuture schemaAPIGetCatalog() throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = schemaAPIGetCatalogRequestBuilder(); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("schemaAPIGetCatalog", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } /** * Get processor catalog * Get the processor catalog with all the available sources and actions. - * @return a {@code ProcessorCatalogResponse} + * @return CompletableFuture<ApiResponse<ProcessorCatalogResponse>> * @throws ApiException if fails to make API call */ - public ProcessorCatalogResponse schemaAPIGetCatalog() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/api/v1/schemas".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "bearer" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + public CompletableFuture> schemaAPIGetCatalogWithHttpInfo() throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = schemaAPIGetCatalogRequestBuilder(); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("schemaAPIGetCatalog", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder schemaAPIGetCatalogRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/schemas"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Get source processor schema * Get the source processor JSON schema. * @param id (required) - * @return a {@code Object} + * @return CompletableFuture<Object> * @throws ApiException if fails to make API call */ - public Object schemaAPIGetSourceProcessorSchema(String id) throws ApiException { - Object localVarPostBody = null; - + public CompletableFuture schemaAPIGetSourceProcessorSchema(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = schemaAPIGetSourceProcessorSchemaRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("schemaAPIGetSourceProcessorSchema", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + }); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + /** + * Get source processor schema + * Get the source processor JSON schema. + * @param id (required) + * @return CompletableFuture<ApiResponse<Object>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> schemaAPIGetSourceProcessorSchemaWithHttpInfo(String id) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = schemaAPIGetSourceProcessorSchemaRequestBuilder(id); + return memberVarHttpClient.sendAsync( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofString()).thenComposeAsync(localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode()/ 100 != 2) { + return CompletableFuture.failedFuture(getApiException("schemaAPIGetSourceProcessorSchema", localVarResponse)); + } + try { + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {})) + ); + } catch (IOException e) { + return CompletableFuture.failedFuture(new ApiException(e)); + } + } + ); + } + catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder schemaAPIGetSourceProcessorSchemaRequestBuilder(String id) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling schemaAPIGetSourceProcessorSchema"); } - - // create path and map variables - String localVarPath = "/api/v1/schemas/sources/{id}".replaceAll("\\{format\\}","json") - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + String localVarPath = "/api/v1/schemas/sources/{id}" + .replace("{id}", ApiClient.urlEncode(id.toString())); - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - String[] localVarAuthNames = new String[] { "bearer" }; + localVarRequestBuilder.header("Accept", "application/json"); - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiClient.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiClient.java index c3a7b350..4008af80 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiClient.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiClient.java @@ -1,738 +1,417 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + package com.openshift.cloud.api.smartevents.invoker; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; + import java.io.InputStream; -import java.io.UnsupportedEncodingException; +import java.net.URI; import java.net.URLEncoder; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.Collection; import java.util.Collections; -import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TimeZone; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.time.OffsetDateTime; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import org.jboss.logging.Logger; -import org.jboss.resteasy.client.jaxrs.internal.ClientConfiguration; -import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput; -import org.jboss.resteasy.spi.ResteasyProviderFactory; - -import com.openshift.cloud.api.smartevents.invoker.auth.Authentication; -import com.openshift.cloud.api.smartevents.invoker.auth.HttpBasicAuth; -import com.openshift.cloud.api.smartevents.invoker.auth.HttpBearerAuth; -import com.openshift.cloud.api.smartevents.invoker.auth.ApiKeyAuth; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class ApiClient extends JavaTimeFormatter { - private Map defaultHeaderMap = new HashMap(); - private Map defaultCookieMap = new HashMap(); - private String basePath = "http://localhost"; - private boolean debugging = false; - - private Client httpClient; - private JSON json; - private String tempFolderPath = null; - - private Map authentications; - - private int statusCode; - private Map> responseHeaders; - - private DateFormat dateFormat; - - public ApiClient() { - json = new JSON(); - httpClient = buildHttpClient(debugging); - - this.dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT); - - // Use UTC as the default time zone. - this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - - this.json.setDateFormat((DateFormat) dateFormat.clone()); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/0.0.2/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("bearer", new HttpBearerAuth("Bearer")); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + * + *

This class can be constructed and modified, then used to instantiate the + * various API classes. The API classes use the settings in this class to + * configure themselves, but otherwise do not store a link to this class.

+ * + *

This class is mutable and not synchronized, so it is not thread-safe. + * The API classes generated from this are immutable and thread-safe.

+ * + *

The setter methods of this class return the current object to facilitate + * a fluent style of configuration.

+ */ +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ApiClient { + + private HttpClient.Builder builder; + private ObjectMapper mapper; + private String scheme; + private String host; + private int port; + private String basePath; + private Consumer interceptor; + private Consumer> responseInterceptor; + private Consumer> asyncResponseInterceptor; + private Duration readTimeout; + + private static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); } /** - * Gets the JSON instance to do JSON serialization and deserialization. - * @return the JSON utility class + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. */ - public JSON getJSON() { - return json; - } - - public Client getHttpClient() { - return httpClient; - } - - public ApiClient setHttpClient(Client httpClient) { - this.httpClient = httpClient; - return this; - } - - public String getBasePath() { - return basePath; - } - - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } /** - * Gets the status code of the previous request - * @return the status code of the previous request + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. */ - public int getStatusCode() { - return statusCode; + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); } /** - * Gets the response headers of the previous request - * @return the response headers of the previous request + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. */ - public Map> getResponseHeaders() { - return responseHeaders; - } + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } - /** - * Get authentications (key: authentication name, value: authentication). - * @return the authentications - */ - public Map getAuthentications() { - return authentications; - } + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username the username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password the password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); } - throw new RuntimeException("No HTTP basic authentication configured!"); + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); } /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey the API key + * Ctor. */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; } /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix the API key prefix + * Ctor. */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; } - /** - * Set the User-Agent header's value (by adding to the default header map). - * @param userAgent the User-Agent header value - * @return this {@code ApiClient} - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; + protected ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); + return mapper; } - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return this {@code ApiClient} - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; + protected String getDefaultBaseUri() { + return "http://localhost"; } - /** - * Check that whether debugging is enabled for this API client. - * @return {@code true} if debugging is enabled for this API client - */ - public boolean isDebugging() { - return debugging; + protected HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } + + public void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); } /** - * Enable/disable debugging for this API client. + * Set a custom {@link HttpClient.Builder} object to use when creating the + * {@link HttpClient} that is used by the API client. * - * @param debugging To enable (true) or disable (false) debugging - * @return this {@code ApiClient} + * @param builder Custom client builder. + * @return This object. */ - public ApiClient setDebugging(boolean debugging) { - this.debugging = debugging; - // Rebuild HTTP Client according to the new "debugging" value. - this.httpClient = buildHttpClient(debugging); + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; return this; } /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default temporary folder. + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe.

* - * @return the temporary folder path - * @see createTempFile + * @return The HTTP client. */ - public String getTempFolderPath() { - return tempFolderPath; + public HttpClient getHttpClient() { + return builder.build(); } - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request + * and response bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; return this; } /** - * Get the date format used to parse/format date parameters. - * @return the date format used to parse/format date parameters + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. */ - public DateFormat getDateFormat() { - return dateFormat; + public ObjectMapper getObjectMapper() { + return mapper.copy(); } /** - * Set the date format used to parse/format date parameters. - * @param dateFormat a date format used to parse/format date parameters - * @return this {@code ApiClient} + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - // also set the date format for model (de)serialization with Date properties - this.json.setDateFormat((DateFormat) dateFormat.clone()); + public ApiClient setHost(String host) { + this.host = host; return this; } /** - * Parse the given string into Date object. - * @param str a string to parse - * @return a {@code Date} object + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the + * value to the default for the scheme. + * @return This object. */ - public Date parseDate(String str) { - try { - return dateFormat.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } + public ApiClient setPort(int port) { + this.port = port; + return this; } /** - * Format the given Date object into string. - * @param date a {@code Date} object to format - * @return the {@code String} version of the {@code Date} object + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is + * resolved. + * @return This object. */ - public String formatDate(Date date) { - return dateFormat.format(date); + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; } /** - * Format the given parameter object into string. - * @param param an object to format - * @return the {@code String} version of the object + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are + * resolved against. */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof OffsetDateTime) { - return formatOffsetDateTime((OffsetDateTime) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /* - Format to {@code Pair} objects. - */ - public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null) return params; - - Collection valueCollection = null; - if (value instanceof Collection) { - valueCollection = (Collection) value; - } else { - params.add(new Pair(name, parameterToString(value))); - return params; - } - - if (valueCollection.isEmpty()){ - return params; - } - - // get the collection format - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv - - // create the params based on the collection format - if (collectionFormat.equals("multi")) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } - - return params; - } - - String delimiter = ","; - - if (collectionFormat.equals("csv")) { - delimiter = ","; - } else if (collectionFormat.equals("ssv")) { - delimiter = " "; - } else if (collectionFormat.equals("tsv")) { - delimiter = "\t"; - } else if (collectionFormat.equals("pipes")) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - params.add(new Pair(name, sb.substring(1))); - - return params; + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; } /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + public ApiClient setScheme(String scheme){ + this.scheme = scheme; + return this; } /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it + * is sent. After the request has been fully configured but not yet built, the + * request builder is passed into this function for further modification, + * after which it is sent out.

+ * + *

This is useful for altering the requests in a custom manner, such as + * adding headers. It could also be used for logging and monitoring.

* - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; } /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. + * Get the custom interceptor. * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * JSON will be used. + * @return The custom interceptor that was set, or null if there isn't any. */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return "application/json"; - } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - return contentTypes[0]; + public Consumer getRequestInterceptor() { + return interceptor; } /** - * Escape the given string to be used as URL query value. - * @param str a {@code String} to escape - * @return the escaped version of the {@code String} + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; } - /** - * Serialize the given Java object into string entity according the given - * Content-Type (only JSON is supported for now). - * @param obj the object to serialize - * @param formParams the form parameters - * @param contentType the content type - * @return an {@code Entity} - * @throws ApiException on failure to serialize + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. */ - public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { - Entity entity = null; - if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); - //MultiPart multiPart = new MultiPart(); - for (Entry param: formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - try { - multipart.addFormData(param.getValue().toString(),new FileInputStream(file),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } catch (FileNotFoundException e) { - throw new ApiException("Could not serialize multipart/form-data "+e.getMessage()); - } - } else { - multipart.addFormData(param.getValue().toString(),param.getValue().toString(),MediaType.APPLICATION_OCTET_STREAM_TYPE); - } - } - entity = Entity.entity(multipart.getFormData(), MediaType.MULTIPART_FORM_DATA_TYPE); - } else if (contentType.startsWith("application/x-www-form-urlencoded")) { - Form form = new Form(); - for (Entry param: formParams.entrySet()) { - form.param(param.getKey(), parameterToString(param.getValue())); - } - entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); - } else { - // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); - } - return entity; + public Consumer> getResponseInterceptor() { + return responseInterceptor; } /** - * Deserialize response body to Java object according to the Content-Type. - * @param a Java type parameter - * @param response the response body to deserialize - * @param returnType a Java type to deserialize into - * @return a deserialized Java object - * @throws ApiException on failure to deserialize + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables

+ * + * @param interceptor A function invoked before creating each request. A value + * of null resets the interceptor to a no-op. + * @return This object. */ - public T deserialize(Response response, GenericType returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - return (T) response.readEntity(byte[].class); - } else if (returnType.equals(File.class)) { - // Handle file downloading. - @SuppressWarnings("unchecked") - T file = (T) downloadFileFromResponse(response); - return file; - } - - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - if (contentType == null) - throw new ApiException(500, "missing Content-Type in response"); - - return response.readEntity(returnType); + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; } - /** - * Download file from the given response. - * @param response a response - * @return a file from the given response - * @throws ApiException If fail to read file content from response and write to disk + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - Files.copy(response.readEntity(InputStream.class), file.toPath()); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) - filename = matcher.group(1); - } - - String prefix = null; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf("."); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; } /** - * Invoke API by sending HTTP request with the given options. + * Set the read timeout for the http client. * - * @param a Java type parameter - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param cookieParams The cookie parameters - * @param formParams The form parameters - * @param accept The request's Accept header - * @param contentType The request's Content-Type header - * @param authNames The authentications to apply - * @param returnType The return type into which to deserialize the response - * @return The response body in type of string - * @throws ApiException if the invocation failed - */ - public T invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); - - // Not using `.target(this.basePath).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" - WebTarget target = httpClient.target(this.basePath + path); - - if (queryParams != null) { - for (Pair queryParam : queryParams) { - if (queryParam.getValue() != null) { - target = target.queryParam(queryParam.getName(), queryParam.getValue()); - } - } - } - - Invocation.Builder invocationBuilder = target.request().accept(accept); - - for (Entry headerParamsEntry : headerParams.entrySet()) { - String value = headerParamsEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(headerParamsEntry.getKey(), value); - } - } - - for (Entry defaultHeaderEntry: defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(defaultHeaderEntry.getKey())) { - String value = defaultHeaderEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(defaultHeaderEntry.getKey(), value); - } - } - } - - for (Entry cookieParamsEntry : cookieParams.entrySet()) { - String value = cookieParamsEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(cookieParamsEntry.getKey(), value); - } - } - - for (Entry defaultCookieEntry: defaultHeaderMap.entrySet()) { - if (!cookieParams.containsKey(defaultCookieEntry.getKey())) { - String value = defaultCookieEntry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.cookie(defaultCookieEntry.getKey(), value); - } - } - } - - Entity entity = serialize(body, formParams, contentType); - - Response response = null; - - if ("GET".equals(method)) { - response = invocationBuilder.get(); - } else if ("POST".equals(method)) { - response = invocationBuilder.post(entity); - } else if ("PUT".equals(method)) { - response = invocationBuilder.put(entity); - } else if ("DELETE".equals(method)) { - response = invocationBuilder.method("DELETE", entity); - } else if ("PATCH".equals(method)) { - response = invocationBuilder.method("PATCH", entity); - } else if ("HEAD".equals(method)) { - response = invocationBuilder.head(); - } else if ("OPTIONS".equals(method)) { - response = invocationBuilder.options(); - } else if ("TRACE".equals(method)) { - response = invocationBuilder.trace(); - } else { - throw new ApiException(500, "unknown method type " + method); - } - - statusCode = response.getStatusInfo().getStatusCode(); - responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return null; - } else if (response.getStatusInfo().getFamily().equals(Status.Family.SUCCESSFUL)) { - if (returnType == null) - return null; - else - return deserialize(response, returnType); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } - } - - /** - * Build the Client used to make HTTP requests. + *

This is the value used by default for each request, though it can be + * overridden on a per-request basis with a request interceptor.

+ * + * @param readTimeout The read timeout used by default by the http client. + * Setting this value to null resets the timeout to an + * effectively infinite value. + * @return This object. */ - private Client buildHttpClient(boolean debugging) { - final ClientConfiguration clientConfig = new ClientConfiguration(ResteasyProviderFactory.getInstance()); - clientConfig.register(json); - if(debugging){ - clientConfig.register(Logger.class); - } - return ClientBuilder.newClient(clientConfig); - } - private Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); - for (Entry> entry: response.getHeaders().entrySet()) { - List values = entry.getValue(); - List headers = new ArrayList(); - for (Object o : values) { - headers.add(String.valueOf(o)); - } - responseHeaders.put(entry.getKey(), headers); - } - return responseHeaders; + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; } /** - * Update query and header parameters based on authentication settings. + * Get the read timeout that was set. * - * @param authNames The authentications to apply + * @return The read timeout, or null if no timeout was set. Null represents + * an infinite wait time. */ - private void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams, cookieParams); - } + public Duration getReadTimeout() { + return readTimeout; } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiException.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiException.java index 69ba1495..41c176cc 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiException.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiException.java @@ -13,13 +13,12 @@ package com.openshift.cloud.api.smartevents.invoker; -import java.util.Map; -import java.util.List; +import java.net.http.HttpHeaders; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiException extends Exception { private int code = 0; - private Map> responseHeaders = null; + private HttpHeaders responseHeaders = null; private String responseBody = null; public ApiException() {} @@ -32,22 +31,22 @@ public ApiException(String message) { super(message); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { this(message, throwable, code, responseHeaders, null); } - public ApiException(int code, Map> responseHeaders, String responseBody) { + public ApiException(int code, HttpHeaders responseHeaders, String responseBody) { this((String) null, (Throwable) null, code, responseHeaders, responseBody); } @@ -56,7 +55,7 @@ public ApiException(int code, String message) { this.code = code; } - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; @@ -74,9 +73,9 @@ public int getCode() { /** * Get the HTTP response headers. * - * @return A map of list of string + * @return Headers as an HttpHeaders object */ - public Map> getResponseHeaders() { + public HttpHeaders getResponseHeaders() { return responseHeaders; } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiResponse.java new file mode 100644 index 00000000..95cfa0e0 --- /dev/null +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/ApiResponse.java @@ -0,0 +1,59 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.openshift.cloud.api.smartevents.invoker; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Configuration.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Configuration.java index cca3ed53..567ebd89 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Configuration.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Configuration.java @@ -13,7 +13,7 @@ package com.openshift.cloud.api.smartevents.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/JSON.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/JSON.java index 60202b46..cb5dca0a 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/JSON.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/JSON.java @@ -3,40 +3,238 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import org.openapitools.jackson.nullable.JsonNullableModule; -import com.fasterxml.jackson.datatype.jsr310.*; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.openshift.cloud.api.smartevents.models.*; import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; -import javax.ws.rs.ext.ContextResolver; - -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class JSON implements ContextResolver { +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class JSON { private ObjectMapper mapper; public JSON() { mapper = new ObjectMapper(); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); JsonNullableModule jnm = new JsonNullableModule(); mapper.registerModule(jnm); - mapper.registerModule(new JavaTimeModule()); } /** * Set the date format for JSON (de)serialization with Date properties. - * @param dateFormat the date format to set + * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { mapper.setDateFormat(dateFormat); } - @Override - public ObjectMapper getContext(Class type) { - return mapper; + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; } } diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Pair.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Pair.java index ee6de807..56432331 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Pair.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/invoker/Pair.java @@ -13,7 +13,7 @@ package com.openshift.cloud.api.smartevents.invoker; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pair { private String name = ""; private String value = ""; diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/AbstractOpenApiSchema.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/AbstractOpenApiSchema.java new file mode 100644 index 00000000..78d0f97d --- /dev/null +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/AbstractOpenApiSchema.java @@ -0,0 +1,148 @@ +/* + * Red Hat Openshift SmartEvents Fleet Manager + * The API exposed by the fleet manager of the SmartEvents service. + * + * The version of the OpenAPI document: 0.0.2 + * Contact: openbridge-dev@redhat.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.openshift.cloud.api.smartevents.models; + +import com.openshift.cloud.api.smartevents.invoker.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Action.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Action.java index 2e063ab6..2bc77ac0 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Action.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Action.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Action @@ -32,8 +34,7 @@ Action.JSON_PROPERTY_TYPE, Action.JSON_PROPERTY_PARAMETERS }) -@JsonTypeName("Action") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Action { public static final String JSON_PROPERTY_TYPE = "type"; private String type; @@ -45,7 +46,6 @@ public Action() { } public Action type(String type) { - this.type = type; return this; } @@ -72,7 +72,6 @@ public void setType(String type) { public Action parameters(Object parameters) { - this.parameters = parameters; return this; } @@ -98,6 +97,9 @@ public void setParameters(Object parameters) { } + /** + * Return true if this Action object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BaseFilter.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BaseFilter.java index 4c697118..d49fcce4 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BaseFilter.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BaseFilter.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * BaseFilter @@ -32,8 +34,7 @@ BaseFilter.JSON_PROPERTY_TYPE, BaseFilter.JSON_PROPERTY_KEY }) -@JsonTypeName("BaseFilter") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BaseFilter { public static final String JSON_PROPERTY_TYPE = "type"; private String type; @@ -45,7 +46,6 @@ public BaseFilter() { } public BaseFilter type(String type) { - this.type = type; return this; } @@ -72,7 +72,6 @@ public void setType(String type) { public BaseFilter key(String key) { - this.key = key; return this; } @@ -98,6 +97,9 @@ public void setKey(String key) { } + /** + * Return true if this BaseFilter object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeError.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeError.java index ef3077ec..57d127cf 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeError.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeError.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * BridgeError @@ -35,8 +37,7 @@ BridgeError.JSON_PROPERTY_REASON, BridgeError.JSON_PROPERTY_TYPE }) -@JsonTypeName("BridgeError") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BridgeError { public static final String JSON_PROPERTY_ID = "id"; private Integer id; @@ -54,7 +55,6 @@ public BridgeError() { } public BridgeError id(Integer id) { - this.id = id; return this; } @@ -81,7 +81,6 @@ public void setId(Integer id) { public BridgeError code(String code) { - this.code = code; return this; } @@ -108,7 +107,6 @@ public void setCode(String code) { public BridgeError reason(String reason) { - this.reason = reason; return this; } @@ -135,7 +133,6 @@ public void setReason(String reason) { public BridgeError type(BridgeErrorType type) { - this.type = type; return this; } @@ -161,6 +158,9 @@ public void setType(BridgeErrorType type) { } + /** + * Return true if this BridgeError object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeErrorType.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeErrorType.java index d2691a72..182b0476 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeErrorType.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeErrorType.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeListResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeListResponse.java index 44c5e8a6..2cda0773 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeListResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeListResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * BridgeListResponse @@ -38,8 +40,7 @@ BridgeListResponse.JSON_PROPERTY_SIZE, BridgeListResponse.JSON_PROPERTY_TOTAL }) -@JsonTypeName("BridgeListResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BridgeListResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -60,7 +61,6 @@ public BridgeListResponse() { } public BridgeListResponse kind(String kind) { - this.kind = kind; return this; } @@ -87,7 +87,6 @@ public void setKind(String kind) { public BridgeListResponse items(List items) { - this.items = items; return this; } @@ -122,7 +121,6 @@ public void setItems(List items) { public BridgeListResponse page(Long page) { - this.page = page; return this; } @@ -149,7 +147,6 @@ public void setPage(Long page) { public BridgeListResponse size(Long size) { - this.size = size; return this; } @@ -176,7 +173,6 @@ public void setSize(Long size) { public BridgeListResponse total(Long total) { - this.total = total; return this; } @@ -202,6 +198,9 @@ public void setTotal(Long total) { } + /** + * Return true if this BridgeListResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeRequest.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeRequest.java index b8210223..ec3b4bbb 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeRequest.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -24,7 +26,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * BridgeRequest @@ -33,8 +35,7 @@ BridgeRequest.JSON_PROPERTY_NAME, BridgeRequest.JSON_PROPERTY_ERROR_HANDLER }) -@JsonTypeName("BridgeRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BridgeRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -46,7 +47,6 @@ public BridgeRequest() { } public BridgeRequest name(String name) { - this.name = name; return this; } @@ -73,7 +73,6 @@ public void setName(String name) { public BridgeRequest errorHandler(Action errorHandler) { - this.errorHandler = errorHandler; return this; } @@ -99,6 +98,9 @@ public void setErrorHandler(Action errorHandler) { } + /** + * Return true if this BridgeRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeResponse.java index cd7e3ddc..49602075 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/BridgeResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import io.swagger.annotations.ApiModelProperty; import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * BridgeResponse @@ -43,8 +45,7 @@ BridgeResponse.JSON_PROPERTY_ENDPOINT, BridgeResponse.JSON_PROPERTY_ERROR_HANDLER }) -@JsonTypeName("BridgeResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BridgeResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -80,7 +81,6 @@ public BridgeResponse() { } public BridgeResponse kind(String kind) { - this.kind = kind; return this; } @@ -107,7 +107,6 @@ public void setKind(String kind) { public BridgeResponse id(String id) { - this.id = id; return this; } @@ -134,7 +133,6 @@ public void setId(String id) { public BridgeResponse name(String name) { - this.name = name; return this; } @@ -161,7 +159,6 @@ public void setName(String name) { public BridgeResponse href(String href) { - this.href = href; return this; } @@ -188,7 +185,6 @@ public void setHref(String href) { public BridgeResponse submittedAt(OffsetDateTime submittedAt) { - this.submittedAt = submittedAt; return this; } @@ -215,7 +211,6 @@ public void setSubmittedAt(OffsetDateTime submittedAt) { public BridgeResponse publishedAt(OffsetDateTime publishedAt) { - this.publishedAt = publishedAt; return this; } @@ -242,7 +237,6 @@ public void setPublishedAt(OffsetDateTime publishedAt) { public BridgeResponse status(ManagedResourceStatus status) { - this.status = status; return this; } @@ -269,7 +263,6 @@ public void setStatus(ManagedResourceStatus status) { public BridgeResponse owner(String owner) { - this.owner = owner; return this; } @@ -296,7 +289,6 @@ public void setOwner(String owner) { public BridgeResponse endpoint(String endpoint) { - this.endpoint = endpoint; return this; } @@ -323,7 +315,6 @@ public void setEndpoint(String endpoint) { public BridgeResponse errorHandler(Action errorHandler) { - this.errorHandler = errorHandler; return this; } @@ -349,6 +340,9 @@ public void setErrorHandler(Action errorHandler) { } + /** + * Return true if this BridgeResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderListResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderListResponse.java index ce60edd8..0be8a0f9 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderListResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderListResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * CloudProviderListResponse @@ -38,8 +40,7 @@ CloudProviderListResponse.JSON_PROPERTY_SIZE, CloudProviderListResponse.JSON_PROPERTY_TOTAL }) -@JsonTypeName("CloudProviderListResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CloudProviderListResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -60,7 +61,6 @@ public CloudProviderListResponse() { } public CloudProviderListResponse kind(String kind) { - this.kind = kind; return this; } @@ -87,7 +87,6 @@ public void setKind(String kind) { public CloudProviderListResponse items(List items) { - this.items = items; return this; } @@ -122,7 +121,6 @@ public void setItems(List items) { public CloudProviderListResponse page(Long page) { - this.page = page; return this; } @@ -149,7 +147,6 @@ public void setPage(Long page) { public CloudProviderListResponse size(Long size) { - this.size = size; return this; } @@ -176,7 +173,6 @@ public void setSize(Long size) { public CloudProviderListResponse total(Long total) { - this.total = total; return this; } @@ -202,6 +198,9 @@ public void setTotal(Long total) { } + /** + * Return true if this CloudProviderListResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderResponse.java index c798f133..0ecbf6e0 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudProviderResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * CloudProviderResponse @@ -36,8 +38,7 @@ CloudProviderResponse.JSON_PROPERTY_DISPLAY_NAME, CloudProviderResponse.JSON_PROPERTY_ENABLED }) -@JsonTypeName("CloudProviderResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CloudProviderResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -61,7 +62,6 @@ public CloudProviderResponse() { } public CloudProviderResponse kind(String kind) { - this.kind = kind; return this; } @@ -88,7 +88,6 @@ public void setKind(String kind) { public CloudProviderResponse id(String id) { - this.id = id; return this; } @@ -115,7 +114,6 @@ public void setId(String id) { public CloudProviderResponse name(String name) { - this.name = name; return this; } @@ -142,7 +140,6 @@ public void setName(String name) { public CloudProviderResponse href(String href) { - this.href = href; return this; } @@ -169,7 +166,6 @@ public void setHref(String href) { public CloudProviderResponse displayName(String displayName) { - this.displayName = displayName; return this; } @@ -196,7 +192,6 @@ public void setDisplayName(String displayName) { public CloudProviderResponse enabled(Boolean enabled) { - this.enabled = enabled; return this; } @@ -222,6 +217,9 @@ public void setEnabled(Boolean enabled) { } + /** + * Return true if this CloudProviderResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionListResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionListResponse.java index d119f5ae..4e8aa8f2 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionListResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionListResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * CloudRegionListResponse @@ -38,8 +40,7 @@ CloudRegionListResponse.JSON_PROPERTY_SIZE, CloudRegionListResponse.JSON_PROPERTY_TOTAL }) -@JsonTypeName("CloudRegionListResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CloudRegionListResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -60,7 +61,6 @@ public CloudRegionListResponse() { } public CloudRegionListResponse kind(String kind) { - this.kind = kind; return this; } @@ -87,7 +87,6 @@ public void setKind(String kind) { public CloudRegionListResponse items(List items) { - this.items = items; return this; } @@ -122,7 +121,6 @@ public void setItems(List items) { public CloudRegionListResponse page(Long page) { - this.page = page; return this; } @@ -149,7 +147,6 @@ public void setPage(Long page) { public CloudRegionListResponse size(Long size) { - this.size = size; return this; } @@ -176,7 +173,6 @@ public void setSize(Long size) { public CloudRegionListResponse total(Long total) { - this.total = total; return this; } @@ -202,6 +198,9 @@ public void setTotal(Long total) { } + /** + * Return true if this CloudRegionListResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionResponse.java index 0da2f29a..446fbad5 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/CloudRegionResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * CloudRegionResponse @@ -34,8 +36,7 @@ CloudRegionResponse.JSON_PROPERTY_DISPLAY_NAME, CloudRegionResponse.JSON_PROPERTY_ENABLED }) -@JsonTypeName("CloudRegionResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CloudRegionResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -53,7 +54,6 @@ public CloudRegionResponse() { } public CloudRegionResponse kind(String kind) { - this.kind = kind; return this; } @@ -80,7 +80,6 @@ public void setKind(String kind) { public CloudRegionResponse name(String name) { - this.name = name; return this; } @@ -107,7 +106,6 @@ public void setName(String name) { public CloudRegionResponse displayName(String displayName) { - this.displayName = displayName; return this; } @@ -134,7 +132,6 @@ public void setDisplayName(String displayName) { public CloudRegionResponse enabled(Boolean enabled) { - this.enabled = enabled; return this; } @@ -160,6 +157,9 @@ public void setEnabled(Boolean enabled) { } + /** + * Return true if this CloudRegionResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorListResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorListResponse.java index 2454d256..3089ed67 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorListResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorListResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ErrorListResponse @@ -38,8 +40,7 @@ ErrorListResponse.JSON_PROPERTY_SIZE, ErrorListResponse.JSON_PROPERTY_TOTAL }) -@JsonTypeName("ErrorListResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorListResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -60,7 +61,6 @@ public ErrorListResponse() { } public ErrorListResponse kind(String kind) { - this.kind = kind; return this; } @@ -87,7 +87,6 @@ public void setKind(String kind) { public ErrorListResponse items(List items) { - this.items = items; return this; } @@ -122,7 +121,6 @@ public void setItems(List items) { public ErrorListResponse page(Long page) { - this.page = page; return this; } @@ -149,7 +147,6 @@ public void setPage(Long page) { public ErrorListResponse size(Long size) { - this.size = size; return this; } @@ -176,7 +173,6 @@ public void setSize(Long size) { public ErrorListResponse total(Long total) { - this.total = total; return this; } @@ -202,6 +198,9 @@ public void setTotal(Long total) { } + /** + * Return true if this ErrorListResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorResponse.java index 43c57fd6..4fabeb1f 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ErrorResponse @@ -36,8 +38,7 @@ ErrorResponse.JSON_PROPERTY_CODE, ErrorResponse.JSON_PROPERTY_REASON }) -@JsonTypeName("ErrorResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -61,7 +62,6 @@ public ErrorResponse() { } public ErrorResponse kind(String kind) { - this.kind = kind; return this; } @@ -88,7 +88,6 @@ public void setKind(String kind) { public ErrorResponse id(String id) { - this.id = id; return this; } @@ -115,7 +114,6 @@ public void setId(String id) { public ErrorResponse name(String name) { - this.name = name; return this; } @@ -142,7 +140,6 @@ public void setName(String name) { public ErrorResponse href(String href) { - this.href = href; return this; } @@ -169,7 +166,6 @@ public void setHref(String href) { public ErrorResponse code(String code) { - this.code = code; return this; } @@ -196,7 +192,6 @@ public void setCode(String code) { public ErrorResponse reason(String reason) { - this.reason = reason; return this; } @@ -222,6 +217,9 @@ public void setReason(String reason) { } + /** + * Return true if this ErrorResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorsResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorsResponse.java index bb39c4fe..69aa0d7f 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorsResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ErrorsResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ErrorsResponse @@ -35,8 +37,7 @@ ErrorsResponse.JSON_PROPERTY_KIND, ErrorsResponse.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ErrorsResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ErrorsResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -48,7 +49,6 @@ public ErrorsResponse() { } public ErrorsResponse kind(String kind) { - this.kind = kind; return this; } @@ -75,7 +75,6 @@ public void setKind(String kind) { public ErrorsResponse items(List items) { - this.items = items; return this; } @@ -109,6 +108,9 @@ public void setItems(List items) { } + /** + * Return true if this ErrorsResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ManagedResourceStatus.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ManagedResourceStatus.java index 235882e6..68d8f85b 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ManagedResourceStatus.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ManagedResourceStatus.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorCatalogResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorCatalogResponse.java index 540fc821..6ef5ae3f 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorCatalogResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorCatalogResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ProcessorCatalogResponse @@ -35,8 +37,7 @@ ProcessorCatalogResponse.JSON_PROPERTY_KIND, ProcessorCatalogResponse.JSON_PROPERTY_ITEMS }) -@JsonTypeName("ProcessorCatalogResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ProcessorCatalogResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -48,7 +49,6 @@ public ProcessorCatalogResponse() { } public ProcessorCatalogResponse kind(String kind) { - this.kind = kind; return this; } @@ -75,7 +75,6 @@ public void setKind(String kind) { public ProcessorCatalogResponse items(List items) { - this.items = items; return this; } @@ -109,6 +108,9 @@ public void setItems(List items) { } + /** + * Return true if this ProcessorCatalogResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorListResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorListResponse.java index 2d4c6b2f..c3897cfa 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorListResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorListResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -26,7 +28,7 @@ import java.util.ArrayList; import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ProcessorListResponse @@ -38,8 +40,7 @@ ProcessorListResponse.JSON_PROPERTY_SIZE, ProcessorListResponse.JSON_PROPERTY_TOTAL }) -@JsonTypeName("ProcessorListResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ProcessorListResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -60,7 +61,6 @@ public ProcessorListResponse() { } public ProcessorListResponse kind(String kind) { - this.kind = kind; return this; } @@ -87,7 +87,6 @@ public void setKind(String kind) { public ProcessorListResponse items(List items) { - this.items = items; return this; } @@ -122,7 +121,6 @@ public void setItems(List items) { public ProcessorListResponse page(Long page) { - this.page = page; return this; } @@ -149,7 +147,6 @@ public void setPage(Long page) { public ProcessorListResponse size(Long size) { - this.size = size; return this; } @@ -176,7 +173,6 @@ public void setSize(Long size) { public ProcessorListResponse total(Long total) { - this.total = total; return this; } @@ -202,6 +198,9 @@ public void setTotal(Long total) { } + /** + * Return true if this ProcessorListResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorRequest.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorRequest.java index 99e710a8..7aa000b4 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorRequest.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorRequest.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -30,7 +32,7 @@ import java.util.List; import java.util.Set; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ProcessorRequest @@ -42,8 +44,7 @@ ProcessorRequest.JSON_PROPERTY_ACTION, ProcessorRequest.JSON_PROPERTY_SOURCE }) -@JsonTypeName("ProcessorRequest") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ProcessorRequest { public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -64,7 +65,6 @@ public ProcessorRequest() { } public ProcessorRequest name(String name) { - this.name = name; return this; } @@ -91,7 +91,6 @@ public void setName(String name) { public ProcessorRequest filters(Set filters) { - this.filters = filters; return this; } @@ -127,7 +126,6 @@ public void setFilters(Set filters) { public ProcessorRequest transformationTemplate(String transformationTemplate) { - this.transformationTemplate = transformationTemplate; return this; } @@ -154,7 +152,6 @@ public void setTransformationTemplate(String transformationTemplate) { public ProcessorRequest action(Action action) { - this.action = action; return this; } @@ -181,7 +178,6 @@ public void setAction(Action action) { public ProcessorRequest source(Source source) { - this.source = source; return this; } @@ -207,6 +203,9 @@ public void setSource(Source source) { } + /** + * Return true if this ProcessorRequest object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorResponse.java index 999a0696..6bdebb55 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -33,7 +35,7 @@ import java.util.List; import java.util.Set; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ProcessorResponse @@ -53,8 +55,7 @@ ProcessorResponse.JSON_PROPERTY_ACTION, ProcessorResponse.JSON_PROPERTY_SOURCE }) -@JsonTypeName("ProcessorResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ProcessorResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -99,7 +100,6 @@ public ProcessorResponse() { } public ProcessorResponse kind(String kind) { - this.kind = kind; return this; } @@ -126,7 +126,6 @@ public void setKind(String kind) { public ProcessorResponse id(String id) { - this.id = id; return this; } @@ -153,7 +152,6 @@ public void setId(String id) { public ProcessorResponse name(String name) { - this.name = name; return this; } @@ -180,7 +178,6 @@ public void setName(String name) { public ProcessorResponse href(String href) { - this.href = href; return this; } @@ -207,7 +204,6 @@ public void setHref(String href) { public ProcessorResponse submittedAt(OffsetDateTime submittedAt) { - this.submittedAt = submittedAt; return this; } @@ -234,7 +230,6 @@ public void setSubmittedAt(OffsetDateTime submittedAt) { public ProcessorResponse publishedAt(OffsetDateTime publishedAt) { - this.publishedAt = publishedAt; return this; } @@ -261,7 +256,6 @@ public void setPublishedAt(OffsetDateTime publishedAt) { public ProcessorResponse status(ManagedResourceStatus status) { - this.status = status; return this; } @@ -288,7 +282,6 @@ public void setStatus(ManagedResourceStatus status) { public ProcessorResponse owner(String owner) { - this.owner = owner; return this; } @@ -315,7 +308,6 @@ public void setOwner(String owner) { public ProcessorResponse type(ProcessorType type) { - this.type = type; return this; } @@ -342,7 +334,6 @@ public void setType(ProcessorType type) { public ProcessorResponse filters(Set filters) { - this.filters = filters; return this; } @@ -378,7 +369,6 @@ public void setFilters(Set filters) { public ProcessorResponse transformationTemplate(String transformationTemplate) { - this.transformationTemplate = transformationTemplate; return this; } @@ -405,7 +395,6 @@ public void setTransformationTemplate(String transformationTemplate) { public ProcessorResponse action(Action action) { - this.action = action; return this; } @@ -432,7 +421,6 @@ public void setAction(Action action) { public ProcessorResponse source(Source source) { - this.source = source; return this; } @@ -458,6 +446,9 @@ public void setSource(Source source) { } + /** + * Return true if this ProcessorResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorSchemaEntryResponse.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorSchemaEntryResponse.java index 2ef440aa..9eecc6de 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorSchemaEntryResponse.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorSchemaEntryResponse.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * ProcessorSchemaEntryResponse @@ -36,8 +38,7 @@ ProcessorSchemaEntryResponse.JSON_PROPERTY_TYPE, ProcessorSchemaEntryResponse.JSON_PROPERTY_HREF }) -@JsonTypeName("ProcessorSchemaEntryResponse") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ProcessorSchemaEntryResponse { public static final String JSON_PROPERTY_KIND = "kind"; private String kind; @@ -61,7 +62,6 @@ public ProcessorSchemaEntryResponse() { } public ProcessorSchemaEntryResponse kind(String kind) { - this.kind = kind; return this; } @@ -88,7 +88,6 @@ public void setKind(String kind) { public ProcessorSchemaEntryResponse id(String id) { - this.id = id; return this; } @@ -115,7 +114,6 @@ public void setId(String id) { public ProcessorSchemaEntryResponse name(String name) { - this.name = name; return this; } @@ -142,7 +140,6 @@ public void setName(String name) { public ProcessorSchemaEntryResponse description(String description) { - this.description = description; return this; } @@ -169,7 +166,6 @@ public void setDescription(String description) { public ProcessorSchemaEntryResponse type(String type) { - this.type = type; return this; } @@ -196,7 +192,6 @@ public void setType(String type) { public ProcessorSchemaEntryResponse href(String href) { - this.href = href; return this; } @@ -222,6 +217,9 @@ public void setHref(String href) { } + /** + * Return true if this ProcessorSchemaEntryResponse object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorType.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorType.java index 9adbf20a..3c13697d 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorType.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/ProcessorType.java @@ -15,8 +15,10 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Source.java b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Source.java index 8f93ab2d..f87f91ce 100644 --- a/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Source.java +++ b/packages/smartevents-management-sdk/src/main/java/com/openshift/cloud/api/smartevents/models/Source.java @@ -15,6 +15,8 @@ import java.util.Objects; import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -23,7 +25,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.annotation.JsonTypeName; + /** * Source @@ -32,8 +34,7 @@ Source.JSON_PROPERTY_TYPE, Source.JSON_PROPERTY_PARAMETERS }) -@JsonTypeName("Source") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Source { public static final String JSON_PROPERTY_TYPE = "type"; private String type; @@ -45,7 +46,6 @@ public Source() { } public Source type(String type) { - this.type = type; return this; } @@ -72,7 +72,6 @@ public void setType(String type) { public Source parameters(Object parameters) { - this.parameters = parameters; return this; } @@ -98,6 +97,9 @@ public void setParameters(Object parameters) { } + /** + * Return true if this Source object is equal to o. + */ @Override public boolean equals(Object o) { if (this == o) { diff --git a/scripts/generate.sh b/scripts/generate.sh index a5919aba..ac6b276f 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -58,36 +58,37 @@ npx @openapitools/openapi-generator-cli generate -g java --library resteasy -t --ignore-file-override=.openapi-generator-ignore GROUP_ID="com.redhat.cloud" -ARTIFACT_ID="connector-management-sdk" -OPENAPI_FILENAME=".openapi/connector_mgmt.yaml" -PACKAGE_NAME="com.openshift.cloud.api.connector" -OUTPUT_PATH="packages/connector-management-sdk/" -yq e 'del(.. | select(has("deprecated")))' "${OPENAPI_FILENAME}" > "${OPENAPI_FILENAME}.processed" -yq e 'del(.. | select(has("deprecated")))' "${OPENAPI_FILENAME}" > "${OPENAPI_FILENAME}.processed" -rm -Rf $OUTPUT_PATH/src $OUTPUT_PATH/target +ARTIFACT_ID="service-accounts-sdk" +OPENAPI_FILENAME=".openapi/service-accounts.yaml" +PACKAGE_NAME="com.openshift.cloud.api.serviceaccounts" +OUTPUT_PATH="packages/service-accounts-sdk/" echo "Generating based on ${OPENAPI_FILENAME}" +rm -Rf $OUTPUT_PATH/src $OUTPUT_PATH/target -npx @openapitools/openapi-generator-cli generate -g java --library resteasy -t "$TEMPLATES_DIR" -i \ - "$OPENAPI_FILENAME.processed" -o "$OUTPUT_PATH" \ +npx @openapitools/openapi-generator-cli generate -g java \ + --library native -t "$TEMPLATES_DIR" \ + -i "$OPENAPI_FILENAME" -o "$OUTPUT_PATH" \ --package-name="${PACKAGE_NAME}" \ --additional-properties="apiTests=false,modelTests=false,hideGenerationTimestamp=true,groupId=${GROUP_ID},artifactId=${ARTIFACT_ID},modelPackage=${PACKAGE_NAME}.models,invokerPackage=${PACKAGE_NAME}.invoker,apiPackage=${PACKAGE_NAME},dateLibrary=java8,licenseName=Apache-2.0,licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.txt" \ --ignore-file-override=.openapi-generator-ignore +echo "generating experimental native java clients" + GROUP_ID="com.redhat.cloud" -ARTIFACT_ID="service-accounts-sdk" -OPENAPI_FILENAME=".openapi/service-accounts.yaml" -PACKAGE_NAME="com.openshift.cloud.api.serviceaccounts" -OUTPUT_PATH="packages/service-accounts-sdk/" +ARTIFACT_ID="connector-management-sdk" +OPENAPI_FILENAME=".openapi/connector_mgmt.yaml" +PACKAGE_NAME="com.openshift.cloud.api.connector" +OUTPUT_PATH="packages/connector-management-sdk/" +rm -Rf $OUTPUT_PATH/src $OUTPUT_PATH/target echo "Generating based on ${OPENAPI_FILENAME}" -rm -Rf $OUTPUT_PATH/src $OUTPUT_PATH/target npx @openapitools/openapi-generator-cli generate -g java \ - --library resteasy -t "$TEMPLATES_DIR" \ - -i "$OPENAPI_FILENAME" -o "$OUTPUT_PATH" \ + --library native -i "$OPENAPI_FILENAME" \ + -o "$OUTPUT_PATH" \ --package-name="${PACKAGE_NAME}" \ - --additional-properties="apiTests=false,modelTests=false,hideGenerationTimestamp=true,groupId=${GROUP_ID},artifactId=${ARTIFACT_ID},modelPackage=${PACKAGE_NAME}.models,invokerPackage=${PACKAGE_NAME}.invoker,apiPackage=${PACKAGE_NAME},dateLibrary=java8,licenseName=Apache-2.0,licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.txt" \ + --additional-properties="asyncNative=true,apiTests=false,modelTests=false,hideGenerationTimestamp=true,groupId=${GROUP_ID},artifactId=${ARTIFACT_ID},modelPackage=${PACKAGE_NAME}.models,invokerPackage=${PACKAGE_NAME}.invoker,apiPackage=${PACKAGE_NAME},dateLibrary=java8,licenseName=Apache-2.0,licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.txt" \ --ignore-file-override=.openapi-generator-ignore GROUP_ID="com.redhat.cloud" @@ -97,8 +98,8 @@ PACKAGE_NAME="com.openshift.cloud.api.smartevents" OUTPUT_PATH="packages/smartevents-management-sdk/" npx @openapitools/openapi-generator-cli generate -g java \ - --library resteasy -t "$TEMPLATES_DIR" \ + --library native \ -i "$OPENAPI_FILENAME" -o "$OUTPUT_PATH" \ --package-name="${PACKAGE_NAME}" \ - --additional-properties="apiTests=false,modelTests=false,hideGenerationTimestamp=true,groupId=${GROUP_ID},artifactId=${ARTIFACT_ID},modelPackage=${PACKAGE_NAME}.models,invokerPackage=${PACKAGE_NAME}.invoker,apiPackage=${PACKAGE_NAME},dateLibrary=java8,licenseName=Apache-2.0,licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.txt" \ + --additional-properties="asyncNative=true,apiTests=false,modelTests=false,hideGenerationTimestamp=true,groupId=${GROUP_ID},artifactId=${ARTIFACT_ID},modelPackage=${PACKAGE_NAME}.models,invokerPackage=${PACKAGE_NAME}.invoker,apiPackage=${PACKAGE_NAME},dateLibrary=java8,licenseName=Apache-2.0,licenseUrl=https://www.apache.org/licenses/LICENSE-2.0.txt" \ --ignore-file-override=.openapi-generator-ignore