/* * Copyright 2012-2017 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.iot; 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.services.iot.AWSIotClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.iot.model.*; import com.amazonaws.services.iot.model.transform.*; /** * Client for accessing AWS IoT. All service calls made using this client are blocking, and will not return until the * service call completes. * <p> * <fullname>AWS IoT</fullname> * <p> * AWS IoT provides secure, bi-directional communication between Internet-connected things (such as sensors, actuators, * embedded devices, or smart appliances) and the AWS cloud. You can discover your custom IoT-Data endpoint to * communicate with, configure rules for data processing and integration with other services, organize resources * associated with each thing (Thing Registry), configure logging, and create and manage policies and credentials to * authenticate things. * </p> * <p> * For more information about how AWS IoT works, see the <a * href="http://docs.aws.amazon.com/iot/latest/developerguide/aws-iot-how-it-works.html">Developer Guide</a>. * </p> */ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSIotClient extends AmazonWebServiceClient implements AWSIot { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSIot.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "execute-api"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalFailureException").withModeledClass( com.amazonaws.services.iot.model.InternalFailureException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("DeleteConflictException").withModeledClass( com.amazonaws.services.iot.model.DeleteConflictException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidRequestException").withModeledClass( com.amazonaws.services.iot.model.InvalidRequestException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CertificateConflictException").withModeledClass( com.amazonaws.services.iot.model.CertificateConflictException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("RegistrationCodeValidationException").withModeledClass( com.amazonaws.services.iot.model.RegistrationCodeValidationException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withModeledClass( com.amazonaws.services.iot.model.ThrottlingException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("UnauthorizedException").withModeledClass( com.amazonaws.services.iot.model.UnauthorizedException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withModeledClass( com.amazonaws.services.iot.model.LimitExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CertificateStateException").withModeledClass( com.amazonaws.services.iot.model.CertificateStateException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("TransferAlreadyCompletedException").withModeledClass( com.amazonaws.services.iot.model.TransferAlreadyCompletedException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("VersionConflictException").withModeledClass( com.amazonaws.services.iot.model.VersionConflictException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withModeledClass( com.amazonaws.services.iot.model.ResourceNotFoundException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("SqlParseException").withModeledClass( com.amazonaws.services.iot.model.SqlParseException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("MalformedPolicyException").withModeledClass( com.amazonaws.services.iot.model.MalformedPolicyException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ServiceUnavailableException").withModeledClass( com.amazonaws.services.iot.model.ServiceUnavailableException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CertificateValidationException").withModeledClass( com.amazonaws.services.iot.model.CertificateValidationException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceAlreadyExistsException").withModeledClass( com.amazonaws.services.iot.model.ResourceAlreadyExistsException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalException").withModeledClass( com.amazonaws.services.iot.model.InternalException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("VersionsLimitExceededException").withModeledClass( com.amazonaws.services.iot.model.VersionsLimitExceededException.class)) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("TransferConflictException").withModeledClass( com.amazonaws.services.iot.model.TransferConflictException.class)) .withBaseServiceExceptionClass(com.amazonaws.services.iot.model.AWSIotException.class)); /** * Constructs a new client to invoke service methods on AWS IoT. A credentials provider chain will be used that * searches for credentials in this order: * <ul> * <li>Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY</li> * <li>Java System Properties - aws.accessKeyId and aws.secretKey</li> * <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li> * </ul> * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @see DefaultAWSCredentialsProviderChain * @deprecated use {@link AWSIotClientBuilder#defaultClient()} */ @Deprecated public AWSIotClient() { this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on AWS IoT. A credentials provider chain will be used that * searches for credentials in this order: * <ul> * <li>Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY</li> * <li>Java System Properties - aws.accessKeyId and aws.secretKey</li> * <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li> * </ul> * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientConfiguration * The client configuration options controlling how this client connects to AWS IoT (ex: proxy settings, * retry counts, etc.). * * @see DefaultAWSCredentialsProviderChain * @deprecated use {@link AWSIotClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSIotClient(ClientConfiguration clientConfiguration) { this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration); } /** * Constructs a new client to invoke service methods on AWS IoT using the specified AWS account credentials. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @deprecated use {@link AWSIotClientBuilder#withCredentials(AWSCredentialsProvider)} for example: * {@code AWSIotClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();} */ @Deprecated public AWSIotClient(AWSCredentials awsCredentials) { this(awsCredentials, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on AWS IoT using the specified AWS account credentials and * client configuration options. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to AWS IoT (ex: proxy settings, * retry counts, etc.). * @deprecated use {@link AWSIotClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSIotClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSIotClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials); init(); } /** * Constructs a new client to invoke service methods on AWS IoT using the specified AWS account credentials * provider. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @deprecated use {@link AWSIotClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on AWS IoT using the specified AWS account credentials provider * and client configuration options. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to AWS IoT (ex: proxy settings, * retry counts, etc.). * @deprecated use {@link AWSIotClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSIotClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, null); } /** * Constructs a new client to invoke service methods on AWS IoT using the specified AWS account credentials * provider, client configuration options, and request metric collector. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to AWS IoT (ex: proxy settings, * retry counts, etc.). * @param requestMetricCollector * optional request metric collector * @deprecated use {@link AWSIotClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSIotClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSIotClientBuilder#withMetricsCollector(RequestMetricCollector)} */ @Deprecated public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(clientConfiguration, requestMetricCollector); this.awsCredentialsProvider = awsCredentialsProvider; init(); } public static AWSIotClientBuilder builder() { return AWSIotClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on AWS IoT using the specified parameters. * * <p> * 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. */ AWSIotClient(AwsSyncClientParams clientParams) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("https://iot.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/iot/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/iot/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** * <p> * Accepts a pending certificate transfer. The default state of the certificate is INACTIVE. * </p> * <p> * To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate your certificates. * </p> * * @param acceptCertificateTransferRequest * The input for the AcceptCertificateTransfer operation. * @return Result of the AcceptCertificateTransfer operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws TransferAlreadyCompletedException * You can't revert the certificate transfer because the transfer is already complete. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.AcceptCertificateTransfer */ @Override public AcceptCertificateTransferResult acceptCertificateTransfer(AcceptCertificateTransferRequest request) { request = beforeClientExecution(request); return executeAcceptCertificateTransfer(request); } @SdkInternalApi final AcceptCertificateTransferResult executeAcceptCertificateTransfer(AcceptCertificateTransferRequest acceptCertificateTransferRequest) { ExecutionContext executionContext = createExecutionContext(acceptCertificateTransferRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<AcceptCertificateTransferRequest> request = null; Response<AcceptCertificateTransferResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AcceptCertificateTransferRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(acceptCertificateTransferRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<AcceptCertificateTransferResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AcceptCertificateTransferResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Attaches the specified policy to the specified principal (certificate or other credential). * </p> * * @param attachPrincipalPolicyRequest * The input for the AttachPrincipalPolicy operation. * @return Result of the AttachPrincipalPolicy operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws LimitExceededException * The number of attached entities exceeds the limit. * @sample AWSIot.AttachPrincipalPolicy */ @Override public AttachPrincipalPolicyResult attachPrincipalPolicy(AttachPrincipalPolicyRequest request) { request = beforeClientExecution(request); return executeAttachPrincipalPolicy(request); } @SdkInternalApi final AttachPrincipalPolicyResult executeAttachPrincipalPolicy(AttachPrincipalPolicyRequest attachPrincipalPolicyRequest) { ExecutionContext executionContext = createExecutionContext(attachPrincipalPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<AttachPrincipalPolicyRequest> request = null; Response<AttachPrincipalPolicyResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AttachPrincipalPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(attachPrincipalPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<AttachPrincipalPolicyResult>> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AttachPrincipalPolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Attaches the specified principal to the specified thing. * </p> * * @param attachThingPrincipalRequest * The input for the AttachThingPrincipal operation. * @return Result of the AttachThingPrincipal operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.AttachThingPrincipal */ @Override public AttachThingPrincipalResult attachThingPrincipal(AttachThingPrincipalRequest request) { request = beforeClientExecution(request); return executeAttachThingPrincipal(request); } @SdkInternalApi final AttachThingPrincipalResult executeAttachThingPrincipal(AttachThingPrincipalRequest attachThingPrincipalRequest) { ExecutionContext executionContext = createExecutionContext(attachThingPrincipalRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<AttachThingPrincipalRequest> request = null; Response<AttachThingPrincipalResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AttachThingPrincipalRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(attachThingPrincipalRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<AttachThingPrincipalResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AttachThingPrincipalResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Cancels a pending transfer for the specified certificate. * </p> * <p> * <b>Note</b> Only the transfer source account can use this operation to cancel a transfer. (Transfer destinations * can use <a>RejectCertificateTransfer</a> instead.) After transfer, AWS IoT returns the certificate to the source * account in the INACTIVE state. After the destination account has accepted the transfer, the transfer cannot be * cancelled. * </p> * <p> * After a certificate transfer is cancelled, the status of the certificate changes from PENDING_TRANSFER to * INACTIVE. * </p> * * @param cancelCertificateTransferRequest * The input for the CancelCertificateTransfer operation. * @return Result of the CancelCertificateTransfer operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws TransferAlreadyCompletedException * You can't revert the certificate transfer because the transfer is already complete. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.CancelCertificateTransfer */ @Override public CancelCertificateTransferResult cancelCertificateTransfer(CancelCertificateTransferRequest request) { request = beforeClientExecution(request); return executeCancelCertificateTransfer(request); } @SdkInternalApi final CancelCertificateTransferResult executeCancelCertificateTransfer(CancelCertificateTransferRequest cancelCertificateTransferRequest) { ExecutionContext executionContext = createExecutionContext(cancelCertificateTransferRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CancelCertificateTransferRequest> request = null; Response<CancelCertificateTransferResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CancelCertificateTransferRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(cancelCertificateTransferRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CancelCertificateTransferResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CancelCertificateTransferResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates an X.509 certificate using the specified certificate signing request. * </p> * <p> * <b>Note</b> Reusing the same certificate signing request (CSR) results in a distinct certificate. * </p> * <p> * You can create multiple certificates in a batch by creating a directory, copying multiple .csr files into that * directory, and then specifying that directory on the command line. The following commands show how to create a * batch of certificates given a batch of CSRs. * </p> * <p> * Assuming a set of CSRs are located inside of the directory my-csr-directory: * </p> * <p> * On Linux and OS X, the command is: * </p> * <p> * $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request * file://my-csr-directory/{} * </p> * <p> * This command lists all of the CSRs in my-csr-directory and pipes each CSR file name to the aws iot * create-certificate-from-csr AWS CLI command to create a certificate for the corresponding CSR. * </p> * <p> * The aws iot create-certificate-from-csr part of the command can also be run in parallel to speed up the * certificate creation process: * </p> * <p> * $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request * file://my-csr-directory/{} * </p> * <p> * On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory is: * </p> * <p> * > ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request * file://my-csr-directory/$_} * </p> * <p> * On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory is: * </p> * <p> * > forfiles /p my-csr-directory /c * "cmd /c aws iot create-certificate-from-csr --certificate-signing-request file://@path" * </p> * * @param createCertificateFromCsrRequest * The input for the CreateCertificateFromCsr operation. * @return Result of the CreateCertificateFromCsr operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.CreateCertificateFromCsr */ @Override public CreateCertificateFromCsrResult createCertificateFromCsr(CreateCertificateFromCsrRequest request) { request = beforeClientExecution(request); return executeCreateCertificateFromCsr(request); } @SdkInternalApi final CreateCertificateFromCsrResult executeCreateCertificateFromCsr(CreateCertificateFromCsrRequest createCertificateFromCsrRequest) { ExecutionContext executionContext = createExecutionContext(createCertificateFromCsrRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreateCertificateFromCsrRequest> request = null; Response<CreateCertificateFromCsrResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateCertificateFromCsrRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(createCertificateFromCsrRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreateCertificateFromCsrResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCertificateFromCsrResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public key. * </p> * <p> * <b>Note</b> This is the only time AWS IoT issues the private key for this certificate, so it is important to keep * it in a secure location. * </p> * * @param createKeysAndCertificateRequest * The input for the CreateKeysAndCertificate operation. * @return Result of the CreateKeysAndCertificate operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.CreateKeysAndCertificate */ @Override public CreateKeysAndCertificateResult createKeysAndCertificate(CreateKeysAndCertificateRequest request) { request = beforeClientExecution(request); return executeCreateKeysAndCertificate(request); } @SdkInternalApi final CreateKeysAndCertificateResult executeCreateKeysAndCertificate(CreateKeysAndCertificateRequest createKeysAndCertificateRequest) { ExecutionContext executionContext = createExecutionContext(createKeysAndCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreateKeysAndCertificateRequest> request = null; Response<CreateKeysAndCertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateKeysAndCertificateRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(createKeysAndCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreateKeysAndCertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateKeysAndCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates an AWS IoT policy. * </p> * <p> * The created policy is the default version for the policy. This operation creates a policy version with a version * identifier of <b>1</b> and sets <b>1</b> as the policy's default version. * </p> * * @param createPolicyRequest * The input for the CreatePolicy operation. * @return Result of the CreatePolicy operation returned by the service. * @throws ResourceAlreadyExistsException * The resource already exists. * @throws MalformedPolicyException * The policy documentation is not valid. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.CreatePolicy */ @Override public CreatePolicyResult createPolicy(CreatePolicyRequest request) { request = beforeClientExecution(request); return executeCreatePolicy(request); } @SdkInternalApi final CreatePolicyResult executeCreatePolicy(CreatePolicyRequest createPolicyRequest) { ExecutionContext executionContext = createExecutionContext(createPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreatePolicyRequest> request = null; Response<CreatePolicyResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreatePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreatePolicyResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates a new version of the specified AWS IoT policy. To update a policy, create a new policy version. A managed * policy can have up to five versions. If the policy has five versions, you must use <a>DeletePolicyVersion</a> to * delete an existing version before you create a new one. * </p> * <p> * Optionally, you can set the new version as the policy's default version. The default version is the operative * version (that is, the version that is in effect for the certificates to which the policy is attached). * </p> * * @param createPolicyVersionRequest * The input for the CreatePolicyVersion operation. * @return Result of the CreatePolicyVersion operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws MalformedPolicyException * The policy documentation is not valid. * @throws VersionsLimitExceededException * The number of policy versions exceeds the limit. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.CreatePolicyVersion */ @Override public CreatePolicyVersionResult createPolicyVersion(CreatePolicyVersionRequest request) { request = beforeClientExecution(request); return executeCreatePolicyVersion(request); } @SdkInternalApi final CreatePolicyVersionResult executeCreatePolicyVersion(CreatePolicyVersionRequest createPolicyVersionRequest) { ExecutionContext executionContext = createExecutionContext(createPolicyVersionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreatePolicyVersionRequest> request = null; Response<CreatePolicyVersionResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreatePolicyVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPolicyVersionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreatePolicyVersionResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePolicyVersionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates a thing record in the thing registry. * </p> * * @param createThingRequest * The input for the CreateThing operation. * @return Result of the CreateThing operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceAlreadyExistsException * The resource already exists. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.CreateThing */ @Override public CreateThingResult createThing(CreateThingRequest request) { request = beforeClientExecution(request); return executeCreateThing(request); } @SdkInternalApi final CreateThingResult executeCreateThing(CreateThingRequest createThingRequest) { ExecutionContext executionContext = createExecutionContext(createThingRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreateThingRequest> request = null; Response<CreateThingResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateThingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createThingRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreateThingResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateThingResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates a new thing type. * </p> * * @param createThingTypeRequest * The input for the CreateThingType operation. * @return Result of the CreateThingType operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceAlreadyExistsException * The resource already exists. * @sample AWSIot.CreateThingType */ @Override public CreateThingTypeResult createThingType(CreateThingTypeRequest request) { request = beforeClientExecution(request); return executeCreateThingType(request); } @SdkInternalApi final CreateThingTypeResult executeCreateThingType(CreateThingTypeRequest createThingTypeRequest) { ExecutionContext executionContext = createExecutionContext(createThingTypeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreateThingTypeRequest> request = null; Response<CreateThingTypeResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateThingTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createThingTypeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreateThingTypeResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateThingTypeResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Creates a rule. Creating rules is an administrator-level action. Any user who has permission to create rules will * be able to access data processed by the rule. * </p> * * @param createTopicRuleRequest * The input for the CreateTopicRule operation. * @return Result of the CreateTopicRule operation returned by the service. * @throws SqlParseException * The Rule-SQL expression can't be parsed correctly. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ResourceAlreadyExistsException * The resource already exists. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @sample AWSIot.CreateTopicRule */ @Override public CreateTopicRuleResult createTopicRule(CreateTopicRuleRequest request) { request = beforeClientExecution(request); return executeCreateTopicRule(request); } @SdkInternalApi final CreateTopicRuleResult executeCreateTopicRule(CreateTopicRuleRequest createTopicRuleRequest) { ExecutionContext executionContext = createExecutionContext(createTopicRuleRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<CreateTopicRuleRequest> request = null; Response<CreateTopicRuleResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new CreateTopicRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTopicRuleRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<CreateTopicRuleResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTopicRuleResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes a registered CA certificate. * </p> * * @param deleteCACertificateRequest * Input for the DeleteCACertificate operation. * @return Result of the DeleteCACertificate operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws CertificateStateException * The certificate operation is not allowed. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.DeleteCACertificate */ @Override public DeleteCACertificateResult deleteCACertificate(DeleteCACertificateRequest request) { request = beforeClientExecution(request); return executeDeleteCACertificate(request); } @SdkInternalApi final DeleteCACertificateResult executeDeleteCACertificate(DeleteCACertificateRequest deleteCACertificateRequest) { ExecutionContext executionContext = createExecutionContext(deleteCACertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteCACertificateRequest> request = null; Response<DeleteCACertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteCACertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCACertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteCACertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCACertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes the specified certificate. * </p> * <p> * A certificate cannot be deleted if it has a policy attached to it or if its status is set to ACTIVE. To delete a * certificate, first use the <a>DetachPrincipalPolicy</a> API to detach all policies. Next, use the * <a>UpdateCertificate</a> API to set the certificate to the INACTIVE status. * </p> * * @param deleteCertificateRequest * The input for the DeleteCertificate operation. * @return Result of the DeleteCertificate operation returned by the service. * @throws CertificateStateException * The certificate operation is not allowed. * @throws DeleteConflictException * You can't delete the resource because it is attached to one or more resources. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.DeleteCertificate */ @Override public DeleteCertificateResult deleteCertificate(DeleteCertificateRequest request) { request = beforeClientExecution(request); return executeDeleteCertificate(request); } @SdkInternalApi final DeleteCertificateResult executeDeleteCertificate(DeleteCertificateRequest deleteCertificateRequest) { ExecutionContext executionContext = createExecutionContext(deleteCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteCertificateRequest> request = null; Response<DeleteCertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteCertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes the specified policy. * </p> * <p> * A policy cannot be deleted if it has non-default versions or it is attached to any certificate. * </p> * <p> * To delete a policy, use the DeletePolicyVersion API to delete all non-default versions of the policy; use the * DetachPrincipalPolicy API to detach the policy from any certificate; and then use the DeletePolicy API to delete * the policy. * </p> * <p> * When a policy is deleted using DeletePolicy, its default version is deleted with it. * </p> * * @param deletePolicyRequest * The input for the DeletePolicy operation. * @return Result of the DeletePolicy operation returned by the service. * @throws DeleteConflictException * You can't delete the resource because it is attached to one or more resources. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DeletePolicy */ @Override public DeletePolicyResult deletePolicy(DeletePolicyRequest request) { request = beforeClientExecution(request); return executeDeletePolicy(request); } @SdkInternalApi final DeletePolicyResult executeDeletePolicy(DeletePolicyRequest deletePolicyRequest) { ExecutionContext executionContext = createExecutionContext(deletePolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeletePolicyRequest> request = null; Response<DeletePolicyResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeletePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeletePolicyResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes the specified version of the specified policy. You cannot delete the default version of a policy using * this API. To delete the default version of a policy, use <a>DeletePolicy</a>. To find out which version of a * policy is marked as the default version, use ListPolicyVersions. * </p> * * @param deletePolicyVersionRequest * The input for the DeletePolicyVersion operation. * @return Result of the DeletePolicyVersion operation returned by the service. * @throws DeleteConflictException * You can't delete the resource because it is attached to one or more resources. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DeletePolicyVersion */ @Override public DeletePolicyVersionResult deletePolicyVersion(DeletePolicyVersionRequest request) { request = beforeClientExecution(request); return executeDeletePolicyVersion(request); } @SdkInternalApi final DeletePolicyVersionResult executeDeletePolicyVersion(DeletePolicyVersionRequest deletePolicyVersionRequest) { ExecutionContext executionContext = createExecutionContext(deletePolicyVersionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeletePolicyVersionRequest> request = null; Response<DeletePolicyVersionResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeletePolicyVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePolicyVersionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeletePolicyVersionResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePolicyVersionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes a CA certificate registration code. * </p> * * @param deleteRegistrationCodeRequest * The input for the DeleteRegistrationCode operation. * @return Result of the DeleteRegistrationCode operation returned by the service. * @throws ThrottlingException * The rate exceeds the limit. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DeleteRegistrationCode */ @Override public DeleteRegistrationCodeResult deleteRegistrationCode(DeleteRegistrationCodeRequest request) { request = beforeClientExecution(request); return executeDeleteRegistrationCode(request); } @SdkInternalApi final DeleteRegistrationCodeResult executeDeleteRegistrationCode(DeleteRegistrationCodeRequest deleteRegistrationCodeRequest) { ExecutionContext executionContext = createExecutionContext(deleteRegistrationCodeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteRegistrationCodeRequest> request = null; Response<DeleteRegistrationCodeResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteRegistrationCodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteRegistrationCodeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteRegistrationCodeResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteRegistrationCodeResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes the specified thing. * </p> * * @param deleteThingRequest * The input for the DeleteThing operation. * @return Result of the DeleteThing operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws VersionConflictException * An exception thrown when the version of a thing passed to a command is different than the version * specified with the --version parameter. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DeleteThing */ @Override public DeleteThingResult deleteThing(DeleteThingRequest request) { request = beforeClientExecution(request); return executeDeleteThing(request); } @SdkInternalApi final DeleteThingResult executeDeleteThing(DeleteThingRequest deleteThingRequest) { ExecutionContext executionContext = createExecutionContext(deleteThingRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteThingRequest> request = null; Response<DeleteThingResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteThingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteThingRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteThingResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteThingResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes the specified thing type . You cannot delete a thing type if it has things associated with it. To delete * a thing type, first mark it as deprecated by calling <a>DeprecateThingType</a>, then remove any associated things * by calling <a>UpdateThing</a> to change the thing type on any associated thing, and finally use * <a>DeleteThingType</a> to delete the thing type. * </p> * * @param deleteThingTypeRequest * The input for the DeleteThingType operation. * @return Result of the DeleteThingType operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DeleteThingType */ @Override public DeleteThingTypeResult deleteThingType(DeleteThingTypeRequest request) { request = beforeClientExecution(request); return executeDeleteThingType(request); } @SdkInternalApi final DeleteThingTypeResult executeDeleteThingType(DeleteThingTypeRequest deleteThingTypeRequest) { ExecutionContext executionContext = createExecutionContext(deleteThingTypeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteThingTypeRequest> request = null; Response<DeleteThingTypeResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteThingTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteThingTypeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteThingTypeResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteThingTypeResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deletes the specified rule. * </p> * * @param deleteTopicRuleRequest * The input for the DeleteTopicRule operation. * @return Result of the DeleteTopicRule operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws UnauthorizedException * You are not authorized to perform this operation. * @sample AWSIot.DeleteTopicRule */ @Override public DeleteTopicRuleResult deleteTopicRule(DeleteTopicRuleRequest request) { request = beforeClientExecution(request); return executeDeleteTopicRule(request); } @SdkInternalApi final DeleteTopicRuleResult executeDeleteTopicRule(DeleteTopicRuleRequest deleteTopicRuleRequest) { ExecutionContext executionContext = createExecutionContext(deleteTopicRuleRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteTopicRuleRequest> request = null; Response<DeleteTopicRuleResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteTopicRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTopicRuleRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteTopicRuleResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTopicRuleResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Deprecates a thing type. You can not associate new things with deprecated thing type. * </p> * * @param deprecateThingTypeRequest * The input for the DeprecateThingType operation. * @return Result of the DeprecateThingType operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DeprecateThingType */ @Override public DeprecateThingTypeResult deprecateThingType(DeprecateThingTypeRequest request) { request = beforeClientExecution(request); return executeDeprecateThingType(request); } @SdkInternalApi final DeprecateThingTypeResult executeDeprecateThingType(DeprecateThingTypeRequest deprecateThingTypeRequest) { ExecutionContext executionContext = createExecutionContext(deprecateThingTypeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeprecateThingTypeRequest> request = null; Response<DeprecateThingTypeResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeprecateThingTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deprecateThingTypeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeprecateThingTypeResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeprecateThingTypeResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Describes a registered CA certificate. * </p> * * @param describeCACertificateRequest * The input for the DescribeCACertificate operation. * @return Result of the DescribeCACertificate operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.DescribeCACertificate */ @Override public DescribeCACertificateResult describeCACertificate(DescribeCACertificateRequest request) { request = beforeClientExecution(request); return executeDescribeCACertificate(request); } @SdkInternalApi final DescribeCACertificateResult executeDescribeCACertificate(DescribeCACertificateRequest describeCACertificateRequest) { ExecutionContext executionContext = createExecutionContext(describeCACertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DescribeCACertificateRequest> request = null; Response<DescribeCACertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeCACertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCACertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DescribeCACertificateResult>> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCACertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets information about the specified certificate. * </p> * * @param describeCertificateRequest * The input for the DescribeCertificate operation. * @return Result of the DescribeCertificate operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.DescribeCertificate */ @Override public DescribeCertificateResult describeCertificate(DescribeCertificateRequest request) { request = beforeClientExecution(request); return executeDescribeCertificate(request); } @SdkInternalApi final DescribeCertificateResult executeDescribeCertificate(DescribeCertificateRequest describeCertificateRequest) { ExecutionContext executionContext = createExecutionContext(describeCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DescribeCertificateRequest> request = null; Response<DescribeCertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DescribeCertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Returns a unique endpoint specific to the AWS account making the call. * </p> * * @param describeEndpointRequest * The input for the DescribeEndpoint operation. * @return Result of the DescribeEndpoint operation returned by the service. * @throws InternalFailureException * An unexpected error has occurred. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ThrottlingException * The rate exceeds the limit. * @sample AWSIot.DescribeEndpoint */ @Override public DescribeEndpointResult describeEndpoint(DescribeEndpointRequest request) { request = beforeClientExecution(request); return executeDescribeEndpoint(request); } @SdkInternalApi final DescribeEndpointResult executeDescribeEndpoint(DescribeEndpointRequest describeEndpointRequest) { ExecutionContext executionContext = createExecutionContext(describeEndpointRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DescribeEndpointRequest> request = null; Response<DescribeEndpointResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeEndpointRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DescribeEndpointResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeEndpointResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets information about the specified thing. * </p> * * @param describeThingRequest * The input for the DescribeThing operation. * @return Result of the DescribeThing operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DescribeThing */ @Override public DescribeThingResult describeThing(DescribeThingRequest request) { request = beforeClientExecution(request); return executeDescribeThing(request); } @SdkInternalApi final DescribeThingResult executeDescribeThing(DescribeThingRequest describeThingRequest) { ExecutionContext executionContext = createExecutionContext(describeThingRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DescribeThingRequest> request = null; Response<DescribeThingResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeThingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeThingRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DescribeThingResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeThingResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets information about the specified thing type. * </p> * * @param describeThingTypeRequest * The input for the DescribeThingType operation. * @return Result of the DescribeThingType operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DescribeThingType */ @Override public DescribeThingTypeResult describeThingType(DescribeThingTypeRequest request) { request = beforeClientExecution(request); return executeDescribeThingType(request); } @SdkInternalApi final DescribeThingTypeResult executeDescribeThingType(DescribeThingTypeRequest describeThingTypeRequest) { ExecutionContext executionContext = createExecutionContext(describeThingTypeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DescribeThingTypeRequest> request = null; Response<DescribeThingTypeResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DescribeThingTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeThingTypeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DescribeThingTypeResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeThingTypeResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Removes the specified policy from the specified certificate. * </p> * * @param detachPrincipalPolicyRequest * The input for the DetachPrincipalPolicy operation. * @return Result of the DetachPrincipalPolicy operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DetachPrincipalPolicy */ @Override public DetachPrincipalPolicyResult detachPrincipalPolicy(DetachPrincipalPolicyRequest request) { request = beforeClientExecution(request); return executeDetachPrincipalPolicy(request); } @SdkInternalApi final DetachPrincipalPolicyResult executeDetachPrincipalPolicy(DetachPrincipalPolicyRequest detachPrincipalPolicyRequest) { ExecutionContext executionContext = createExecutionContext(detachPrincipalPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DetachPrincipalPolicyRequest> request = null; Response<DetachPrincipalPolicyResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DetachPrincipalPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(detachPrincipalPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DetachPrincipalPolicyResult>> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DetachPrincipalPolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Detaches the specified principal from the specified thing. * </p> * * @param detachThingPrincipalRequest * The input for the DetachThingPrincipal operation. * @return Result of the DetachThingPrincipal operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.DetachThingPrincipal */ @Override public DetachThingPrincipalResult detachThingPrincipal(DetachThingPrincipalRequest request) { request = beforeClientExecution(request); return executeDetachThingPrincipal(request); } @SdkInternalApi final DetachThingPrincipalResult executeDetachThingPrincipal(DetachThingPrincipalRequest detachThingPrincipalRequest) { ExecutionContext executionContext = createExecutionContext(detachThingPrincipalRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DetachThingPrincipalRequest> request = null; Response<DetachThingPrincipalResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DetachThingPrincipalRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(detachThingPrincipalRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DetachThingPrincipalResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DetachThingPrincipalResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Disables the specified rule. * </p> * * @param disableTopicRuleRequest * The input for the DisableTopicRuleRequest operation. * @return Result of the DisableTopicRule operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws UnauthorizedException * You are not authorized to perform this operation. * @sample AWSIot.DisableTopicRule */ @Override public DisableTopicRuleResult disableTopicRule(DisableTopicRuleRequest request) { request = beforeClientExecution(request); return executeDisableTopicRule(request); } @SdkInternalApi final DisableTopicRuleResult executeDisableTopicRule(DisableTopicRuleRequest disableTopicRuleRequest) { ExecutionContext executionContext = createExecutionContext(disableTopicRuleRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DisableTopicRuleRequest> request = null; Response<DisableTopicRuleResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DisableTopicRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disableTopicRuleRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DisableTopicRuleResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisableTopicRuleResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Enables the specified rule. * </p> * * @param enableTopicRuleRequest * The input for the EnableTopicRuleRequest operation. * @return Result of the EnableTopicRule operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws UnauthorizedException * You are not authorized to perform this operation. * @sample AWSIot.EnableTopicRule */ @Override public EnableTopicRuleResult enableTopicRule(EnableTopicRuleRequest request) { request = beforeClientExecution(request); return executeEnableTopicRule(request); } @SdkInternalApi final EnableTopicRuleResult executeEnableTopicRule(EnableTopicRuleRequest enableTopicRuleRequest) { ExecutionContext executionContext = createExecutionContext(enableTopicRuleRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<EnableTopicRuleRequest> request = null; Response<EnableTopicRuleResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new EnableTopicRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableTopicRuleRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<EnableTopicRuleResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableTopicRuleResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets the logging options. * </p> * * @param getLoggingOptionsRequest * The input for the GetLoggingOptions operation. * @return Result of the GetLoggingOptions operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @sample AWSIot.GetLoggingOptions */ @Override public GetLoggingOptionsResult getLoggingOptions(GetLoggingOptionsRequest request) { request = beforeClientExecution(request); return executeGetLoggingOptions(request); } @SdkInternalApi final GetLoggingOptionsResult executeGetLoggingOptions(GetLoggingOptionsRequest getLoggingOptionsRequest) { ExecutionContext executionContext = createExecutionContext(getLoggingOptionsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetLoggingOptionsRequest> request = null; Response<GetLoggingOptionsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetLoggingOptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLoggingOptionsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetLoggingOptionsResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLoggingOptionsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets information about the specified policy with the policy document of the default version. * </p> * * @param getPolicyRequest * The input for the GetPolicy operation. * @return Result of the GetPolicy operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.GetPolicy */ @Override public GetPolicyResult getPolicy(GetPolicyRequest request) { request = beforeClientExecution(request); return executeGetPolicy(request); } @SdkInternalApi final GetPolicyResult executeGetPolicy(GetPolicyRequest getPolicyRequest) { ExecutionContext executionContext = createExecutionContext(getPolicyRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetPolicyRequest> request = null; Response<GetPolicyResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPolicyRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPolicyResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets information about the specified policy version. * </p> * * @param getPolicyVersionRequest * The input for the GetPolicyVersion operation. * @return Result of the GetPolicyVersion operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.GetPolicyVersion */ @Override public GetPolicyVersionResult getPolicyVersion(GetPolicyVersionRequest request) { request = beforeClientExecution(request); return executeGetPolicyVersion(request); } @SdkInternalApi final GetPolicyVersionResult executeGetPolicyVersion(GetPolicyVersionRequest getPolicyVersionRequest) { ExecutionContext executionContext = createExecutionContext(getPolicyVersionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetPolicyVersionRequest> request = null; Response<GetPolicyVersionResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetPolicyVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPolicyVersionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetPolicyVersionResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPolicyVersionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets a registration code used to register a CA certificate with AWS IoT. * </p> * * @param getRegistrationCodeRequest * The input to the GetRegistrationCode operation. * @return Result of the GetRegistrationCode operation returned by the service. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @sample AWSIot.GetRegistrationCode */ @Override public GetRegistrationCodeResult getRegistrationCode(GetRegistrationCodeRequest request) { request = beforeClientExecution(request); return executeGetRegistrationCode(request); } @SdkInternalApi final GetRegistrationCodeResult executeGetRegistrationCode(GetRegistrationCodeRequest getRegistrationCodeRequest) { ExecutionContext executionContext = createExecutionContext(getRegistrationCodeRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetRegistrationCodeRequest> request = null; Response<GetRegistrationCodeResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetRegistrationCodeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRegistrationCodeRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetRegistrationCodeResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRegistrationCodeResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets information about the specified rule. * </p> * * @param getTopicRuleRequest * The input for the GetTopicRule operation. * @return Result of the GetTopicRule operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws UnauthorizedException * You are not authorized to perform this operation. * @sample AWSIot.GetTopicRule */ @Override public GetTopicRuleResult getTopicRule(GetTopicRuleRequest request) { request = beforeClientExecution(request); return executeGetTopicRule(request); } @SdkInternalApi final GetTopicRuleResult executeGetTopicRule(GetTopicRuleRequest getTopicRuleRequest) { ExecutionContext executionContext = createExecutionContext(getTopicRuleRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetTopicRuleRequest> request = null; Response<GetTopicRuleResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetTopicRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTopicRuleRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetTopicRuleResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTopicRuleResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the CA certificates registered for your AWS account. * </p> * <p> * The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional * results. * </p> * * @param listCACertificatesRequest * Input for the ListCACertificates operation. * @return Result of the ListCACertificates operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListCACertificates */ @Override public ListCACertificatesResult listCACertificates(ListCACertificatesRequest request) { request = beforeClientExecution(request); return executeListCACertificates(request); } @SdkInternalApi final ListCACertificatesResult executeListCACertificates(ListCACertificatesRequest listCACertificatesRequest) { ExecutionContext executionContext = createExecutionContext(listCACertificatesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListCACertificatesRequest> request = null; Response<ListCACertificatesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListCACertificatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCACertificatesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListCACertificatesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCACertificatesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the certificates registered in your AWS account. * </p> * <p> * The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional * results. * </p> * * @param listCertificatesRequest * The input for the ListCertificates operation. * @return Result of the ListCertificates operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListCertificates */ @Override public ListCertificatesResult listCertificates(ListCertificatesRequest request) { request = beforeClientExecution(request); return executeListCertificates(request); } @SdkInternalApi final ListCertificatesResult executeListCertificates(ListCertificatesRequest listCertificatesRequest) { ExecutionContext executionContext = createExecutionContext(listCertificatesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListCertificatesRequest> request = null; Response<ListCertificatesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListCertificatesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCertificatesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListCertificatesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCertificatesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * List the device certificates signed by the specified CA certificate. * </p> * * @param listCertificatesByCARequest * The input to the ListCertificatesByCA operation. * @return Result of the ListCertificatesByCA operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListCertificatesByCA */ @Override public ListCertificatesByCAResult listCertificatesByCA(ListCertificatesByCARequest request) { request = beforeClientExecution(request); return executeListCertificatesByCA(request); } @SdkInternalApi final ListCertificatesByCAResult executeListCertificatesByCA(ListCertificatesByCARequest listCertificatesByCARequest) { ExecutionContext executionContext = createExecutionContext(listCertificatesByCARequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListCertificatesByCARequest> request = null; Response<ListCertificatesByCAResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListCertificatesByCARequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listCertificatesByCARequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListCertificatesByCAResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListCertificatesByCAResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists certificates that are being transfered but not yet accepted. * </p> * * @param listOutgoingCertificatesRequest * The input to the ListOutgoingCertificates operation. * @return Result of the ListOutgoingCertificates operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListOutgoingCertificates */ @Override public ListOutgoingCertificatesResult listOutgoingCertificates(ListOutgoingCertificatesRequest request) { request = beforeClientExecution(request); return executeListOutgoingCertificates(request); } @SdkInternalApi final ListOutgoingCertificatesResult executeListOutgoingCertificates(ListOutgoingCertificatesRequest listOutgoingCertificatesRequest) { ExecutionContext executionContext = createExecutionContext(listOutgoingCertificatesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListOutgoingCertificatesRequest> request = null; Response<ListOutgoingCertificatesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListOutgoingCertificatesRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(listOutgoingCertificatesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListOutgoingCertificatesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListOutgoingCertificatesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists your policies. * </p> * * @param listPoliciesRequest * The input for the ListPolicies operation. * @return Result of the ListPolicies operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListPolicies */ @Override public ListPoliciesResult listPolicies(ListPoliciesRequest request) { request = beforeClientExecution(request); return executeListPolicies(request); } @SdkInternalApi final ListPoliciesResult executeListPolicies(ListPoliciesRequest listPoliciesRequest) { ExecutionContext executionContext = createExecutionContext(listPoliciesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListPoliciesRequest> request = null; Response<ListPoliciesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListPoliciesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPoliciesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListPoliciesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPoliciesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the principals associated with the specified policy. * </p> * * @param listPolicyPrincipalsRequest * The input for the ListPolicyPrincipals operation. * @return Result of the ListPolicyPrincipals operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListPolicyPrincipals */ @Override public ListPolicyPrincipalsResult listPolicyPrincipals(ListPolicyPrincipalsRequest request) { request = beforeClientExecution(request); return executeListPolicyPrincipals(request); } @SdkInternalApi final ListPolicyPrincipalsResult executeListPolicyPrincipals(ListPolicyPrincipalsRequest listPolicyPrincipalsRequest) { ExecutionContext executionContext = createExecutionContext(listPolicyPrincipalsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListPolicyPrincipalsRequest> request = null; Response<ListPolicyPrincipalsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListPolicyPrincipalsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPolicyPrincipalsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListPolicyPrincipalsResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPolicyPrincipalsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the versions of the specified policy and identifies the default version. * </p> * * @param listPolicyVersionsRequest * The input for the ListPolicyVersions operation. * @return Result of the ListPolicyVersions operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListPolicyVersions */ @Override public ListPolicyVersionsResult listPolicyVersions(ListPolicyVersionsRequest request) { request = beforeClientExecution(request); return executeListPolicyVersions(request); } @SdkInternalApi final ListPolicyVersionsResult executeListPolicyVersions(ListPolicyVersionsRequest listPolicyVersionsRequest) { ExecutionContext executionContext = createExecutionContext(listPolicyVersionsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListPolicyVersionsRequest> request = null; Response<ListPolicyVersionsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListPolicyVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPolicyVersionsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListPolicyVersionsResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPolicyVersionsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in <a * href= * "http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html#API_GetCredentialsForIdentity_RequestSyntax" * >AmazonCognito Identity format</a>. * </p> * * @param listPrincipalPoliciesRequest * The input for the ListPrincipalPolicies operation. * @return Result of the ListPrincipalPolicies operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListPrincipalPolicies */ @Override public ListPrincipalPoliciesResult listPrincipalPolicies(ListPrincipalPoliciesRequest request) { request = beforeClientExecution(request); return executeListPrincipalPolicies(request); } @SdkInternalApi final ListPrincipalPoliciesResult executeListPrincipalPolicies(ListPrincipalPoliciesRequest listPrincipalPoliciesRequest) { ExecutionContext executionContext = createExecutionContext(listPrincipalPoliciesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListPrincipalPoliciesRequest> request = null; Response<ListPrincipalPoliciesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListPrincipalPoliciesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPrincipalPoliciesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListPrincipalPoliciesResult>> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPrincipalPoliciesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the things associated with the specified principal. * </p> * * @param listPrincipalThingsRequest * The input for the ListPrincipalThings operation. * @return Result of the ListPrincipalThings operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.ListPrincipalThings */ @Override public ListPrincipalThingsResult listPrincipalThings(ListPrincipalThingsRequest request) { request = beforeClientExecution(request); return executeListPrincipalThings(request); } @SdkInternalApi final ListPrincipalThingsResult executeListPrincipalThings(ListPrincipalThingsRequest listPrincipalThingsRequest) { ExecutionContext executionContext = createExecutionContext(listPrincipalThingsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListPrincipalThingsRequest> request = null; Response<ListPrincipalThingsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListPrincipalThingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPrincipalThingsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListPrincipalThingsResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPrincipalThingsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the principals associated with the specified thing. * </p> * * @param listThingPrincipalsRequest * The input for the ListThingPrincipal operation. * @return Result of the ListThingPrincipals operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.ListThingPrincipals */ @Override public ListThingPrincipalsResult listThingPrincipals(ListThingPrincipalsRequest request) { request = beforeClientExecution(request); return executeListThingPrincipals(request); } @SdkInternalApi final ListThingPrincipalsResult executeListThingPrincipals(ListThingPrincipalsRequest listThingPrincipalsRequest) { ExecutionContext executionContext = createExecutionContext(listThingPrincipalsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListThingPrincipalsRequest> request = null; Response<ListThingPrincipalsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListThingPrincipalsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listThingPrincipalsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListThingPrincipalsResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListThingPrincipalsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the existing thing types. * </p> * * @param listThingTypesRequest * The input for the ListThingTypes operation. * @return Result of the ListThingTypes operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListThingTypes */ @Override public ListThingTypesResult listThingTypes(ListThingTypesRequest request) { request = beforeClientExecution(request); return executeListThingTypes(request); } @SdkInternalApi final ListThingTypesResult executeListThingTypes(ListThingTypesRequest listThingTypesRequest) { ExecutionContext executionContext = createExecutionContext(listThingTypesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListThingTypesRequest> request = null; Response<ListThingTypesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListThingTypesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listThingTypesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListThingTypesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListThingTypesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters to filter your things. For * example, calling <code>ListThings</code> with attributeName=Color and attributeValue=Red retrieves all things in * the registry that contain an attribute <b>Color</b> with the value <b>Red</b>. * </p> * * @param listThingsRequest * The input for the ListThings operation. * @return Result of the ListThings operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.ListThings */ @Override public ListThingsResult listThings(ListThingsRequest request) { request = beforeClientExecution(request); return executeListThings(request); } @SdkInternalApi final ListThingsResult executeListThings(ListThingsRequest listThingsRequest) { ExecutionContext executionContext = createExecutionContext(listThingsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListThingsRequest> request = null; Response<ListThingsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListThingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listThingsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListThingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata() .withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListThingsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Lists the rules for the specific topic. * </p> * * @param listTopicRulesRequest * The input for the ListTopicRules operation. * @return Result of the ListTopicRules operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @sample AWSIot.ListTopicRules */ @Override public ListTopicRulesResult listTopicRules(ListTopicRulesRequest request) { request = beforeClientExecution(request); return executeListTopicRules(request); } @SdkInternalApi final ListTopicRulesResult executeListTopicRules(ListTopicRulesRequest listTopicRulesRequest) { ExecutionContext executionContext = createExecutionContext(listTopicRulesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ListTopicRulesRequest> request = null; Response<ListTopicRulesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ListTopicRulesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTopicRulesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ListTopicRulesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTopicRulesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Registers a CA certificate with AWS IoT. This CA certificate can then be used to sign device certificates, which * can be then registered with AWS IoT. You can register up to 10 CA certificates per AWS account that have the same * subject field and public key. This enables you to have up to 10 certificate authorities sign your device * certificates. If you have more than one CA certificate registered, make sure you pass the CA certificate when you * register your device certificates with the RegisterCertificate API. * </p> * * @param registerCACertificateRequest * The input to the RegisterCACertificate operation. * @return Result of the RegisterCACertificate operation returned by the service. * @throws ResourceAlreadyExistsException * The resource already exists. * @throws RegistrationCodeValidationException * The registration code is invalid. * @throws InvalidRequestException * The request is not valid. * @throws CertificateValidationException * The certificate is invalid. * @throws ThrottlingException * The rate exceeds the limit. * @throws LimitExceededException * The number of attached entities exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.RegisterCACertificate */ @Override public RegisterCACertificateResult registerCACertificate(RegisterCACertificateRequest request) { request = beforeClientExecution(request); return executeRegisterCACertificate(request); } @SdkInternalApi final RegisterCACertificateResult executeRegisterCACertificate(RegisterCACertificateRequest registerCACertificateRequest) { ExecutionContext executionContext = createExecutionContext(registerCACertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<RegisterCACertificateRequest> request = null; Response<RegisterCACertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RegisterCACertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(registerCACertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<RegisterCACertificateResult>> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RegisterCACertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Registers a device certificate with AWS IoT. If you have more than one CA certificate that has the same subject * field, you must specify the CA certificate that was used to sign the device certificate being registered. * </p> * * @param registerCertificateRequest * The input to the RegisterCertificate operation. * @return Result of the RegisterCertificate operation returned by the service. * @throws ResourceAlreadyExistsException * The resource already exists. * @throws InvalidRequestException * The request is not valid. * @throws CertificateValidationException * The certificate is invalid. * @throws CertificateStateException * The certificate operation is not allowed. * @throws CertificateConflictException * Unable to verify the CA certificate used to sign the device certificate you are attempting to register. * This is happens when you have registered more than one CA certificate that has the same subject field and * public key. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.RegisterCertificate */ @Override public RegisterCertificateResult registerCertificate(RegisterCertificateRequest request) { request = beforeClientExecution(request); return executeRegisterCertificate(request); } @SdkInternalApi final RegisterCertificateResult executeRegisterCertificate(RegisterCertificateRequest registerCertificateRequest) { ExecutionContext executionContext = createExecutionContext(registerCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<RegisterCertificateRequest> request = null; Response<RegisterCertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RegisterCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(registerCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<RegisterCertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RegisterCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, the certificate status * changes from <b>PENDING_TRANSFER</b> to <b>INACTIVE</b>. * </p> * <p> * To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate your certificates. * </p> * <p> * This operation can only be called by the transfer destination. After it is called, the certificate will be * returned to the source's account in the INACTIVE state. * </p> * * @param rejectCertificateTransferRequest * The input for the RejectCertificateTransfer operation. * @return Result of the RejectCertificateTransfer operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws TransferAlreadyCompletedException * You can't revert the certificate transfer because the transfer is already complete. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.RejectCertificateTransfer */ @Override public RejectCertificateTransferResult rejectCertificateTransfer(RejectCertificateTransferRequest request) { request = beforeClientExecution(request); return executeRejectCertificateTransfer(request); } @SdkInternalApi final RejectCertificateTransferResult executeRejectCertificateTransfer(RejectCertificateTransferRequest rejectCertificateTransferRequest) { ExecutionContext executionContext = createExecutionContext(rejectCertificateTransferRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<RejectCertificateTransferRequest> request = null; Response<RejectCertificateTransferResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new RejectCertificateTransferRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(rejectCertificateTransferRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<RejectCertificateTransferResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RejectCertificateTransferResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Replaces the specified rule. You must specify all parameters for the new rule. Creating rules is an * administrator-level action. Any user who has permission to create rules will be able to access data processed by * the rule. * </p> * * @param replaceTopicRuleRequest * The input for the ReplaceTopicRule operation. * @return Result of the ReplaceTopicRule operation returned by the service. * @throws SqlParseException * The Rule-SQL expression can't be parsed correctly. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws UnauthorizedException * You are not authorized to perform this operation. * @sample AWSIot.ReplaceTopicRule */ @Override public ReplaceTopicRuleResult replaceTopicRule(ReplaceTopicRuleRequest request) { request = beforeClientExecution(request); return executeReplaceTopicRule(request); } @SdkInternalApi final ReplaceTopicRuleResult executeReplaceTopicRule(ReplaceTopicRuleRequest replaceTopicRuleRequest) { ExecutionContext executionContext = createExecutionContext(replaceTopicRuleRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<ReplaceTopicRuleRequest> request = null; Response<ReplaceTopicRuleResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new ReplaceTopicRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(replaceTopicRuleRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<ReplaceTopicRuleResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ReplaceTopicRuleResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Sets the specified version of the specified policy as the policy's default (operative) version. This action * affects all certificates to which the policy is attached. To list the principals the policy is attached to, use * the ListPrincipalPolicy API. * </p> * * @param setDefaultPolicyVersionRequest * The input for the SetDefaultPolicyVersion operation. * @return Result of the SetDefaultPolicyVersion operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.SetDefaultPolicyVersion */ @Override public SetDefaultPolicyVersionResult setDefaultPolicyVersion(SetDefaultPolicyVersionRequest request) { request = beforeClientExecution(request); return executeSetDefaultPolicyVersion(request); } @SdkInternalApi final SetDefaultPolicyVersionResult executeSetDefaultPolicyVersion(SetDefaultPolicyVersionRequest setDefaultPolicyVersionRequest) { ExecutionContext executionContext = createExecutionContext(setDefaultPolicyVersionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<SetDefaultPolicyVersionRequest> request = null; Response<SetDefaultPolicyVersionResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetDefaultPolicyVersionRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(setDefaultPolicyVersionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<SetDefaultPolicyVersionResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetDefaultPolicyVersionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Sets the logging options. * </p> * * @param setLoggingOptionsRequest * The input for the SetLoggingOptions operation. * @return Result of the SetLoggingOptions operation returned by the service. * @throws InternalException * An unexpected error has occurred. * @throws InvalidRequestException * The request is not valid. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @sample AWSIot.SetLoggingOptions */ @Override public SetLoggingOptionsResult setLoggingOptions(SetLoggingOptionsRequest request) { request = beforeClientExecution(request); return executeSetLoggingOptions(request); } @SdkInternalApi final SetLoggingOptionsResult executeSetLoggingOptions(SetLoggingOptionsRequest setLoggingOptionsRequest) { ExecutionContext executionContext = createExecutionContext(setLoggingOptionsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<SetLoggingOptionsRequest> request = null; Response<SetLoggingOptionsResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new SetLoggingOptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setLoggingOptionsRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<SetLoggingOptionsResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetLoggingOptionsResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Transfers the specified certificate to the specified AWS account. * </p> * <p> * You can cancel the transfer until it is acknowledged by the recipient. * </p> * <p> * No notification is sent to the transfer destination's account. It is up to the caller to notify the transfer * target. * </p> * <p> * The certificate being transferred must not be in the ACTIVE state. You can use the UpdateCertificate API to * deactivate it. * </p> * <p> * The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy API to detach * them. * </p> * * @param transferCertificateRequest * The input for the TransferCertificate operation. * @return Result of the TransferCertificate operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws CertificateStateException * The certificate operation is not allowed. * @throws TransferConflictException * You can't transfer the certificate because authorization policies are still attached. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.TransferCertificate */ @Override public TransferCertificateResult transferCertificate(TransferCertificateRequest request) { request = beforeClientExecution(request); return executeTransferCertificate(request); } @SdkInternalApi final TransferCertificateResult executeTransferCertificate(TransferCertificateRequest transferCertificateRequest) { ExecutionContext executionContext = createExecutionContext(transferCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<TransferCertificateRequest> request = null; Response<TransferCertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new TransferCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(transferCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<TransferCertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TransferCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Updates a registered CA certificate. * </p> * * @param updateCACertificateRequest * The input to the UpdateCACertificate operation. * @return Result of the UpdateCACertificate operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.UpdateCACertificate */ @Override public UpdateCACertificateResult updateCACertificate(UpdateCACertificateRequest request) { request = beforeClientExecution(request); return executeUpdateCACertificate(request); } @SdkInternalApi final UpdateCACertificateResult executeUpdateCACertificate(UpdateCACertificateRequest updateCACertificateRequest) { ExecutionContext executionContext = createExecutionContext(updateCACertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<UpdateCACertificateRequest> request = null; Response<UpdateCACertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateCACertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCACertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<UpdateCACertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCACertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Updates the status of the specified certificate. This operation is idempotent. * </p> * <p> * Moving a certificate from the ACTIVE state (including REVOKED) will not disconnect currently connected devices, * but these devices will be unable to reconnect. * </p> * <p> * The ACTIVE state is required to authenticate devices connecting to AWS IoT using a certificate. * </p> * * @param updateCertificateRequest * The input for the UpdateCertificate operation. * @return Result of the UpdateCertificate operation returned by the service. * @throws ResourceNotFoundException * The specified resource does not exist. * @throws CertificateStateException * The certificate operation is not allowed. * @throws InvalidRequestException * The request is not valid. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @sample AWSIot.UpdateCertificate */ @Override public UpdateCertificateResult updateCertificate(UpdateCertificateRequest request) { request = beforeClientExecution(request); return executeUpdateCertificate(request); } @SdkInternalApi final UpdateCertificateResult executeUpdateCertificate(UpdateCertificateRequest updateCertificateRequest) { ExecutionContext executionContext = createExecutionContext(updateCertificateRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<UpdateCertificateRequest> request = null; Response<UpdateCertificateResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateCertificateRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<UpdateCertificateResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateCertificateResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Updates the data for a thing. * </p> * * @param updateThingRequest * The input for the UpdateThing operation. * @return Result of the UpdateThing operation returned by the service. * @throws InvalidRequestException * The request is not valid. * @throws VersionConflictException * An exception thrown when the version of a thing passed to a command is different than the version * specified with the --version parameter. * @throws ThrottlingException * The rate exceeds the limit. * @throws UnauthorizedException * You are not authorized to perform this operation. * @throws ServiceUnavailableException * The service is temporarily unavailable. * @throws InternalFailureException * An unexpected error has occurred. * @throws ResourceNotFoundException * The specified resource does not exist. * @sample AWSIot.UpdateThing */ @Override public UpdateThingResult updateThing(UpdateThingRequest request) { request = beforeClientExecution(request); return executeUpdateThing(request); } @SdkInternalApi final UpdateThingResult executeUpdateThing(UpdateThingRequest updateThingRequest) { ExecutionContext executionContext = createExecutionContext(updateThingRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<UpdateThingRequest> request = null; Response<UpdateThingResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new UpdateThingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateThingRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<UpdateThingResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateThingResultJsonUnmarshaller()); 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. * <p> * 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 <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) { executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext); } /** * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will * be ignored for this operation. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> anonymousInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext); } /** * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the * ExecutionContext beforehand. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) { request.setEndpoint(endpoint); request.setTimeOffset(timeOffset); HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } }