/* * Copyright 2018-2023 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 com.amazonaws.services.iotroborunner; import org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.internal.auth.*; import com.amazonaws.metrics.*; import com.amazonaws.regions.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.protocol.json.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.annotation.ThreadSafe; import com.amazonaws.client.AwsSyncClientParams; import com.amazonaws.client.builder.AdvancedConfig; import com.amazonaws.services.iotroborunner.AWSIoTRoboRunnerClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.iotroborunner.model.*; import com.amazonaws.services.iotroborunner.model.transform.*; /** * Client for accessing AWS IoT RoboRunner. All service calls made using this client are blocking, and will not return * until the service call completes. *

*

* An example service, deployed with the Octane Service creator, which will echo the string *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSIoTRoboRunnerClient extends AmazonWebServiceClient implements AWSIoTRoboRunner { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSIoTRoboRunner.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "iotroborunner"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("application/json") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.AccessDeniedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.ConflictExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.ThrottlingExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.ValidationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.ServiceQuotaExceededExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller( com.amazonaws.services.iotroborunner.model.transform.InternalServerExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.iotroborunner.model.AWSIoTRoboRunnerException.class)); public static AWSIoTRoboRunnerClientBuilder builder() { return AWSIoTRoboRunnerClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on AWS IoT RoboRunner using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSIoTRoboRunnerClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on AWS IoT RoboRunner using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSIoTRoboRunnerClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("iotroborunner.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/iotroborunner/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/iotroborunner/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *

* Grants permission to create a destination *

* * @param createDestinationRequest * @return Result of the CreateDestination operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @throws ServiceQuotaExceededException * Exception thrown if the user's AWS account has reached a service limit and the operation cannot proceed. * @sample AWSIoTRoboRunner.CreateDestination * @see AWS API Documentation */ @Override public CreateDestinationResult createDestination(CreateDestinationRequest request) { request = beforeClientExecution(request); return executeCreateDestination(request); } @SdkInternalApi final CreateDestinationResult executeCreateDestination(CreateDestinationRequest createDestinationRequest) { ExecutionContext executionContext = createExecutionContext(createDestinationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDestinationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDestination"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDestinationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to create a site *

* * @param createSiteRequest * @return Result of the CreateSite operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @throws ServiceQuotaExceededException * Exception thrown if the user's AWS account has reached a service limit and the operation cannot proceed. * @sample AWSIoTRoboRunner.CreateSite * @see AWS API * Documentation */ @Override public CreateSiteResult createSite(CreateSiteRequest request) { request = beforeClientExecution(request); return executeCreateSite(request); } @SdkInternalApi final CreateSiteResult executeCreateSite(CreateSiteRequest createSiteRequest) { ExecutionContext executionContext = createExecutionContext(createSiteRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSiteRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSite"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSiteResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to create a worker *

* * @param createWorkerRequest * @return Result of the CreateWorker operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @throws ServiceQuotaExceededException * Exception thrown if the user's AWS account has reached a service limit and the operation cannot proceed. * @sample AWSIoTRoboRunner.CreateWorker * @see AWS * API Documentation */ @Override public CreateWorkerResult createWorker(CreateWorkerRequest request) { request = beforeClientExecution(request); return executeCreateWorker(request); } @SdkInternalApi final CreateWorkerResult executeCreateWorker(CreateWorkerRequest createWorkerRequest) { ExecutionContext executionContext = createExecutionContext(createWorkerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateWorkerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createWorkerRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateWorker"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateWorkerResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to create a worker fleet *

* * @param createWorkerFleetRequest * @return Result of the CreateWorkerFleet operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @throws ServiceQuotaExceededException * Exception thrown if the user's AWS account has reached a service limit and the operation cannot proceed. * @sample AWSIoTRoboRunner.CreateWorkerFleet * @see AWS API Documentation */ @Override public CreateWorkerFleetResult createWorkerFleet(CreateWorkerFleetRequest request) { request = beforeClientExecution(request); return executeCreateWorkerFleet(request); } @SdkInternalApi final CreateWorkerFleetResult executeCreateWorkerFleet(CreateWorkerFleetRequest createWorkerFleetRequest) { ExecutionContext executionContext = createExecutionContext(createWorkerFleetRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateWorkerFleetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createWorkerFleetRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateWorkerFleet"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateWorkerFleetResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to delete a destination *

* * @param deleteDestinationRequest * @return Result of the DeleteDestination operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.DeleteDestination * @see AWS API Documentation */ @Override public DeleteDestinationResult deleteDestination(DeleteDestinationRequest request) { request = beforeClientExecution(request); return executeDeleteDestination(request); } @SdkInternalApi final DeleteDestinationResult executeDeleteDestination(DeleteDestinationRequest deleteDestinationRequest) { ExecutionContext executionContext = createExecutionContext(deleteDestinationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDestinationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDestination"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDestinationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to delete a site *

* * @param deleteSiteRequest * @return Result of the DeleteSite operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.DeleteSite * @see AWS API * Documentation */ @Override public DeleteSiteResult deleteSite(DeleteSiteRequest request) { request = beforeClientExecution(request); return executeDeleteSite(request); } @SdkInternalApi final DeleteSiteResult executeDeleteSite(DeleteSiteRequest deleteSiteRequest) { ExecutionContext executionContext = createExecutionContext(deleteSiteRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteSiteRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteSite"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteSiteResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to delete a worker *

* * @param deleteWorkerRequest * @return Result of the DeleteWorker operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.DeleteWorker * @see AWS * API Documentation */ @Override public DeleteWorkerResult deleteWorker(DeleteWorkerRequest request) { request = beforeClientExecution(request); return executeDeleteWorker(request); } @SdkInternalApi final DeleteWorkerResult executeDeleteWorker(DeleteWorkerRequest deleteWorkerRequest) { ExecutionContext executionContext = createExecutionContext(deleteWorkerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteWorkerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWorkerRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWorker"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWorkerResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to delete a worker fleet *

* * @param deleteWorkerFleetRequest * @return Result of the DeleteWorkerFleet operation returned by the service. * @throws ConflictException * Exception thrown if a resource in a create request already exists. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.DeleteWorkerFleet * @see AWS API Documentation */ @Override public DeleteWorkerFleetResult deleteWorkerFleet(DeleteWorkerFleetRequest request) { request = beforeClientExecution(request); return executeDeleteWorkerFleet(request); } @SdkInternalApi final DeleteWorkerFleetResult executeDeleteWorkerFleet(DeleteWorkerFleetRequest deleteWorkerFleetRequest) { ExecutionContext executionContext = createExecutionContext(deleteWorkerFleetRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteWorkerFleetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteWorkerFleetRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteWorkerFleet"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteWorkerFleetResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to get a destination *

* * @param getDestinationRequest * @return Result of the GetDestination operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.GetDestination * @see AWS * API Documentation */ @Override public GetDestinationResult getDestination(GetDestinationRequest request) { request = beforeClientExecution(request); return executeGetDestination(request); } @SdkInternalApi final GetDestinationResult executeGetDestination(GetDestinationRequest getDestinationRequest) { ExecutionContext executionContext = createExecutionContext(getDestinationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDestinationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDestination"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDestinationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to get a site *

* * @param getSiteRequest * @return Result of the GetSite operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.GetSite * @see AWS API * Documentation */ @Override public GetSiteResult getSite(GetSiteRequest request) { request = beforeClientExecution(request); return executeGetSite(request); } @SdkInternalApi final GetSiteResult executeGetSite(GetSiteRequest getSiteRequest) { ExecutionContext executionContext = createExecutionContext(getSiteRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSiteRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSite"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSiteResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to get a worker *

* * @param getWorkerRequest * @return Result of the GetWorker operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.GetWorker * @see AWS API * Documentation */ @Override public GetWorkerResult getWorker(GetWorkerRequest request) { request = beforeClientExecution(request); return executeGetWorker(request); } @SdkInternalApi final GetWorkerResult executeGetWorker(GetWorkerRequest getWorkerRequest) { ExecutionContext executionContext = createExecutionContext(getWorkerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetWorkerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWorkerRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWorker"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWorkerResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to get a worker fleet *

* * @param getWorkerFleetRequest * @return Result of the GetWorkerFleet operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.GetWorkerFleet * @see AWS * API Documentation */ @Override public GetWorkerFleetResult getWorkerFleet(GetWorkerFleetRequest request) { request = beforeClientExecution(request); return executeGetWorkerFleet(request); } @SdkInternalApi final GetWorkerFleetResult executeGetWorkerFleet(GetWorkerFleetRequest getWorkerFleetRequest) { ExecutionContext executionContext = createExecutionContext(getWorkerFleetRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetWorkerFleetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWorkerFleetRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWorkerFleet"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWorkerFleetResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to list destinations *

* * @param listDestinationsRequest * @return Result of the ListDestinations operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.ListDestinations * @see AWS API Documentation */ @Override public ListDestinationsResult listDestinations(ListDestinationsRequest request) { request = beforeClientExecution(request); return executeListDestinations(request); } @SdkInternalApi final ListDestinationsResult executeListDestinations(ListDestinationsRequest listDestinationsRequest) { ExecutionContext executionContext = createExecutionContext(listDestinationsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListDestinationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDestinationsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDestinations"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDestinationsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to list sites *

* * @param listSitesRequest * @return Result of the ListSites operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.ListSites * @see AWS API * Documentation */ @Override public ListSitesResult listSites(ListSitesRequest request) { request = beforeClientExecution(request); return executeListSites(request); } @SdkInternalApi final ListSitesResult executeListSites(ListSitesRequest listSitesRequest) { ExecutionContext executionContext = createExecutionContext(listSitesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListSitesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSitesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSites"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSitesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to list worker fleets *

* * @param listWorkerFleetsRequest * @return Result of the ListWorkerFleets operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.ListWorkerFleets * @see AWS API Documentation */ @Override public ListWorkerFleetsResult listWorkerFleets(ListWorkerFleetsRequest request) { request = beforeClientExecution(request); return executeListWorkerFleets(request); } @SdkInternalApi final ListWorkerFleetsResult executeListWorkerFleets(ListWorkerFleetsRequest listWorkerFleetsRequest) { ExecutionContext executionContext = createExecutionContext(listWorkerFleetsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListWorkerFleetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listWorkerFleetsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListWorkerFleets"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListWorkerFleetsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to list workers *

* * @param listWorkersRequest * @return Result of the ListWorkers operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.ListWorkers * @see AWS API * Documentation */ @Override public ListWorkersResult listWorkers(ListWorkersRequest request) { request = beforeClientExecution(request); return executeListWorkers(request); } @SdkInternalApi final ListWorkersResult executeListWorkers(ListWorkersRequest listWorkersRequest) { ExecutionContext executionContext = createExecutionContext(listWorkersRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListWorkersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listWorkersRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListWorkers"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListWorkersResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to update a destination *

* * @param updateDestinationRequest * @return Result of the UpdateDestination operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.UpdateDestination * @see AWS API Documentation */ @Override public UpdateDestinationResult updateDestination(UpdateDestinationRequest request) { request = beforeClientExecution(request); return executeUpdateDestination(request); } @SdkInternalApi final UpdateDestinationResult executeUpdateDestination(UpdateDestinationRequest updateDestinationRequest) { ExecutionContext executionContext = createExecutionContext(updateDestinationRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDestinationRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDestination"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDestinationResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to update a site *

* * @param updateSiteRequest * @return Result of the UpdateSite operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.UpdateSite * @see AWS API * Documentation */ @Override public UpdateSiteResult updateSite(UpdateSiteRequest request) { request = beforeClientExecution(request); return executeUpdateSite(request); } @SdkInternalApi final UpdateSiteResult executeUpdateSite(UpdateSiteRequest updateSiteRequest) { ExecutionContext executionContext = createExecutionContext(updateSiteRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateSiteRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSiteRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSite"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSiteResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to update a worker *

* * @param updateWorkerRequest * @return Result of the UpdateWorker operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.UpdateWorker * @see AWS * API Documentation */ @Override public UpdateWorkerResult updateWorker(UpdateWorkerRequest request) { request = beforeClientExecution(request); return executeUpdateWorker(request); } @SdkInternalApi final UpdateWorkerResult executeUpdateWorker(UpdateWorkerRequest updateWorkerRequest) { ExecutionContext executionContext = createExecutionContext(updateWorkerRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateWorkerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateWorkerRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateWorker"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateWorkerResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** *

* Grants permission to update a worker fleet *

* * @param updateWorkerFleetRequest * @return Result of the UpdateWorkerFleet operation returned by the service. * @throws AccessDeniedException * User does not have sufficient access to perform this action. * @throws ValidationException * Exception thrown if an invalid parameter is provided to an API. * @throws ResourceNotFoundException * Exception thrown if a resource referenced in the request doesn't exist. * @throws ThrottlingException * Exception thrown if the api has been called too quickly be the client. * @throws InternalServerException * Exception thrown if something goes wrong within the service. * @sample AWSIoTRoboRunner.UpdateWorkerFleet * @see AWS API Documentation */ @Override public UpdateWorkerFleetResult updateWorkerFleet(UpdateWorkerFleetRequest request) { request = beforeClientExecution(request); return executeUpdateWorkerFleet(request); } @SdkInternalApi final UpdateWorkerFleetResult executeUpdateWorkerFleet(UpdateWorkerFleetRequest updateWorkerFleetRequest) { ExecutionContext executionContext = createExecutionContext(updateWorkerFleetRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request request = null; Response response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateWorkerFleetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateWorkerFleetRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT RoboRunner"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateWorkerFleet"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateWorkerFleetResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * Returns additional metadata for a previously executed successful, request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. *

* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic * information for an executed request, you should use this method to retrieve it as soon as possible after * executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none is available. */ public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return invoke(request, responseHandler, executionContext, null, null); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private Response invoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) { executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait); } /** * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will * be ignored for this operation. **/ private Response anonymousInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext, null, null); } /** * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the * ExecutionContext beforehand. **/ private Response doInvoke(Request request, HttpResponseHandler> responseHandler, ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) { if (discoveredEndpoint != null) { request.setEndpoint(discoveredEndpoint); request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery"); } else if (uriFromEndpointTrait != null) { request.setEndpoint(uriFromEndpointTrait); } else { request.setEndpoint(endpoint); } request.setTimeOffset(timeOffset); HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } @com.amazonaws.annotation.SdkInternalApi static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() { return protocolFactory; } @Override public void shutdown() { super.shutdown(); } }