diff --git a/CHANGELOG.md b/CHANGELOG.md index f5aeae280fe..efdfa4dbb35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - N/A +## 1.2.40 - 2018-06-14 +### Added +- Support for the Container Engine service. A sample showing how to use this service from the SDK is available [here](https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/ContainerEngineClusterExample.java) + ## 1.2.39 - 2018-05-31 ### Added - Support for the "soft shutdown" instance action in the Compute service diff --git a/bmc-audit/pom.xml b/bmc-audit/pom.xml index b7ef63ce428..34d3679c011 100644 --- a/bmc-audit/pom.xml +++ b/bmc-audit/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-bom/pom.xml b/bmc-bom/pom.xml index 86865e51b64..acea0eb7a41 100644 --- a/bmc-bom/pom.xml +++ b/bmc-bom/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml oci-java-sdk-bom @@ -19,62 +19,68 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-audit - 1.2.39 + 1.2.40 + false + + + com.oracle.oci.sdk + oci-java-sdk-containerengine + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-core - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-database - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-dns - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-email - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-filestorage - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-identity - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-loadbalancer - 1.2.39 + 1.2.40 false com.oracle.oci.sdk oci-java-sdk-objectstorage - 1.2.39 + 1.2.40 false pom diff --git a/bmc-common/pom.xml b/bmc-common/pom.xml index bf8bf147001..351a56bbba4 100644 --- a/bmc-common/pom.xml +++ b/bmc-common/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml diff --git a/bmc-containerengine/pom.xml b/bmc-containerengine/pom.xml new file mode 100644 index 00000000000..7e7cad3eb9d --- /dev/null +++ b/bmc-containerengine/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + + com.oracle.oci.sdk + oci-java-sdk + 1.2.40 + ../pom.xml + + + oci-java-sdk-containerengine + Oracle Cloud Infrastructure SDK - Container Engine + This project contains the SDK used for Oracle Cloud Infrastructure Container Engine + https://docs.us-phoenix-1.oraclecloud.com/Content/API/SDKDocs/javasdk.htm + + + + com.oracle.oci.sdk + oci-java-sdk-common + 1.2.40 + + + + diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngine.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngine.java new file mode 100644 index 00000000000..2e776b15e3a --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngine.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine; + +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +public interface ContainerEngine extends AutoCloseable { + + /** + * Sets the endpoint to call (ex, https://www.example.com). + * @param endpoint The endpoint of the service. + */ + void setEndpoint(String endpoint); + + /** + * Sets the region to call (ex, Region.US_PHOENIX_1). + *

+ * Note, this will call {@link #setEndpoint(String) setEndpoint} after resolving the endpoint. If the service is not available in this Region, however, an IllegalArgumentException will be raised. + * @param region The region of the service. + */ + void setRegion(com.oracle.bmc.Region region); + + /** + * Sets the region to call (ex, 'us-phoenix-1'). + *

+ * Note, this will first try to map the region ID to a known Region and call + * {@link #setRegion(Region) setRegion}. + *

+ * If no known Region could be determined, it will create an endpoint based on the + * default endpoint format ({@link Region#formatDefaultRegionEndpoint(Service, String)} + * and then call {@link #setEndpoint(String) setEndpoint}. + * @param regionId The public region ID. + */ + void setRegion(String regionId); + + /** + * Create a new cluster. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateClusterResponse createCluster(CreateClusterRequest request); + + /** + * Create the Kubeconfig YAML for a cluster. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateKubeconfigResponse createKubeconfig(CreateKubeconfigRequest request); + + /** + * Create a new node pool. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + CreateNodePoolResponse createNodePool(CreateNodePoolRequest request); + + /** + * Delete a cluster. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteClusterResponse deleteCluster(DeleteClusterRequest request); + + /** + * Delete a node pool. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteNodePoolResponse deleteNodePool(DeleteNodePoolRequest request); + + /** + * Cancel a work request that has not started. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + DeleteWorkRequestResponse deleteWorkRequest(DeleteWorkRequestRequest request); + + /** + * Get the details of a cluster. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetClusterResponse getCluster(GetClusterRequest request); + + /** + * Get options available for clusters. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetClusterOptionsResponse getClusterOptions(GetClusterOptionsRequest request); + + /** + * Get the details of a node pool. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetNodePoolResponse getNodePool(GetNodePoolRequest request); + + /** + * Get options available for node pools. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetNodePoolOptionsResponse getNodePoolOptions(GetNodePoolOptionsRequest request); + + /** + * Get the details of a work request. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + GetWorkRequestResponse getWorkRequest(GetWorkRequestRequest request); + + /** + * List all the cluster objects in a compartment. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListClustersResponse listClusters(ListClustersRequest request); + + /** + * List all the node pools in a compartment, and optionally filter by cluster. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListNodePoolsResponse listNodePools(ListNodePoolsRequest request); + + /** + * Get the errors of a work request. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListWorkRequestErrorsResponse listWorkRequestErrors(ListWorkRequestErrorsRequest request); + + /** + * Get the logs of a work request. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListWorkRequestLogsResponse listWorkRequestLogs(ListWorkRequestLogsRequest request); + + /** + * List all work requests in a compartment. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + ListWorkRequestsResponse listWorkRequests(ListWorkRequestsRequest request); + + /** + * Update the details of a cluster. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateClusterResponse updateCluster(UpdateClusterRequest request); + + /** + * Update the details of a node pool. + * @param request The request object containing the details to send + * @return A response object containing details about the completed operation + * @throws BmcException when an error occurs. + */ + UpdateNodePoolResponse updateNodePool(UpdateNodePoolRequest request); + + /** + * Gets the pre-configured waiters available for resources for this service. + * + * @return The service waiters. + */ + ContainerEngineWaiters getWaiters(); + + /** + * Gets the pre-configured paginators available for list operations in this service which may return multiple + * pages of data. These paginators provide an {@link java.lang.Iterable} interface so that service responses, or + * resources/records, can be iterated through without having to manually deal with pagination and page tokens. + * + * @return The service paginators. + */ + ContainerEnginePaginators getPaginators(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineAsync.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineAsync.java new file mode 100644 index 00000000000..b953bf195fd --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineAsync.java @@ -0,0 +1,311 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine; + +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +public interface ContainerEngineAsync extends AutoCloseable { + + /** + * Sets the endpoint to call (ex, https://www.example.com). + * @param endpoint The endpoint of the serice. + */ + void setEndpoint(String endpoint); + + /** + * Sets the region to call (ex, Region.US_PHOENIX_1). + *

+ * Note, this will call {@link #setEndpoint(String) setEndpoint} after resolving the endpoint. If the service is not available in this region, however, an IllegalArgumentException will be raised. + * @param region The region of the service. + */ + void setRegion(com.oracle.bmc.Region region); + + /** + * Sets the region to call (ex, 'us-phoenix-1'). + *

+ * Note, this will first try to map the region ID to a known Region and call + * {@link #setRegion(Region) setRegion}. + *

+ * If no known Region could be determined, it will create an endpoint based on the + * default endpoint format ({@link Region#formatDefaultRegionEndpoint(Service, String)} + * and then call {@link #setEndpoint(String) setEndpoint}. + * @param regionId The public region ID. + */ + void setRegion(String regionId); + + /** + * Create a new cluster. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future createCluster( + CreateClusterRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Create the Kubeconfig YAML for a cluster. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future createKubeconfig( + CreateKubeconfigRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Create a new node pool. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future createNodePool( + CreateNodePoolRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Delete a cluster. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future deleteCluster( + DeleteClusterRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Delete a node pool. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future deleteNodePool( + DeleteNodePoolRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Cancel a work request that has not started. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future deleteWorkRequest( + DeleteWorkRequestRequest request, + com.oracle.bmc.responses.AsyncHandler< + DeleteWorkRequestRequest, DeleteWorkRequestResponse> + handler); + + /** + * Get the details of a cluster. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future getCluster( + GetClusterRequest request, + com.oracle.bmc.responses.AsyncHandler handler); + + /** + * Get options available for clusters. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future getClusterOptions( + GetClusterOptionsRequest request, + com.oracle.bmc.responses.AsyncHandler< + GetClusterOptionsRequest, GetClusterOptionsResponse> + handler); + + /** + * Get the details of a node pool. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future getNodePool( + GetNodePoolRequest request, + com.oracle.bmc.responses.AsyncHandler handler); + + /** + * Get options available for node pools. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future getNodePoolOptions( + GetNodePoolOptionsRequest request, + com.oracle.bmc.responses.AsyncHandler< + GetNodePoolOptionsRequest, GetNodePoolOptionsResponse> + handler); + + /** + * Get the details of a work request. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future getWorkRequest( + GetWorkRequestRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * List all the cluster objects in a compartment. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future listClusters( + ListClustersRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * List all the node pools in a compartment, and optionally filter by cluster. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future listNodePools( + ListNodePoolsRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Get the errors of a work request. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future listWorkRequestErrors( + ListWorkRequestErrorsRequest request, + com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse> + handler); + + /** + * Get the logs of a work request. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future listWorkRequestLogs( + ListWorkRequestLogsRequest request, + com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestLogsRequest, ListWorkRequestLogsResponse> + handler); + + /** + * List all work requests in a compartment. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future listWorkRequests( + ListWorkRequestsRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Update the details of a cluster. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future updateCluster( + UpdateClusterRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); + + /** + * Update the details of a node pool. + * + * @param request The request object containing the details to send + * @param handler The request handler to invoke upon completion, may be null. + * @return A Future that can be used to get the response if no AsyncHandler was + * provided. Note, if you provide an AsyncHandler and use the Future, some + * types of responses (like java.io.InputStream) may not be able to be read in + * both places as the underlying stream may only be consumed once. + */ + java.util.concurrent.Future updateNodePool( + UpdateNodePoolRequest request, + com.oracle.bmc.responses.AsyncHandler + handler); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineAsyncClient.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineAsyncClient.java new file mode 100644 index 00000000000..8814a72a88f --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineAsyncClient.java @@ -0,0 +1,1619 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine; + +import java.util.Locale; +import com.oracle.bmc.containerengine.internal.http.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ContainerEngineAsyncClient implements ContainerEngineAsync { + /** + * Service instance for ContainerEngine. + */ + public static final com.oracle.bmc.Service SERVICE = + com.oracle.bmc.Services.create("CONTAINERENGINE", "containerengine"); + + @lombok.Getter(value = lombok.AccessLevel.PACKAGE) + private final com.oracle.bmc.http.internal.RestClient client; + + private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider + authenticationDetailsProvider; + + /** + * Creates a new service instance using the given authentication provider. + * @param authenticationDetailsProvider The authentication details provider, required. + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider) { + this(authenticationDetailsProvider, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration) { + this(authenticationDetailsProvider, configuration, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + new com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory( + com.oracle.bmc.http.signing.SigningStrategy.STANDARD)); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + defaultRequestSignerFactory, + new java.util.ArrayList()); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + * @param additionalClientConfigurators Additional client configurators to be run after the primary configurator. + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory, + java.util.List additionalClientConfigurators) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + defaultRequestSignerFactory, + additionalClientConfigurators, + null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + * @param additionalClientConfigurators Additional client configurators to be run after the primary configurator. + * @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider}) + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory, + java.util.List additionalClientConfigurators, + String endpoint) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + defaultRequestSignerFactory, + com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory + .createDefaultRequestSignerFactories(), + additionalClientConfigurators, + endpoint); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + * @param signingStrategyRequestSignerFactories The request signer factories for each signing strategy used to create the request signer + * @param additionalClientConfigurators Additional client configurators to be run after the primary configurator. + * @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider}) + */ + public ContainerEngineAsyncClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory, + java.util.Map< + com.oracle.bmc.http.signing.SigningStrategy, + com.oracle.bmc.http.signing.RequestSignerFactory> + signingStrategyRequestSignerFactories, + java.util.List additionalClientConfigurators, + String endpoint) { + this.authenticationDetailsProvider = authenticationDetailsProvider; + com.oracle.bmc.http.internal.RestClientFactory restClientFactory = + com.oracle.bmc.http.internal.RestClientFactoryBuilder.builder() + .clientConfigurator(clientConfigurator) + .additionalClientConfigurators(additionalClientConfigurators) + .build(); + com.oracle.bmc.http.signing.RequestSigner defaultRequestSigner = + defaultRequestSignerFactory.createRequestSigner( + SERVICE, this.authenticationDetailsProvider); + java.util.Map< + com.oracle.bmc.http.signing.SigningStrategy, + com.oracle.bmc.http.signing.RequestSigner> + requestSigners = new java.util.HashMap<>(); + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.BasicAuthenticationDetailsProvider) { + for (com.oracle.bmc.http.signing.SigningStrategy s : + com.oracle.bmc.http.signing.SigningStrategy.values()) { + requestSigners.put( + s, + signingStrategyRequestSignerFactories + .get(s) + .createRequestSigner(SERVICE, authenticationDetailsProvider)); + } + } + this.client = restClientFactory.create(defaultRequestSigner, requestSigners, configuration); + + if (this.authenticationDetailsProvider instanceof com.oracle.bmc.auth.RegionProvider) { + com.oracle.bmc.auth.RegionProvider provider = + (com.oracle.bmc.auth.RegionProvider) this.authenticationDetailsProvider; + + if (provider.getRegion() != null) { + this.setRegion(provider.getRegion()); + if (endpoint != null) { + LOG.info( + "Authentication details provider configured for region '{}', but endpoint specifically set to '{}'. Using endpoint setting instead of region.", + provider.getRegion(), + endpoint); + } + } + } + if (endpoint != null) { + setEndpoint(endpoint); + } + } + + /** + * Create a builder for this client. + * @return builder + */ + public static Builder builder() { + return new Builder(SERVICE); + } + + /** + * Builder class for this client. The "authenticationDetailsProvider" is required and must be passed to the + * {@link #build(AbstractAuthenticationDetailsProvider)} or {@link #buildAsync(AbstractAuthenticationDetailsProvider)} method. + */ + public static class Builder + extends com.oracle.bmc.common.RegionalClientBuilder< + Builder, ContainerEngineAsyncClient> { + private Builder(com.oracle.bmc.Service service) { + super(service); + requestSignerFactory = + new com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory( + com.oracle.bmc.http.signing.SigningStrategy.STANDARD); + } + + /** + * Build the client. + * @param authenticationDetailsProvider authentication details provider + * @return the client + */ + public ContainerEngineAsyncClient build( + @lombok.NonNull + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider + authenticationDetailsProvider) { + return new ContainerEngineAsyncClient( + authenticationDetailsProvider, + configuration, + clientConfigurator, + requestSignerFactory, + additionalClientConfigurators, + endpoint); + } + } + + @Override + public void setEndpoint(String endpoint) { + LOG.info("Setting endpoint to {}", endpoint); + client.setEndpoint(endpoint); + } + + @Override + public void setRegion(com.oracle.bmc.Region region) { + com.google.common.base.Optional endpoint = region.getEndpoint(SERVICE); + if (endpoint.isPresent()) { + setEndpoint(endpoint.get()); + } else { + throw new IllegalArgumentException( + "Endpoint for " + SERVICE + " is not known in region " + region); + } + } + + @Override + public void setRegion(String regionId) { + regionId = regionId.toLowerCase(Locale.ENGLISH); + try { + com.oracle.bmc.Region region = com.oracle.bmc.Region.fromRegionId(regionId); + setRegion(region); + } catch (IllegalArgumentException e) { + LOG.info("Unknown regionId '{}', falling back to default endpoint format", regionId); + String endpoint = com.oracle.bmc.Region.formatDefaultRegionEndpoint(SERVICE, regionId); + setEndpoint(endpoint); + } + } + + @Override + public void close() { + client.close(); + } + + @Override + public java.util.concurrent.Future createCluster( + final CreateClusterRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async createCluster"); + final CreateClusterRequest interceptedRequest = + CreateClusterConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateClusterConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = CreateClusterConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + CreateClusterRequest, CreateClusterResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.post( + ib, + interceptedRequest.getCreateClusterDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.post( + ib, + interceptedRequest.getCreateClusterDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, CreateClusterResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.post( + ib, + interceptedRequest.getCreateClusterDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future createKubeconfig( + final CreateKubeconfigRequest request, + final com.oracle.bmc.responses.AsyncHandler< + CreateKubeconfigRequest, CreateKubeconfigResponse> + handler) { + LOG.trace("Called async createKubeconfig"); + final CreateKubeconfigRequest interceptedRequest = + CreateKubeconfigConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateKubeconfigConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = CreateKubeconfigConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + CreateKubeconfigRequest, CreateKubeconfigResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.post( + ib, + interceptedRequest.getCreateClusterKubeconfigContentDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.post( + ib, + interceptedRequest.getCreateClusterKubeconfigContentDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, CreateKubeconfigResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.post( + ib, + interceptedRequest.getCreateClusterKubeconfigContentDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future createNodePool( + final CreateNodePoolRequest request, + final com.oracle.bmc.responses.AsyncHandler< + CreateNodePoolRequest, CreateNodePoolResponse> + handler) { + LOG.trace("Called async createNodePool"); + final CreateNodePoolRequest interceptedRequest = + CreateNodePoolConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateNodePoolConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = CreateNodePoolConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + CreateNodePoolRequest, CreateNodePoolResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.post( + ib, + interceptedRequest.getCreateNodePoolDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.post( + ib, + interceptedRequest.getCreateNodePoolDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, CreateNodePoolResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.post( + ib, + interceptedRequest.getCreateNodePoolDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future deleteCluster( + final DeleteClusterRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async deleteCluster"); + final DeleteClusterRequest interceptedRequest = + DeleteClusterConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteClusterConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = DeleteClusterConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + DeleteClusterRequest, DeleteClusterResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.delete(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.delete(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, DeleteClusterResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.delete(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future deleteNodePool( + final DeleteNodePoolRequest request, + final com.oracle.bmc.responses.AsyncHandler< + DeleteNodePoolRequest, DeleteNodePoolResponse> + handler) { + LOG.trace("Called async deleteNodePool"); + final DeleteNodePoolRequest interceptedRequest = + DeleteNodePoolConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteNodePoolConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = DeleteNodePoolConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + DeleteNodePoolRequest, DeleteNodePoolResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.delete(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.delete(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, DeleteNodePoolResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.delete(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future deleteWorkRequest( + final DeleteWorkRequestRequest request, + final com.oracle.bmc.responses.AsyncHandler< + DeleteWorkRequestRequest, DeleteWorkRequestResponse> + handler) { + LOG.trace("Called async deleteWorkRequest"); + final DeleteWorkRequestRequest interceptedRequest = + DeleteWorkRequestConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteWorkRequestConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = DeleteWorkRequestConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + DeleteWorkRequestRequest, DeleteWorkRequestResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.delete(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.delete(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, DeleteWorkRequestResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.delete(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future getCluster( + final GetClusterRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async getCluster"); + final GetClusterRequest interceptedRequest = GetClusterConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetClusterConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = GetClusterConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler handlerToUse = + handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + GetClusterRequest, GetClusterResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, GetClusterResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future getClusterOptions( + final GetClusterOptionsRequest request, + final com.oracle.bmc.responses.AsyncHandler< + GetClusterOptionsRequest, GetClusterOptionsResponse> + handler) { + LOG.trace("Called async getClusterOptions"); + final GetClusterOptionsRequest interceptedRequest = + GetClusterOptionsConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetClusterOptionsConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = GetClusterOptionsConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + GetClusterOptionsRequest, GetClusterOptionsResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, GetClusterOptionsResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future getNodePool( + final GetNodePoolRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async getNodePool"); + final GetNodePoolRequest interceptedRequest = + GetNodePoolConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetNodePoolConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = GetNodePoolConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + GetNodePoolRequest, GetNodePoolResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, GetNodePoolResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future getNodePoolOptions( + final GetNodePoolOptionsRequest request, + final com.oracle.bmc.responses.AsyncHandler< + GetNodePoolOptionsRequest, GetNodePoolOptionsResponse> + handler) { + LOG.trace("Called async getNodePoolOptions"); + final GetNodePoolOptionsRequest interceptedRequest = + GetNodePoolOptionsConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetNodePoolOptionsConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = GetNodePoolOptionsConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + GetNodePoolOptionsRequest, GetNodePoolOptionsResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, GetNodePoolOptionsResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future getWorkRequest( + final GetWorkRequestRequest request, + final com.oracle.bmc.responses.AsyncHandler< + GetWorkRequestRequest, GetWorkRequestResponse> + handler) { + LOG.trace("Called async getWorkRequest"); + final GetWorkRequestRequest interceptedRequest = + GetWorkRequestConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetWorkRequestConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = GetWorkRequestConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + GetWorkRequestRequest, GetWorkRequestResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, GetWorkRequestResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future listClusters( + final ListClustersRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async listClusters"); + final ListClustersRequest interceptedRequest = + ListClustersConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListClustersConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = ListClustersConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + ListClustersRequest, ListClustersResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, ListClustersResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future listNodePools( + final ListNodePoolsRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async listNodePools"); + final ListNodePoolsRequest interceptedRequest = + ListNodePoolsConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListNodePoolsConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = ListNodePoolsConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + ListNodePoolsRequest, ListNodePoolsResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, ListNodePoolsResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future listWorkRequestErrors( + final ListWorkRequestErrorsRequest request, + final com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse> + handler) { + LOG.trace("Called async listWorkRequestErrors"); + final ListWorkRequestErrorsRequest interceptedRequest = + ListWorkRequestErrorsConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListWorkRequestErrorsConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestErrorsResponse> + transformer = ListWorkRequestErrorsConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse> + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, ListWorkRequestErrorsResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future listWorkRequestLogs( + final ListWorkRequestLogsRequest request, + final com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestLogsRequest, ListWorkRequestLogsResponse> + handler) { + LOG.trace("Called async listWorkRequestLogs"); + final ListWorkRequestLogsRequest interceptedRequest = + ListWorkRequestLogsConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListWorkRequestLogsConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestLogsResponse> + transformer = ListWorkRequestLogsConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestLogsRequest, ListWorkRequestLogsResponse> + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + ListWorkRequestLogsRequest, ListWorkRequestLogsResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, ListWorkRequestLogsResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future listWorkRequests( + final ListWorkRequestsRequest request, + final com.oracle.bmc.responses.AsyncHandler< + ListWorkRequestsRequest, ListWorkRequestsResponse> + handler) { + LOG.trace("Called async listWorkRequests"); + final ListWorkRequestsRequest interceptedRequest = + ListWorkRequestsConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListWorkRequestsConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = ListWorkRequestsConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + ListWorkRequestsRequest, ListWorkRequestsResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.get(ib, interceptedRequest, onSuccess, onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.get(ib, interceptedRequest, onSuccess, onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, ListWorkRequestsResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.get(ib, interceptedRequest, onSuccess, onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future updateCluster( + final UpdateClusterRequest request, + final com.oracle.bmc.responses.AsyncHandler + handler) { + LOG.trace("Called async updateCluster"); + final UpdateClusterRequest interceptedRequest = + UpdateClusterConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + UpdateClusterConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = UpdateClusterConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + UpdateClusterRequest, UpdateClusterResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.put( + ib, + interceptedRequest.getUpdateClusterDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.put( + ib, + interceptedRequest.getUpdateClusterDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, UpdateClusterResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.put( + ib, + interceptedRequest.getUpdateClusterDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } + + @Override + public java.util.concurrent.Future updateNodePool( + final UpdateNodePoolRequest request, + final com.oracle.bmc.responses.AsyncHandler< + UpdateNodePoolRequest, UpdateNodePoolResponse> + handler) { + LOG.trace("Called async updateNodePool"); + final UpdateNodePoolRequest interceptedRequest = + UpdateNodePoolConverter.interceptRequest(request); + final com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + UpdateNodePoolConverter.fromRequest(client, interceptedRequest); + final com.google.common.base.Function + transformer = UpdateNodePoolConverter.fromResponse(); + + com.oracle.bmc.responses.AsyncHandler + handlerToUse = handler; + if (handler != null + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + handlerToUse = + new com.oracle.bmc.util.internal.InstancePrincipalsWrappingAsyncHandler< + UpdateNodePoolRequest, UpdateNodePoolResponse>( + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + handler) { + @Override + public void retryCall() { + final com.oracle.bmc.util.internal.Consumer + onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + this, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>( + this, interceptedRequest); + client.put( + ib, + interceptedRequest.getUpdateNodePoolDetails(), + interceptedRequest, + onSuccess, + onError); + } + }; + } + + final com.oracle.bmc.util.internal.Consumer onSuccess = + new com.oracle.bmc.http.internal.SuccessConsumer<>( + handlerToUse, transformer, interceptedRequest); + final com.oracle.bmc.util.internal.Consumer onError = + new com.oracle.bmc.http.internal.ErrorConsumer<>(handlerToUse, interceptedRequest); + + java.util.concurrent.Future responseFuture = + client.put( + ib, + interceptedRequest.getUpdateNodePoolDetails(), + interceptedRequest, + onSuccess, + onError); + + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + return new com.oracle.bmc.util.internal.InstancePrincipalsBasedTransformingFuture< + javax.ws.rs.core.Response, UpdateNodePoolResponse>( + responseFuture, + transformer, + (com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider, + new com.google.common.base.Supplier< + java.util.concurrent.Future>() { + @Override + public java.util.concurrent.Future get() { + return client.put( + ib, + interceptedRequest.getUpdateNodePoolDetails(), + interceptedRequest, + onSuccess, + onError); + } + }); + } else { + return new com.oracle.bmc.util.internal.TransformingFuture<>( + responseFuture, transformer); + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineClient.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineClient.java new file mode 100644 index 00000000000..e7b7482e49e --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineClient.java @@ -0,0 +1,790 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine; + +import java.util.Locale; +import com.oracle.bmc.containerengine.internal.http.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ContainerEngineClient implements ContainerEngine { + /** + * Service instance for ContainerEngine. + */ + public static final com.oracle.bmc.Service SERVICE = + com.oracle.bmc.Services.create("CONTAINERENGINE", "containerengine"); + // attempt twice if it's instance principals, immediately failures will try to refresh the token + private static final int MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS = 2; + + private final ContainerEngineWaiters waiters; + private final ContainerEnginePaginators paginators; + + @lombok.Getter(value = lombok.AccessLevel.PACKAGE) + private final com.oracle.bmc.http.internal.RestClient client; + + private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider + authenticationDetailsProvider; + + /** + * Creates a new service instance using the given authentication provider. + * @param authenticationDetailsProvider The authentication details provider, required. + */ + public ContainerEngineClient( + com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider) { + this(authenticationDetailsProvider, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + */ + public ContainerEngineClient( + com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration) { + this(authenticationDetailsProvider, configuration, null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + */ + public ContainerEngineClient( + com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + new com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory( + com.oracle.bmc.http.signing.SigningStrategy.STANDARD)); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + */ + public ContainerEngineClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + defaultRequestSignerFactory, + new java.util.ArrayList()); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + * @param additionalClientConfigurators Additional client configurators to be run after the primary configurator. + */ + public ContainerEngineClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory, + java.util.List additionalClientConfigurators) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + defaultRequestSignerFactory, + additionalClientConfigurators, + null); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + * @param additionalClientConfigurators Additional client configurators to be run after the primary configurator. + * @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider}) + */ + public ContainerEngineClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory, + java.util.List additionalClientConfigurators, + String endpoint) { + this( + authenticationDetailsProvider, + configuration, + clientConfigurator, + defaultRequestSignerFactory, + com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory + .createDefaultRequestSignerFactories(), + additionalClientConfigurators, + endpoint); + } + + /** + * Creates a new service instance using the given authentication provider and client configuration. Additionally, + * a Consumer can be provided that will be invoked whenever a REST Client is created to allow for additional configuration/customization. + *

+ * This is an advanced constructor for clients that want to take control over how requests are signed. + * @param authenticationDetailsProvider The authentication details provider, required. + * @param configuration The client configuration, optional. + * @param clientConfigurator ClientConfigurator that will be invoked for additional configuration of a REST client, optional. + * @param defaultRequestSignerFactory The request signer factory used to create the request signer for this service. + * @param signingStrategyRequestSignerFactories The request signer factories for each signing strategy used to create the request signer + * @param additionalClientConfigurators Additional client configurators to be run after the primary configurator. + * @param endpoint Endpoint, or null to leave unset (note, may be overridden by {@code authenticationDetailsProvider}) + */ + public ContainerEngineClient( + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider, + com.oracle.bmc.ClientConfiguration configuration, + com.oracle.bmc.http.ClientConfigurator clientConfigurator, + com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory, + java.util.Map< + com.oracle.bmc.http.signing.SigningStrategy, + com.oracle.bmc.http.signing.RequestSignerFactory> + signingStrategyRequestSignerFactories, + java.util.List additionalClientConfigurators, + String endpoint) { + this.authenticationDetailsProvider = authenticationDetailsProvider; + com.oracle.bmc.http.internal.RestClientFactory restClientFactory = + com.oracle.bmc.http.internal.RestClientFactoryBuilder.builder() + .clientConfigurator(clientConfigurator) + .additionalClientConfigurators(additionalClientConfigurators) + .build(); + com.oracle.bmc.http.signing.RequestSigner defaultRequestSigner = + defaultRequestSignerFactory.createRequestSigner( + SERVICE, this.authenticationDetailsProvider); + java.util.Map< + com.oracle.bmc.http.signing.SigningStrategy, + com.oracle.bmc.http.signing.RequestSigner> + requestSigners = new java.util.HashMap<>(); + if (this.authenticationDetailsProvider + instanceof com.oracle.bmc.auth.BasicAuthenticationDetailsProvider) { + for (com.oracle.bmc.http.signing.SigningStrategy s : + com.oracle.bmc.http.signing.SigningStrategy.values()) { + requestSigners.put( + s, + signingStrategyRequestSignerFactories + .get(s) + .createRequestSigner(SERVICE, authenticationDetailsProvider)); + } + } + this.client = restClientFactory.create(defaultRequestSigner, requestSigners, configuration); + // up to 50 (core) threads, time out after 60s idle, all daemon + java.util.concurrent.ThreadPoolExecutor executorService = + new java.util.concurrent.ThreadPoolExecutor( + 50, + 50, + 60L, + java.util.concurrent.TimeUnit.SECONDS, + new java.util.concurrent.LinkedBlockingQueue(), + new com.google.common.util.concurrent.ThreadFactoryBuilder() + .setDaemon(false) + .setNameFormat("ContainerEngine-waiters-%d") + .build()); + executorService.allowCoreThreadTimeOut(true); + + this.waiters = new ContainerEngineWaiters(executorService, this); + + this.paginators = new ContainerEnginePaginators(this); + + if (this.authenticationDetailsProvider instanceof com.oracle.bmc.auth.RegionProvider) { + com.oracle.bmc.auth.RegionProvider provider = + (com.oracle.bmc.auth.RegionProvider) this.authenticationDetailsProvider; + + if (provider.getRegion() != null) { + this.setRegion(provider.getRegion()); + if (endpoint != null) { + LOG.info( + "Authentication details provider configured for region '{}', but endpoint specifically set to '{}'. Using endpoint setting instead of region.", + provider.getRegion(), + endpoint); + } + } + } + if (endpoint != null) { + setEndpoint(endpoint); + } + } + + /** + * Create a builder for this client. + * @return builder + */ + public static Builder builder() { + return new Builder(SERVICE); + } + + /** + * Builder class for this client. The "authenticationDetailsProvider" is required and must be passed to the + * {@link #build(AbstractAuthenticationDetailsProvider)} or {@link #buildAsync(AbstractAuthenticationDetailsProvider)} method. + */ + public static class Builder + extends com.oracle.bmc.common.RegionalClientBuilder { + private Builder(com.oracle.bmc.Service service) { + super(service); + requestSignerFactory = + new com.oracle.bmc.http.signing.internal.DefaultRequestSignerFactory( + com.oracle.bmc.http.signing.SigningStrategy.STANDARD); + } + + /** + * Build the client. + * @param authenticationDetailsProvider authentication details provider + * @return the client + */ + public ContainerEngineClient build( + @lombok.NonNull + com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider + authenticationDetailsProvider) { + return new ContainerEngineClient( + authenticationDetailsProvider, + configuration, + clientConfigurator, + requestSignerFactory, + signingStrategyRequestSignerFactories, + additionalClientConfigurators, + endpoint); + } + } + + @Override + public void setEndpoint(String endpoint) { + LOG.info("Setting endpoint to {}", endpoint); + client.setEndpoint(endpoint); + } + + @Override + public void setRegion(com.oracle.bmc.Region region) { + com.google.common.base.Optional endpoint = region.getEndpoint(SERVICE); + if (endpoint.isPresent()) { + setEndpoint(endpoint.get()); + } else { + throw new IllegalArgumentException( + "Endpoint for " + SERVICE + " is not known in region " + region); + } + } + + @Override + public void setRegion(String regionId) { + regionId = regionId.toLowerCase(Locale.ENGLISH); + try { + com.oracle.bmc.Region region = com.oracle.bmc.Region.fromRegionId(regionId); + setRegion(region); + } catch (IllegalArgumentException e) { + LOG.info("Unknown regionId '{}', falling back to default endpoint format", regionId); + String endpoint = com.oracle.bmc.Region.formatDefaultRegionEndpoint(SERVICE, regionId); + setEndpoint(endpoint); + } + } + + @Override + public void close() { + client.close(); + } + + @Override + public CreateClusterResponse createCluster(CreateClusterRequest request) { + LOG.trace("Called createCluster"); + request = CreateClusterConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateClusterConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = CreateClusterConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.post(ib, request.getCreateClusterDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public CreateKubeconfigResponse createKubeconfig(CreateKubeconfigRequest request) { + LOG.trace("Called createKubeconfig"); + request = CreateKubeconfigConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateKubeconfigConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = CreateKubeconfigConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.post( + ib, request.getCreateClusterKubeconfigContentDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public CreateNodePoolResponse createNodePool(CreateNodePoolRequest request) { + LOG.trace("Called createNodePool"); + request = CreateNodePoolConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + CreateNodePoolConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = CreateNodePoolConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.post(ib, request.getCreateNodePoolDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public DeleteClusterResponse deleteCluster(DeleteClusterRequest request) { + LOG.trace("Called deleteCluster"); + request = DeleteClusterConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteClusterConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = DeleteClusterConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.delete(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public DeleteNodePoolResponse deleteNodePool(DeleteNodePoolRequest request) { + LOG.trace("Called deleteNodePool"); + request = DeleteNodePoolConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteNodePoolConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = DeleteNodePoolConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.delete(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public DeleteWorkRequestResponse deleteWorkRequest(DeleteWorkRequestRequest request) { + LOG.trace("Called deleteWorkRequest"); + request = DeleteWorkRequestConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + DeleteWorkRequestConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = DeleteWorkRequestConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.delete(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public GetClusterResponse getCluster(GetClusterRequest request) { + LOG.trace("Called getCluster"); + request = GetClusterConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetClusterConverter.fromRequest(client, request); + com.google.common.base.Function transformer = + GetClusterConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public GetClusterOptionsResponse getClusterOptions(GetClusterOptionsRequest request) { + LOG.trace("Called getClusterOptions"); + request = GetClusterOptionsConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetClusterOptionsConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = GetClusterOptionsConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public GetNodePoolResponse getNodePool(GetNodePoolRequest request) { + LOG.trace("Called getNodePool"); + request = GetNodePoolConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetNodePoolConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = GetNodePoolConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public GetNodePoolOptionsResponse getNodePoolOptions(GetNodePoolOptionsRequest request) { + LOG.trace("Called getNodePoolOptions"); + request = GetNodePoolOptionsConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetNodePoolOptionsConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = GetNodePoolOptionsConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public GetWorkRequestResponse getWorkRequest(GetWorkRequestRequest request) { + LOG.trace("Called getWorkRequest"); + request = GetWorkRequestConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + GetWorkRequestConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = GetWorkRequestConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public ListClustersResponse listClusters(ListClustersRequest request) { + LOG.trace("Called listClusters"); + request = ListClustersConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListClustersConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = ListClustersConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public ListNodePoolsResponse listNodePools(ListNodePoolsRequest request) { + LOG.trace("Called listNodePools"); + request = ListNodePoolsConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListNodePoolsConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = ListNodePoolsConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public ListWorkRequestErrorsResponse listWorkRequestErrors( + ListWorkRequestErrorsRequest request) { + LOG.trace("Called listWorkRequestErrors"); + request = ListWorkRequestErrorsConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListWorkRequestErrorsConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = ListWorkRequestErrorsConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public ListWorkRequestLogsResponse listWorkRequestLogs(ListWorkRequestLogsRequest request) { + LOG.trace("Called listWorkRequestLogs"); + request = ListWorkRequestLogsConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListWorkRequestLogsConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = ListWorkRequestLogsConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public ListWorkRequestsResponse listWorkRequests(ListWorkRequestsRequest request) { + LOG.trace("Called listWorkRequests"); + request = ListWorkRequestsConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + ListWorkRequestsConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = ListWorkRequestsConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = client.get(ib, request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public UpdateClusterResponse updateCluster(UpdateClusterRequest request) { + LOG.trace("Called updateCluster"); + request = UpdateClusterConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + UpdateClusterConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = UpdateClusterConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.put(ib, request.getUpdateClusterDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + @Override + public UpdateNodePoolResponse updateNodePool(UpdateNodePoolRequest request) { + LOG.trace("Called updateNodePool"); + request = UpdateNodePoolConverter.interceptRequest(request); + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = + UpdateNodePoolConverter.fromRequest(client, request); + com.google.common.base.Function + transformer = UpdateNodePoolConverter.fromResponse(); + + int attempts = 0; + while (true) { + try { + javax.ws.rs.core.Response response = + client.put(ib, request.getUpdateNodePoolDetails(), request); + return transformer.apply(response); + } catch (com.oracle.bmc.model.BmcException e) { + if (++attempts < MAX_IMMEDIATE_RETRIES_IF_USING_INSTANCE_PRINCIPALS + && canRetryRequestIfInstancePrincipalsUsed(e)) { + continue; + } else { + throw e; + } + } + } + } + + private boolean canRetryRequestIfInstancePrincipalsUsed(com.oracle.bmc.model.BmcException e) { + if (e.getStatusCode() == 401 + && this.authenticationDetailsProvider + instanceof + com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) { + ((com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider) + this.authenticationDetailsProvider) + .refreshSecurityToken(); + return true; + } + return false; + } + + @Override + public ContainerEngineWaiters getWaiters() { + return waiters; + } + + @Override + public ContainerEnginePaginators getPaginators() { + return paginators; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEnginePaginators.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEnginePaginators.java new file mode 100644 index 00000000000..1dadcc927fe --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEnginePaginators.java @@ -0,0 +1,363 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine; + +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; + +/** + * Collection of helper methods that can be used to provide an {@link java.lang.Iterable} interface + * to any list operations of ContainerEngine where multiple pages of data may be fetched. + * Two styles of iteration are supported: + * + *

+ * + * These iterables abstract away the need to write code to manually handle pagination via looping and using the page tokens. + * They will automatically fetch more data from the service when required. + * + * As an example, if we were using the ListUsers operation in IdentityService, then the {@link java.lang.Iterable} returned by calling a + * ResponseIterator method would iterate over the ListUsersResponse objects returned by each ListUsers call, whereas the {@link java.lang.Iterable} + * returned by calling a RecordIterator method would iterate over the User records and we don't have to deal with ListUsersResponse objects at all. + * In either case, pagination will be automatically handled so we can iterate until there are no more responses or no more resources/records available. + */ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.RequiredArgsConstructor +public class ContainerEnginePaginators { + private final ContainerEngine client; + + /** + * Creates a new iterable which will iterate over the responses received from the listClusters operation. This iterable + * will fetch more data from the server as needed. + * + * @param request a request which can be sent to the service operation + * @return an {@link java.lang.Iterable} which can be used to iterate over the responses received from the service. + */ + public Iterable listClustersResponseIterator( + final ListClustersRequest request) { + return new com.oracle.bmc.paginator.internal.ResponseIterable< + ListClustersRequest.Builder, ListClustersRequest, ListClustersResponse>( + new com.google.common.base.Supplier() { + @Override + public ListClustersRequest.Builder get() { + return ListClustersRequest.builder().copy(request); + } + }, + new com.google.common.base.Function() { + @Override + public String apply(ListClustersResponse response) { + return response.getOpcNextPage(); + } + }, + new com.google.common.base.Function< + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListClustersRequest.Builder>, + ListClustersRequest>() { + @Override + public ListClustersRequest apply( + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListClustersRequest.Builder> + input) { + if (input.getToken() == null) { + return input.getRequestBuilder().build(); + } else { + return input.getRequestBuilder() + .page(input.getToken().orNull()) + .build(); + } + } + }, + new com.google.common.base.Function() { + @Override + public ListClustersResponse apply(ListClustersRequest request) { + return client.listClusters(request); + } + }); + } + + /** + * Creates a new iterable which will iterate over the {@link com.oracle.bmc.containerengine.model.ClusterSummary} objects + * contained in responses from the listClusters operation. This iterable will fetch more data from the + * server as needed. + * + * @param request a request which can be sent to the service operation + * @return an {@link java.lang.Iterable} which can be used to iterate over the {@link com.oracle.bmc.containerengine.model.ClusterSummary} objects + * contained in responses received from the service. + */ + public Iterable listClustersRecordIterator( + final ListClustersRequest request) { + return new com.oracle.bmc.paginator.internal.ResponseRecordIterable< + ListClustersRequest.Builder, ListClustersRequest, ListClustersResponse, + com.oracle.bmc.containerengine.model.ClusterSummary>( + new com.google.common.base.Supplier() { + @Override + public ListClustersRequest.Builder get() { + return ListClustersRequest.builder().copy(request); + } + }, + new com.google.common.base.Function() { + @Override + public String apply(ListClustersResponse response) { + return response.getOpcNextPage(); + } + }, + new com.google.common.base.Function< + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListClustersRequest.Builder>, + ListClustersRequest>() { + @Override + public ListClustersRequest apply( + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListClustersRequest.Builder> + input) { + if (input.getToken() == null) { + return input.getRequestBuilder().build(); + } else { + return input.getRequestBuilder() + .page(input.getToken().orNull()) + .build(); + } + } + }, + new com.google.common.base.Function() { + @Override + public ListClustersResponse apply(ListClustersRequest request) { + return client.listClusters(request); + } + }, + new com.google.common.base.Function< + ListClustersResponse, + java.util.List>() { + @Override + public java.util.List + apply(ListClustersResponse response) { + return response.getItems(); + } + }); + } + + /** + * Creates a new iterable which will iterate over the responses received from the listNodePools operation. This iterable + * will fetch more data from the server as needed. + * + * @param request a request which can be sent to the service operation + * @return an {@link java.lang.Iterable} which can be used to iterate over the responses received from the service. + */ + public Iterable listNodePoolsResponseIterator( + final ListNodePoolsRequest request) { + return new com.oracle.bmc.paginator.internal.ResponseIterable< + ListNodePoolsRequest.Builder, ListNodePoolsRequest, ListNodePoolsResponse>( + new com.google.common.base.Supplier() { + @Override + public ListNodePoolsRequest.Builder get() { + return ListNodePoolsRequest.builder().copy(request); + } + }, + new com.google.common.base.Function() { + @Override + public String apply(ListNodePoolsResponse response) { + return response.getOpcNextPage(); + } + }, + new com.google.common.base.Function< + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListNodePoolsRequest.Builder>, + ListNodePoolsRequest>() { + @Override + public ListNodePoolsRequest apply( + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListNodePoolsRequest.Builder> + input) { + if (input.getToken() == null) { + return input.getRequestBuilder().build(); + } else { + return input.getRequestBuilder() + .page(input.getToken().orNull()) + .build(); + } + } + }, + new com.google.common.base.Function() { + @Override + public ListNodePoolsResponse apply(ListNodePoolsRequest request) { + return client.listNodePools(request); + } + }); + } + + /** + * Creates a new iterable which will iterate over the {@link com.oracle.bmc.containerengine.model.NodePoolSummary} objects + * contained in responses from the listNodePools operation. This iterable will fetch more data from the + * server as needed. + * + * @param request a request which can be sent to the service operation + * @return an {@link java.lang.Iterable} which can be used to iterate over the {@link com.oracle.bmc.containerengine.model.NodePoolSummary} objects + * contained in responses received from the service. + */ + public Iterable + listNodePoolsRecordIterator(final ListNodePoolsRequest request) { + return new com.oracle.bmc.paginator.internal.ResponseRecordIterable< + ListNodePoolsRequest.Builder, ListNodePoolsRequest, ListNodePoolsResponse, + com.oracle.bmc.containerengine.model.NodePoolSummary>( + new com.google.common.base.Supplier() { + @Override + public ListNodePoolsRequest.Builder get() { + return ListNodePoolsRequest.builder().copy(request); + } + }, + new com.google.common.base.Function() { + @Override + public String apply(ListNodePoolsResponse response) { + return response.getOpcNextPage(); + } + }, + new com.google.common.base.Function< + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListNodePoolsRequest.Builder>, + ListNodePoolsRequest>() { + @Override + public ListNodePoolsRequest apply( + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListNodePoolsRequest.Builder> + input) { + if (input.getToken() == null) { + return input.getRequestBuilder().build(); + } else { + return input.getRequestBuilder() + .page(input.getToken().orNull()) + .build(); + } + } + }, + new com.google.common.base.Function() { + @Override + public ListNodePoolsResponse apply(ListNodePoolsRequest request) { + return client.listNodePools(request); + } + }, + new com.google.common.base.Function< + ListNodePoolsResponse, + java.util.List>() { + @Override + public java.util.List + apply(ListNodePoolsResponse response) { + return response.getItems(); + } + }); + } + + /** + * Creates a new iterable which will iterate over the responses received from the listWorkRequests operation. This iterable + * will fetch more data from the server as needed. + * + * @param request a request which can be sent to the service operation + * @return an {@link java.lang.Iterable} which can be used to iterate over the responses received from the service. + */ + public Iterable listWorkRequestsResponseIterator( + final ListWorkRequestsRequest request) { + return new com.oracle.bmc.paginator.internal.ResponseIterable< + ListWorkRequestsRequest.Builder, ListWorkRequestsRequest, ListWorkRequestsResponse>( + new com.google.common.base.Supplier() { + @Override + public ListWorkRequestsRequest.Builder get() { + return ListWorkRequestsRequest.builder().copy(request); + } + }, + new com.google.common.base.Function() { + @Override + public String apply(ListWorkRequestsResponse response) { + return response.getOpcNextPage(); + } + }, + new com.google.common.base.Function< + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListWorkRequestsRequest.Builder>, + ListWorkRequestsRequest>() { + @Override + public ListWorkRequestsRequest apply( + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListWorkRequestsRequest.Builder> + input) { + if (input.getToken() == null) { + return input.getRequestBuilder().build(); + } else { + return input.getRequestBuilder() + .page(input.getToken().orNull()) + .build(); + } + } + }, + new com.google.common.base.Function< + ListWorkRequestsRequest, ListWorkRequestsResponse>() { + @Override + public ListWorkRequestsResponse apply(ListWorkRequestsRequest request) { + return client.listWorkRequests(request); + } + }); + } + + /** + * Creates a new iterable which will iterate over the {@link com.oracle.bmc.containerengine.model.WorkRequestSummary} objects + * contained in responses from the listWorkRequests operation. This iterable will fetch more data from the + * server as needed. + * + * @param request a request which can be sent to the service operation + * @return an {@link java.lang.Iterable} which can be used to iterate over the {@link com.oracle.bmc.containerengine.model.WorkRequestSummary} objects + * contained in responses received from the service. + */ + public Iterable + listWorkRequestsRecordIterator(final ListWorkRequestsRequest request) { + return new com.oracle.bmc.paginator.internal.ResponseRecordIterable< + ListWorkRequestsRequest.Builder, ListWorkRequestsRequest, ListWorkRequestsResponse, + com.oracle.bmc.containerengine.model.WorkRequestSummary>( + new com.google.common.base.Supplier() { + @Override + public ListWorkRequestsRequest.Builder get() { + return ListWorkRequestsRequest.builder().copy(request); + } + }, + new com.google.common.base.Function() { + @Override + public String apply(ListWorkRequestsResponse response) { + return response.getOpcNextPage(); + } + }, + new com.google.common.base.Function< + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListWorkRequestsRequest.Builder>, + ListWorkRequestsRequest>() { + @Override + public ListWorkRequestsRequest apply( + com.oracle.bmc.paginator.internal.RequestBuilderAndToken< + ListWorkRequestsRequest.Builder> + input) { + if (input.getToken() == null) { + return input.getRequestBuilder().build(); + } else { + return input.getRequestBuilder() + .page(input.getToken().orNull()) + .build(); + } + } + }, + new com.google.common.base.Function< + ListWorkRequestsRequest, ListWorkRequestsResponse>() { + @Override + public ListWorkRequestsResponse apply(ListWorkRequestsRequest request) { + return client.listWorkRequests(request); + } + }, + new com.google.common.base.Function< + ListWorkRequestsResponse, + java.util.List>() { + @Override + public java.util.List + apply(ListWorkRequestsResponse response) { + return response.getItems(); + } + }); + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineWaiters.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineWaiters.java new file mode 100644 index 00000000000..9b8da476189 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/ContainerEngineWaiters.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine; + +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; + +/** + * Collection of helper methods to produce {@link Waiter}s for different + * resources of ContainerEngine. + *

+ * The default configuration used is defined by {@link Waiters#DEFAULT_POLLING_WAITER}. + */ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.RequiredArgsConstructor +public class ContainerEngineWaiters { + private final java.util.concurrent.ExecutorService executorService; + private final ContainerEngine client; + + /** + * Creates a new {@link Waiter} using default configuration. + * + * @param request the request to send + * @param targetState the desired states to wait for. If multiple states are provided then the waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forCluster( + GetClusterRequest request, + com.oracle.bmc.containerengine.model.ClusterLifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forCluster( + com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request, targetStates); + } + + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param targetState the desired state to wait for + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forCluster( + GetClusterRequest request, + com.oracle.bmc.containerengine.model.ClusterLifecycleState targetState, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + org.apache.commons.lang3.Validate.notNull(targetState, "The targetState cannot be null"); + + return forCluster( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetState); + } + + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @param targetStates the desired states to wait for. The waiter will return once the resource reaches any of the provided states + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter forCluster( + GetClusterRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy, + com.oracle.bmc.containerengine.model.ClusterLifecycleState... targetStates) { + org.apache.commons.lang3.Validate.notEmpty( + targetStates, "At least one targetState must be provided"); + org.apache.commons.lang3.Validate.noNullElements( + targetStates, "Null targetState values are not permitted"); + + return forCluster( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request, + targetStates); + } + + // Helper method to create a new Waiter for Cluster. + private com.oracle.bmc.waiter.Waiter forCluster( + com.oracle.bmc.waiter.BmcGenericWaiter waiter, + final GetClusterRequest request, + final com.oracle.bmc.containerengine.model.ClusterLifecycleState... targetStates) { + final java.util.Set + targetStatesSet = new java.util.HashSet<>(java.util.Arrays.asList(targetStates)); + + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( + executorService, + waiter.toCallable( + com.google.common.base.Suppliers.ofInstance(request), + new com.google.common.base.Function< + GetClusterRequest, GetClusterResponse>() { + @Override + public GetClusterResponse apply(GetClusterRequest request) { + return client.getCluster(request); + } + }, + new com.google.common.base.Predicate() { + @Override + public boolean apply(GetClusterResponse response) { + return targetStatesSet.contains( + response.getCluster().getLifecycleState()); + } + }, + targetStatesSet.contains( + com.oracle.bmc.containerengine.model.ClusterLifecycleState + .Deleted)), + request); + } + + /** + * Creates a new {@link Waiter} using default configuration. + * + * @param request the request to send + * @return a new Waiter instance + */ + public com.oracle.bmc.waiter.Waiter + forWorkRequest(GetWorkRequestRequest request) { + return forWorkRequest(com.oracle.bmc.waiter.Waiters.DEFAULT_POLLING_WAITER, request); + } + + /** + * Creates a new {@link Waiter} using the provided configuration. + * + * @param request the request to send + * @param terminationStrategy the {@link TerminationStrategy} to use + * @param delayStrategy the {@link DelayStrategy} to use + * @return a new {@code Waiter} instance + */ + public com.oracle.bmc.waiter.Waiter + forWorkRequest( + GetWorkRequestRequest request, + com.oracle.bmc.waiter.TerminationStrategy terminationStrategy, + com.oracle.bmc.waiter.DelayStrategy delayStrategy) { + return forWorkRequest( + com.oracle.bmc.waiter.Waiters.newWaiter(terminationStrategy, delayStrategy), + request); + } + + // Helper method to create a new Waiter for WorkRequest. + private com.oracle.bmc.waiter.Waiter + forWorkRequest( + com.oracle.bmc.waiter.BmcGenericWaiter waiter, + final GetWorkRequestRequest request) { + return new com.oracle.bmc.waiter.internal.SimpleWaiterImpl<>( + executorService, + waiter.toCallable( + com.google.common.base.Suppliers.ofInstance(request), + new com.google.common.base.Function< + GetWorkRequestRequest, GetWorkRequestResponse>() { + @Override + public GetWorkRequestResponse apply(GetWorkRequestRequest request) { + return client.getWorkRequest(request); + } + }, + new com.google.common.base.Predicate() { + @Override + public boolean apply(GetWorkRequestResponse response) { + // work requests are complete once the time finished is available + return response.getWorkRequest().getTimeFinished() != null; + } + }, + false), + request); + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateClusterConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateClusterConverter.java new file mode 100644 index 00000000000..c7a68cd398b --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateClusterConverter.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class CreateClusterConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static CreateClusterRequest interceptRequest(CreateClusterRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, CreateClusterRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCreateClusterDetails(), "createClusterDetails is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget().path("/20180222").path("clusters"); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, CreateClusterResponse>() { + @Override + public CreateClusterResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for CreateClusterResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + CreateClusterResponse.Builder builder = + CreateClusterResponse.builder(); + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + CreateClusterResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateKubeconfigConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateKubeconfigConverter.java new file mode 100644 index 00000000000..a9c164e3bd8 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateKubeconfigConverter.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class CreateKubeconfigConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static CreateKubeconfigRequest interceptRequest(CreateKubeconfigRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, CreateKubeconfigRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getClusterId(), "clusterId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("clusters") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getClusterId())) + .path("kubeconfig") + .path("content"); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept("application/x-yaml"); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, CreateKubeconfigResponse> + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, CreateKubeconfigResponse>() { + @Override + public CreateKubeconfigResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for CreateKubeconfigResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.io.InputStream>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + java.io.InputStream.class); + + com.oracle.bmc.http.internal.WithHeaders + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + CreateKubeconfigResponse.Builder builder = + CreateKubeconfigResponse.builder(); + + builder.inputStream(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + CreateKubeconfigResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateNodePoolConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateNodePoolConverter.java new file mode 100644 index 00000000000..c1bcdbd6ce9 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/CreateNodePoolConverter.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class CreateNodePoolConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static CreateNodePoolRequest interceptRequest(CreateNodePoolRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, CreateNodePoolRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCreateNodePoolDetails(), "createNodePoolDetails is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget().path("/20180222").path("nodePools"); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRetryToken() != null) { + ib.header("opc-retry-token", request.getOpcRetryToken()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, CreateNodePoolResponse>() { + @Override + public CreateNodePoolResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for CreateNodePoolResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + CreateNodePoolResponse.Builder builder = + CreateNodePoolResponse.builder(); + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + CreateNodePoolResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteClusterConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteClusterConverter.java new file mode 100644 index 00000000000..2234c321874 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteClusterConverter.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class DeleteClusterConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static DeleteClusterRequest interceptRequest(DeleteClusterRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, DeleteClusterRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getClusterId(), "clusterId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("clusters") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getClusterId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, DeleteClusterResponse>() { + @Override + public DeleteClusterResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for DeleteClusterResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + DeleteClusterResponse.Builder builder = + DeleteClusterResponse.builder(); + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + DeleteClusterResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteNodePoolConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteNodePoolConverter.java new file mode 100644 index 00000000000..76c27dbfb66 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteNodePoolConverter.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class DeleteNodePoolConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static DeleteNodePoolRequest interceptRequest(DeleteNodePoolRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, DeleteNodePoolRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getNodePoolId(), "nodePoolId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("nodePools") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getNodePoolId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, DeleteNodePoolResponse>() { + @Override + public DeleteNodePoolResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for DeleteNodePoolResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + DeleteNodePoolResponse.Builder builder = + DeleteNodePoolResponse.builder(); + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + DeleteNodePoolResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteWorkRequestConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteWorkRequestConverter.java new file mode 100644 index 00000000000..a3649363776 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/DeleteWorkRequestConverter.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class DeleteWorkRequestConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static DeleteWorkRequestRequest interceptRequest(DeleteWorkRequestRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, DeleteWorkRequestRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getWorkRequestId(), "workRequestId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("workRequests") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getWorkRequestId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, DeleteWorkRequestResponse> + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, DeleteWorkRequestResponse>() { + @Override + public DeleteWorkRequestResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for DeleteWorkRequestResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + DeleteWorkRequestResponse.Builder builder = + DeleteWorkRequestResponse.builder(); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + DeleteWorkRequestResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetClusterConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetClusterConverter.java new file mode 100644 index 00000000000..a1af4097fea --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetClusterConverter.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class GetClusterConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static GetClusterRequest interceptRequest(GetClusterRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, GetClusterRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getClusterId(), "clusterId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("clusters") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getClusterId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, GetClusterResponse>() { + @Override + public GetClusterResponse apply(javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for GetClusterResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = + RESPONSE_CONVERSION_FACTORY.create(Cluster.class); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + GetClusterResponse.Builder builder = GetClusterResponse.builder(); + + builder.cluster(response.getItem()); + + com.google.common.base.Optional> etagHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "etag"); + if (etagHeader.isPresent()) { + builder.etag( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "etag", etagHeader.get().get(0), String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetClusterResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetClusterOptionsConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetClusterOptionsConverter.java new file mode 100644 index 00000000000..1a483291075 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetClusterOptionsConverter.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class GetClusterOptionsConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static GetClusterOptionsRequest interceptRequest(GetClusterOptionsRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, GetClusterOptionsRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getClusterOptionId(), "clusterOptionId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("clusterOptions") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getClusterOptionId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, GetClusterOptionsResponse> + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, GetClusterOptionsResponse>() { + @Override + public GetClusterOptionsResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for GetClusterOptionsResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + ClusterOptions>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + ClusterOptions.class); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + GetClusterOptionsResponse.Builder builder = + GetClusterOptionsResponse.builder(); + + builder.clusterOptions(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetClusterOptionsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetNodePoolConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetNodePoolConverter.java new file mode 100644 index 00000000000..07e344b4f6d --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetNodePoolConverter.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class GetNodePoolConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static GetNodePoolRequest interceptRequest(GetNodePoolRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, GetNodePoolRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getNodePoolId(), "nodePoolId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("nodePools") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getNodePoolId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, GetNodePoolResponse>() { + @Override + public GetNodePoolResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for GetNodePoolResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = + RESPONSE_CONVERSION_FACTORY.create(NodePool.class); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + GetNodePoolResponse.Builder builder = GetNodePoolResponse.builder(); + + builder.nodePool(response.getItem()); + + com.google.common.base.Optional> etagHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "etag"); + if (etagHeader.isPresent()) { + builder.etag( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "etag", etagHeader.get().get(0), String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetNodePoolResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetNodePoolOptionsConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetNodePoolOptionsConverter.java new file mode 100644 index 00000000000..e384b6b6975 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetNodePoolOptionsConverter.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class GetNodePoolOptionsConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static GetNodePoolOptionsRequest interceptRequest(GetNodePoolOptionsRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, GetNodePoolOptionsRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getNodePoolOptionId(), "nodePoolOptionId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("nodePoolOptions") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getNodePoolOptionId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, GetNodePoolOptionsResponse> + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, GetNodePoolOptionsResponse>() { + @Override + public GetNodePoolOptionsResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for GetNodePoolOptionsResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + NodePoolOptions>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + NodePoolOptions.class); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + GetNodePoolOptionsResponse.Builder builder = + GetNodePoolOptionsResponse.builder(); + + builder.nodePoolOptions(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + GetNodePoolOptionsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetWorkRequestConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetWorkRequestConverter.java new file mode 100644 index 00000000000..ce73e1807d8 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/GetWorkRequestConverter.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class GetWorkRequestConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static GetWorkRequestRequest interceptRequest(GetWorkRequestRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, GetWorkRequestRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getWorkRequestId(), "workRequestId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("workRequests") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getWorkRequestId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, GetWorkRequestResponse>() { + @Override + public GetWorkRequestResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for GetWorkRequestResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + WorkRequest>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + WorkRequest.class); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + GetWorkRequestResponse.Builder builder = + GetWorkRequestResponse.builder(); + + builder.workRequest(response.getItem()); + + com.google.common.base.Optional> etagHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "etag"); + if (etagHeader.isPresent()) { + builder.etag( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "etag", etagHeader.get().get(0), String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + retryAfterHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "retry-after"); + if (retryAfterHeader.isPresent()) { + builder.retryAfter( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "retry-after", + retryAfterHeader.get().get(0), + Integer.class)); + } + + GetWorkRequestResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListClustersConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListClustersConverter.java new file mode 100644 index 00000000000..1df2ab8b670 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListClustersConverter.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ListClustersConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static ListClustersRequest interceptRequest(ListClustersRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, ListClustersRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCompartmentId(), "compartmentId is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget().path("/20180222").path("clusters"); + + target = + target.queryParam( + "compartmentId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getCompartmentId())); + + if (request.getLifecycleState() != null) { + target = + com.oracle.bmc.util.internal.HttpUtils.encodeCollectionFormatQueryParam( + target, + "lifecycleState", + request.getLifecycleState(), + com.oracle.bmc.util.internal.CollectionFormatType.Multi); + } + + if (request.getName() != null) { + target = + target.queryParam( + "name", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getName())); + } + + if (request.getLimit() != null) { + target = + target.queryParam( + "limit", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getLimit())); + } + + if (request.getPage() != null) { + target = + target.queryParam( + "page", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getPage())); + } + + if (request.getSortOrder() != null) { + target = + target.queryParam( + "sortOrder", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getSortOrder().getValue())); + } + + if (request.getSortBy() != null) { + target = + target.queryParam( + "sortBy", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getSortBy().getValue())); + } + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, ListClustersResponse>() { + @Override + public ListClustersResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for ListClustersResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.util.List>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new javax.ws.rs.core.GenericType< + java.util.List< + ClusterSummary>>() {}); + + com.oracle.bmc.http.internal.WithHeaders< + java.util.List> + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + ListClustersResponse.Builder builder = + ListClustersResponse.builder(); + + builder.items(response.getItem()); + + com.google.common.base.Optional> + opcNextPageHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListClustersResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListNodePoolsConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListNodePoolsConverter.java new file mode 100644 index 00000000000..4d469c42583 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListNodePoolsConverter.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ListNodePoolsConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static ListNodePoolsRequest interceptRequest(ListNodePoolsRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, ListNodePoolsRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCompartmentId(), "compartmentId is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget().path("/20180222").path("nodePools"); + + target = + target.queryParam( + "compartmentId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getCompartmentId())); + + if (request.getClusterId() != null) { + target = + target.queryParam( + "clusterId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getClusterId())); + } + + if (request.getName() != null) { + target = + target.queryParam( + "name", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getName())); + } + + if (request.getLimit() != null) { + target = + target.queryParam( + "limit", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getLimit())); + } + + if (request.getPage() != null) { + target = + target.queryParam( + "page", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getPage())); + } + + if (request.getSortOrder() != null) { + target = + target.queryParam( + "sortOrder", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getSortOrder().getValue())); + } + + if (request.getSortBy() != null) { + target = + target.queryParam( + "sortBy", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getSortBy().getValue())); + } + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, ListNodePoolsResponse>() { + @Override + public ListNodePoolsResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for ListNodePoolsResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.util.List>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new javax.ws.rs.core.GenericType< + java.util.List< + NodePoolSummary>>() {}); + + com.oracle.bmc.http.internal.WithHeaders< + java.util.List> + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + ListNodePoolsResponse.Builder builder = + ListNodePoolsResponse.builder(); + + builder.items(response.getItem()); + + com.google.common.base.Optional> + opcNextPageHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListNodePoolsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestErrorsConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestErrorsConverter.java new file mode 100644 index 00000000000..85d603f9dd5 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestErrorsConverter.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ListWorkRequestErrorsConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static ListWorkRequestErrorsRequest interceptRequest( + ListWorkRequestErrorsRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, ListWorkRequestErrorsRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCompartmentId(), "compartmentId is required"); + Validate.notBlank(request.getWorkRequestId(), "workRequestId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("workRequests") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getWorkRequestId())) + .path("errors"); + + target = + target.queryParam( + "compartmentId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getCompartmentId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestErrorsResponse> + fromResponse() { + final com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestErrorsResponse> + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestErrorsResponse>() { + @Override + public ListWorkRequestErrorsResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for ListWorkRequestErrorsResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.util.List>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new javax.ws.rs.core.GenericType< + java.util.List< + WorkRequestError>>() {}); + + com.oracle.bmc.http.internal.WithHeaders< + java.util.List> + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + ListWorkRequestErrorsResponse.Builder builder = + ListWorkRequestErrorsResponse.builder(); + + builder.items(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListWorkRequestErrorsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestLogsConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestLogsConverter.java new file mode 100644 index 00000000000..3c8f09d13b7 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestLogsConverter.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ListWorkRequestLogsConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static ListWorkRequestLogsRequest interceptRequest(ListWorkRequestLogsRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, ListWorkRequestLogsRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCompartmentId(), "compartmentId is required"); + Validate.notBlank(request.getWorkRequestId(), "workRequestId must not be blank"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("workRequests") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getWorkRequestId())) + .path("logs"); + + target = + target.queryParam( + "compartmentId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getCompartmentId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestLogsResponse> + fromResponse() { + final com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestLogsResponse> + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestLogsResponse>() { + @Override + public ListWorkRequestLogsResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for ListWorkRequestLogsResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.util.List>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new javax.ws.rs.core.GenericType< + java.util.List< + WorkRequestLogEntry>>() {}); + + com.oracle.bmc.http.internal.WithHeaders< + java.util.List> + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + ListWorkRequestLogsResponse.Builder builder = + ListWorkRequestLogsResponse.builder(); + + builder.items(response.getItem()); + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListWorkRequestLogsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestsConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestsConverter.java new file mode 100644 index 00000000000..e1ac8f9f986 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/ListWorkRequestsConverter.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class ListWorkRequestsConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static ListWorkRequestsRequest interceptRequest(ListWorkRequestsRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, ListWorkRequestsRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notNull(request.getCompartmentId(), "compartmentId is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget().path("/20180222").path("workRequests"); + + target = + target.queryParam( + "compartmentId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getCompartmentId())); + + if (request.getClusterId() != null) { + target = + target.queryParam( + "clusterId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getClusterId())); + } + + if (request.getResourceId() != null) { + target = + target.queryParam( + "resourceId", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getResourceId())); + } + + if (request.getResourceType() != null) { + target = + target.queryParam( + "resourceType", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getResourceType().getValue())); + } + + if (request.getStatus() != null) { + target = + com.oracle.bmc.util.internal.HttpUtils.encodeCollectionFormatQueryParam( + target, + "status", + request.getStatus(), + com.oracle.bmc.util.internal.CollectionFormatType.Multi); + } + + if (request.getLimit() != null) { + target = + target.queryParam( + "limit", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getLimit())); + } + + if (request.getPage() != null) { + target = + target.queryParam( + "page", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getPage())); + } + + if (request.getSortOrder() != null) { + target = + target.queryParam( + "sortOrder", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getSortOrder().getValue())); + } + + if (request.getSortBy() != null) { + target = + target.queryParam( + "sortBy", + com.oracle.bmc.util.internal.HttpUtils.attemptEncodeQueryParam( + request.getSortBy().getValue())); + } + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestsResponse> + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, ListWorkRequestsResponse>() { + @Override + public ListWorkRequestsResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace( + "Transform function invoked for ListWorkRequestsResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders< + java.util.List>> + responseFn = + RESPONSE_CONVERSION_FACTORY.create( + new javax.ws.rs.core.GenericType< + java.util.List< + WorkRequestSummary>>() {}); + + com.oracle.bmc.http.internal.WithHeaders< + java.util.List> + response = responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + ListWorkRequestsResponse.Builder builder = + ListWorkRequestsResponse.builder(); + + builder.items(response.getItem()); + + com.google.common.base.Optional> + opcNextPageHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-next-page"); + if (opcNextPageHeader.isPresent()) { + builder.opcNextPage( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-next-page", + opcNextPageHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + ListWorkRequestsResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/UpdateClusterConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/UpdateClusterConverter.java new file mode 100644 index 00000000000..a136b342349 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/UpdateClusterConverter.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class UpdateClusterConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static UpdateClusterRequest interceptRequest(UpdateClusterRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, UpdateClusterRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getClusterId(), "clusterId must not be blank"); + Validate.notNull(request.getUpdateClusterDetails(), "updateClusterDetails is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("clusters") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getClusterId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, UpdateClusterResponse>() { + @Override + public UpdateClusterResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for UpdateClusterResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + UpdateClusterResponse.Builder builder = + UpdateClusterResponse.builder(); + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + UpdateClusterResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/UpdateNodePoolConverter.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/UpdateNodePoolConverter.java new file mode 100644 index 00000000000..5c93fd636b4 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/internal/http/UpdateNodePoolConverter.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.internal.http; + +import com.oracle.bmc.containerengine.model.*; +import com.oracle.bmc.containerengine.requests.*; +import com.oracle.bmc.containerengine.responses.*; +import org.apache.commons.lang3.Validate; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public class UpdateNodePoolConverter { + private static final com.oracle.bmc.http.internal.ResponseConversionFunctionFactory + RESPONSE_CONVERSION_FACTORY = + new com.oracle.bmc.http.internal.ResponseConversionFunctionFactory(); + + public static UpdateNodePoolRequest interceptRequest(UpdateNodePoolRequest request) { + + return request; + } + + public static com.oracle.bmc.http.internal.WrappedInvocationBuilder fromRequest( + com.oracle.bmc.http.internal.RestClient client, UpdateNodePoolRequest request) { + Validate.notNull(request, "request instance is required"); + Validate.notBlank(request.getNodePoolId(), "nodePoolId must not be blank"); + Validate.notNull(request.getUpdateNodePoolDetails(), "updateNodePoolDetails is required"); + + com.oracle.bmc.http.internal.WrappedWebTarget target = + client.getBaseTarget() + .path("/20180222") + .path("nodePools") + .path( + com.oracle.bmc.util.internal.HttpUtils.encodePathSegment( + request.getNodePoolId())); + + com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = target.request(); + + ib.accept(javax.ws.rs.core.MediaType.APPLICATION_JSON); + + if (request.getIfMatch() != null) { + ib.header("if-match", request.getIfMatch()); + } + + if (request.getOpcRequestId() != null) { + ib.header("opc-request-id", request.getOpcRequestId()); + } + + return ib; + } + + public static com.google.common.base.Function + fromResponse() { + final com.google.common.base.Function + transformer = + new com.google.common.base.Function< + javax.ws.rs.core.Response, UpdateNodePoolResponse>() { + @Override + public UpdateNodePoolResponse apply( + javax.ws.rs.core.Response rawResponse) { + LOG.trace("Transform function invoked for UpdateNodePoolResponse"); + com.google.common.base.Function< + javax.ws.rs.core.Response, + com.oracle.bmc.http.internal.WithHeaders> + responseFn = RESPONSE_CONVERSION_FACTORY.create(); + + com.oracle.bmc.http.internal.WithHeaders response = + responseFn.apply(rawResponse); + javax.ws.rs.core.MultivaluedMap headers = + response.getHeaders(); + + UpdateNodePoolResponse.Builder builder = + UpdateNodePoolResponse.builder(); + + com.google.common.base.Optional> + opcWorkRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-work-request-id"); + if (opcWorkRequestIdHeader.isPresent()) { + builder.opcWorkRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-work-request-id", + opcWorkRequestIdHeader.get().get(0), + String.class)); + } + + com.google.common.base.Optional> + opcRequestIdHeader = + com.oracle.bmc.http.internal.HeaderUtils.get( + headers, "opc-request-id"); + if (opcRequestIdHeader.isPresent()) { + builder.opcRequestId( + com.oracle.bmc.http.internal.HeaderUtils.toValue( + "opc-request-id", + opcRequestIdHeader.get().get(0), + String.class)); + } + + UpdateNodePoolResponse responseWrapper = builder.build(); + + return responseWrapper; + } + }; + return transformer; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/AddOnOptions.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/AddOnOptions.java new file mode 100644 index 00000000000..814bc988457 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/AddOnOptions.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define options for supported add-ons. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = AddOnOptions.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class AddOnOptions { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("isKubernetesDashboardEnabled") + private Boolean isKubernetesDashboardEnabled; + + public Builder isKubernetesDashboardEnabled(Boolean isKubernetesDashboardEnabled) { + this.isKubernetesDashboardEnabled = isKubernetesDashboardEnabled; + this.__explicitlySet__.add("isKubernetesDashboardEnabled"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("isTillerEnabled") + private Boolean isTillerEnabled; + + public Builder isTillerEnabled(Boolean isTillerEnabled) { + this.isTillerEnabled = isTillerEnabled; + this.__explicitlySet__.add("isTillerEnabled"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public AddOnOptions build() { + AddOnOptions __instance__ = + new AddOnOptions(isKubernetesDashboardEnabled, isTillerEnabled); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(AddOnOptions o) { + Builder copiedBuilder = + isKubernetesDashboardEnabled(o.getIsKubernetesDashboardEnabled()) + .isTillerEnabled(o.getIsTillerEnabled()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Whether or not to enable the Kubernetes Dashboard add-on. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("isKubernetesDashboardEnabled") + Boolean isKubernetesDashboardEnabled; + + /** + * Whether or not to enable the Tiller add-on. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("isTillerEnabled") + Boolean isTillerEnabled; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/Cluster.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/Cluster.java new file mode 100644 index 00000000000..77c386b1772 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/Cluster.java @@ -0,0 +1,240 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * A Kubernetes cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = Cluster.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class Cluster { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") + private String vcnId; + + public Builder vcnId(String vcnId) { + this.vcnId = vcnId; + this.__explicitlySet__.add("vcnId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("options") + private ClusterCreateOptions options; + + public Builder options(ClusterCreateOptions options) { + this.options = options; + this.__explicitlySet__.add("options"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("metadata") + private ClusterMetadata metadata; + + public Builder metadata(ClusterMetadata metadata) { + this.metadata = metadata; + this.__explicitlySet__.add("metadata"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") + private ClusterLifecycleState lifecycleState; + + public Builder lifecycleState(ClusterLifecycleState lifecycleState) { + this.lifecycleState = lifecycleState; + this.__explicitlySet__.add("lifecycleState"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") + private String lifecycleDetails; + + public Builder lifecycleDetails(String lifecycleDetails) { + this.lifecycleDetails = lifecycleDetails; + this.__explicitlySet__.add("lifecycleDetails"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("endpoints") + private ClusterEndpoints endpoints; + + public Builder endpoints(ClusterEndpoints endpoints) { + this.endpoints = endpoints; + this.__explicitlySet__.add("endpoints"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("availableKubernetesUpgrades") + private java.util.List availableKubernetesUpgrades; + + public Builder availableKubernetesUpgrades( + java.util.List availableKubernetesUpgrades) { + this.availableKubernetesUpgrades = availableKubernetesUpgrades; + this.__explicitlySet__.add("availableKubernetesUpgrades"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public Cluster build() { + Cluster __instance__ = + new Cluster( + id, + name, + compartmentId, + vcnId, + kubernetesVersion, + options, + metadata, + lifecycleState, + lifecycleDetails, + endpoints, + availableKubernetesUpgrades); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(Cluster o) { + Builder copiedBuilder = + id(o.getId()) + .name(o.getName()) + .compartmentId(o.getCompartmentId()) + .vcnId(o.getVcnId()) + .kubernetesVersion(o.getKubernetesVersion()) + .options(o.getOptions()) + .metadata(o.getMetadata()) + .lifecycleState(o.getLifecycleState()) + .lifecycleDetails(o.getLifecycleDetails()) + .endpoints(o.getEndpoints()) + .availableKubernetesUpgrades(o.getAvailableKubernetesUpgrades()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The name of the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The OCID of the compartment in which the cluster exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The OCID of the virtual cloud network (VCN) in which the cluster exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") + String vcnId; + + /** + * The version of Kubernetes running on the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * Optional attributes for the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("options") + ClusterCreateOptions options; + + /** + * Metadata about the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("metadata") + ClusterMetadata metadata; + + /** + * The state of the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") + ClusterLifecycleState lifecycleState; + + /** + * Details about the state of the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") + String lifecycleDetails; + + /** + * Endpoints served up by the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("endpoints") + ClusterEndpoints endpoints; + + /** + * Available Kubernetes versions to which the clusters masters may be upgraded. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("availableKubernetesUpgrades") + java.util.List availableKubernetesUpgrades; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterCreateOptions.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterCreateOptions.java new file mode 100644 index 00000000000..ea2a335e544 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterCreateOptions.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define extra options for a cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = ClusterCreateOptions.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class ClusterCreateOptions { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("serviceLbSubnetIds") + private java.util.List serviceLbSubnetIds; + + public Builder serviceLbSubnetIds(java.util.List serviceLbSubnetIds) { + this.serviceLbSubnetIds = serviceLbSubnetIds; + this.__explicitlySet__.add("serviceLbSubnetIds"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesNetworkConfig") + private KubernetesNetworkConfig kubernetesNetworkConfig; + + public Builder kubernetesNetworkConfig(KubernetesNetworkConfig kubernetesNetworkConfig) { + this.kubernetesNetworkConfig = kubernetesNetworkConfig; + this.__explicitlySet__.add("kubernetesNetworkConfig"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("addOns") + private AddOnOptions addOns; + + public Builder addOns(AddOnOptions addOns) { + this.addOns = addOns; + this.__explicitlySet__.add("addOns"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public ClusterCreateOptions build() { + ClusterCreateOptions __instance__ = + new ClusterCreateOptions(serviceLbSubnetIds, kubernetesNetworkConfig, addOns); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(ClusterCreateOptions o) { + Builder copiedBuilder = + serviceLbSubnetIds(o.getServiceLbSubnetIds()) + .kubernetesNetworkConfig(o.getKubernetesNetworkConfig()) + .addOns(o.getAddOns()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCIDs of the subnets used for Kubernetes services load balancers. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("serviceLbSubnetIds") + java.util.List serviceLbSubnetIds; + + /** + * Network configuration for Kubernetes. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesNetworkConfig") + KubernetesNetworkConfig kubernetesNetworkConfig; + + /** + * Configurable cluster add-ons + **/ + @com.fasterxml.jackson.annotation.JsonProperty("addOns") + AddOnOptions addOns; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterEndpoints.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterEndpoints.java new file mode 100644 index 00000000000..29a6d0855c2 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterEndpoints.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define endpoints for a cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = ClusterEndpoints.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class ClusterEndpoints { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("kubernetes") + private String kubernetes; + + public Builder kubernetes(String kubernetes) { + this.kubernetes = kubernetes; + this.__explicitlySet__.add("kubernetes"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public ClusterEndpoints build() { + ClusterEndpoints __instance__ = new ClusterEndpoints(kubernetes); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(ClusterEndpoints o) { + Builder copiedBuilder = kubernetes(o.getKubernetes()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The Kubernetes API server endpoint. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetes") + String kubernetes; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterLifecycleState.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterLifecycleState.java new file mode 100644 index 00000000000..366162bfb0a --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterLifecycleState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The lifecycle state of a cluster. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public enum ClusterLifecycleState { + Creating("CREATING"), + Active("ACTIVE"), + Failed("FAILED"), + Deleting("DELETING"), + Deleted("DELETED"), + Updating("UPDATING"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (ClusterLifecycleState v : ClusterLifecycleState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + ClusterLifecycleState(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public static ClusterLifecycleState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'ClusterLifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterMetadata.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterMetadata.java new file mode 100644 index 00000000000..d8a394d063a --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterMetadata.java @@ -0,0 +1,205 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define meta data for a cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = ClusterMetadata.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class ClusterMetadata { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("timeCreated") + private java.util.Date timeCreated; + + public Builder timeCreated(java.util.Date timeCreated) { + this.timeCreated = timeCreated; + this.__explicitlySet__.add("timeCreated"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("createdByUserId") + private String createdByUserId; + + public Builder createdByUserId(String createdByUserId) { + this.createdByUserId = createdByUserId; + this.__explicitlySet__.add("createdByUserId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("createdByWorkRequestId") + private String createdByWorkRequestId; + + public Builder createdByWorkRequestId(String createdByWorkRequestId) { + this.createdByWorkRequestId = createdByWorkRequestId; + this.__explicitlySet__.add("createdByWorkRequestId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeDeleted") + private java.util.Date timeDeleted; + + public Builder timeDeleted(java.util.Date timeDeleted) { + this.timeDeleted = timeDeleted; + this.__explicitlySet__.add("timeDeleted"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("deletedByUserId") + private String deletedByUserId; + + public Builder deletedByUserId(String deletedByUserId) { + this.deletedByUserId = deletedByUserId; + this.__explicitlySet__.add("deletedByUserId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("deletedByWorkRequestId") + private String deletedByWorkRequestId; + + public Builder deletedByWorkRequestId(String deletedByWorkRequestId) { + this.deletedByWorkRequestId = deletedByWorkRequestId; + this.__explicitlySet__.add("deletedByWorkRequestId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeUpdated") + private java.util.Date timeUpdated; + + public Builder timeUpdated(java.util.Date timeUpdated) { + this.timeUpdated = timeUpdated; + this.__explicitlySet__.add("timeUpdated"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("updatedByUserId") + private String updatedByUserId; + + public Builder updatedByUserId(String updatedByUserId) { + this.updatedByUserId = updatedByUserId; + this.__explicitlySet__.add("updatedByUserId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("updatedByWorkRequestId") + private String updatedByWorkRequestId; + + public Builder updatedByWorkRequestId(String updatedByWorkRequestId) { + this.updatedByWorkRequestId = updatedByWorkRequestId; + this.__explicitlySet__.add("updatedByWorkRequestId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public ClusterMetadata build() { + ClusterMetadata __instance__ = + new ClusterMetadata( + timeCreated, + createdByUserId, + createdByWorkRequestId, + timeDeleted, + deletedByUserId, + deletedByWorkRequestId, + timeUpdated, + updatedByUserId, + updatedByWorkRequestId); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(ClusterMetadata o) { + Builder copiedBuilder = + timeCreated(o.getTimeCreated()) + .createdByUserId(o.getCreatedByUserId()) + .createdByWorkRequestId(o.getCreatedByWorkRequestId()) + .timeDeleted(o.getTimeDeleted()) + .deletedByUserId(o.getDeletedByUserId()) + .deletedByWorkRequestId(o.getDeletedByWorkRequestId()) + .timeUpdated(o.getTimeUpdated()) + .updatedByUserId(o.getUpdatedByUserId()) + .updatedByWorkRequestId(o.getUpdatedByWorkRequestId()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The time the cluster was created. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeCreated") + java.util.Date timeCreated; + + /** + * The user who created the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("createdByUserId") + String createdByUserId; + + /** + * The OCID of the work request which created the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("createdByWorkRequestId") + String createdByWorkRequestId; + + /** + * The time the cluster was deleted. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeDeleted") + java.util.Date timeDeleted; + + /** + * The user who deleted the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("deletedByUserId") + String deletedByUserId; + + /** + * The OCID of the work request which deleted the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("deletedByWorkRequestId") + String deletedByWorkRequestId; + + /** + * The time the cluster was updated. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeUpdated") + java.util.Date timeUpdated; + + /** + * The user who updated the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("updatedByUserId") + String updatedByUserId; + + /** + * The OCID of the work request which updated the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("updatedByWorkRequestId") + String updatedByWorkRequestId; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterOptions.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterOptions.java new file mode 100644 index 00000000000..63a9991cb8d --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterOptions.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * Options for creating or updating clusters. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = ClusterOptions.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class ClusterOptions { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersions") + private java.util.List kubernetesVersions; + + public Builder kubernetesVersions(java.util.List kubernetesVersions) { + this.kubernetesVersions = kubernetesVersions; + this.__explicitlySet__.add("kubernetesVersions"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public ClusterOptions build() { + ClusterOptions __instance__ = new ClusterOptions(kubernetesVersions); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(ClusterOptions o) { + Builder copiedBuilder = kubernetesVersions(o.getKubernetesVersions()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Available Kubernetes versions. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersions") + java.util.List kubernetesVersions; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterSummary.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterSummary.java new file mode 100644 index 00000000000..61fd57b9911 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/ClusterSummary.java @@ -0,0 +1,240 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a cluster summary. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = ClusterSummary.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class ClusterSummary { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") + private String vcnId; + + public Builder vcnId(String vcnId) { + this.vcnId = vcnId; + this.__explicitlySet__.add("vcnId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("options") + private ClusterCreateOptions options; + + public Builder options(ClusterCreateOptions options) { + this.options = options; + this.__explicitlySet__.add("options"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("metadata") + private ClusterMetadata metadata; + + public Builder metadata(ClusterMetadata metadata) { + this.metadata = metadata; + this.__explicitlySet__.add("metadata"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") + private ClusterLifecycleState lifecycleState; + + public Builder lifecycleState(ClusterLifecycleState lifecycleState) { + this.lifecycleState = lifecycleState; + this.__explicitlySet__.add("lifecycleState"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") + private String lifecycleDetails; + + public Builder lifecycleDetails(String lifecycleDetails) { + this.lifecycleDetails = lifecycleDetails; + this.__explicitlySet__.add("lifecycleDetails"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("endpoints") + private ClusterEndpoints endpoints; + + public Builder endpoints(ClusterEndpoints endpoints) { + this.endpoints = endpoints; + this.__explicitlySet__.add("endpoints"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("availableKubernetesUpgrades") + private java.util.List availableKubernetesUpgrades; + + public Builder availableKubernetesUpgrades( + java.util.List availableKubernetesUpgrades) { + this.availableKubernetesUpgrades = availableKubernetesUpgrades; + this.__explicitlySet__.add("availableKubernetesUpgrades"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public ClusterSummary build() { + ClusterSummary __instance__ = + new ClusterSummary( + id, + name, + compartmentId, + vcnId, + kubernetesVersion, + options, + metadata, + lifecycleState, + lifecycleDetails, + endpoints, + availableKubernetesUpgrades); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(ClusterSummary o) { + Builder copiedBuilder = + id(o.getId()) + .name(o.getName()) + .compartmentId(o.getCompartmentId()) + .vcnId(o.getVcnId()) + .kubernetesVersion(o.getKubernetesVersion()) + .options(o.getOptions()) + .metadata(o.getMetadata()) + .lifecycleState(o.getLifecycleState()) + .lifecycleDetails(o.getLifecycleDetails()) + .endpoints(o.getEndpoints()) + .availableKubernetesUpgrades(o.getAvailableKubernetesUpgrades()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The name of the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The OCID of the compartment in which the cluster exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The OCID of the virtual cloud network (VCN) in which the cluster exists + **/ + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") + String vcnId; + + /** + * The version of Kubernetes running on the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * Optional attributes for the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("options") + ClusterCreateOptions options; + + /** + * Metadata about the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("metadata") + ClusterMetadata metadata; + + /** + * The state of the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") + ClusterLifecycleState lifecycleState; + + /** + * Details about the state of the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") + String lifecycleDetails; + + /** + * Endpoints served up by the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("endpoints") + ClusterEndpoints endpoints; + + /** + * Available Kubernetes versions to which the clusters masters may be upgraded. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("availableKubernetesUpgrades") + java.util.List availableKubernetesUpgrades; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateClusterDetails.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateClusterDetails.java new file mode 100644 index 00000000000..5dfb25b3367 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateClusterDetails.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a request to create a cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = CreateClusterDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class CreateClusterDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") + private String vcnId; + + public Builder vcnId(String vcnId) { + this.vcnId = vcnId; + this.__explicitlySet__.add("vcnId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("options") + private ClusterCreateOptions options; + + public Builder options(ClusterCreateOptions options) { + this.options = options; + this.__explicitlySet__.add("options"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public CreateClusterDetails build() { + CreateClusterDetails __instance__ = + new CreateClusterDetails( + name, compartmentId, vcnId, kubernetesVersion, options); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(CreateClusterDetails o) { + Builder copiedBuilder = + name(o.getName()) + .compartmentId(o.getCompartmentId()) + .vcnId(o.getVcnId()) + .kubernetesVersion(o.getKubernetesVersion()) + .options(o.getOptions()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The name of the cluster. Avoid entering confidential information. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The OCID of the compartment in which to create the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The OCID of the virtual cloud network (VCN) in which to create the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("vcnId") + String vcnId; + + /** + * The version of Kubernetes to install into the cluster masters. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * Optional attributes for the cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("options") + ClusterCreateOptions options; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateClusterKubeconfigContentDetails.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateClusterKubeconfigContentDetails.java new file mode 100644 index 00000000000..1f90ededeaa --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateClusterKubeconfigContentDetails.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a request to create a cluster kubeconfig. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = CreateClusterKubeconfigContentDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class CreateClusterKubeconfigContentDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("tokenVersion") + private String tokenVersion; + + public Builder tokenVersion(String tokenVersion) { + this.tokenVersion = tokenVersion; + this.__explicitlySet__.add("tokenVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("expiration") + private Integer expiration; + + public Builder expiration(Integer expiration) { + this.expiration = expiration; + this.__explicitlySet__.add("expiration"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public CreateClusterKubeconfigContentDetails build() { + CreateClusterKubeconfigContentDetails __instance__ = + new CreateClusterKubeconfigContentDetails(tokenVersion, expiration); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(CreateClusterKubeconfigContentDetails o) { + Builder copiedBuilder = tokenVersion(o.getTokenVersion()).expiration(o.getExpiration()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The version of the kubeconfig token. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("tokenVersion") + String tokenVersion; + + /** + * The desired expiration, in seconds, to use for the kubeconfig token. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("expiration") + Integer expiration; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateNodePoolDetails.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateNodePoolDetails.java new file mode 100644 index 00000000000..a98ae80d720 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/CreateNodePoolDetails.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a request to create a node pool. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = CreateNodePoolDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class CreateNodePoolDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("clusterId") + private String clusterId; + + public Builder clusterId(String clusterId) { + this.clusterId = clusterId; + this.__explicitlySet__.add("clusterId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageName") + private String nodeImageName; + + public Builder nodeImageName(String nodeImageName) { + this.nodeImageName = nodeImageName; + this.__explicitlySet__.add("nodeImageName"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeShape") + private String nodeShape; + + public Builder nodeShape(String nodeShape) { + this.nodeShape = nodeShape; + this.__explicitlySet__.add("nodeShape"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + private java.util.List initialNodeLabels; + + public Builder initialNodeLabels(java.util.List initialNodeLabels) { + this.initialNodeLabels = initialNodeLabels; + this.__explicitlySet__.add("initialNodeLabels"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("sshPublicKey") + private String sshPublicKey; + + public Builder sshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + this.__explicitlySet__.add("sshPublicKey"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + private Integer quantityPerSubnet; + + public Builder quantityPerSubnet(Integer quantityPerSubnet) { + this.quantityPerSubnet = quantityPerSubnet; + this.__explicitlySet__.add("quantityPerSubnet"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + private java.util.List subnetIds; + + public Builder subnetIds(java.util.List subnetIds) { + this.subnetIds = subnetIds; + this.__explicitlySet__.add("subnetIds"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public CreateNodePoolDetails build() { + CreateNodePoolDetails __instance__ = + new CreateNodePoolDetails( + compartmentId, + clusterId, + name, + kubernetesVersion, + nodeImageName, + nodeShape, + initialNodeLabels, + sshPublicKey, + quantityPerSubnet, + subnetIds); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(CreateNodePoolDetails o) { + Builder copiedBuilder = + compartmentId(o.getCompartmentId()) + .clusterId(o.getClusterId()) + .name(o.getName()) + .kubernetesVersion(o.getKubernetesVersion()) + .nodeImageName(o.getNodeImageName()) + .nodeShape(o.getNodeShape()) + .initialNodeLabels(o.getInitialNodeLabels()) + .sshPublicKey(o.getSshPublicKey()) + .quantityPerSubnet(o.getQuantityPerSubnet()) + .subnetIds(o.getSubnetIds()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the compartment in which the node pool exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The OCID of the cluster to which this node pool is attached. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("clusterId") + String clusterId; + + /** + * The name of the node pool. Avoid entering confidential information. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The version of Kubernetes to install on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * The name of the image running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageName") + String nodeImageName; + + /** + * The name of the node shape of the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeShape") + String nodeShape; + + /** + * A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + java.util.List initialNodeLabels; + + /** + * The SSH public key to add to each node in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("sshPublicKey") + String sshPublicKey; + + /** + * The number of nodes to create in each subnet. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + Integer quantityPerSubnet; + + /** + * The OCIDs of the subnets in which to place nodes for this node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + java.util.List subnetIds; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/KeyValue.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/KeyValue.java new file mode 100644 index 00000000000..47808967410 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/KeyValue.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a key value pair. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = KeyValue.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class KeyValue { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("key") + private String key; + + public Builder key(String key) { + this.key = key; + this.__explicitlySet__.add("key"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("value") + private String value; + + public Builder value(String value) { + this.value = value; + this.__explicitlySet__.add("value"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public KeyValue build() { + KeyValue __instance__ = new KeyValue(key, value); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(KeyValue o) { + Builder copiedBuilder = key(o.getKey()).value(o.getValue()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The key of the pair. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("key") + String key; + + /** + * The value of the pair. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("value") + String value; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/KubernetesNetworkConfig.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/KubernetesNetworkConfig.java new file mode 100644 index 00000000000..981f0b876a8 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/KubernetesNetworkConfig.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define the network configuration for Kubernetes. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = KubernetesNetworkConfig.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class KubernetesNetworkConfig { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("podsCidr") + private String podsCidr; + + public Builder podsCidr(String podsCidr) { + this.podsCidr = podsCidr; + this.__explicitlySet__.add("podsCidr"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("servicesCidr") + private String servicesCidr; + + public Builder servicesCidr(String servicesCidr) { + this.servicesCidr = servicesCidr; + this.__explicitlySet__.add("servicesCidr"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public KubernetesNetworkConfig build() { + KubernetesNetworkConfig __instance__ = + new KubernetesNetworkConfig(podsCidr, servicesCidr); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(KubernetesNetworkConfig o) { + Builder copiedBuilder = podsCidr(o.getPodsCidr()).servicesCidr(o.getServicesCidr()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The CIDR block for Kubernetes pods. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("podsCidr") + String podsCidr; + + /** + * The CIDR block for Kubernetes services. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("servicesCidr") + String servicesCidr; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/Node.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/Node.java new file mode 100644 index 00000000000..15485c29e26 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/Node.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a node. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = Node.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class Node { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("availabilityDomain") + private String availabilityDomain; + + public Builder availabilityDomain(String availabilityDomain) { + this.availabilityDomain = availabilityDomain; + this.__explicitlySet__.add("availabilityDomain"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("subnetId") + private String subnetId; + + public Builder subnetId(String subnetId) { + this.subnetId = subnetId; + this.__explicitlySet__.add("subnetId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodePoolId") + private String nodePoolId; + + public Builder nodePoolId(String nodePoolId) { + this.nodePoolId = nodePoolId; + this.__explicitlySet__.add("nodePoolId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("publicIp") + private String publicIp; + + public Builder publicIp(String publicIp) { + this.publicIp = publicIp; + this.__explicitlySet__.add("publicIp"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeError") + private NodeError nodeError; + + public Builder nodeError(NodeError nodeError) { + this.nodeError = nodeError; + this.__explicitlySet__.add("nodeError"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") + private LifecycleState lifecycleState; + + public Builder lifecycleState(LifecycleState lifecycleState) { + this.lifecycleState = lifecycleState; + this.__explicitlySet__.add("lifecycleState"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") + private String lifecycleDetails; + + public Builder lifecycleDetails(String lifecycleDetails) { + this.lifecycleDetails = lifecycleDetails; + this.__explicitlySet__.add("lifecycleDetails"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public Node build() { + Node __instance__ = + new Node( + id, + name, + availabilityDomain, + subnetId, + nodePoolId, + publicIp, + nodeError, + lifecycleState, + lifecycleDetails); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(Node o) { + Builder copiedBuilder = + id(o.getId()) + .name(o.getName()) + .availabilityDomain(o.getAvailabilityDomain()) + .subnetId(o.getSubnetId()) + .nodePoolId(o.getNodePoolId()) + .publicIp(o.getPublicIp()) + .nodeError(o.getNodeError()) + .lifecycleState(o.getLifecycleState()) + .lifecycleDetails(o.getLifecycleDetails()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the compute instance backing this node. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The name of the node. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The name of the availability domain in which this node is placed. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("availabilityDomain") + String availabilityDomain; + + /** + * The OCID of the subnet in which this node is placed. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("subnetId") + String subnetId; + + /** + * The OCID of the node pool to which this node belongs. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodePoolId") + String nodePoolId; + + /** + * The public IP address of this node. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("publicIp") + String publicIp; + + /** + * An error that may be associated with the node. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeError") + NodeError nodeError; + /** + * The state of the node. + **/ + @lombok.extern.slf4j.Slf4j + public enum LifecycleState { + Creating("CREATING"), + Active("ACTIVE"), + Updating("UPDATING"), + Deleting("DELETING"), + Deleted("DELETED"), + Failing("FAILING"), + Inactive("INACTIVE"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (LifecycleState v : LifecycleState.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + LifecycleState(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static LifecycleState create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'LifecycleState', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + /** + * The state of the node. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleState") + LifecycleState lifecycleState; + + /** + * Details about the state of the node. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("lifecycleDetails") + String lifecycleDetails; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodeError.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodeError.java new file mode 100644 index 00000000000..0a417d49a93 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodeError.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define an error. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = NodeError.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class NodeError { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("code") + private String code; + + public Builder code(String code) { + this.code = code; + this.__explicitlySet__.add("code"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("message") + private String message; + + public Builder message(String message) { + this.message = message; + this.__explicitlySet__.add("message"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public NodeError build() { + NodeError __instance__ = new NodeError(code, message); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(NodeError o) { + Builder copiedBuilder = code(o.getCode()).message(o.getMessage()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm). + **/ + @com.fasterxml.jackson.annotation.JsonProperty("code") + String code; + + /** + * A human-readable error string. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("message") + String message; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePool.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePool.java new file mode 100644 index 00000000000..50547ed6d67 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePool.java @@ -0,0 +1,273 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * A pool of compute nodes attached to a cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = NodePool.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class NodePool { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("clusterId") + private String clusterId; + + public Builder clusterId(String clusterId) { + this.clusterId = clusterId; + this.__explicitlySet__.add("clusterId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageId") + private String nodeImageId; + + public Builder nodeImageId(String nodeImageId) { + this.nodeImageId = nodeImageId; + this.__explicitlySet__.add("nodeImageId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageName") + private String nodeImageName; + + public Builder nodeImageName(String nodeImageName) { + this.nodeImageName = nodeImageName; + this.__explicitlySet__.add("nodeImageName"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeShape") + private String nodeShape; + + public Builder nodeShape(String nodeShape) { + this.nodeShape = nodeShape; + this.__explicitlySet__.add("nodeShape"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + private java.util.List initialNodeLabels; + + public Builder initialNodeLabels(java.util.List initialNodeLabels) { + this.initialNodeLabels = initialNodeLabels; + this.__explicitlySet__.add("initialNodeLabels"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("sshPublicKey") + private String sshPublicKey; + + public Builder sshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + this.__explicitlySet__.add("sshPublicKey"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + private Integer quantityPerSubnet; + + public Builder quantityPerSubnet(Integer quantityPerSubnet) { + this.quantityPerSubnet = quantityPerSubnet; + this.__explicitlySet__.add("quantityPerSubnet"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + private java.util.List subnetIds; + + public Builder subnetIds(java.util.List subnetIds) { + this.subnetIds = subnetIds; + this.__explicitlySet__.add("subnetIds"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodes") + private java.util.List nodes; + + public Builder nodes(java.util.List nodes) { + this.nodes = nodes; + this.__explicitlySet__.add("nodes"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public NodePool build() { + NodePool __instance__ = + new NodePool( + id, + compartmentId, + clusterId, + name, + kubernetesVersion, + nodeImageId, + nodeImageName, + nodeShape, + initialNodeLabels, + sshPublicKey, + quantityPerSubnet, + subnetIds, + nodes); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(NodePool o) { + Builder copiedBuilder = + id(o.getId()) + .compartmentId(o.getCompartmentId()) + .clusterId(o.getClusterId()) + .name(o.getName()) + .kubernetesVersion(o.getKubernetesVersion()) + .nodeImageId(o.getNodeImageId()) + .nodeImageName(o.getNodeImageName()) + .nodeShape(o.getNodeShape()) + .initialNodeLabels(o.getInitialNodeLabels()) + .sshPublicKey(o.getSshPublicKey()) + .quantityPerSubnet(o.getQuantityPerSubnet()) + .subnetIds(o.getSubnetIds()) + .nodes(o.getNodes()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The OCID of the compartment in which the node pool exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The OCID of the cluster to which this node pool is attached. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("clusterId") + String clusterId; + + /** + * The name of the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The version of Kubernetes running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * The OCID of the image running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageId") + String nodeImageId; + + /** + * The name of the image running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageName") + String nodeImageName; + + /** + * The name of the node shape of the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeShape") + String nodeShape; + + /** + * A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + java.util.List initialNodeLabels; + + /** + * The SSH public key on each node in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("sshPublicKey") + String sshPublicKey; + + /** + * The number of nodes in each subnet. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + Integer quantityPerSubnet; + + /** + * The OCIDs of the subnets in which to place nodes for this node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + java.util.List subnetIds; + + /** + * The nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodes") + java.util.List nodes; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePoolOptions.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePoolOptions.java new file mode 100644 index 00000000000..14346933832 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePoolOptions.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * Options for creating or updating node pools. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = NodePoolOptions.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class NodePoolOptions { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersions") + private java.util.List kubernetesVersions; + + public Builder kubernetesVersions(java.util.List kubernetesVersions) { + this.kubernetesVersions = kubernetesVersions; + this.__explicitlySet__.add("kubernetesVersions"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("images") + private java.util.List images; + + public Builder images(java.util.List images) { + this.images = images; + this.__explicitlySet__.add("images"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("shapes") + private java.util.List shapes; + + public Builder shapes(java.util.List shapes) { + this.shapes = shapes; + this.__explicitlySet__.add("shapes"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public NodePoolOptions build() { + NodePoolOptions __instance__ = new NodePoolOptions(kubernetesVersions, images, shapes); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(NodePoolOptions o) { + Builder copiedBuilder = + kubernetesVersions(o.getKubernetesVersions()) + .images(o.getImages()) + .shapes(o.getShapes()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Available Kubernetes versions. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersions") + java.util.List kubernetesVersions; + + /** + * Available Kubernetes versions. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("images") + java.util.List images; + + /** + * Available shapes for nodes. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("shapes") + java.util.List shapes; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePoolSummary.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePoolSummary.java new file mode 100644 index 00000000000..50628c8244f --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/NodePoolSummary.java @@ -0,0 +1,256 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a node pool summary. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = NodePoolSummary.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class NodePoolSummary { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("clusterId") + private String clusterId; + + public Builder clusterId(String clusterId) { + this.clusterId = clusterId; + this.__explicitlySet__.add("clusterId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageId") + private String nodeImageId; + + public Builder nodeImageId(String nodeImageId) { + this.nodeImageId = nodeImageId; + this.__explicitlySet__.add("nodeImageId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageName") + private String nodeImageName; + + public Builder nodeImageName(String nodeImageName) { + this.nodeImageName = nodeImageName; + this.__explicitlySet__.add("nodeImageName"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("nodeShape") + private String nodeShape; + + public Builder nodeShape(String nodeShape) { + this.nodeShape = nodeShape; + this.__explicitlySet__.add("nodeShape"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + private java.util.List initialNodeLabels; + + public Builder initialNodeLabels(java.util.List initialNodeLabels) { + this.initialNodeLabels = initialNodeLabels; + this.__explicitlySet__.add("initialNodeLabels"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("sshPublicKey") + private String sshPublicKey; + + public Builder sshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + this.__explicitlySet__.add("sshPublicKey"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + private Integer quantityPerSubnet; + + public Builder quantityPerSubnet(Integer quantityPerSubnet) { + this.quantityPerSubnet = quantityPerSubnet; + this.__explicitlySet__.add("quantityPerSubnet"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + private java.util.List subnetIds; + + public Builder subnetIds(java.util.List subnetIds) { + this.subnetIds = subnetIds; + this.__explicitlySet__.add("subnetIds"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public NodePoolSummary build() { + NodePoolSummary __instance__ = + new NodePoolSummary( + id, + compartmentId, + clusterId, + name, + kubernetesVersion, + nodeImageId, + nodeImageName, + nodeShape, + initialNodeLabels, + sshPublicKey, + quantityPerSubnet, + subnetIds); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(NodePoolSummary o) { + Builder copiedBuilder = + id(o.getId()) + .compartmentId(o.getCompartmentId()) + .clusterId(o.getClusterId()) + .name(o.getName()) + .kubernetesVersion(o.getKubernetesVersion()) + .nodeImageId(o.getNodeImageId()) + .nodeImageName(o.getNodeImageName()) + .nodeShape(o.getNodeShape()) + .initialNodeLabels(o.getInitialNodeLabels()) + .sshPublicKey(o.getSshPublicKey()) + .quantityPerSubnet(o.getQuantityPerSubnet()) + .subnetIds(o.getSubnetIds()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The OCID of the compartment in which the node pool exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The OCID of the cluster to which this node pool is attached. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("clusterId") + String clusterId; + + /** + * The name of the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The version of Kubernetes running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * The OCID of the image running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageId") + String nodeImageId; + + /** + * The name of the image running on the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeImageName") + String nodeImageName; + + /** + * The name of the node shape of the nodes in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("nodeShape") + String nodeShape; + + /** + * A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + java.util.List initialNodeLabels; + + /** + * The SSH public key on each node in the node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("sshPublicKey") + String sshPublicKey; + + /** + * The number of nodes in each subnet. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + Integer quantityPerSubnet; + + /** + * The OCIDs of the subnets in which to place nodes for this node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + java.util.List subnetIds; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/SortOrder.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/SortOrder.java new file mode 100644 index 00000000000..7cbd61a966b --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/SortOrder.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The sort order for a list operation. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +public enum SortOrder { + Asc("ASC"), + Desc("DESC"), + ; + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (SortOrder v : SortOrder.values()) { + map.put(v.getValue(), v); + } + } + + SortOrder(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public static SortOrder create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid SortOrder: " + key); + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/UpdateClusterDetails.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/UpdateClusterDetails.java new file mode 100644 index 00000000000..96e6c14b84b --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/UpdateClusterDetails.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a request to update a cluster. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = UpdateClusterDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class UpdateClusterDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public UpdateClusterDetails build() { + UpdateClusterDetails __instance__ = new UpdateClusterDetails(name, kubernetesVersion); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(UpdateClusterDetails o) { + Builder copiedBuilder = name(o.getName()).kubernetesVersion(o.getKubernetesVersion()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The new name for the cluster. Avoid entering confidential information. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The version of Kubernetes to which the cluster masters should be upgraded. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/UpdateNodePoolDetails.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/UpdateNodePoolDetails.java new file mode 100644 index 00000000000..42d51b7ffc8 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/UpdateNodePoolDetails.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a request to update a node pool. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = UpdateNodePoolDetails.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class UpdateNodePoolDetails { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("name") + private String name; + + public Builder name(String name) { + this.name = name; + this.__explicitlySet__.add("name"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + private String kubernetesVersion; + + public Builder kubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + this.__explicitlySet__.add("kubernetesVersion"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + private Integer quantityPerSubnet; + + public Builder quantityPerSubnet(Integer quantityPerSubnet) { + this.quantityPerSubnet = quantityPerSubnet; + this.__explicitlySet__.add("quantityPerSubnet"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + private java.util.List initialNodeLabels; + + public Builder initialNodeLabels(java.util.List initialNodeLabels) { + this.initialNodeLabels = initialNodeLabels; + this.__explicitlySet__.add("initialNodeLabels"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + private java.util.List subnetIds; + + public Builder subnetIds(java.util.List subnetIds) { + this.subnetIds = subnetIds; + this.__explicitlySet__.add("subnetIds"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public UpdateNodePoolDetails build() { + UpdateNodePoolDetails __instance__ = + new UpdateNodePoolDetails( + name, + kubernetesVersion, + quantityPerSubnet, + initialNodeLabels, + subnetIds); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(UpdateNodePoolDetails o) { + Builder copiedBuilder = + name(o.getName()) + .kubernetesVersion(o.getKubernetesVersion()) + .quantityPerSubnet(o.getQuantityPerSubnet()) + .initialNodeLabels(o.getInitialNodeLabels()) + .subnetIds(o.getSubnetIds()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The new name for the cluster. Avoid entering confidential information. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("name") + String name; + + /** + * The version of Kubernetes to which the nodes in the node pool should be upgraded. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("kubernetesVersion") + String kubernetesVersion; + + /** + * The number of nodes to ensure in each subnet. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("quantityPerSubnet") + Integer quantityPerSubnet; + + /** + * A list of key/value pairs to add to nodes after they join the Kubernetes cluster. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("initialNodeLabels") + java.util.List initialNodeLabels; + + /** + * The OCIDs of the subnets in which to place nodes for this node pool. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("subnetIds") + java.util.List subnetIds; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequest.java new file mode 100644 index 00000000000..5a749481acd --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequest.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * An asynchronous work request. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = WorkRequest.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class WorkRequest { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("operationType") + private WorkRequestOperationType operationType; + + public Builder operationType(WorkRequestOperationType operationType) { + this.operationType = operationType; + this.__explicitlySet__.add("operationType"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("status") + private WorkRequestStatus status; + + public Builder status(WorkRequestStatus status) { + this.status = status; + this.__explicitlySet__.add("status"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("resources") + private java.util.List resources; + + public Builder resources(java.util.List resources) { + this.resources = resources; + this.__explicitlySet__.add("resources"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeAccepted") + private java.util.Date timeAccepted; + + public Builder timeAccepted(java.util.Date timeAccepted) { + this.timeAccepted = timeAccepted; + this.__explicitlySet__.add("timeAccepted"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeStarted") + private java.util.Date timeStarted; + + public Builder timeStarted(java.util.Date timeStarted) { + this.timeStarted = timeStarted; + this.__explicitlySet__.add("timeStarted"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeFinished") + private java.util.Date timeFinished; + + public Builder timeFinished(java.util.Date timeFinished) { + this.timeFinished = timeFinished; + this.__explicitlySet__.add("timeFinished"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public WorkRequest build() { + WorkRequest __instance__ = + new WorkRequest( + id, + operationType, + status, + compartmentId, + resources, + timeAccepted, + timeStarted, + timeFinished); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(WorkRequest o) { + Builder copiedBuilder = + id(o.getId()) + .operationType(o.getOperationType()) + .status(o.getStatus()) + .compartmentId(o.getCompartmentId()) + .resources(o.getResources()) + .timeAccepted(o.getTimeAccepted()) + .timeStarted(o.getTimeStarted()) + .timeFinished(o.getTimeFinished()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the work request. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The type of work the work request is doing. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("operationType") + WorkRequestOperationType operationType; + + /** + * The current status of the work request. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("status") + WorkRequestStatus status; + + /** + * The OCID of the compartment in which the work request exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The resources this work request affects. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("resources") + java.util.List resources; + + /** + * The time the work request was accepted. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeAccepted") + java.util.Date timeAccepted; + + /** + * The time the work request was started. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeStarted") + java.util.Date timeStarted; + + /** + * The time the work request was finished. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeFinished") + java.util.Date timeFinished; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestError.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestError.java new file mode 100644 index 00000000000..9b410804585 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestError.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * Errors related to a specific work request. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize(builder = WorkRequestError.Builder.class) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class WorkRequestError { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("code") + private String code; + + public Builder code(String code) { + this.code = code; + this.__explicitlySet__.add("code"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("message") + private String message; + + public Builder message(String message) { + this.message = message; + this.__explicitlySet__.add("message"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timestamp") + private java.util.Date timestamp; + + public Builder timestamp(java.util.Date timestamp) { + this.timestamp = timestamp; + this.__explicitlySet__.add("timestamp"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public WorkRequestError build() { + WorkRequestError __instance__ = new WorkRequestError(code, message, timestamp); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(WorkRequestError o) { + Builder copiedBuilder = + code(o.getCode()).message(o.getMessage()).timestamp(o.getTimestamp()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm). + **/ + @com.fasterxml.jackson.annotation.JsonProperty("code") + String code; + + /** + * A human-readable error string. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("message") + String message; + + /** + * The date and time the error occurred. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timestamp") + java.util.Date timestamp; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestLogEntry.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestLogEntry.java new file mode 100644 index 00000000000..fe8e09b7946 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestLogEntry.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * Log entries related to a specific work request. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = WorkRequestLogEntry.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class WorkRequestLogEntry { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("message") + private String message; + + public Builder message(String message) { + this.message = message; + this.__explicitlySet__.add("message"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timestamp") + private String timestamp; + + public Builder timestamp(String timestamp) { + this.timestamp = timestamp; + this.__explicitlySet__.add("timestamp"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public WorkRequestLogEntry build() { + WorkRequestLogEntry __instance__ = new WorkRequestLogEntry(message, timestamp); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(WorkRequestLogEntry o) { + Builder copiedBuilder = message(o.getMessage()).timestamp(o.getTimestamp()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The description of an action that occurred. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("message") + String message; + + /** + * The date and time the log entry occurred. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timestamp") + String timestamp; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestOperationType.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestOperationType.java new file mode 100644 index 00000000000..e800c2d7ee0 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestOperationType.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The types of work request operations. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public enum WorkRequestOperationType { + ClusterCreate("CLUSTER_CREATE"), + ClusterUpdate("CLUSTER_UPDATE"), + ClusterDelete("CLUSTER_DELETE"), + NodepoolCreate("NODEPOOL_CREATE"), + NodepoolUpdate("NODEPOOL_UPDATE"), + NodepoolDelete("NODEPOOL_DELETE"), + WorkrequestCancel("WORKREQUEST_CANCEL"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (WorkRequestOperationType v : WorkRequestOperationType.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + WorkRequestOperationType(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public static WorkRequestOperationType create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'WorkRequestOperationType', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestResource.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestResource.java new file mode 100644 index 00000000000..901a366700e --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestResource.java @@ -0,0 +1,168 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a work request resource. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = WorkRequestResource.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class WorkRequestResource { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("actionType") + private ActionType actionType; + + public Builder actionType(ActionType actionType) { + this.actionType = actionType; + this.__explicitlySet__.add("actionType"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("entityType") + private String entityType; + + public Builder entityType(String entityType) { + this.entityType = entityType; + this.__explicitlySet__.add("entityType"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("identifier") + private String identifier; + + public Builder identifier(String identifier) { + this.identifier = identifier; + this.__explicitlySet__.add("identifier"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("entityUri") + private String entityUri; + + public Builder entityUri(String entityUri) { + this.entityUri = entityUri; + this.__explicitlySet__.add("entityUri"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public WorkRequestResource build() { + WorkRequestResource __instance__ = + new WorkRequestResource(actionType, entityType, identifier, entityUri); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(WorkRequestResource o) { + Builder copiedBuilder = + actionType(o.getActionType()) + .entityType(o.getEntityType()) + .identifier(o.getIdentifier()) + .entityUri(o.getEntityUri()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The way in which this resource was affected by the work tracked by the work request. + **/ + @lombok.extern.slf4j.Slf4j + public enum ActionType { + Created("CREATED"), + Updated("UPDATED"), + Deleted("DELETED"), + Related("RELATED"), + InProgress("IN_PROGRESS"), + Failed("FAILED"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (ActionType v : ActionType.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + ActionType(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static ActionType create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'ActionType', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } + }; + /** + * The way in which this resource was affected by the work tracked by the work request. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("actionType") + ActionType actionType; + + /** + * The resource type the work request affects. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("entityType") + String entityType; + + /** + * The OCID of the resource the work request affects. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("identifier") + String identifier; + + /** + * The URI path on which the user can issue a GET request to access the resource metadata. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("entityUri") + String entityUri; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestStatus.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestStatus.java new file mode 100644 index 00000000000..39713c0af2d --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestStatus.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The status of a work request. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.extern.slf4j.Slf4j +public enum WorkRequestStatus { + Accepted("ACCEPTED"), + InProgress("IN_PROGRESS"), + Failed("FAILED"), + Succeeded("SUCCEEDED"), + Canceling("CANCELING"), + Canceled("CANCELED"), + + /** + * This value is used if a service returns a value for this enum that is not recognized by this + * version of the SDK. + */ + UnknownEnumValue(null); + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (WorkRequestStatus v : WorkRequestStatus.values()) { + if (v != UnknownEnumValue) { + map.put(v.getValue(), v); + } + } + } + + WorkRequestStatus(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public static WorkRequestStatus create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + LOG.warn( + "Received unknown value '{}' for enum 'WorkRequestStatus', returning UnknownEnumValue", + key); + return UnknownEnumValue; + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestSummary.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestSummary.java new file mode 100644 index 00000000000..d860b8716a1 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/model/WorkRequestSummary.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.model; + +/** + * The properties that define a work request summary. + *
+ * Note: This model distinguishes fields that are {@code null} because they are unset from fields that are explicitly + * set to {@code null}. This is done in the setter methods of the {@link Builder}, which maintain a set of all + * explicitly set fields called {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods + * are implemented to take {@link #__explicitlySet__} into account. The constructor, on the other hand, does not + * set {@link #__explicitlySet__} (since the constructor cannot distinguish explicit {@code null} from unset + * {@code null}). As a consequence, objects should always be created or deserialized using the {@link Builder}. + **/ +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Value +@com.fasterxml.jackson.databind.annotation.JsonDeserialize( + builder = WorkRequestSummary.Builder.class +) +@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME) +public class WorkRequestSummary { + @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "") + @lombok.experimental.Accessors(fluent = true) + public static class Builder { + @com.fasterxml.jackson.annotation.JsonProperty("id") + private String id; + + public Builder id(String id) { + this.id = id; + this.__explicitlySet__.add("id"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("operationType") + private WorkRequestOperationType operationType; + + public Builder operationType(WorkRequestOperationType operationType) { + this.operationType = operationType; + this.__explicitlySet__.add("operationType"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("status") + private WorkRequestStatus status; + + public Builder status(WorkRequestStatus status) { + this.status = status; + this.__explicitlySet__.add("status"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + private String compartmentId; + + public Builder compartmentId(String compartmentId) { + this.compartmentId = compartmentId; + this.__explicitlySet__.add("compartmentId"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("resources") + private java.util.List resources; + + public Builder resources(java.util.List resources) { + this.resources = resources; + this.__explicitlySet__.add("resources"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeAccepted") + private java.util.Date timeAccepted; + + public Builder timeAccepted(java.util.Date timeAccepted) { + this.timeAccepted = timeAccepted; + this.__explicitlySet__.add("timeAccepted"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeStarted") + private java.util.Date timeStarted; + + public Builder timeStarted(java.util.Date timeStarted) { + this.timeStarted = timeStarted; + this.__explicitlySet__.add("timeStarted"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonProperty("timeFinished") + private java.util.Date timeFinished; + + public Builder timeFinished(java.util.Date timeFinished) { + this.timeFinished = timeFinished; + this.__explicitlySet__.add("timeFinished"); + return this; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); + + public WorkRequestSummary build() { + WorkRequestSummary __instance__ = + new WorkRequestSummary( + id, + operationType, + status, + compartmentId, + resources, + timeAccepted, + timeStarted, + timeFinished); + __instance__.__explicitlySet__.addAll(__explicitlySet__); + return __instance__; + } + + @com.fasterxml.jackson.annotation.JsonIgnore + public Builder copy(WorkRequestSummary o) { + Builder copiedBuilder = + id(o.getId()) + .operationType(o.getOperationType()) + .status(o.getStatus()) + .compartmentId(o.getCompartmentId()) + .resources(o.getResources()) + .timeAccepted(o.getTimeAccepted()) + .timeStarted(o.getTimeStarted()) + .timeFinished(o.getTimeFinished()); + + copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__); + return copiedBuilder; + } + } + + /** + * Create a new builder. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * The OCID of the work request. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("id") + String id; + + /** + * The type of work the work request is doing. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("operationType") + WorkRequestOperationType operationType; + + /** + * The current status of the work request. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("status") + WorkRequestStatus status; + + /** + * The OCID of the compartment in which the work request exists. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("compartmentId") + String compartmentId; + + /** + * The resources this work request affects. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("resources") + java.util.List resources; + + /** + * The time the work request was accepted. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeAccepted") + java.util.Date timeAccepted; + + /** + * The time the work request was started. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeStarted") + java.util.Date timeStarted; + + /** + * The time the work request was finished. + **/ + @com.fasterxml.jackson.annotation.JsonProperty("timeFinished") + java.util.Date timeFinished; + + @com.fasterxml.jackson.annotation.JsonIgnore + private final java.util.Set __explicitlySet__ = new java.util.HashSet(); +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateClusterRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateClusterRequest.java new file mode 100644 index 00000000000..9a683619bc2 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateClusterRequest.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class CreateClusterRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The details of the cluster to create. + */ + private CreateClusterDetails createClusterDetails; + + /** + * A token you supply to uniquely identify the request and provide idempotency if + * the request is retried. Idempotency tokens expire after 24 hours. + * + */ + private String opcRetryToken; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateClusterRequest o) { + createClusterDetails(o.getCreateClusterDetails()); + opcRetryToken(o.getOpcRetryToken()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of CreateClusterRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of CreateClusterRequest + */ + public CreateClusterRequest build() { + CreateClusterRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateKubeconfigRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateKubeconfigRequest.java new file mode 100644 index 00000000000..1e18d44de29 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateKubeconfigRequest.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class CreateKubeconfigRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the cluster. + */ + private String clusterId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The details of the cluster kubeconfig to create. + */ + private CreateClusterKubeconfigContentDetails createClusterKubeconfigContentDetails; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateKubeconfigRequest o) { + clusterId(o.getClusterId()); + opcRequestId(o.getOpcRequestId()); + createClusterKubeconfigContentDetails(o.getCreateClusterKubeconfigContentDetails()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of CreateKubeconfigRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of CreateKubeconfigRequest + */ + public CreateKubeconfigRequest build() { + CreateKubeconfigRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateNodePoolRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateNodePoolRequest.java new file mode 100644 index 00000000000..08e0c8197bc --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/CreateNodePoolRequest.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class CreateNodePoolRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The details of the node pool to create. + */ + private CreateNodePoolDetails createNodePoolDetails; + + /** + * A token you supply to uniquely identify the request and provide idempotency if + * the request is retried. Idempotency tokens expire after 24 hours. + * + */ + private String opcRetryToken; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateNodePoolRequest o) { + createNodePoolDetails(o.getCreateNodePoolDetails()); + opcRetryToken(o.getOpcRetryToken()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of CreateNodePoolRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of CreateNodePoolRequest + */ + public CreateNodePoolRequest build() { + CreateNodePoolRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteClusterRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteClusterRequest.java new file mode 100644 index 00000000000..92e54cc9da1 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteClusterRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class DeleteClusterRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the cluster. + */ + private String clusterId; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteClusterRequest o) { + clusterId(o.getClusterId()); + ifMatch(o.getIfMatch()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of DeleteClusterRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of DeleteClusterRequest + */ + public DeleteClusterRequest build() { + DeleteClusterRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteNodePoolRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteNodePoolRequest.java new file mode 100644 index 00000000000..411f6b32c2d --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteNodePoolRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class DeleteNodePoolRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the node pool. + */ + private String nodePoolId; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteNodePoolRequest o) { + nodePoolId(o.getNodePoolId()); + ifMatch(o.getIfMatch()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of DeleteNodePoolRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of DeleteNodePoolRequest + */ + public DeleteNodePoolRequest build() { + DeleteNodePoolRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteWorkRequestRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteWorkRequestRequest.java new file mode 100644 index 00000000000..b1b7901fd81 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/DeleteWorkRequestRequest.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class DeleteWorkRequestRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the work request. + */ + private String workRequestId; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteWorkRequestRequest o) { + workRequestId(o.getWorkRequestId()); + ifMatch(o.getIfMatch()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of DeleteWorkRequestRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of DeleteWorkRequestRequest + */ + public DeleteWorkRequestRequest build() { + DeleteWorkRequestRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetClusterOptionsRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetClusterOptionsRequest.java new file mode 100644 index 00000000000..712d0f53765 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetClusterOptionsRequest.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class GetClusterOptionsRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The id of the option set to retrieve. Only \"all\" is supported. + */ + private String clusterOptionId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetClusterOptionsRequest o) { + clusterOptionId(o.getClusterOptionId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of GetClusterOptionsRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of GetClusterOptionsRequest + */ + public GetClusterOptionsRequest build() { + GetClusterOptionsRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetClusterRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetClusterRequest.java new file mode 100644 index 00000000000..99df064690c --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetClusterRequest.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class GetClusterRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the cluster. + */ + private String clusterId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetClusterRequest o) { + clusterId(o.getClusterId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of GetClusterRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of GetClusterRequest + */ + public GetClusterRequest build() { + GetClusterRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetNodePoolOptionsRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetNodePoolOptionsRequest.java new file mode 100644 index 00000000000..ccfd440303e --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetNodePoolOptionsRequest.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class GetNodePoolOptionsRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The id of the option set to retrieve. Use \"all\" get all options, or use a cluster ID to get options specific to the provided cluster. + */ + private String nodePoolOptionId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetNodePoolOptionsRequest o) { + nodePoolOptionId(o.getNodePoolOptionId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of GetNodePoolOptionsRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of GetNodePoolOptionsRequest + */ + public GetNodePoolOptionsRequest build() { + GetNodePoolOptionsRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetNodePoolRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetNodePoolRequest.java new file mode 100644 index 00000000000..5f6b3aee090 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetNodePoolRequest.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class GetNodePoolRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the node pool. + */ + private String nodePoolId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetNodePoolRequest o) { + nodePoolId(o.getNodePoolId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of GetNodePoolRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of GetNodePoolRequest + */ + public GetNodePoolRequest build() { + GetNodePoolRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetWorkRequestRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetWorkRequestRequest.java new file mode 100644 index 00000000000..b23edb25cb3 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/GetWorkRequestRequest.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class GetWorkRequestRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the work request. + */ + private String workRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetWorkRequestRequest o) { + workRequestId(o.getWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of GetWorkRequestRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of GetWorkRequestRequest + */ + public GetWorkRequestRequest build() { + GetWorkRequestRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListClustersRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListClustersRequest.java new file mode 100644 index 00000000000..2fa4b17fa6f --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListClustersRequest.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class ListClustersRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * A cluster lifecycle state to filter on. Can have multiple parameters of this name. + */ + private java.util.List + lifecycleState; + + /** + * The name to filter on. + */ + private String name; + + /** + * The maximum number of items to return in a paginated \"List\" call. + * + */ + private Integer limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + * + */ + private String page; + + /** + * The optional order in which to sort the results. + */ + private com.oracle.bmc.containerengine.model.SortOrder sortOrder; + + /** + * The optional field to sort the results by. + */ + private SortBy sortBy; + + /** + * The optional field to sort the results by. + **/ + public enum SortBy { + Id("ID"), + Name("NAME"), + TimeCreated("TIME_CREATED"), + ; + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (SortBy v : SortBy.values()) { + map.put(v.getValue(), v); + } + } + + SortBy(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static SortBy create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid SortBy: " + key); + } + }; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListClustersRequest o) { + compartmentId(o.getCompartmentId()); + lifecycleState(o.getLifecycleState()); + name(o.getName()); + limit(o.getLimit()); + page(o.getPage()); + sortOrder(o.getSortOrder()); + sortBy(o.getSortBy()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of ListClustersRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of ListClustersRequest + */ + public ListClustersRequest build() { + ListClustersRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListNodePoolsRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListNodePoolsRequest.java new file mode 100644 index 00000000000..0d91bd0c054 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListNodePoolsRequest.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class ListNodePoolsRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The OCID of the cluster. + */ + private String clusterId; + + /** + * The name to filter on. + */ + private String name; + + /** + * The maximum number of items to return in a paginated \"List\" call. + * + */ + private Integer limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + * + */ + private String page; + + /** + * The optional order in which to sort the results. + */ + private com.oracle.bmc.containerengine.model.SortOrder sortOrder; + + /** + * The optional field to sort the results by. + */ + private SortBy sortBy; + + /** + * The optional field to sort the results by. + **/ + public enum SortBy { + Id("ID"), + Name("NAME"), + TimeCreated("TIME_CREATED"), + ; + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (SortBy v : SortBy.values()) { + map.put(v.getValue(), v); + } + } + + SortBy(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static SortBy create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid SortBy: " + key); + } + }; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListNodePoolsRequest o) { + compartmentId(o.getCompartmentId()); + clusterId(o.getClusterId()); + name(o.getName()); + limit(o.getLimit()); + page(o.getPage()); + sortOrder(o.getSortOrder()); + sortBy(o.getSortBy()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of ListNodePoolsRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of ListNodePoolsRequest + */ + public ListNodePoolsRequest build() { + ListNodePoolsRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestErrorsRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestErrorsRequest.java new file mode 100644 index 00000000000..d67120a5ee7 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestErrorsRequest.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class ListWorkRequestErrorsRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The OCID of the work request. + */ + private String workRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestErrorsRequest o) { + compartmentId(o.getCompartmentId()); + workRequestId(o.getWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of ListWorkRequestErrorsRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of ListWorkRequestErrorsRequest + */ + public ListWorkRequestErrorsRequest build() { + ListWorkRequestErrorsRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestLogsRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestLogsRequest.java new file mode 100644 index 00000000000..cb01f01f608 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestLogsRequest.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class ListWorkRequestLogsRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The OCID of the work request. + */ + private String workRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestLogsRequest o) { + compartmentId(o.getCompartmentId()); + workRequestId(o.getWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of ListWorkRequestLogsRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of ListWorkRequestLogsRequest + */ + public ListWorkRequestLogsRequest build() { + ListWorkRequestLogsRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestsRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestsRequest.java new file mode 100644 index 00000000000..fe2c1549d4c --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/ListWorkRequestsRequest.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class ListWorkRequestsRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the compartment. + */ + private String compartmentId; + + /** + * The OCID of the cluster. + */ + private String clusterId; + + /** + * The OCID of the resource associated with a work request + */ + private String resourceId; + + /** + * Type of the resource associated with a work request + */ + private ResourceType resourceType; + + /** + * Type of the resource associated with a work request + **/ + public enum ResourceType { + Cluster("CLUSTER"), + Nodepool("NODEPOOL"), + ; + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (ResourceType v : ResourceType.values()) { + map.put(v.getValue(), v); + } + } + + ResourceType(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static ResourceType create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid ResourceType: " + key); + } + }; + + /** + * A work request status to filter on. Can have multiple parameters of this name. + */ + private java.util.List status; + + /** + * The maximum number of items to return in a paginated \"List\" call. + * + */ + private Integer limit; + + /** + * The value of the `opc-next-page` response header from the previous \"List\" call. + * + */ + private String page; + + /** + * The optional order in which to sort the results. + */ + private com.oracle.bmc.containerengine.model.SortOrder sortOrder; + + /** + * The optional field to sort the results by. + */ + private SortBy sortBy; + + /** + * The optional field to sort the results by. + **/ + public enum SortBy { + Id("ID"), + OperationType("OPERATION_TYPE"), + Status("STATUS"), + TimeAccepted("TIME_ACCEPTED"), + TimeStarted("TIME_STARTED"), + TimeFinished("TIME_FINISHED"), + ; + + private final String value; + private static java.util.Map map; + + static { + map = new java.util.HashMap<>(); + for (SortBy v : SortBy.values()) { + map.put(v.getValue(), v); + } + } + + SortBy(String value) { + this.value = value; + } + + @com.fasterxml.jackson.annotation.JsonValue + public String getValue() { + return value; + } + + @com.fasterxml.jackson.annotation.JsonCreator + public static SortBy create(String key) { + if (map.containsKey(key)) { + return map.get(key); + } + throw new RuntimeException("Invalid SortBy: " + key); + } + }; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestsRequest o) { + compartmentId(o.getCompartmentId()); + clusterId(o.getClusterId()); + resourceId(o.getResourceId()); + resourceType(o.getResourceType()); + status(o.getStatus()); + limit(o.getLimit()); + page(o.getPage()); + sortOrder(o.getSortOrder()); + sortBy(o.getSortBy()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of ListWorkRequestsRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of ListWorkRequestsRequest + */ + public ListWorkRequestsRequest build() { + ListWorkRequestsRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/UpdateClusterRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/UpdateClusterRequest.java new file mode 100644 index 00000000000..e5a3ffe1382 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/UpdateClusterRequest.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class UpdateClusterRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the cluster. + */ + private String clusterId; + + /** + * The details of the cluster to update. + */ + private UpdateClusterDetails updateClusterDetails; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateClusterRequest o) { + clusterId(o.getClusterId()); + updateClusterDetails(o.getUpdateClusterDetails()); + ifMatch(o.getIfMatch()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of UpdateClusterRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of UpdateClusterRequest + */ + public UpdateClusterRequest build() { + UpdateClusterRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/UpdateNodePoolRequest.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/UpdateNodePoolRequest.java new file mode 100644 index 00000000000..f6f3e343e26 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/requests/UpdateNodePoolRequest.java @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.requests; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback") +@lombok.Getter +public class UpdateNodePoolRequest extends com.oracle.bmc.requests.BmcRequest { + + /** + * The OCID of the node pool. + */ + private String nodePoolId; + + /** + * The fields to update in a node pool. + */ + private UpdateNodePoolDetails updateNodePoolDetails; + + /** + * For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + * parameter to the value of the etag from a previous GET or POST response for that resource. The resource + * will be updated or deleted only if the etag you provide matches the resource's current etag value. + * + */ + private String ifMatch; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact + * Oracle about a particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + private com.oracle.bmc.util.internal.Consumer + invocationCallback = null; + + /** + * Set the invocation callback for the request to be built. + * @param invocationCallback the invocation callback to be set for the request + * @return this builder instance + */ + public Builder invocationCallback( + com.oracle.bmc.util.internal.Consumer + invocationCallback) { + this.invocationCallback = invocationCallback; + return this; + } + + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateNodePoolRequest o) { + nodePoolId(o.getNodePoolId()); + updateNodePoolDetails(o.getUpdateNodePoolDetails()); + ifMatch(o.getIfMatch()); + opcRequestId(o.getOpcRequestId()); + invocationCallback(o.getInvocationCallback()); + return this; + } + + /** + * Build the instance of UpdateNodePoolRequest as configured by this builder + * + * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account, + * while the method {@link Builder#buildWithoutInvocationCallback} does not. + * + * This is the preferred method to build an instance. + * + * @return instance of UpdateNodePoolRequest + */ + public UpdateNodePoolRequest build() { + UpdateNodePoolRequest request = buildWithoutInvocationCallback(); + request.setInvocationCallback(invocationCallback); + return request; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateClusterResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateClusterResponse.java new file mode 100644 index 00000000000..bd8a4b45d6b --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateClusterResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class CreateClusterResponse { + + /** + * The OCID of the work request handling the operation. + */ + private String opcWorkRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateClusterResponse o) { + opcWorkRequestId(o.getOpcWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateKubeconfigResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateKubeconfigResponse.java new file mode 100644 index 00000000000..a060ec7a75f --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateKubeconfigResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class CreateKubeconfigResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned java.io.InputStream instance. + */ + private java.io.InputStream inputStream; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateKubeconfigResponse o) { + opcRequestId(o.getOpcRequestId()); + inputStream(o.getInputStream()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateNodePoolResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateNodePoolResponse.java new file mode 100644 index 00000000000..eb4fea8dcb8 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/CreateNodePoolResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class CreateNodePoolResponse { + + /** + * The OCID of the work request handling the operation. + */ + private String opcWorkRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(CreateNodePoolResponse o) { + opcWorkRequestId(o.getOpcWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteClusterResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteClusterResponse.java new file mode 100644 index 00000000000..96f566cd4b4 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteClusterResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class DeleteClusterResponse { + + /** + * The OCID of the work request handling the operation. + */ + private String opcWorkRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteClusterResponse o) { + opcWorkRequestId(o.getOpcWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteNodePoolResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteNodePoolResponse.java new file mode 100644 index 00000000000..5deee116b05 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteNodePoolResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class DeleteNodePoolResponse { + + /** + * The OCID of the work request handling the operation. + */ + private String opcWorkRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteNodePoolResponse o) { + opcWorkRequestId(o.getOpcWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteWorkRequestResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteWorkRequestResponse.java new file mode 100644 index 00000000000..3ce3b3440e9 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/DeleteWorkRequestResponse.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class DeleteWorkRequestResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(DeleteWorkRequestResponse o) { + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetClusterOptionsResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetClusterOptionsResponse.java new file mode 100644 index 00000000000..2081fc7bc48 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetClusterOptionsResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class GetClusterOptionsResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned ClusterOptions instance. + */ + private ClusterOptions clusterOptions; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetClusterOptionsResponse o) { + opcRequestId(o.getOpcRequestId()); + clusterOptions(o.getClusterOptions()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetClusterResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetClusterResponse.java new file mode 100644 index 00000000000..bf58e67f32e --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetClusterResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class GetClusterResponse { + + /** + * For optimistic concurrency control. See `if-match`. + */ + private String etag; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned Cluster instance. + */ + private Cluster cluster; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetClusterResponse o) { + etag(o.getEtag()); + opcRequestId(o.getOpcRequestId()); + cluster(o.getCluster()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetNodePoolOptionsResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetNodePoolOptionsResponse.java new file mode 100644 index 00000000000..ce1b3106b34 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetNodePoolOptionsResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class GetNodePoolOptionsResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned NodePoolOptions instance. + */ + private NodePoolOptions nodePoolOptions; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetNodePoolOptionsResponse o) { + opcRequestId(o.getOpcRequestId()); + nodePoolOptions(o.getNodePoolOptions()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetNodePoolResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetNodePoolResponse.java new file mode 100644 index 00000000000..1ea4f47cedc --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetNodePoolResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class GetNodePoolResponse { + + /** + * For optimistic concurrency control. See `if-match`. + */ + private String etag; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * The returned NodePool instance. + */ + private NodePool nodePool; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetNodePoolResponse o) { + etag(o.getEtag()); + opcRequestId(o.getOpcRequestId()); + nodePool(o.getNodePool()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetWorkRequestResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetWorkRequestResponse.java new file mode 100644 index 00000000000..f78c7a4b3b8 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/GetWorkRequestResponse.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class GetWorkRequestResponse { + + /** + * For optimistic concurrency control. See `if-match`. + */ + private String etag; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * the number of seconds to should wait before polling this endpoint again + */ + private Integer retryAfter; + + /** + * The returned WorkRequest instance. + */ + private WorkRequest workRequest; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(GetWorkRequestResponse o) { + etag(o.getEtag()); + opcRequestId(o.getOpcRequestId()); + retryAfter(o.getRetryAfter()); + workRequest(o.getWorkRequest()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListClustersResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListClustersResponse.java new file mode 100644 index 00000000000..3ff50d0f8b6 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListClustersResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class ListClustersResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then there might be additional items still to get. Include this value as the `page` parameter for the + * subsequent GET request. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of ClusterSummary instances. + */ + private java.util.List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListClustersResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListNodePoolsResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListNodePoolsResponse.java new file mode 100644 index 00000000000..cc68a6579cd --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListNodePoolsResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class ListNodePoolsResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then there might be additional items still to get. Include this value as the `page` parameter for the + * subsequent GET request. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of NodePoolSummary instances. + */ + private java.util.List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListNodePoolsResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestErrorsResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestErrorsResponse.java new file mode 100644 index 00000000000..5785d5c0095 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestErrorsResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class ListWorkRequestErrorsResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of WorkRequestError instances. + */ + private java.util.List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestErrorsResponse o) { + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestLogsResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestLogsResponse.java new file mode 100644 index 00000000000..450a467f051 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestLogsResponse.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class ListWorkRequestLogsResponse { + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of WorkRequestLogEntry instances. + */ + private java.util.List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestLogsResponse o) { + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestsResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestsResponse.java new file mode 100644 index 00000000000..25a26140837 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/ListWorkRequestsResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class ListWorkRequestsResponse { + + /** + * For pagination of a list of items. When paging through a list, if this header appears in the response, + * then there might be additional items still to get. Include this value as the `page` parameter for the + * subsequent GET request. + * + */ + private String opcNextPage; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + * particular request, please provide the request ID. + * + */ + private String opcRequestId; + + /** + * A list of WorkRequestSummary instances. + */ + private java.util.List items; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(ListWorkRequestsResponse o) { + opcNextPage(o.getOpcNextPage()); + opcRequestId(o.getOpcRequestId()); + items(o.getItems()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/UpdateClusterResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/UpdateClusterResponse.java new file mode 100644 index 00000000000..3ba83e1ee69 --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/UpdateClusterResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class UpdateClusterResponse { + + /** + * The OCID of the work request handling the operation. + */ + private String opcWorkRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateClusterResponse o) { + opcWorkRequestId(o.getOpcWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/UpdateNodePoolResponse.java b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/UpdateNodePoolResponse.java new file mode 100644 index 00000000000..621a4ce825e --- /dev/null +++ b/bmc-containerengine/src/main/java/com/oracle/bmc/containerengine/responses/UpdateNodePoolResponse.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +package com.oracle.bmc.containerengine.responses; + +import com.oracle.bmc.containerengine.model.*; + +@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180222") +@lombok.Builder(builderClassName = "Builder") +@lombok.Getter +public class UpdateNodePoolResponse { + + /** + * The OCID of the work request handling the operation. + */ + private String opcWorkRequestId; + + /** + * Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + */ + private String opcRequestId; + + public static class Builder { + /** + * Copy method to populate the builder with values from the given instance. + * @return this builder instance + */ + public Builder copy(UpdateNodePoolResponse o) { + opcWorkRequestId(o.getOpcWorkRequestId()); + opcRequestId(o.getOpcRequestId()); + + return this; + } + } +} diff --git a/bmc-core/pom.xml b/bmc-core/pom.xml index e0e70defb4b..f7c1b05cf1f 100644 --- a/bmc-core/pom.xml +++ b/bmc-core/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-database/pom.xml b/bmc-database/pom.xml index b405264c960..7b7d7ee03a1 100644 --- a/bmc-database/pom.xml +++ b/bmc-database/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-dns/pom.xml b/bmc-dns/pom.xml index 84e0074f8b8..11c0f62d9d4 100644 --- a/bmc-dns/pom.xml +++ b/bmc-dns/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-email/pom.xml b/bmc-email/pom.xml index 1f103d313c4..05eb5bf38d5 100644 --- a/bmc-email/pom.xml +++ b/bmc-email/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-examples/pom.xml b/bmc-examples/pom.xml index e8c7a2e3563..e6b0cda810b 100644 --- a/bmc-examples/pom.xml +++ b/bmc-examples/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -19,7 +19,7 @@ com.oracle.oci.sdk oci-java-sdk-bom - 1.2.39 + 1.2.40 pom import @@ -60,6 +60,10 @@ oci-java-sdk-objectstorage pom + + com.oracle.oci.sdk + oci-java-sdk-containerengine + diff --git a/bmc-examples/src/main/java/ContainerEngineClusterExample.java b/bmc-examples/src/main/java/ContainerEngineClusterExample.java new file mode 100644 index 00000000000..5d5d8fa8b61 --- /dev/null +++ b/bmc-examples/src/main/java/ContainerEngineClusterExample.java @@ -0,0 +1,540 @@ +/** + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + */ +import com.oracle.bmc.Region; +import com.oracle.bmc.auth.AuthenticationDetailsProvider; +import com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider; +import com.oracle.bmc.containerengine.ContainerEngineClient; +import com.oracle.bmc.containerengine.model.Cluster; +import com.oracle.bmc.containerengine.model.ClusterCreateOptions; +import com.oracle.bmc.containerengine.model.CreateClusterDetails; +import com.oracle.bmc.containerengine.model.UpdateClusterDetails; +import com.oracle.bmc.containerengine.model.WorkRequestResource; +import com.oracle.bmc.containerengine.model.WorkRequestStatus; +import com.oracle.bmc.containerengine.requests.CreateClusterRequest; +import com.oracle.bmc.containerengine.requests.DeleteClusterRequest; +import com.oracle.bmc.containerengine.requests.GetClusterOptionsRequest; +import com.oracle.bmc.containerengine.requests.GetClusterRequest; +import com.oracle.bmc.containerengine.requests.GetWorkRequestRequest; +import com.oracle.bmc.containerengine.requests.UpdateClusterRequest; +import com.oracle.bmc.containerengine.responses.CreateClusterResponse; +import com.oracle.bmc.containerengine.responses.DeleteClusterResponse; +import com.oracle.bmc.containerengine.responses.GetClusterOptionsResponse; +import com.oracle.bmc.containerengine.responses.GetClusterResponse; +import com.oracle.bmc.containerengine.responses.GetWorkRequestResponse; +import com.oracle.bmc.containerengine.responses.UpdateClusterResponse; +import com.oracle.bmc.core.VirtualNetworkClient; +import com.oracle.bmc.core.model.CreateSubnetDetails; +import com.oracle.bmc.core.model.CreateVcnDetails; +import com.oracle.bmc.core.model.Subnet; +import com.oracle.bmc.core.model.Vcn; +import com.oracle.bmc.core.requests.CreateSubnetRequest; +import com.oracle.bmc.core.requests.CreateVcnRequest; +import com.oracle.bmc.core.requests.DeleteSubnetRequest; +import com.oracle.bmc.core.requests.DeleteVcnRequest; +import com.oracle.bmc.core.requests.GetSubnetRequest; +import com.oracle.bmc.core.requests.GetVcnRequest; +import com.oracle.bmc.core.responses.CreateSubnetResponse; +import com.oracle.bmc.core.responses.CreateVcnResponse; +import com.oracle.bmc.core.responses.GetSubnetResponse; +import com.oracle.bmc.core.responses.GetVcnResponse; +import com.oracle.bmc.identity.IdentityClient; +import com.oracle.bmc.identity.model.AvailabilityDomain; +import com.oracle.bmc.identity.requests.ListAvailabilityDomainsRequest; +import com.oracle.bmc.identity.responses.ListAvailabilityDomainsResponse; + +import java.util.ArrayList; +import java.util.List; + +/** + * This class provides an example of how to create a Container Engine Cluster in the Java SDK. + * It will create a VCN and two subnets, one Container Engine cluster. + * These will be deleted at the end. The class also makes some assumptions about + * the resources it will create: + * + *

    : + *
  • The VCN created by this example will have a display name of java_sdk_oke_example_vcn
  • + *
  • The subnet created by this example will have a display name of: java_sdk_oke_example_subnet_1
  • + *
  • The subnet created by this example will have a display name of: java_sdk_oke_example_subnet_2
  • + *
  • The VCN will have a private IP CIDR block of 10.0.0.0/16
  • + *
  • The subnets will have private IP CIDR blocks of 10.0.0.0/24 and 10.0.1.0/24
  • + *
  • The cluster created will have hardcoded display names of ContanerEngineClusterExample
  • + *
  • The kubernetesVersion is hardcoded to use v1.8.11
  • + *
  • + * The configuration file used by service clients will be sourced from the default + * location (~/.oci/config) and the DEFAULT profile will be used + *
  • + *
  • Resources will be created in us-phoenix-1
  • + *
  • Resources will be created in the first AD returned from the ListAvailabilityDomains call
  • + *
      + */ +public class ContainerEngineClusterExample { + private static final String VCN_DISPLAY_NAME = "java_sdk_oke_example_vcn"; + private static final String[] SUBNET_DISPLAY_NAMES = { + "java_sdk_oke_example_subnet_1", "java_sdk_oke_example_subnet_2" + }; + private static final String CIDR_BLOCK = "10.0.0.0/16"; + private static final String[] SUBNET_CIDR_BLOCKS = {"10.0.0.0/24", "10.0.1.0/24"}; + + private static final String CONFIG_LOCATION = "~/.oci/config"; + private static final String CONFIG_PROFILE = "DEFAULT"; + + private static final String CLUSTER_DISPLAY_NAME = "ContanerEngineClusterExample"; + private static final String CLUSTER_NEW_DISPLAY_NAME = "ContanerEngineClusterExampleNew"; + + private static String clusterId = null; + + /** + * The entry point for the example. + * + * @param args Arguments to provide to the example. The following arguments are expected: + *
        + *
      • The OCID of the compartment where the Container Engine cluster and associated resources will be created
      • + *
      + */ + public static void main(String[] args) throws Exception { + if (args.length != 1) { + throw new IllegalArgumentException( + "This example expects an argument of the compartment OCID"); + } + + final String compartmentId = args[0]; + + final AuthenticationDetailsProvider provider = + new ConfigFileAuthenticationDetailsProvider(CONFIG_LOCATION, CONFIG_PROFILE); + + final ContainerEngineClient containerEngineClient = new ContainerEngineClient(provider); + final VirtualNetworkClient vcnClient = new VirtualNetworkClient(provider); + final IdentityClient identityClient = new IdentityClient(provider); + + containerEngineClient.setRegion(Region.US_PHOENIX_1); + vcnClient.setRegion(Region.US_PHOENIX_1); + identityClient.setRegion(Region.US_PHOENIX_1); + + Vcn vcn = null; + List subnets = new ArrayList(); + Cluster cluster = null; + + try { + final List availabilityDomains = + getAvailabilityDomains(identityClient, compartmentId); + final AvailabilityDomain adToUse = availabilityDomains.get(0); + + // A VCN and subnets are required to create a Container Engine Cluster + vcn = createVcn(vcnClient, compartmentId); + System.out.println("Created VCN"); + System.out.println(); + + for (int i = 0; i < 2; i++) { + Subnet subnet = + createSubnet( + vcnClient, + compartmentId, + adToUse, + vcn.getId(), + SUBNET_DISPLAY_NAMES[i], + SUBNET_CIDR_BLOCKS[i]); + subnets.add(subnet); + System.out.println("Created subnet" + i); + System.out.println(); + } + + //Create a Container Engine Cluster + List subnetIds = new ArrayList(); + for (Subnet subnet : subnets) { + subnetIds.add(subnet.getId()); + } + String kubernetesVersion = getKubernetesVersions(containerEngineClient).get(0); + System.out.println("kubernetes version: " + kubernetesVersion); + + cluster = + createCluster( + containerEngineClient, + vcn.getId(), + subnetIds, + kubernetesVersion, + compartmentId); + System.out.println("Created cluster"); + System.out.println(); + + // Update the Container Engine Cluster + updateCluster(containerEngineClient, clusterId, CLUSTER_NEW_DISPLAY_NAME); + System.out.println("Updated cluster"); + System.out.println(); + + } finally { + System.out.println("Clean Up"); + System.out.println("=========="); + + if (cluster != null) { + deleteCluster(containerEngineClient, clusterId); + System.out.println("Deleted cluster"); + } + + for (int i = 0; i < subnets.size(); i++) { + if (subnets.get(i) != null) { + deleteSubnet(vcnClient, subnets.get(i)); + System.out.println("Deleted subnet" + i); + } + } + + if (vcn != null) { + deleteVcn(vcnClient, vcn); + System.out.println("Deleted VCN"); + } + + vcnClient.close(); + identityClient.close(); + containerEngineClient.close(); + } + } + + /** + * Creates a VCN and waits for it to become available to use. + * + * @param vcnClient the service client to use to create the VCN + * @param compartmentId the OCID of the compartment where the VCN will be created + * + * @return the created VCN + * + * @throws Exception if there is an error waiting on the VCN to become available to use + */ + private static Vcn createVcn(final VirtualNetworkClient vcnClient, final String compartmentId) + throws Exception { + final CreateVcnResponse createVcnResponse = + vcnClient.createVcn( + CreateVcnRequest.builder() + .createVcnDetails( + CreateVcnDetails.builder() + .cidrBlock(CIDR_BLOCK) + .compartmentId(compartmentId) + .displayName(VCN_DISPLAY_NAME) + .build()) + .build()); + + final GetVcnResponse getVcnResponse = + vcnClient + .getWaiters() + .forVcn( + GetVcnRequest.builder() + .vcnId(createVcnResponse.getVcn().getId()) + .build(), + Vcn.LifecycleState.Available) + .execute(); + + return getVcnResponse.getVcn(); + } + + /** + * Deletes a VCN and waits for it to be deleted. + * + * @param vcnClient the service client to use to delete the VCN + * @param vcn the VCN to delete + * + * @throws Exception if there is an error waiting on the VCN to be deleted + */ + private static void deleteVcn(final VirtualNetworkClient vcnClient, final Vcn vcn) + throws Exception { + + vcnClient.deleteVcn(DeleteVcnRequest.builder().vcnId(vcn.getId()).build()); + + vcnClient + .getWaiters() + .forVcn( + GetVcnRequest.builder().vcnId(vcn.getId()).build(), + Vcn.LifecycleState.Terminated) + .execute(); + } + + /** + * Creates a subnet in a VCN and waits for the subnet to become available to use. + * + * @param vcnClient the service client to use to create the subnet + * @param compartmentId the OCID of the compartment which owns the VCN + * @param availabilityDomain the availability domain where the subnet will be created + * @param cidrBlock the cidr block used to create subnet + * @param vcnId the ID of the VCN which will own the subnet + * @param subnetName the subnet that will be created + * + * @return the created subnet + * + * @throws Exception if there is an error waiting on the subnet to become available to use + */ + private static Subnet createSubnet( + final VirtualNetworkClient vcnClient, + final String compartmentId, + final AvailabilityDomain availabilityDomain, + final String vcnId, + final String subnetName, + final String cidrBlock) + throws Exception { + + final CreateSubnetResponse createSubnetResponse = + vcnClient.createSubnet( + CreateSubnetRequest.builder() + .createSubnetDetails( + CreateSubnetDetails.builder() + .availabilityDomain(availabilityDomain.getName()) + .compartmentId(compartmentId) + .displayName(subnetName) + .cidrBlock(cidrBlock) + .vcnId(vcnId) + .build()) + .build()); + + final GetSubnetResponse getSubnetResponse = + vcnClient + .getWaiters() + .forSubnet( + GetSubnetRequest.builder() + .subnetId(createSubnetResponse.getSubnet().getId()) + .build(), + Subnet.LifecycleState.Available) + .execute(); + + return getSubnetResponse.getSubnet(); + } + + /** + * Deletes a subnet and waits for it to be deleted. + * + * @param vcnClient the service client to use to delete the subnet + * @param subnet the subnet to delete + * + * @throws Exception if there is an error waiting on the subnet to be deleted + */ + private static void deleteSubnet(final VirtualNetworkClient vcnClient, final Subnet subnet) + throws Exception { + + vcnClient.deleteSubnet(DeleteSubnetRequest.builder().subnetId(subnet.getId()).build()); + + vcnClient + .getWaiters() + .forSubnet( + GetSubnetRequest.builder().subnetId(subnet.getId()).build(), + Subnet.LifecycleState.Terminated) + .execute(); + } + + /** + * Retrieves a list of availability domains in a compartment. + * + * @param identityClient the client to use to retrieve the availability domains + * @param compartmentId the OCID of the compartment whose availability domains we're listing + * + * @return a list of all availability domains in a compartment + */ + private static List getAvailabilityDomains( + final IdentityClient identityClient, final String compartmentId) { + + ListAvailabilityDomainsResponse listAvailabilityDomainsResponse = + identityClient.listAvailabilityDomains( + ListAvailabilityDomainsRequest.builder() + .compartmentId(compartmentId) + .build()); + + return listAvailabilityDomainsResponse.getItems(); + } + + /** + * Creates a Cluster and waits for it to become active + * + * @param containerEngineClient the containerEngineclient used to create the cluster + * @param vcnId the ID of the VCN which will own the subnets + * @param subnetIds list of subnet ids + * @param kubernetesVersion kubernetesVersion + * @param compartmentId + * + * @return the created cluster + * + * @throws Exception if there is an error waiting on the cluster to become available + */ + private static Cluster createCluster( + final ContainerEngineClient containerEngineClient, + final String vcnId, + final List subnetIds, + final String kubernetesVersion, + final String compartmentId) + throws Exception { + + Cluster cluster = null; + + System.out.println("Creating Cluster"); + System.out.println("================"); + + final CreateClusterResponse createdClusterResponse = + containerEngineClient.createCluster( + CreateClusterRequest.builder() + .createClusterDetails( + CreateClusterDetails.builder() + .name(CLUSTER_DISPLAY_NAME) + .compartmentId(compartmentId) + .vcnId(vcnId) + .kubernetesVersion(kubernetesVersion) + .options( + ClusterCreateOptions.builder() + .serviceLbSubnetIds(subnetIds) + .build()) + .build()) + .build()); + + final String workRequestId = createdClusterResponse.getOpcWorkRequestId(); + System.out.println("cluster work request ID is: " + workRequestId); + System.out.println(); + + GetWorkRequestResponse workRequestResponse = + waitForWorkRequestFinished(containerEngineClient, workRequestId); + + if (isWorkRequestInSuccessState(workRequestResponse)) { + clusterId = getClusterId(workRequestResponse); + System.out.println("cluster ID is: " + clusterId); + System.out.println(); + + GetClusterResponse getResponse = + containerEngineClient.getCluster( + GetClusterRequest.builder().clusterId(clusterId).build()); + + cluster = getResponse.getCluster(); + } + return cluster; + } + + /** + * Deletes a cluster and waits for it to be deleted. + * + * @param containerEngineClient the service client to use to delete the cluster + * @param cluster the cluster to delete + * + * @throws Exception if there is an error waiting on the cluster to be deleted + */ + private static void deleteCluster(ContainerEngineClient containerEngineClient, String clusterId) + throws Exception { + + DeleteClusterResponse deleteClusterReponse = + containerEngineClient.deleteCluster( + DeleteClusterRequest.builder().clusterId(clusterId).build()); + + String workRequestId = deleteClusterReponse.getOpcWorkRequestId(); + GetWorkRequestResponse workRequestResponse = + waitForWorkRequestFinished(containerEngineClient, workRequestId); + + if (isWorkRequestInSuccessState(workRequestResponse)) { + GetClusterResponse getResponse = + containerEngineClient.getCluster( + GetClusterRequest.builder().clusterId(clusterId).build()); + System.out.println( + "Cluster lifecycle state is " + getResponse.getCluster().getLifecycleState()); + } + } + + /** + * Update a cluster and waits for it to become active + * + * @param containerEngineClient the service client to use to delete the cluster + * @param clusterId the cluster ID + * @param newClusterName The new cluster name + * + * @throws Exception if there is an error waiting on the cluster to be updated + */ + private static void updateCluster( + ContainerEngineClient containerEngineClient, String clusterId, String newClusterName) + throws Exception { + + UpdateClusterResponse updateClusterResponse = + containerEngineClient.updateCluster( + UpdateClusterRequest.builder() + .clusterId(clusterId) + .updateClusterDetails( + UpdateClusterDetails.builder().name(newClusterName).build()) + .build()); + String workRequestId = updateClusterResponse.getOpcWorkRequestId(); + GetWorkRequestResponse workRequestResponse = + waitForWorkRequestFinished(containerEngineClient, workRequestId); + + if (isWorkRequestInSuccessState(workRequestResponse)) { + GetClusterResponse getResponse = + containerEngineClient.getCluster( + GetClusterRequest.builder().clusterId(clusterId).build()); + Cluster cluster = getResponse.getCluster(); + System.out.println("Cluster name is changed to " + cluster.getName()); + } + } + + /** + * Retrieve a list of Kubernetes versions + * + * @param containerEngineClient the service client to use to retrieve Kubernetes versions + * + * @return a list of Kubernetes versions + * + * @throws Exception if there is an error while retrieving + */ + private static List getKubernetesVersions(ContainerEngineClient containerEngineClient) + throws Exception { + GetClusterOptionsResponse getResponse = + containerEngineClient.getClusterOptions( + GetClusterOptionsRequest.builder().clusterOptionId("all").build()); + return getResponse.getClusterOptions().getKubernetesVersions(); + } + + /** + * Get cluster ID + * + * @param GetWorkRequestResponse The work request response for getting cluster ID + * + * @return cluster ID + * + * @throws Exception if there is an error + */ + private static String getClusterId(GetWorkRequestResponse getWorkRequestResponse) { + String clusterId = null; + List resources = + getWorkRequestResponse.getWorkRequest().getResources(); + for (WorkRequestResource resource : resources) { + if (resource.getEntityType().equals("cluster")) { + clusterId = resource.getIdentifier(); + break; + } + } + return clusterId; + } + + /** + * Wait for a work request finished + * @param containerEngineClient the service client to use to get work request + * @param workRequestId the id of work request + * @return a work request response object + * @throws Exception If the waiter timed out. + */ + private static GetWorkRequestResponse waitForWorkRequestFinished( + final ContainerEngineClient containerEngineClient, final String workRequestId) + throws Exception { + final GetWorkRequestResponse workRequestResponse = + containerEngineClient + .getWaiters() + .forWorkRequest( + GetWorkRequestRequest.builder() + .workRequestId(workRequestId) + .build()) + .execute(); + + return workRequestResponse; + } + + /** + * Check work request in Success state + * @param containerEngineClient the service client to use to get work request + * @return boolean + * @throws Exception If there is error + */ + private static boolean isWorkRequestInSuccessState(GetWorkRequestResponse workRequestResponse) + throws Exception { + boolean inSuccessState = false; + WorkRequestStatus workRequestStatus = workRequestResponse.getWorkRequest().getStatus(); + + if (workRequestStatus == WorkRequestStatus.Succeeded) { + inSuccessState = true; + } + return inSuccessState; + } +} diff --git a/bmc-filestorage/pom.xml b/bmc-filestorage/pom.xml index b294e0f6929..5f06452f61e 100644 --- a/bmc-filestorage/pom.xml +++ b/bmc-filestorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-full/pom.xml b/bmc-full/pom.xml index 9eaa0da9d05..e707332a879 100644 --- a/bmc-full/pom.xml +++ b/bmc-full/pom.xml @@ -4,7 +4,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml oci-java-sdk-full @@ -16,7 +16,7 @@ com.oracle.oci.sdk oci-java-sdk-bom - 1.2.39 + 1.2.40 pom import @@ -64,5 +64,9 @@ oci-java-sdk-objectstorage pom + + com.oracle.oci.sdk + oci-java-sdk-containerengine + diff --git a/bmc-identity/pom.xml b/bmc-identity/pom.xml index 9fa6c833b0f..8a1f0417d33 100644 --- a/bmc-identity/pom.xml +++ b/bmc-identity/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-loadbalancer/pom.xml b/bmc-loadbalancer/pom.xml index 66ec88752bc..9dc3140cdd6 100644 --- a/bmc-loadbalancer/pom.xml +++ b/bmc-loadbalancer/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml b/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml index 3a4c871b218..a5c6aba1351 100644 --- a/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-extensions/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../../pom.xml @@ -18,12 +18,12 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 com.oracle.oci.sdk oci-java-sdk-objectstorage-generated - 1.2.39 + 1.2.40 diff --git a/bmc-objectstorage/bmc-objectstorage-generated/pom.xml b/bmc-objectstorage/bmc-objectstorage-generated/pom.xml index 14c04d8fdb2..e57fe57cbbc 100644 --- a/bmc-objectstorage/bmc-objectstorage-generated/pom.xml +++ b/bmc-objectstorage/bmc-objectstorage-generated/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../../pom.xml @@ -18,7 +18,7 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 diff --git a/bmc-objectstorage/pom.xml b/bmc-objectstorage/pom.xml index 1b4e00c787e..c242ccf1a24 100644 --- a/bmc-objectstorage/pom.xml +++ b/bmc-objectstorage/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml @@ -19,17 +19,17 @@ com.oracle.oci.sdk oci-java-sdk-common - 1.2.39 + 1.2.40 com.oracle.oci.sdk oci-java-sdk-objectstorage-generated - 1.2.39 + 1.2.40 com.oracle.oci.sdk oci-java-sdk-objectstorage-extensions - 1.2.39 + 1.2.40 diff --git a/bmc-shaded/bmc-shaded-full/pom.xml b/bmc-shaded/bmc-shaded-full/pom.xml index da848583848..92a291cc794 100644 --- a/bmc-shaded/bmc-shaded-full/pom.xml +++ b/bmc-shaded/bmc-shaded-full/pom.xml @@ -4,7 +4,7 @@ com.oracle.oci.sdk oci-java-sdk-shaded - 1.2.39 + 1.2.40 ../pom.xml oci-java-sdk-shaded-full diff --git a/bmc-shaded/pom.xml b/bmc-shaded/pom.xml index 7822cb69497..44d95db8369 100644 --- a/bmc-shaded/pom.xml +++ b/bmc-shaded/pom.xml @@ -5,7 +5,7 @@ com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 ../pom.xml diff --git a/pom.xml b/pom.xml index f47d28b7577..53bf99ca9e9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.oracle.oci.sdk oci-java-sdk - 1.2.39 + 1.2.40 pom Oracle Cloud Infrastructure SDK This project contains the SDK used for Oracle Cloud Infrastructure @@ -497,6 +497,7 @@ bmc-objectstorage/bmc-objectstorage-generated bmc-objectstorage/bmc-objectstorage-extensions bmc-objectstorage + bmc-containerengine bmc-full bmc-shaded