All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oracle.bmc.apigateway.ApiGatewayClient Maven / Gradle / Ivy

There is a newer version: 3.55.1
Show newest version
/**
 * Copyright (c) 2016, 2023, Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
 */
package com.oracle.bmc.apigateway;

import com.oracle.bmc.apigateway.internal.http.*;
import com.oracle.bmc.apigateway.requests.*;
import com.oracle.bmc.apigateway.responses.*;
import com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration;
import com.oracle.bmc.util.CircuitBreakerUtils;

@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20190501")
public class ApiGatewayClient implements ApiGateway {
    /**
     * Service instance for ApiGateway.
     */
    public static final com.oracle.bmc.Service SERVICE =
            com.oracle.bmc.Services.serviceBuilder()
                    .serviceName("APIGATEWAY")
                    .serviceEndpointPrefix("")
                    .serviceEndpointTemplate("https://apigateway.{region}.oci.{secondLevelDomain}")
                    .build();
    // 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 static final org.slf4j.Logger LOG =
            org.slf4j.LoggerFactory.getLogger(ApiGatewayClient.class);

    com.oracle.bmc.http.internal.RestClient getClient() {
        return client;
    }

    private final ApiGatewayWaiters waiters;

    private final ApiGatewayPaginators paginators;
    private final com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider
            authenticationDetailsProvider;
    private final com.oracle.bmc.retrier.RetryConfiguration retryConfiguration;
    private final org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy
            apacheConnectionClosingStrategy;
    private final com.oracle.bmc.http.internal.RestClientFactory restClientFactory;
    private final com.oracle.bmc.http.signing.RequestSignerFactory defaultRequestSignerFactory;
    private final java.util.Map<
                    com.oracle.bmc.http.signing.SigningStrategy,
                    com.oracle.bmc.http.signing.RequestSignerFactory>
            signingStrategyRequestSignerFactories;
    private final boolean isNonBufferingApacheClient;
    private final com.oracle.bmc.ClientConfiguration clientConfigurationToUse;
    private final com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration
            circuitBreakerConfiguration;

    /**
     * Used to synchronize any updates on the `this.client` object.
     */
    private final Object clientUpdate = new Object();

    /**
     * Stores the actual client object used to make the API calls.
     * Note: This object can get refreshed periodically, hence it's important to keep any updates synchronized.
     *       For any writes to the object, please synchronize on `this.clientUpdate`.
     */
    private volatile com.oracle.bmc.http.internal.RestClient client;

    /**
     * Keeps track of the last endpoint that was assigned to the client, which in turn can be used when the client is refreshed.
     * Note: Always synchronize on `this.clientUpdate` when reading/writing this field.
     */
    private volatile String overrideEndpoint = null;

    /**
     * Creates a new service instance using the given authentication provider.
     * @param authenticationDetailsProvider The authentication details provider, required.
     */
    public ApiGatewayClient(
            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 ApiGatewayClient(
            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 ApiGatewayClient(
            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 ApiGatewayClient( 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 ApiGatewayClient( 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 ApiGatewayClient( 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 ApiGatewayClient( 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, configuration, clientConfigurator, defaultRequestSignerFactory, signingStrategyRequestSignerFactories, additionalClientConfigurators, endpoint, 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 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}) * @param executorService ExecutorService used by the client, or null to use the default configured ThreadPoolExecutor */ public ApiGatewayClient( 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, java.util.concurrent.ExecutorService executorService) { this( authenticationDetailsProvider, configuration, clientConfigurator, defaultRequestSignerFactory, signingStrategyRequestSignerFactories, additionalClientConfigurators, endpoint, executorService, com.oracle.bmc.http.internal.RestClientFactoryBuilder.builder()); } /** * 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. * Use the {@link Builder} to get access to all these parameters. * * @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}) * @param executorService ExecutorService used by the client, or null to use the default configured ThreadPoolExecutor * @param restClientFactoryBuilder the builder for the {@link com.oracle.bmc.http.internal.RestClientFactory} */ protected ApiGatewayClient( 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, java.util.concurrent.ExecutorService executorService, com.oracle.bmc.http.internal.RestClientFactoryBuilder restClientFactoryBuilder) { this.authenticationDetailsProvider = authenticationDetailsProvider; java.util.List authenticationDetailsConfigurators = new java.util.ArrayList<>(); if (this.authenticationDetailsProvider instanceof com.oracle.bmc.auth.ProvidesClientConfigurators) { authenticationDetailsConfigurators.addAll( ((com.oracle.bmc.auth.ProvidesClientConfigurators) this.authenticationDetailsProvider) .getClientConfigurators()); } java.util.List allConfigurators = new java.util.ArrayList<>(additionalClientConfigurators); allConfigurators.addAll(authenticationDetailsConfigurators); this.restClientFactory = restClientFactoryBuilder .clientConfigurator(clientConfigurator) .additionalClientConfigurators(allConfigurators) .build(); this.isNonBufferingApacheClient = com.oracle.bmc.http.ApacheUtils.isNonBufferingClientConfigurator( this.restClientFactory.getClientConfigurator()); this.apacheConnectionClosingStrategy = com.oracle.bmc.http.ApacheUtils.getApacheConnectionClosingStrategy( restClientFactory.getClientConfigurator()); this.clientConfigurationToUse = (configuration != null) ? configuration : com.oracle.bmc.ClientConfiguration.builder().build(); this.defaultRequestSignerFactory = defaultRequestSignerFactory; this.signingStrategyRequestSignerFactories = signingStrategyRequestSignerFactories; this.retryConfiguration = clientConfigurationToUse.getRetryConfiguration(); final com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration userCircuitBreakerConfiguration = CircuitBreakerUtils.getUserDefinedCircuitBreakerConfiguration( configuration); if (userCircuitBreakerConfiguration == null) { this.circuitBreakerConfiguration = CircuitBreakerUtils.DEFAULT_CIRCUIT_BREAKER_CONFIGURATION; } else { this.circuitBreakerConfiguration = userCircuitBreakerConfiguration; } this.refreshClient(); if (executorService == null) { // up to 50 (core) threads, time out after 60s idle, all daemon java.util.concurrent.ThreadPoolExecutor threadPoolExecutor = new java.util.concurrent.ThreadPoolExecutor( 50, 50, 60L, java.util.concurrent.TimeUnit.SECONDS, new java.util.concurrent.LinkedBlockingQueue(), com.oracle.bmc.internal.ClientThreadFactory.builder() .isDaemon(true) .nameFormat("ApiGateway-waiters-%d") .build()); threadPoolExecutor.allowCoreThreadTimeOut(true); executorService = threadPoolExecutor; } this.waiters = new ApiGatewayWaiters(executorService, this); this.paginators = new ApiGatewayPaginators(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)} method. */ public static class Builder extends com.oracle.bmc.common.RegionalClientBuilder { private java.util.concurrent.ExecutorService executorService; 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); } /** * Set the ExecutorService for the client to be created. * @param executorService executorService * @return this builder */ public Builder executorService(java.util.concurrent.ExecutorService executorService) { this.executorService = executorService; return this; } /** * Build the client. * @param authenticationDetailsProvider authentication details provider * @return the client */ public ApiGatewayClient build( @javax.annotation.Nonnull com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider authenticationDetailsProvider) { if (authenticationDetailsProvider == null) { throw new NullPointerException( "authenticationDetailsProvider is marked non-null but is null"); } return new ApiGatewayClient( authenticationDetailsProvider, configuration, clientConfigurator, requestSignerFactory, signingStrategyRequestSignerFactories, additionalClientConfigurators, endpoint, executorService); } } @Override public void refreshClient() { LOG.info("Refreshing client '{}'.", this.client != null ? this.client.getClass() : null); com.oracle.bmc.http.signing.RequestSigner defaultRequestSigner = this.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, this.signingStrategyRequestSignerFactories .get(s) .createRequestSigner(SERVICE, this.authenticationDetailsProvider)); } } com.oracle.bmc.http.internal.RestClient refreshedClient = this.restClientFactory.create( defaultRequestSigner, requestSigners, this.clientConfigurationToUse, this.isNonBufferingApacheClient, null, this.circuitBreakerConfiguration); synchronized (clientUpdate) { if (this.overrideEndpoint != null) { refreshedClient.setEndpoint(this.overrideEndpoint); } this.client = refreshedClient; } LOG.info("Refreshed client '{}'.", this.client != null ? this.client.getClass() : null); } @Override public void setEndpoint(String endpoint) { LOG.info("Setting endpoint to {}", endpoint); synchronized (clientUpdate) { this.overrideEndpoint = endpoint; client.setEndpoint(endpoint); } } @Override public String getEndpoint() { String endpoint = null; java.net.URI uri = client.getBaseTarget().getUri(); if (uri != null) { endpoint = uri.toString(); } return endpoint; } @Override public void setRegion(com.oracle.bmc.Region region) { java.util.Optional endpoint = com.oracle.bmc.internal.GuavaUtils.adaptFromGuava(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(java.util.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 ChangeApiCompartmentResponse changeApiCompartment(ChangeApiCompartmentRequest request) { LOG.trace("Called changeApiCompartment"); final ChangeApiCompartmentRequest interceptedRequest = ChangeApiCompartmentConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ChangeApiCompartmentConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "ChangeApiCompartment", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Api/ChangeApiCompartment"); java.util.function.Function transformer = ChangeApiCompartmentConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest.getChangeApiCompartmentDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public ChangeCertificateCompartmentResponse changeCertificateCompartment( ChangeCertificateCompartmentRequest request) { LOG.trace("Called changeCertificateCompartment"); final ChangeCertificateCompartmentRequest interceptedRequest = ChangeCertificateCompartmentConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ChangeCertificateCompartmentConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "ChangeCertificateCompartment", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Certificate/ChangeCertificateCompartment"); java.util.function.Function transformer = ChangeCertificateCompartmentConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest .getChangeCertificateCompartmentDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public CreateApiResponse createApi(CreateApiRequest request) { LOG.trace("Called createApi"); final CreateApiRequest interceptedRequest = CreateApiConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateApiConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "CreateApi", ib.getRequestUri().toString(), ""); java.util.function.Function transformer = CreateApiConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest.getCreateApiDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public CreateCertificateResponse createCertificate(CreateCertificateRequest request) { LOG.trace("Called createCertificate"); final CreateCertificateRequest interceptedRequest = CreateCertificateConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateCertificateConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "CreateCertificate", ib.getRequestUri().toString(), ""); java.util.function.Function transformer = CreateCertificateConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest.getCreateCertificateDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public CreateSdkResponse createSdk(CreateSdkRequest request) { LOG.trace("Called createSdk"); final CreateSdkRequest interceptedRequest = CreateSdkConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = CreateSdkConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryTokenUtils.addRetryToken(ib); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "CreateSdk", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Sdk/CreateSdk"); java.util.function.Function transformer = CreateSdkConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.post( ib, retriedRequest.getCreateSdkDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public DeleteApiResponse deleteApi(DeleteApiRequest request) { LOG.trace("Called deleteApi"); final DeleteApiRequest interceptedRequest = DeleteApiConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = DeleteApiConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "DeleteApi", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Api/DeleteApi"); java.util.function.Function transformer = DeleteApiConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.delete(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public DeleteCertificateResponse deleteCertificate(DeleteCertificateRequest request) { LOG.trace("Called deleteCertificate"); final DeleteCertificateRequest interceptedRequest = DeleteCertificateConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = DeleteCertificateConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "DeleteCertificate", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Certificate/DeleteCertificate"); java.util.function.Function transformer = DeleteCertificateConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.delete(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public DeleteSdkResponse deleteSdk(DeleteSdkRequest request) { LOG.trace("Called deleteSdk"); final DeleteSdkRequest interceptedRequest = DeleteSdkConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = DeleteSdkConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "DeleteSdk", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Sdk/DeleteSdk"); java.util.function.Function transformer = DeleteSdkConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.delete(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetApiResponse getApi(GetApiRequest request) { LOG.trace("Called getApi"); final GetApiRequest interceptedRequest = GetApiConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetApiConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "GetApi", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Api/GetApi"); java.util.function.Function transformer = GetApiConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetApiContentResponse getApiContent(GetApiContentRequest request) { LOG.trace("Called getApiContent"); if (com.oracle.bmc.http.ApacheUtils.isExtraStreamLogsEnabled()) { LOG.warn( "getApiContent returns a stream, please make sure to close the stream to avoid any indefinite hangs"); if (this.apacheConnectionClosingStrategy != null) { LOG.warn( "ApacheConnectionClosingStrategy set to {}. For large streams with partial reads of stream, please use ImmediateClosingStrategy. " + "For small streams with partial reads of stream, please use GracefulClosingStrategy. More info in ApacheConnectorProperties", this.apacheConnectionClosingStrategy); } } final GetApiContentRequest interceptedRequest = GetApiContentConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetApiContentConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "GetApiContent", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Api/GetApiContent"); java.util.function.Function transformer = GetApiContentConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetApiDeploymentSpecificationResponse getApiDeploymentSpecification( GetApiDeploymentSpecificationRequest request) { LOG.trace("Called getApiDeploymentSpecification"); final GetApiDeploymentSpecificationRequest interceptedRequest = GetApiDeploymentSpecificationConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetApiDeploymentSpecificationConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "GetApiDeploymentSpecification", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/ApiSpecification/GetApiDeploymentSpecification"); java.util.function.Function< javax.ws.rs.core.Response, GetApiDeploymentSpecificationResponse> transformer = GetApiDeploymentSpecificationConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetApiValidationsResponse getApiValidations(GetApiValidationsRequest request) { LOG.trace("Called getApiValidations"); final GetApiValidationsRequest interceptedRequest = GetApiValidationsConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetApiValidationsConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "GetApiValidations", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/ApiValidations/GetApiValidations"); java.util.function.Function transformer = GetApiValidationsConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetCertificateResponse getCertificate(GetCertificateRequest request) { LOG.trace("Called getCertificate"); final GetCertificateRequest interceptedRequest = GetCertificateConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetCertificateConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "GetCertificate", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Certificate/GetCertificate"); java.util.function.Function transformer = GetCertificateConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public GetSdkResponse getSdk(GetSdkRequest request) { LOG.trace("Called getSdk"); final GetSdkRequest interceptedRequest = GetSdkConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = GetSdkConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "GetSdk", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Sdk/GetSdk"); java.util.function.Function transformer = GetSdkConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListApisResponse listApis(ListApisRequest request) { LOG.trace("Called listApis"); final ListApisRequest interceptedRequest = ListApisConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListApisConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "ListApis", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Api/ListApis"); java.util.function.Function transformer = ListApisConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListCertificatesResponse listCertificates(ListCertificatesRequest request) { LOG.trace("Called listCertificates"); final ListCertificatesRequest interceptedRequest = ListCertificatesConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListCertificatesConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "ListCertificates", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Certificate/ListCertificates"); java.util.function.Function transformer = ListCertificatesConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListSdkLanguageTypesResponse listSdkLanguageTypes(ListSdkLanguageTypesRequest request) { LOG.trace("Called listSdkLanguageTypes"); final ListSdkLanguageTypesRequest interceptedRequest = ListSdkLanguageTypesConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListSdkLanguageTypesConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "ListSdkLanguageTypes", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/SdkLanguageTypeSummary/ListSdkLanguageTypes"); java.util.function.Function transformer = ListSdkLanguageTypesConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public ListSdksResponse listSdks(ListSdksRequest request) { LOG.trace("Called listSdks"); final ListSdksRequest interceptedRequest = ListSdksConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = ListSdksConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, true); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "ListSdks", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Sdk/ListSdks"); java.util.function.Function transformer = ListSdksConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.get(ib, retriedRequest); return transformer.apply(response); }); }); } @Override public UpdateApiResponse updateApi(UpdateApiRequest request) { LOG.trace("Called updateApi"); final UpdateApiRequest interceptedRequest = UpdateApiConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = UpdateApiConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "UpdateApi", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Api/UpdateApi"); java.util.function.Function transformer = UpdateApiConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.put( ib, retriedRequest.getUpdateApiDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public UpdateCertificateResponse updateCertificate(UpdateCertificateRequest request) { LOG.trace("Called updateCertificate"); final UpdateCertificateRequest interceptedRequest = UpdateCertificateConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = UpdateCertificateConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "UpdateCertificate", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Certificate/UpdateCertificate"); java.util.function.Function transformer = UpdateCertificateConverter.fromResponse( java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.put( ib, retriedRequest.getUpdateCertificateDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public UpdateSdkResponse updateSdk(UpdateSdkRequest request) { LOG.trace("Called updateSdk"); final UpdateSdkRequest interceptedRequest = UpdateSdkConverter.interceptRequest(request); com.oracle.bmc.http.internal.WrappedInvocationBuilder ib = UpdateSdkConverter.fromRequest(client, interceptedRequest); final com.oracle.bmc.retrier.BmcGenericRetrier retrier = com.oracle.bmc.retrier.Retriers.createPreferredRetrier( interceptedRequest.getRetryConfiguration(), retryConfiguration, false); com.oracle.bmc.http.internal.RetryUtils.setClientRetriesHeader(ib, retrier); com.oracle.bmc.ServiceDetails serviceDetails = new com.oracle.bmc.ServiceDetails( "ApiGateway", "UpdateSdk", ib.getRequestUri().toString(), "https://docs.oracle.com/iaas/api/#/en/api-gateway/20190501/Sdk/UpdateSdk"); java.util.function.Function transformer = UpdateSdkConverter.fromResponse(java.util.Optional.of(serviceDetails)); return retrier.execute( interceptedRequest, retryRequest -> { final com.oracle.bmc.retrier.TokenRefreshRetrier tokenRefreshRetrier = new com.oracle.bmc.retrier.TokenRefreshRetrier( authenticationDetailsProvider); return tokenRefreshRetrier.execute( retryRequest, retriedRequest -> { javax.ws.rs.core.Response response = client.put( ib, retriedRequest.getUpdateSdkDetails(), retriedRequest); return transformer.apply(response); }); }); } @Override public ApiGatewayWaiters getWaiters() { return waiters; } @Override public ApiGatewayPaginators getPaginators() { return paginators; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy