software.amazon.awssdk.services.outposts.DefaultOutpostsClient Maven / Gradle / Ivy
Show all versions of outposts Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.outposts;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.outposts.internal.OutpostsServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.outposts.model.AccessDeniedException;
import software.amazon.awssdk.services.outposts.model.CancelCapacityTaskRequest;
import software.amazon.awssdk.services.outposts.model.CancelCapacityTaskResponse;
import software.amazon.awssdk.services.outposts.model.CancelOrderRequest;
import software.amazon.awssdk.services.outposts.model.CancelOrderResponse;
import software.amazon.awssdk.services.outposts.model.ConflictException;
import software.amazon.awssdk.services.outposts.model.CreateOrderRequest;
import software.amazon.awssdk.services.outposts.model.CreateOrderResponse;
import software.amazon.awssdk.services.outposts.model.CreateOutpostRequest;
import software.amazon.awssdk.services.outposts.model.CreateOutpostResponse;
import software.amazon.awssdk.services.outposts.model.CreateSiteRequest;
import software.amazon.awssdk.services.outposts.model.CreateSiteResponse;
import software.amazon.awssdk.services.outposts.model.DeleteOutpostRequest;
import software.amazon.awssdk.services.outposts.model.DeleteOutpostResponse;
import software.amazon.awssdk.services.outposts.model.DeleteSiteRequest;
import software.amazon.awssdk.services.outposts.model.DeleteSiteResponse;
import software.amazon.awssdk.services.outposts.model.GetCapacityTaskRequest;
import software.amazon.awssdk.services.outposts.model.GetCapacityTaskResponse;
import software.amazon.awssdk.services.outposts.model.GetCatalogItemRequest;
import software.amazon.awssdk.services.outposts.model.GetCatalogItemResponse;
import software.amazon.awssdk.services.outposts.model.GetConnectionRequest;
import software.amazon.awssdk.services.outposts.model.GetConnectionResponse;
import software.amazon.awssdk.services.outposts.model.GetOrderRequest;
import software.amazon.awssdk.services.outposts.model.GetOrderResponse;
import software.amazon.awssdk.services.outposts.model.GetOutpostInstanceTypesRequest;
import software.amazon.awssdk.services.outposts.model.GetOutpostInstanceTypesResponse;
import software.amazon.awssdk.services.outposts.model.GetOutpostRequest;
import software.amazon.awssdk.services.outposts.model.GetOutpostResponse;
import software.amazon.awssdk.services.outposts.model.GetOutpostSupportedInstanceTypesRequest;
import software.amazon.awssdk.services.outposts.model.GetOutpostSupportedInstanceTypesResponse;
import software.amazon.awssdk.services.outposts.model.GetSiteAddressRequest;
import software.amazon.awssdk.services.outposts.model.GetSiteAddressResponse;
import software.amazon.awssdk.services.outposts.model.GetSiteRequest;
import software.amazon.awssdk.services.outposts.model.GetSiteResponse;
import software.amazon.awssdk.services.outposts.model.InternalServerException;
import software.amazon.awssdk.services.outposts.model.ListAssetsRequest;
import software.amazon.awssdk.services.outposts.model.ListAssetsResponse;
import software.amazon.awssdk.services.outposts.model.ListCapacityTasksRequest;
import software.amazon.awssdk.services.outposts.model.ListCapacityTasksResponse;
import software.amazon.awssdk.services.outposts.model.ListCatalogItemsRequest;
import software.amazon.awssdk.services.outposts.model.ListCatalogItemsResponse;
import software.amazon.awssdk.services.outposts.model.ListOrdersRequest;
import software.amazon.awssdk.services.outposts.model.ListOrdersResponse;
import software.amazon.awssdk.services.outposts.model.ListOutpostsRequest;
import software.amazon.awssdk.services.outposts.model.ListOutpostsResponse;
import software.amazon.awssdk.services.outposts.model.ListSitesRequest;
import software.amazon.awssdk.services.outposts.model.ListSitesResponse;
import software.amazon.awssdk.services.outposts.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.outposts.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.outposts.model.NotFoundException;
import software.amazon.awssdk.services.outposts.model.OutpostsException;
import software.amazon.awssdk.services.outposts.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.outposts.model.StartCapacityTaskRequest;
import software.amazon.awssdk.services.outposts.model.StartCapacityTaskResponse;
import software.amazon.awssdk.services.outposts.model.StartConnectionRequest;
import software.amazon.awssdk.services.outposts.model.StartConnectionResponse;
import software.amazon.awssdk.services.outposts.model.TagResourceRequest;
import software.amazon.awssdk.services.outposts.model.TagResourceResponse;
import software.amazon.awssdk.services.outposts.model.UntagResourceRequest;
import software.amazon.awssdk.services.outposts.model.UntagResourceResponse;
import software.amazon.awssdk.services.outposts.model.UpdateOutpostRequest;
import software.amazon.awssdk.services.outposts.model.UpdateOutpostResponse;
import software.amazon.awssdk.services.outposts.model.UpdateSiteAddressRequest;
import software.amazon.awssdk.services.outposts.model.UpdateSiteAddressResponse;
import software.amazon.awssdk.services.outposts.model.UpdateSiteRackPhysicalPropertiesRequest;
import software.amazon.awssdk.services.outposts.model.UpdateSiteRackPhysicalPropertiesResponse;
import software.amazon.awssdk.services.outposts.model.UpdateSiteRequest;
import software.amazon.awssdk.services.outposts.model.UpdateSiteResponse;
import software.amazon.awssdk.services.outposts.model.ValidationException;
import software.amazon.awssdk.services.outposts.transform.CancelCapacityTaskRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.CancelOrderRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.CreateOrderRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.CreateOutpostRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.CreateSiteRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.DeleteOutpostRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.DeleteSiteRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetCapacityTaskRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetCatalogItemRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetConnectionRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetOrderRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetOutpostInstanceTypesRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetOutpostRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetOutpostSupportedInstanceTypesRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetSiteAddressRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.GetSiteRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListAssetsRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListCapacityTasksRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListCatalogItemsRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListOrdersRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListOutpostsRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListSitesRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.StartCapacityTaskRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.StartConnectionRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.UpdateOutpostRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.UpdateSiteAddressRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.UpdateSiteRackPhysicalPropertiesRequestMarshaller;
import software.amazon.awssdk.services.outposts.transform.UpdateSiteRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link OutpostsClient}.
*
* @see OutpostsClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultOutpostsClient implements OutpostsClient {
private static final Logger log = Logger.loggerFor(DefaultOutpostsClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultOutpostsClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Cancels the capacity task.
*
*
* @param cancelCapacityTaskRequest
* @return Result of the CancelCapacityTask operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.CancelCapacityTask
* @see AWS
* API Documentation
*/
@Override
public CancelCapacityTaskResponse cancelCapacityTask(CancelCapacityTaskRequest cancelCapacityTaskRequest)
throws ValidationException, AccessDeniedException, NotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CancelCapacityTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(cancelCapacityTaskRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelCapacityTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelCapacityTask");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CancelCapacityTask").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(cancelCapacityTaskRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CancelCapacityTaskRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Cancels the specified order for an Outpost.
*
*
* @param cancelOrderRequest
* @return Result of the CancelOrder operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.CancelOrder
* @see AWS API
* Documentation
*/
@Override
public CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest) throws ValidationException, ConflictException,
AccessDeniedException, NotFoundException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CancelOrderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(cancelOrderRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelOrderRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelOrder");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CancelOrder").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(cancelOrderRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CancelOrderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates an order for an Outpost.
*
*
* @param createOrderRequest
* @return Result of the CreateOrder operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws ServiceQuotaExceededException
* You have exceeded a service quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.CreateOrder
* @see AWS API
* Documentation
*/
@Override
public CreateOrderResponse createOrder(CreateOrderRequest createOrderRequest) throws ValidationException, ConflictException,
AccessDeniedException, NotFoundException, InternalServerException, ServiceQuotaExceededException,
AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateOrderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createOrderRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createOrderRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateOrder");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateOrder").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(createOrderRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateOrderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates an Outpost.
*
*
* You can specify either an Availability one or an AZ ID.
*
*
* @param createOutpostRequest
* @return Result of the CreateOutpost operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws ServiceQuotaExceededException
* You have exceeded a service quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.CreateOutpost
* @see AWS API
* Documentation
*/
@Override
public CreateOutpostResponse createOutpost(CreateOutpostRequest createOutpostRequest) throws ValidationException,
ConflictException, NotFoundException, AccessDeniedException, InternalServerException, ServiceQuotaExceededException,
AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateOutpostResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createOutpostRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createOutpostRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateOutpost");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateOutpost").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createOutpostRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateOutpostRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a site for an Outpost.
*
*
* @param createSiteRequest
* @return Result of the CreateSite operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws ServiceQuotaExceededException
* You have exceeded a service quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.CreateSite
* @see AWS API
* Documentation
*/
@Override
public CreateSiteResponse createSite(CreateSiteRequest createSiteRequest) throws ValidationException, ConflictException,
AccessDeniedException, InternalServerException, ServiceQuotaExceededException, AwsServiceException,
SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateSiteResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSiteRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSiteRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSite");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateSite").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(createSiteRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSiteRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified Outpost.
*
*
* @param deleteOutpostRequest
* @return Result of the DeleteOutpost operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.DeleteOutpost
* @see AWS API
* Documentation
*/
@Override
public DeleteOutpostResponse deleteOutpost(DeleteOutpostRequest deleteOutpostRequest) throws ValidationException,
ConflictException, NotFoundException, AccessDeniedException, InternalServerException, AwsServiceException,
SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteOutpostResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteOutpostRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteOutpostRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteOutpost");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteOutpost").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteOutpostRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteOutpostRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified site.
*
*
* @param deleteSiteRequest
* @return Result of the DeleteSite operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.DeleteSite
* @see AWS API
* Documentation
*/
@Override
public DeleteSiteResponse deleteSite(DeleteSiteRequest deleteSiteRequest) throws ValidationException, ConflictException,
NotFoundException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteSiteResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSiteRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSiteRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSite");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteSite").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(deleteSiteRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteSiteRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets details of the specified capacity task.
*
*
* @param getCapacityTaskRequest
* @return Result of the GetCapacityTask operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetCapacityTask
* @see AWS API
* Documentation
*/
@Override
public GetCapacityTaskResponse getCapacityTask(GetCapacityTaskRequest getCapacityTaskRequest) throws ValidationException,
AccessDeniedException, NotFoundException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCapacityTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCapacityTaskRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCapacityTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCapacityTask");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCapacityTask").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getCapacityTaskRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetCapacityTaskRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about the specified catalog item.
*
*
* @param getCatalogItemRequest
* @return Result of the GetCatalogItem operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetCatalogItem
* @see AWS API
* Documentation
*/
@Override
public GetCatalogItemResponse getCatalogItem(GetCatalogItemRequest getCatalogItemRequest) throws ValidationException,
NotFoundException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCatalogItemResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCatalogItemRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCatalogItemRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCatalogItem");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCatalogItem").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getCatalogItemRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetCatalogItemRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* Amazon Web Services uses this action to install Outpost servers.
*
*
*
* Gets information about the specified connection.
*
*
* Use CloudTrail to monitor this action or Amazon Web Services managed policy for Amazon Web Services Outposts to
* secure it. For more information, see Amazon Web Services
* managed policies for Amazon Web Services Outposts and Logging Amazon Web
* Services Outposts API calls with Amazon Web Services CloudTrail in the Amazon Web Services Outposts User
* Guide.
*
*
* @param getConnectionRequest
* @return Result of the GetConnection operation returned by the service.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetConnection
* @see AWS API
* Documentation
*/
@Override
public GetConnectionResponse getConnection(GetConnectionRequest getConnectionRequest) throws AccessDeniedException,
ValidationException, NotFoundException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConnectionRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConnection");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetConnection").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about the specified order.
*
*
* @param getOrderRequest
* @return Result of the GetOrder operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetOrder
* @see AWS API
* Documentation
*/
@Override
public GetOrderResponse getOrder(GetOrderRequest getOrderRequest) throws ValidationException, NotFoundException,
InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetOrderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getOrderRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getOrderRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetOrder");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetOrder").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getOrderRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetOrderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about the specified Outpost.
*
*
* @param getOutpostRequest
* @return Result of the GetOutpost operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetOutpost
* @see AWS API
* Documentation
*/
@Override
public GetOutpostResponse getOutpost(GetOutpostRequest getOutpostRequest) throws ValidationException, NotFoundException,
AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetOutpostResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getOutpostRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getOutpostRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetOutpost");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetOutpost").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getOutpostRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetOutpostRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the instance types for the specified Outpost.
*
*
* @param getOutpostInstanceTypesRequest
* @return Result of the GetOutpostInstanceTypes operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetOutpostInstanceTypes
* @see AWS API Documentation
*/
@Override
public GetOutpostInstanceTypesResponse getOutpostInstanceTypes(GetOutpostInstanceTypesRequest getOutpostInstanceTypesRequest)
throws ValidationException, NotFoundException, AccessDeniedException, InternalServerException, AwsServiceException,
SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetOutpostInstanceTypesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getOutpostInstanceTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getOutpostInstanceTypesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetOutpostInstanceTypes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetOutpostInstanceTypes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getOutpostInstanceTypesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetOutpostInstanceTypesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the instance types that an Outpost can support in InstanceTypeCapacity
. This will generally
* include instance types that are not currently configured and therefore cannot be launched with the current
* Outpost capacity configuration.
*
*
* @param getOutpostSupportedInstanceTypesRequest
* @return Result of the GetOutpostSupportedInstanceTypes operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetOutpostSupportedInstanceTypes
* @see AWS API Documentation
*/
@Override
public GetOutpostSupportedInstanceTypesResponse getOutpostSupportedInstanceTypes(
GetOutpostSupportedInstanceTypesRequest getOutpostSupportedInstanceTypesRequest) throws ValidationException,
AccessDeniedException, NotFoundException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetOutpostSupportedInstanceTypesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getOutpostSupportedInstanceTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getOutpostSupportedInstanceTypesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetOutpostSupportedInstanceTypes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetOutpostSupportedInstanceTypes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getOutpostSupportedInstanceTypesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetOutpostSupportedInstanceTypesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about the specified Outpost site.
*
*
* @param getSiteRequest
* @return Result of the GetSite operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetSite
* @see AWS API
* Documentation
*/
@Override
public GetSiteResponse getSite(GetSiteRequest getSiteRequest) throws ValidationException, NotFoundException,
AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetSiteResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSiteRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSiteRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSite");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetSite").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getSiteRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetSiteRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the site address of the specified site.
*
*
* @param getSiteAddressRequest
* @return Result of the GetSiteAddress operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.GetSiteAddress
* @see AWS API
* Documentation
*/
@Override
public GetSiteAddressResponse getSiteAddress(GetSiteAddressRequest getSiteAddressRequest) throws ValidationException,
AccessDeniedException, NotFoundException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetSiteAddressResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSiteAddressRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSiteAddressRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSiteAddress");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetSiteAddress").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getSiteAddressRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetSiteAddressRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the hardware assets for the specified Outpost.
*
*
* Use filters to return specific results. If you specify multiple filters, the results include only the resources
* that match all of the specified filters. For a filter where you can specify multiple values, the results include
* items that match any of the values that you specify for the filter.
*
*
* @param listAssetsRequest
* @return Result of the ListAssets operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListAssets
* @see AWS API
* Documentation
*/
@Override
public ListAssetsResponse listAssets(ListAssetsRequest listAssetsRequest) throws ValidationException, AccessDeniedException,
NotFoundException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListAssetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAssetsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAssetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAssets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListAssets").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listAssetsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAssetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the capacity tasks for your Amazon Web Services account.
*
*
* Use filters to return specific results. If you specify multiple filters, the results include only the resources
* that match all of the specified filters. For a filter where you can specify multiple values, the results include
* items that match any of the values that you specify for the filter.
*
*
* @param listCapacityTasksRequest
* @return Result of the ListCapacityTasks operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListCapacityTasks
* @see AWS
* API Documentation
*/
@Override
public ListCapacityTasksResponse listCapacityTasks(ListCapacityTasksRequest listCapacityTasksRequest)
throws ValidationException, AccessDeniedException, NotFoundException, InternalServerException, AwsServiceException,
SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListCapacityTasksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCapacityTasksRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCapacityTasksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCapacityTasks");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListCapacityTasks").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listCapacityTasksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListCapacityTasksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the items in the catalog.
*
*
* Use filters to return specific results. If you specify multiple filters, the results include only the resources
* that match all of the specified filters. For a filter where you can specify multiple values, the results include
* items that match any of the values that you specify for the filter.
*
*
* @param listCatalogItemsRequest
* @return Result of the ListCatalogItems operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListCatalogItems
* @see AWS API
* Documentation
*/
@Override
public ListCatalogItemsResponse listCatalogItems(ListCatalogItemsRequest listCatalogItemsRequest) throws ValidationException,
NotFoundException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListCatalogItemsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCatalogItemsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCatalogItemsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCatalogItems");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListCatalogItems").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listCatalogItemsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListCatalogItemsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the Outpost orders for your Amazon Web Services account.
*
*
* @param listOrdersRequest
* @return Result of the ListOrders operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListOrders
* @see AWS API
* Documentation
*/
@Override
public ListOrdersResponse listOrders(ListOrdersRequest listOrdersRequest) throws ValidationException, NotFoundException,
AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListOrdersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listOrdersRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listOrdersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListOrders");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListOrders").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listOrdersRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListOrdersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the Outposts for your Amazon Web Services account.
*
*
* Use filters to return specific results. If you specify multiple filters, the results include only the resources
* that match all of the specified filters. For a filter where you can specify multiple values, the results include
* items that match any of the values that you specify for the filter.
*
*
* @param listOutpostsRequest
* @return Result of the ListOutposts operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListOutposts
* @see AWS API
* Documentation
*/
@Override
public ListOutpostsResponse listOutposts(ListOutpostsRequest listOutpostsRequest) throws ValidationException,
AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListOutpostsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listOutpostsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listOutpostsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListOutposts");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListOutposts").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listOutpostsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListOutpostsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the Outpost sites for your Amazon Web Services account. Use filters to return specific results.
*
*
* Use filters to return specific results. If you specify multiple filters, the results include only the resources
* that match all of the specified filters. For a filter where you can specify multiple values, the results include
* items that match any of the values that you specify for the filter.
*
*
* @param listSitesRequest
* @return Result of the ListSites operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListSites
* @see AWS API
* Documentation
*/
@Override
public ListSitesResponse listSites(ListSitesRequest listSitesRequest) throws ValidationException, AccessDeniedException,
InternalServerException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListSitesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSitesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listSitesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSites");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListSites").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listSitesRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListSitesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the tags for the specified resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws InternalServerException
* An internal error has occurred.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.ListTagsForResource
* @see AWS
* API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws InternalServerException, ValidationException, NotFoundException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Starts the specified capacity task. You can have one active capacity task for an order.
*
*
* @param startCapacityTaskRequest
* @return Result of the StartCapacityTask operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.StartCapacityTask
* @see AWS
* API Documentation
*/
@Override
public StartCapacityTaskResponse startCapacityTask(StartCapacityTaskRequest startCapacityTaskRequest)
throws ValidationException, AccessDeniedException, NotFoundException, InternalServerException, ConflictException,
AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartCapacityTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startCapacityTaskRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startCapacityTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartCapacityTask");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartCapacityTask").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(startCapacityTaskRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartCapacityTaskRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
*
* Amazon Web Services uses this action to install Outpost servers.
*
*
*
* Starts the connection required for Outpost server installation.
*
*
* Use CloudTrail to monitor this action or Amazon Web Services managed policy for Amazon Web Services Outposts to
* secure it. For more information, see Amazon Web Services
* managed policies for Amazon Web Services Outposts and Logging Amazon Web
* Services Outposts API calls with Amazon Web Services CloudTrail in the Amazon Web Services Outposts User
* Guide.
*
*
* @param startConnectionRequest
* @return Result of the StartConnection operation returned by the service.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.StartConnection
* @see AWS API
* Documentation
*/
@Override
public StartConnectionResponse startConnection(StartConnectionRequest startConnectionRequest) throws AccessDeniedException,
ValidationException, NotFoundException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startConnectionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartConnection");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartConnection").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(startConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds tags to the specified resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws InternalServerException
* An internal error has occurred.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws InternalServerException,
ValidationException, NotFoundException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes tags from the specified resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws InternalServerException
* An internal error has occurred.
* @throws ValidationException
* A parameter is not valid.
* @throws NotFoundException
* The specified request is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws InternalServerException,
ValidationException, NotFoundException, AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates an Outpost.
*
*
* @param updateOutpostRequest
* @return Result of the UpdateOutpost operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.UpdateOutpost
* @see AWS API
* Documentation
*/
@Override
public UpdateOutpostResponse updateOutpost(UpdateOutpostRequest updateOutpostRequest) throws ValidationException,
ConflictException, NotFoundException, AccessDeniedException, InternalServerException, AwsServiceException,
SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateOutpostResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateOutpostRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateOutpostRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateOutpost");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateOutpost").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateOutpostRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateOutpostRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified site.
*
*
* @param updateSiteRequest
* @return Result of the UpdateSite operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.UpdateSite
* @see AWS API
* Documentation
*/
@Override
public UpdateSiteResponse updateSite(UpdateSiteRequest updateSiteRequest) throws ValidationException, ConflictException,
NotFoundException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException,
OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateSiteResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSiteRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSiteRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSite");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateSite").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(updateSiteRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateSiteRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the address of the specified site.
*
*
* You can't update a site address if there is an order in progress. You must wait for the order to complete or
* cancel the order.
*
*
* You can update the operating address before you place an order at the site, or after all Outposts that belong to
* the site have been deactivated.
*
*
* @param updateSiteAddressRequest
* @return Result of the UpdateSiteAddress operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws NotFoundException
* The specified request is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.UpdateSiteAddress
* @see AWS
* API Documentation
*/
@Override
public UpdateSiteAddressResponse updateSiteAddress(UpdateSiteAddressRequest updateSiteAddressRequest)
throws ValidationException, AccessDeniedException, NotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateSiteAddressResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSiteAddressRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSiteAddressRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSiteAddress");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateSiteAddress").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateSiteAddressRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateSiteAddressRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Update the physical and logistical details for a rack at a site. For more information about hardware requirements
* for racks, see Network
* readiness checklist in the Amazon Web Services Outposts User Guide.
*
*
* To update a rack at a site with an order of IN_PROGRESS
, you must wait for the order to complete or
* cancel the order.
*
*
* @param updateSiteRackPhysicalPropertiesRequest
* @return Result of the UpdateSiteRackPhysicalProperties operation returned by the service.
* @throws ValidationException
* A parameter is not valid.
* @throws ConflictException
* Updating or deleting this resource can cause an inconsistent state.
* @throws NotFoundException
* The specified request is not valid.
* @throws AccessDeniedException
* You do not have permission to perform this operation.
* @throws InternalServerException
* An internal error has occurred.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OutpostsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OutpostsClient.UpdateSiteRackPhysicalProperties
* @see AWS API Documentation
*/
@Override
public UpdateSiteRackPhysicalPropertiesResponse updateSiteRackPhysicalProperties(
UpdateSiteRackPhysicalPropertiesRequest updateSiteRackPhysicalPropertiesRequest) throws ValidationException,
ConflictException, NotFoundException, AccessDeniedException, InternalServerException, AwsServiceException,
SdkClientException, OutpostsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateSiteRackPhysicalPropertiesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSiteRackPhysicalPropertiesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateSiteRackPhysicalPropertiesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Outposts");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSiteRackPhysicalProperties");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateSiteRackPhysicalProperties").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateSiteRackPhysicalPropertiesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateSiteRackPhysicalPropertiesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) {
ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder();
RetryMode retryMode = builder.retryMode();
if (retryMode != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode));
} else {
Consumer> configurator = builder.retryStrategyConfigurator();
if (configurator != null) {
RetryStrategy.Builder, ?> defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder();
configurator.accept(defaultBuilder);
configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build());
} else {
RetryStrategy retryStrategy = builder.retryStrategy();
if (retryStrategy != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy);
}
}
}
configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null);
}
private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) {
List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder();
if (plugins.isEmpty()) {
return configuration.build();
}
OutpostsServiceClientConfigurationBuilder serviceConfigBuilder = new OutpostsServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
updateRetryStrategyClientConfiguration(configuration);
return configuration.build();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(OutpostsException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("NotFoundException")
.exceptionBuilderSupplier(NotFoundException::builder).httpStatusCode(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException")
.exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalServerException")
.exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConflictException")
.exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ValidationException")
.exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build());
}
@Override
public final OutpostsServiceClientConfiguration serviceClientConfiguration() {
return new OutpostsServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public void close() {
clientHandler.close();
}
}