software.amazon.awssdk.services.iotfleetwise.DefaultIoTFleetWiseAsyncClient Maven / Gradle / Ivy
Show all versions of iotfleetwise 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.iotfleetwise;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
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.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
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.iotfleetwise.internal.IoTFleetWiseServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.iotfleetwise.model.AccessDeniedException;
import software.amazon.awssdk.services.iotfleetwise.model.AssociateVehicleFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.AssociateVehicleFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.BatchCreateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.BatchCreateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.BatchUpdateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.BatchUpdateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ConflictException;
import software.amazon.awssdk.services.iotfleetwise.model.CreateCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.CreateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.CreateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DecoderManifestValidationException;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DeleteVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.DisassociateVehicleFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.DisassociateVehicleFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetEncryptionConfigurationRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetEncryptionConfigurationResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetLoggingOptionsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetLoggingOptionsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetRegisterAccountStatusRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetRegisterAccountStatusResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusRequest;
import software.amazon.awssdk.services.iotfleetwise.model.GetVehicleStatusResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ImportDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ImportDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ImportSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ImportSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.InternalServerException;
import software.amazon.awssdk.services.iotfleetwise.model.InvalidNodeException;
import software.amazon.awssdk.services.iotfleetwise.model.InvalidSignalsException;
import software.amazon.awssdk.services.iotfleetwise.model.IoTFleetWiseException;
import software.amazon.awssdk.services.iotfleetwise.model.LimitExceededException;
import software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListCampaignsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestNetworkInterfacesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestSignalsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListDecoderManifestsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsForVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListFleetsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestNodesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListModelManifestsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogNodesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogNodesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListSignalCatalogsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesInFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesInFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesRequest;
import software.amazon.awssdk.services.iotfleetwise.model.ListVehiclesResponse;
import software.amazon.awssdk.services.iotfleetwise.model.PutEncryptionConfigurationRequest;
import software.amazon.awssdk.services.iotfleetwise.model.PutEncryptionConfigurationResponse;
import software.amazon.awssdk.services.iotfleetwise.model.PutLoggingOptionsRequest;
import software.amazon.awssdk.services.iotfleetwise.model.PutLoggingOptionsResponse;
import software.amazon.awssdk.services.iotfleetwise.model.RegisterAccountRequest;
import software.amazon.awssdk.services.iotfleetwise.model.RegisterAccountResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ResourceNotFoundException;
import software.amazon.awssdk.services.iotfleetwise.model.TagResourceRequest;
import software.amazon.awssdk.services.iotfleetwise.model.TagResourceResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ThrottlingException;
import software.amazon.awssdk.services.iotfleetwise.model.UntagResourceRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UntagResourceResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateCampaignRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateCampaignResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateDecoderManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateDecoderManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateFleetRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateFleetResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateModelManifestRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateModelManifestResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateSignalCatalogRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateSignalCatalogResponse;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateVehicleRequest;
import software.amazon.awssdk.services.iotfleetwise.model.UpdateVehicleResponse;
import software.amazon.awssdk.services.iotfleetwise.model.ValidationException;
import software.amazon.awssdk.services.iotfleetwise.transform.AssociateVehicleFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.BatchCreateVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.BatchUpdateVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.CreateVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DeleteVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.DisassociateVehicleFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetEncryptionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetLoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetRegisterAccountStatusRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.GetVehicleStatusRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ImportDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ImportSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListCampaignsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListDecoderManifestNetworkInterfacesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListDecoderManifestSignalsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListDecoderManifestsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListFleetsForVehicleRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListFleetsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListModelManifestNodesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListModelManifestsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListSignalCatalogNodesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListSignalCatalogsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListVehiclesInFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.ListVehiclesRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.PutEncryptionConfigurationRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.PutLoggingOptionsRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.RegisterAccountRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateCampaignRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateDecoderManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateFleetRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateModelManifestRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateSignalCatalogRequestMarshaller;
import software.amazon.awssdk.services.iotfleetwise.transform.UpdateVehicleRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link IoTFleetWiseAsyncClient}.
*
* @see IoTFleetWiseAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultIoTFleetWiseAsyncClient implements IoTFleetWiseAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultIoTFleetWiseAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultIoTFleetWiseAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Adds, or associates, a vehicle with a fleet.
*
*
* @param associateVehicleFleetRequest
* @return A Java Future containing the result of the AssociateVehicleFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.AssociateVehicleFleet
* @see AWS API Documentation
*/
@Override
public CompletableFuture associateVehicleFleet(
AssociateVehicleFleetRequest associateVehicleFleetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateVehicleFleetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateVehicleFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateVehicleFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateVehicleFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateVehicleFleet").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AssociateVehicleFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(associateVehicleFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a group, or batch, of vehicles.
*
*
*
* You must specify a decoder manifest and a vehicle model (model manifest) for each vehicle.
*
*
*
* For more information, see Create multiple
* vehicles (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param batchCreateVehicleRequest
* @return A Java Future containing the result of the BatchCreateVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.BatchCreateVehicle
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchCreateVehicle(BatchCreateVehicleRequest batchCreateVehicleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchCreateVehicleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchCreateVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchCreateVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchCreateVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchCreateVehicle").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchCreateVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchCreateVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Updates a group, or batch, of vehicles.
*
*
*
* You must specify a decoder manifest and a vehicle model (model manifest) for each vehicle.
*
*
*
* For more information, see Update multiple
* vehicles (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param batchUpdateVehicleRequest
* @return A Java Future containing the result of the BatchUpdateVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.BatchUpdateVehicle
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchUpdateVehicle(BatchUpdateVehicleRequest batchUpdateVehicleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchUpdateVehicleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchUpdateVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchUpdateVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchUpdateVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchUpdateVehicle").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchUpdateVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchUpdateVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates an orchestration of data collection rules. The Amazon Web Services IoT FleetWise Edge Agent software
* running in vehicles uses campaigns to decide how to collect and transfer data to the cloud. You create campaigns
* in the cloud. After you or your team approve campaigns, Amazon Web Services IoT FleetWise automatically deploys
* them to vehicles.
*
*
* For more information, see Collect and transfer data
* with campaigns in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param createCampaignRequest
* @return A Java Future containing the result of the CreateCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateCampaign
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createCampaign(CreateCampaignRequest createCampaignRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCampaignRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCampaignRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCampaign");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCampaign").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateCampaignRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createCampaignRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates the decoder manifest associated with a model manifest. To create a decoder manifest, the following must
* be true:
*
*
* -
*
* Every signal decoder has a unique name.
*
*
* -
*
* Each signal decoder is associated with a network interface.
*
*
* -
*
* Each network interface has a unique ID.
*
*
* -
*
* The signal decoders are specified in the model manifest.
*
*
*
*
* @param createDecoderManifestRequest
* @return A Java Future containing the result of the CreateDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - DecoderManifestValidationException The request couldn't be completed because it contains signal
* decoders with one or more validation errors.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture createDecoderManifest(
CreateDecoderManifestRequest createDecoderManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDecoderManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDecoderManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a fleet that represents a group of vehicles.
*
*
*
* You must create both a signal catalog and vehicles before you can create a fleet.
*
*
*
* For more information, see Fleets in the Amazon
* Web Services IoT FleetWise Developer Guide.
*
*
* @param createFleetRequest
* @return A Java Future containing the result of the CreateFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateFleet
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createFleet(CreateFleetRequest createFleetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFleetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateFleet").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a vehicle model (model manifest) that specifies signals (attributes, branches, sensors, and actuators).
*
*
* For more information, see Vehicle models in
* the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param createModelManifestRequest
* @return A Java Future containing the result of the CreateModelManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateModelManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture createModelManifest(
CreateModelManifestRequest createModelManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createModelManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createModelManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateModelManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateModelManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateModelManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateModelManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createModelManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a collection of standardized signals that can be reused to create vehicle models.
*
*
* @param createSignalCatalogRequest
* @return A Java Future containing the result of the CreateSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - InvalidNodeException The specified node type doesn't match the expected node type for a node. You can
* specify the node type as branch, sensor, actuator, or attribute.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateSignalCatalog
* @see AWS API Documentation
*/
@Override
public CompletableFuture createSignalCatalog(
CreateSignalCatalogRequest createSignalCatalogRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSignalCatalogRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateSignalCatalog").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a vehicle, which is an instance of a vehicle model (model manifest). Vehicles created from the same
* vehicle model consist of the same signals inherited from the vehicle model.
*
*
*
* If you have an existing Amazon Web Services IoT thing, you can use Amazon Web Services IoT FleetWise to create a
* vehicle and collect data from your thing.
*
*
*
* For more information, see Create a vehicle
* (AWS CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
* @param createVehicleRequest
* @return A Java Future containing the result of the CreateVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.CreateVehicle
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createVehicle(CreateVehicleRequest createVehicleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createVehicleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateVehicle").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a data collection campaign. Deleting a campaign suspends all data collection and removes it from any
* vehicles.
*
*
* @param deleteCampaignRequest
* @return A Java Future containing the result of the DeleteCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteCampaign
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteCampaign(DeleteCampaignRequest deleteCampaignRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCampaignRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCampaignRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCampaign");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCampaign").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteCampaignRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteCampaignRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a decoder manifest. You can't delete a decoder manifest if it has vehicles associated with it.
*
*
*
* If the decoder manifest is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200
* response with an empty body.
*
*
*
* @param deleteDecoderManifestRequest
* @return A Java Future containing the result of the DeleteDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteDecoderManifest(
DeleteDecoderManifestRequest deleteDecoderManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDecoderManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDecoderManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a fleet. Before you delete a fleet, all vehicles must be dissociated from the fleet. For more
* information, see Delete a fleet (AWS
* CLI) in the Amazon Web Services IoT FleetWise Developer Guide.
*
*
*
* If the fleet is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response with an
* empty body.
*
*
*
* @param deleteFleetRequest
* @return A Java Future containing the result of the DeleteFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteFleet
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteFleet(DeleteFleetRequest deleteFleetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFleetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteFleet").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a vehicle model (model manifest).
*
*
*
* If the vehicle model is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response
* with an empty body.
*
*
*
* @param deleteModelManifestRequest
* @return A Java Future containing the result of the DeleteModelManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteModelManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteModelManifest(
DeleteModelManifestRequest deleteModelManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteModelManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteModelManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteModelManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteModelManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteModelManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteModelManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteModelManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a signal catalog.
*
*
*
* If the signal catalog is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response
* with an empty body.
*
*
*
* @param deleteSignalCatalogRequest
* @return A Java Future containing the result of the DeleteSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteSignalCatalog
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteSignalCatalog(
DeleteSignalCatalogRequest deleteSignalCatalogRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSignalCatalogRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteSignalCatalog").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a vehicle and removes it from any campaigns.
*
*
*
* If the vehicle is successfully deleted, Amazon Web Services IoT FleetWise sends back an HTTP 200 response with an
* empty body.
*
*
*
* @param deleteVehicleRequest
* @return A Java Future containing the result of the DeleteVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DeleteVehicle
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteVehicle(DeleteVehicleRequest deleteVehicleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteVehicleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteVehicle").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Removes, or disassociates, a vehicle from a fleet. Disassociating a vehicle from a fleet doesn't delete the
* vehicle.
*
*
*
* If the vehicle is successfully dissociated from a fleet, Amazon Web Services IoT FleetWise sends back an HTTP 200
* response with an empty body.
*
*
*
* @param disassociateVehicleFleetRequest
* @return A Java Future containing the result of the DisassociateVehicleFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.DisassociateVehicleFleet
* @see AWS API Documentation
*/
@Override
public CompletableFuture disassociateVehicleFleet(
DisassociateVehicleFleetRequest disassociateVehicleFleetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateVehicleFleetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateVehicleFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateVehicleFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateVehicleFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateVehicleFleet").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DisassociateVehicleFleetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(disassociateVehicleFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a campaign.
*
*
* @param getCampaignRequest
* @return A Java Future containing the result of the GetCampaign operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetCampaign
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getCampaign(GetCampaignRequest getCampaignRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCampaignRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCampaignRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCampaign");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCampaignResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetCampaign").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetCampaignRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getCampaignRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a created decoder manifest.
*
*
* @param getDecoderManifestRequest
* @return A Java Future containing the result of the GetDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture getDecoderManifest(GetDecoderManifestRequest getDecoderManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDecoderManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDecoderManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the encryption configuration for resources and data in Amazon Web Services IoT FleetWise.
*
*
* @param getEncryptionConfigurationRequest
* @return A Java Future containing the result of the GetEncryptionConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetEncryptionConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture getEncryptionConfiguration(
GetEncryptionConfigurationRequest getEncryptionConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getEncryptionConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getEncryptionConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEncryptionConfiguration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetEncryptionConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetEncryptionConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetEncryptionConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getEncryptionConfigurationRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a fleet.
*
*
* @param getFleetRequest
* @return A Java Future containing the result of the GetFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetFleet
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getFleet(GetFleetRequest getFleetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getFleetRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getFleetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetFleet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetFleet")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetFleetRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withMetricCollector(apiCallMetricCollector).withInput(getFleetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves the logging options.
*
*
* @param getLoggingOptionsRequest
* @return A Java Future containing the result of the GetLoggingOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetLoggingOptions
* @see AWS API Documentation
*/
@Override
public CompletableFuture getLoggingOptions(GetLoggingOptionsRequest getLoggingOptionsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getLoggingOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLoggingOptionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLoggingOptions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLoggingOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLoggingOptions").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetLoggingOptionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getLoggingOptionsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a vehicle model (model manifest).
*
*
* @param getModelManifestRequest
* @return A Java Future containing the result of the GetModelManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetModelManifest
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getModelManifest(GetModelManifestRequest getModelManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getModelManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getModelManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetModelManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetModelManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetModelManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetModelManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getModelManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about the status of registering your Amazon Web Services account, IAM, and Amazon
* Timestream resources so that Amazon Web Services IoT FleetWise can transfer your vehicle data to the Amazon Web
* Services Cloud.
*
*
* For more information, including step-by-step procedures, see Setting up Amazon Web
* Services IoT FleetWise.
*
*
*
* This API operation doesn't require input parameters.
*
*
*
* @param getRegisterAccountStatusRequest
* @return A Java Future containing the result of the GetRegisterAccountStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetRegisterAccountStatus
* @see AWS API Documentation
*/
@Override
public CompletableFuture getRegisterAccountStatus(
GetRegisterAccountStatusRequest getRegisterAccountStatusRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRegisterAccountStatusRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getRegisterAccountStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRegisterAccountStatus");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetRegisterAccountStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetRegisterAccountStatus").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetRegisterAccountStatusRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getRegisterAccountStatusRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a signal catalog.
*
*
* @param getSignalCatalogRequest
* @return A Java Future containing the result of the GetSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetSignalCatalog
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getSignalCatalog(GetSignalCatalogRequest getSignalCatalogRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSignalCatalogRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetSignalCatalog").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about a vehicle.
*
*
* @param getVehicleRequest
* @return A Java Future containing the result of the GetVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetVehicle
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getVehicle(GetVehicleRequest getVehicleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getVehicleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetVehicle")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information about the status of a vehicle with any associated campaigns.
*
*
* @param getVehicleStatusRequest
* @return A Java Future containing the result of the GetVehicleStatus operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.GetVehicleStatus
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getVehicleStatus(GetVehicleStatusRequest getVehicleStatusRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getVehicleStatusRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getVehicleStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetVehicleStatus");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetVehicleStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetVehicleStatus").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetVehicleStatusRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getVehicleStatusRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a decoder manifest using your existing CAN DBC file from your local device.
*
*
* @param importDecoderManifestRequest
* @return A Java Future containing the result of the ImportDecoderManifest operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - DecoderManifestValidationException The request couldn't be completed because it contains signal
* decoders with one or more validation errors.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ImportDecoderManifest
* @see AWS API Documentation
*/
@Override
public CompletableFuture importDecoderManifest(
ImportDecoderManifestRequest importDecoderManifestRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(importDecoderManifestRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, importDecoderManifestRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportDecoderManifest");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ImportDecoderManifestResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ImportDecoderManifest").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ImportDecoderManifestRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(importDecoderManifestRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a signal catalog using your existing VSS formatted content from your local device.
*
*
* @param importSignalCatalogRequest
* @return A Java Future containing the result of the ImportSignalCatalog operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ConflictException The request has conflicting operations. This can occur if you're trying to perform
* more than one operation on the same resource at the same time.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - InvalidSignalsException The request couldn't be completed because it contains signals that aren't
* valid.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ImportSignalCatalog
* @see AWS API Documentation
*/
@Override
public CompletableFuture importSignalCatalog(
ImportSignalCatalogRequest importSignalCatalogRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(importSignalCatalogRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, importSignalCatalogRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ImportSignalCatalog");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ImportSignalCatalogResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ImportSignalCatalog").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ImportSignalCatalogRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(importSignalCatalogRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists information about created campaigns.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listCampaignsRequest
* @return A Java Future containing the result of the ListCampaigns operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListCampaigns
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listCampaigns(ListCampaignsRequest listCampaignsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCampaignsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCampaignsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCampaigns");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListCampaignsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCampaigns").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListCampaignsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listCampaignsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the network interfaces specified in a decoder manifest.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listDecoderManifestNetworkInterfacesRequest
* @return A Java Future containing the result of the ListDecoderManifestNetworkInterfaces operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifestNetworkInterfaces
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDecoderManifestNetworkInterfaces(
ListDecoderManifestNetworkInterfacesRequest listDecoderManifestNetworkInterfacesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDecoderManifestNetworkInterfacesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listDecoderManifestNetworkInterfacesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDecoderManifestNetworkInterfaces");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListDecoderManifestNetworkInterfacesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDecoderManifestNetworkInterfaces").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListDecoderManifestNetworkInterfacesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listDecoderManifestNetworkInterfacesRequest));
CompletableFuture whenCompleted = executeFuture
.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* A list of information about signal decoders specified in a decoder manifest.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listDecoderManifestSignalsRequest
* @return A Java Future containing the result of the ListDecoderManifestSignals operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceNotFoundException The resource wasn't found.
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifestSignals
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDecoderManifestSignals(
ListDecoderManifestSignalsRequest listDecoderManifestSignalsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDecoderManifestSignalsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDecoderManifestSignalsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDecoderManifestSignals");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDecoderManifestSignalsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDecoderManifestSignals").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListDecoderManifestSignalsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listDecoderManifestSignalsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists decoder manifests.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listDecoderManifestsRequest
* @return A Java Future containing the result of the ListDecoderManifests operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListDecoderManifests
* @see AWS API Documentation
*/
@Override
public CompletableFuture listDecoderManifests(
ListDecoderManifestsRequest listDecoderManifestsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDecoderManifestsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDecoderManifestsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDecoderManifests");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDecoderManifestsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDecoderManifests").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListDecoderManifestsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listDecoderManifestsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves information for each created fleet in an Amazon Web Services account.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listFleetsRequest
* @return A Java Future containing the result of the ListFleets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListFleets
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listFleets(ListFleetsRequest listFleetsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listFleetsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFleetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFleets");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListFleetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("ListFleets")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListFleetsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listFleetsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a list of IDs for all fleets that the vehicle is associated with.
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listFleetsForVehicleRequest
* @return A Java Future containing the result of the ListFleetsForVehicle operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListFleetsForVehicle
* @see AWS API Documentation
*/
@Override
public CompletableFuture listFleetsForVehicle(
ListFleetsForVehicleRequest listFleetsForVehicleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listFleetsForVehicleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listFleetsForVehicleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListFleetsForVehicle");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListFleetsForVehicleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListFleetsForVehicle").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListFleetsForVehicleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listFleetsForVehicleRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists information about nodes specified in a vehicle model (model manifest).
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listModelManifestNodesRequest
* @return A Java Future containing the result of the ListModelManifestNodes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ResourceNotFoundException The resource wasn't found.
* - LimitExceededException A service quota was exceeded.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListModelManifestNodes
* @see AWS API Documentation
*/
@Override
public CompletableFuture listModelManifestNodes(
ListModelManifestNodesRequest listModelManifestNodesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listModelManifestNodesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listModelManifestNodesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListModelManifestNodes");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListModelManifestNodesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListModelManifestNodes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListModelManifestNodesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listModelManifestNodesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Retrieves a list of vehicle models (model manifests).
*
*
*
* This API operation uses pagination. Specify the nextToken
parameter in the request to return more
* results.
*
*
*
* @param listModelManifestsRequest
* @return A Java Future containing the result of the ListModelManifests operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerException The request couldn't be completed because the server temporarily failed.
* - ThrottlingException The request couldn't be completed due to throttling.
* - ValidationException The input fails to satisfy the constraints specified by an Amazon Web Services
* service.
* - AccessDeniedException You don't have sufficient permission to perform this action.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - IoTFleetWiseException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample IoTFleetWiseAsyncClient.ListModelManifests
* @see AWS API Documentation
*/
@Override
public CompletableFuture listModelManifests(ListModelManifestsRequest listModelManifestsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listModelManifestsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listModelManifestsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "IoTFleetWise");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListModelManifests");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListModelManifestsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams