/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.iot1clickprojects; import org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.internal.auth.*; import com.amazonaws.metrics.*; import com.amazonaws.regions.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.protocol.json.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.annotation.ThreadSafe; import com.amazonaws.client.AwsSyncClientParams; import com.amazonaws.client.builder.AdvancedConfig; import com.amazonaws.services.iot1clickprojects.AWSIoT1ClickProjectsClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.iot1clickprojects.model.*; import com.amazonaws.services.iot1clickprojects.model.transform.*; /** * Client for accessing AWS IoT 1-Click Projects. All service calls made using this client are blocking, and will not * return until the service call completes. *
*
* The AWS IoT 1-Click Projects API Reference *
*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSIoT1ClickProjectsClient extends AmazonWebServiceClient implements AWSIoT1ClickProjects { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSIoT1ClickProjects.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "iot1click"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("application/json") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalFailureException").withExceptionUnmarshaller( com.amazonaws.services.iot1clickprojects.model.transform.InternalFailureExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidRequestException").withExceptionUnmarshaller( com.amazonaws.services.iot1clickprojects.model.transform.InvalidRequestExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.iot1clickprojects.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceConflictException").withExceptionUnmarshaller( com.amazonaws.services.iot1clickprojects.model.transform.ResourceConflictExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("TooManyRequestsException").withExceptionUnmarshaller( com.amazonaws.services.iot1clickprojects.model.transform.TooManyRequestsExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.iot1clickprojects.model.AWSIoT1ClickProjectsException.class)); public static AWSIoT1ClickProjectsClientBuilder builder() { return AWSIoT1ClickProjectsClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on AWS IoT 1-Click Projects using the specified parameters. * ** All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSIoT1ClickProjectsClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on AWS IoT 1-Click Projects using the specified parameters. * *
* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSIoT1ClickProjectsClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("projects.iot1click.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/iot1clickprojects/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/iot1clickprojects/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *
* Associates a physical device with a placement. *
* * @param associateDeviceWithPlacementRequest * @return Result of the AssociateDeviceWithPlacement operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceConflictException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.AssociateDeviceWithPlacement * @see AWS API Documentation */ @Override public AssociateDeviceWithPlacementResult associateDeviceWithPlacement(AssociateDeviceWithPlacementRequest request) { request = beforeClientExecution(request); return executeAssociateDeviceWithPlacement(request); } @SdkInternalApi final AssociateDeviceWithPlacementResult executeAssociateDeviceWithPlacement(AssociateDeviceWithPlacementRequest associateDeviceWithPlacementRequest) { ExecutionContext executionContext = createExecutionContext(associateDeviceWithPlacementRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Creates an empty placement. *
* * @param createPlacementRequest * @return Result of the CreatePlacement operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceConflictException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.CreatePlacement * @see AWS API Documentation */ @Override public CreatePlacementResult createPlacement(CreatePlacementRequest request) { request = beforeClientExecution(request); return executeCreatePlacement(request); } @SdkInternalApi final CreatePlacementResult executeCreatePlacement(CreatePlacementRequest createPlacementRequest) { ExecutionContext executionContext = createExecutionContext(createPlacementRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Creates an empty project with a placement template. A project contains zero or more placements that adhere to the * placement template defined in the project. *
* * @param createProjectRequest * @return Result of the CreateProject operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceConflictException * @sample AWSIoT1ClickProjects.CreateProject * @see AWS API Documentation */ @Override public CreateProjectResult createProject(CreateProjectRequest request) { request = beforeClientExecution(request); return executeCreateProject(request); } @SdkInternalApi final CreateProjectResult executeCreateProject(CreateProjectRequest createProjectRequest) { ExecutionContext executionContext = createExecutionContext(createProjectRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Deletes a placement. To delete a placement, it must not have any devices associated with it. *
** When you delete a placement, all associated data becomes irretrievable. *
** Deletes a project. To delete a project, it must not have any placements associated with it. *
** When you delete a project, all associated data becomes irretrievable. *
** Describes a placement in a project. *
* * @param describePlacementRequest * @return Result of the DescribePlacement operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.DescribePlacement * @see AWS API Documentation */ @Override public DescribePlacementResult describePlacement(DescribePlacementRequest request) { request = beforeClientExecution(request); return executeDescribePlacement(request); } @SdkInternalApi final DescribePlacementResult executeDescribePlacement(DescribePlacementRequest describePlacementRequest) { ExecutionContext executionContext = createExecutionContext(describePlacementRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Returns an object describing a project. *
* * @param describeProjectRequest * @return Result of the DescribeProject operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.DescribeProject * @see AWS API Documentation */ @Override public DescribeProjectResult describeProject(DescribeProjectRequest request) { request = beforeClientExecution(request); return executeDescribeProject(request); } @SdkInternalApi final DescribeProjectResult executeDescribeProject(DescribeProjectRequest describeProjectRequest) { ExecutionContext executionContext = createExecutionContext(describeProjectRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Removes a physical device from a placement. *
* * @param disassociateDeviceFromPlacementRequest * @return Result of the DisassociateDeviceFromPlacement operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @sample AWSIoT1ClickProjects.DisassociateDeviceFromPlacement * @see AWS API Documentation */ @Override public DisassociateDeviceFromPlacementResult disassociateDeviceFromPlacement(DisassociateDeviceFromPlacementRequest request) { request = beforeClientExecution(request); return executeDisassociateDeviceFromPlacement(request); } @SdkInternalApi final DisassociateDeviceFromPlacementResult executeDisassociateDeviceFromPlacement( DisassociateDeviceFromPlacementRequest disassociateDeviceFromPlacementRequest) { ExecutionContext executionContext = createExecutionContext(disassociateDeviceFromPlacementRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Returns an object enumerating the devices in a placement. *
* * @param getDevicesInPlacementRequest * @return Result of the GetDevicesInPlacement operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.GetDevicesInPlacement * @see AWS API Documentation */ @Override public GetDevicesInPlacementResult getDevicesInPlacement(GetDevicesInPlacementRequest request) { request = beforeClientExecution(request); return executeGetDevicesInPlacement(request); } @SdkInternalApi final GetDevicesInPlacementResult executeGetDevicesInPlacement(GetDevicesInPlacementRequest getDevicesInPlacementRequest) { ExecutionContext executionContext = createExecutionContext(getDevicesInPlacementRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists the placement(s) of a project. *
* * @param listPlacementsRequest * @return Result of the ListPlacements operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.ListPlacements * @see AWS API Documentation */ @Override public ListPlacementsResult listPlacements(ListPlacementsRequest request) { request = beforeClientExecution(request); return executeListPlacements(request); } @SdkInternalApi final ListPlacementsResult executeListPlacements(ListPlacementsRequest listPlacementsRequest) { ExecutionContext executionContext = createExecutionContext(listPlacementsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists the AWS IoT 1-Click project(s) associated with your AWS account and region. *
* * @param listProjectsRequest * @return Result of the ListProjects operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @sample AWSIoT1ClickProjects.ListProjects * @see AWS API Documentation */ @Override public ListProjectsResult listProjects(ListProjectsRequest request) { request = beforeClientExecution(request); return executeListProjects(request); } @SdkInternalApi final ListProjectsResult executeListProjects(ListProjectsRequest listProjectsRequest) { ExecutionContext executionContext = createExecutionContext(listProjectsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists the tags (metadata key/value pairs) which you have assigned to the resource. *
* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.ListTagsForResource * @see AWS API Documentation */ @Override public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) { request = beforeClientExecution(request); return executeListTagsForResource(request); } @SdkInternalApi final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Creates or modifies tags for a resource. Tags are key/value pairs (metadata) that can be used to manage a * resource. For more information, see AWS Tagging Strategies. *
* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.TagResource * @see AWS * API Documentation */ @Override public TagResourceResult tagResource(TagResourceRequest request) { request = beforeClientExecution(request); return executeTagResource(request); } @SdkInternalApi final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) { ExecutionContext executionContext = createExecutionContext(tagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Removes one or more tags (metadata key/value pairs) from a resource. *
* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @sample AWSIoT1ClickProjects.UntagResource * @see AWS API Documentation */ @Override public UntagResourceResult untagResource(UntagResourceRequest request) { request = beforeClientExecution(request); return executeUntagResource(request); } @SdkInternalApi final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) { ExecutionContext executionContext = createExecutionContext(untagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Updates a placement with the given attributes. To clear an attribute, pass an empty value (i.e., ""). *
* * @param updatePlacementRequest * @return Result of the UpdatePlacement operation returned by the service. * @throws InternalFailureException * @throws InvalidRequestException * @throws ResourceNotFoundException * @throws TooManyRequestsException * @sample AWSIoT1ClickProjects.UpdatePlacement * @see AWS API Documentation */ @Override public UpdatePlacementResult updatePlacement(UpdatePlacementRequest request) { request = beforeClientExecution(request); return executeUpdatePlacement(request); } @SdkInternalApi final UpdatePlacementResult executeUpdatePlacement(UpdatePlacementRequest updatePlacementRequest) { ExecutionContext executionContext = createExecutionContext(updatePlacementRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request
* Updates a project associated with your AWS account and region. With the exception of device template names, you
* can pass just the values that need to be updated because the update request will change only the values that are
* provided. To clear a value, pass the empty string (i.e., ""
).
*
* 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